PurExcDeliveryManag.cs 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using CoreFS.CA06;using Pur.Entity;
  10. using Core.Mes.Client.Comm.Control;
  11. using Pur.Entity.ck;
  12. using Infragistics.Win.UltraWinGrid;
  13. using System.Collections;
  14. using Core.Mes.Client.Comm.Tool;
  15. using com.hnshituo.pur.vo;
  16. namespace Pur.ck
  17. {
  18. public partial class PurExcDeliveryManag : FrmPmsBase
  19. {
  20. public PurExcDeliveryManag()
  21. {
  22. InitializeComponent();
  23. }
  24. /// <summary>
  25. /// 菜单栏
  26. /// </summary>
  27. /// <param name="sender"></param>
  28. /// <param name="ToolbarKey"></param>
  29. public override void ToolBar_Click(object sender, string ToolbarKey)
  30. {
  31. switch (ToolbarKey)
  32. {
  33. case "Query":
  34. Get_ExcDeliveryNoticeM();
  35. break;
  36. case "Update":
  37. Upd_ExcDeliveryNoticeM();
  38. break;
  39. case "Delete":
  40. Del_ExcDeliveryNoticeM();
  41. break;
  42. case "Add":
  43. Add_ExcDeliveryNoticeM();
  44. break;
  45. case "Return":
  46. Ret_ExcDeliveryNoticeM();
  47. break;
  48. case "Confirm":
  49. Con_ExcDeliveryNoticeM();
  50. break;
  51. case "Receiving":
  52. Rec_ExcDeliveryNoticeM();
  53. break;
  54. }
  55. }
  56. /// <summary>
  57. /// 生成收货单
  58. /// </summary>
  59. private void Rec_ExcDeliveryNoticeM()
  60. {
  61. throw new NotImplementedException();
  62. }
  63. /// <summary>
  64. /// 到货确认
  65. /// </summary>
  66. private void Con_ExcDeliveryNoticeM()
  67. {
  68. throw new NotImplementedException();
  69. }
  70. /// <summary>
  71. /// 退货
  72. /// </summary>
  73. private void Ret_ExcDeliveryNoticeM()
  74. {
  75. UltraGridRow uge = ultraGrid1.ActiveRow;
  76. PurExcDe_Return Ret = new PurExcDe_Return(this.ob,uge);
  77. Ret.ShowDialog();
  78. }
  79. /// <summary>
  80. /// 生成送货子单
  81. /// </summary>
  82. private void Add_ExcDeliveryNoticeM()
  83. {
  84. UltraGridRow uge = ultraGrid1.ActiveRow;
  85. string str = uge.Cells["DeliveryId"].Value.ToString();
  86. string str2 = uge.Cells["orderId"].Value.ToString();
  87. PurExcDeliveryOk PwdOK = new PurExcDeliveryOk(this.ob, uge);
  88. PwdOK.ShowDialog();
  89. Get_ExcDeliveryNoticeM();
  90. }
  91. /// <summary>
  92. /// 删除
  93. /// </summary>
  94. private void Del_ExcDeliveryNoticeM()
  95. {
  96. try
  97. {
  98. if (SQ == "0")
  99. {
  100. UltraGridRow uge = ultraGrid1.ActiveRow;
  101. ExcDeliveryM EdnM = new ExcDeliveryM();
  102. EdnM.DeliveryId = uge.Cells["DeliveryId"].Value.ToString();
  103. EdnM.Validflag = "0";
  104. CoreResult crt = this.execute<CoreResult>("com.hnshituo.pur.ck.service.ExcDeliveryMService", "doUpdate", new object[] { EdnM });
  105. if (crt.Resultcode != 0)
  106. {
  107. MessageUtil.ShowTips("送货单 " + EdnM.DeliveryId + " 删除失败");
  108. return;
  109. }
  110. MessageUtil.ShowTips("送货单 " + EdnM.DeliveryId + " 删除成功!");
  111. Get_ExcDeliveryNoticeM();
  112. }
  113. if (SQ == "1")
  114. {
  115. UltraGridRow uge = ultraGrid2.ActiveRow;
  116. ExcDeliveryC EdnC = new ExcDeliveryC();
  117. EdnC.DeliveryLineSqe = uge.Cells["DeliveryLineSqe"].Value.ToString();
  118. EdnC.Validflag = "0";
  119. EdnC.Qty = 0;
  120. CoreResult crt = this.execute<CoreResult>("com.hnshituo.pur.ck.service.ExcDeliveryCService", "doUpdate", new object[] { EdnC });
  121. if (crt.Resultcode != 0)
  122. {
  123. MessageUtil.ShowTips("送货单行 " + EdnC.DeliveryLineSqe + " 删除失败");
  124. return;
  125. }
  126. MessageUtil.ShowTips("送货单行 " + EdnC.DeliveryLineSqe + " 删除成功!");
  127. ExcDeliveryC EdnCC = new ExcDeliveryC();
  128. EdnCC.DeliveryId = uge.Cells["DeliveryId"].Value.ToString();
  129. EdnCC.Validflag = "1";
  130. DataTable dt = this.execute<DataTable>("com.hnshituo.pur.ck.service.ExcDeliveryCService", "find_ExcDC", new object[] { EdnCC, 0, 0 });
  131. GridHelper.CopyDataToDatatable(dt, dataTable2, true);
  132. }
  133. }
  134. catch (Exception e)
  135. {
  136. MessageUtil.ShowTips("送货单行 删除失败" + e);
  137. return;
  138. }
  139. }
  140. /// <summary>
  141. /// 修改
  142. /// </summary>
  143. private void Upd_ExcDeliveryNoticeM()
  144. {
  145. UltraGridRow uge = ultraGrid2.ActiveRow;
  146. ExcDeliveryC EdnC = new ExcDeliveryC();
  147. if (uge == null)
  148. {
  149. MessageUtil.ShowTips("请选择送货单行!");
  150. return;
  151. }
  152. try
  153. {
  154. if (string.IsNullOrEmpty(ultraTextEditor6.Text))
  155. {
  156. MessageUtil.ShowTips("已发货数量不能为空!");
  157. return;
  158. }
  159. EdnC.DeliveryLineSqe = uge.Cells["DeliveryLineSqe"].Value.ToString();
  160. EdnC.CreatedQty = Convert.ToDouble(ultraTextEditor6.Value);
  161. CoreResult crt = this.execute<CoreResult>("com.hnshituo.pur.ck.service.ExcDeliveryCService", "doUpdate", new object[] { EdnC });
  162. if (crt.Resultcode != 0)
  163. {
  164. MessageUtil.ShowTips("送货单行 " + EdnC.DeliveryLineSqe + " 修改失败");
  165. return;
  166. }
  167. MessageUtil.ShowTips("送货单行 " + EdnC.DeliveryLineSqe + " 修改成功!");
  168. }
  169. catch (Exception e)
  170. {
  171. MessageUtil.ShowTips("送货单行 " + EdnC.DeliveryLineSqe + " 修改失败"+e);
  172. return;
  173. }
  174. ExcDeliveryC EdnCC = new ExcDeliveryC();
  175. EdnCC.DeliveryId = uge.Cells["DeliveryId"].Value.ToString();
  176. EdnCC.Validflag = "1";
  177. DataTable dt = this.execute<DataTable>("com.hnshituo.pur.ck.service.ExcDeliveryCService", "find_ExcDC", new object[] { EdnCC, 0, 0 });
  178. GridHelper.CopyDataToDatatable(dt, dataTable2, true);
  179. }
  180. /// <summary>
  181. /// 查询
  182. /// </summary>
  183. private void Get_ExcDeliveryNoticeM()
  184. {
  185. dataTable2.Clear();
  186. ExcDeliveryM EdnM = new ExcDeliveryM();
  187. EdnM.OrderId = txt_OrderId.Text;
  188. EdnM.NoticeId = txt_NoticeId.Text;
  189. EdnM.CreateTime = Convert.ToDateTime(txt_CreateTimeS.Text);
  190. EdnM.DeleteTime = Convert.ToDateTime(txt_CreateTimeE.Value);
  191. DataTable dt = this.execute<DataTable>("com.hnshituo.pur.ck.service.ExcDeliveryMService", "find_ExcDM ", new object[] { EdnM });
  192. GridHelper.CopyDataToDatatable(dt,dataTable1,true);
  193. }
  194. string SQ = "";
  195. private void ultraGrid1_ClickCell(object sender, ClickCellEventArgs e)
  196. {
  197. SQ = "0";
  198. UltraGridRow uge = ultraGrid1.ActiveRow;
  199. ExcDeliveryC EdnC = new ExcDeliveryC();
  200. EdnC.DeliveryId = uge.Cells["DeliveryId"].Value.ToString();
  201. EdnC.Validflag = "1";
  202. DataTable dt = this.execute<DataTable>("com.hnshituo.pur.ck.service.ExcDeliveryCService", "find_ExcDC", new object[] { EdnC, 0, 0 });
  203. GridHelper.CopyDataToDatatable(dt, dataTable2, true);
  204. }
  205. private void ultraGrid2_ClickCell(object sender, ClickCellEventArgs e)
  206. {
  207. SQ = "1";
  208. UltraGridRow uge = ultraGrid2.ActiveRow;
  209. ultraTextEditor4.Text = uge.Cells["ITEMNAME"].Value.ToString();
  210. ultraTextEditor5.Text = uge.Cells["QTY"].Value.ToString();
  211. ultraTextEditor6.Text = uge.Cells["CREATEDQTY"].Value.ToString();
  212. }
  213. private void PurExcDeliveryManag_Load(object sender, EventArgs e)
  214. {
  215. txt_CreateTimeS.Value = DateTime.Now.AddMonths(-1);
  216. txt_CreateTimeE.Value = Convert.ToDateTime(DateTime.Now.ToShortDateString()).AddHours(23).AddMinutes(59);
  217. Get_ExcDeliveryNoticeM();
  218. }
  219. }
  220. }