ZbsChooseBillInfo.cs 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. using Core.Mes.Client.Comm.Control;
  2. using Core.Mes.Client.Comm.Server;
  3. using Core.Mes.Client.Comm.Tool;
  4. using CoreFS.CA06;
  5. using Infragistics.Win.UltraWinGrid;
  6. using System;
  7. using System.Collections;
  8. using System.Collections.Generic;
  9. using System.ComponentModel;
  10. using System.Data;
  11. using System.Drawing;
  12. using System.Linq;
  13. using System.Text;
  14. using System.Windows.Forms;
  15. namespace Core.StlMes.Client.Judge.Controls
  16. {
  17. public partial class ZbsChooseBillInfo : FrmBase
  18. {
  19. public ZbsChooseBillInfo(OpeBase ob)
  20. {
  21. this.ob = ob;
  22. InitializeComponent();
  23. doQuery();
  24. }
  25. /// <summary>
  26. /// 窗体关闭属性 默认关闭
  27. /// </summary>
  28. private string closeEvent = "formClose";
  29. /// <summary>
  30. /// 窗体关闭属性
  31. /// </summary>
  32. public string CloseEvent
  33. {
  34. get { return closeEvent; }
  35. set { closeEvent = value; }
  36. }
  37. private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
  38. {
  39. switch (e.Tool.Key)
  40. {
  41. case "Query":
  42. doQuery();
  43. break;
  44. case "doConfirm":
  45. doConfirm();
  46. break;
  47. case "Close":
  48. this.Close();
  49. break;
  50. }
  51. }
  52. private void doQuery()
  53. {
  54. string billNo = "";
  55. string judgeNo = "";
  56. string orderStart = "";
  57. string orderEnd = "";
  58. if (chkBillNo.Checked)
  59. billNo = txtBillNo.Text.Trim();
  60. if (ckJudgeNo.Checked)
  61. judgeNo = utJudgeNo.Text.Trim();
  62. if (uchkDate.Checked)
  63. {
  64. orderStart = udtStart.DateTime.ToString("yyyy-MM-dd") + " 00:00:01";
  65. orderEnd = udtEnd.DateTime.ToString("yyyy-MM-dd") + " 23:59:59";
  66. }
  67. else
  68. {
  69. orderStart = "1000-01-01 00:00:01";
  70. orderEnd = "9999-12-31 23:59:59";
  71. }
  72. DataTable dt = ServerHelper.GetData("com.steering.pss.judge.DAL.ZbsInfoInput.getBillInfo", new Object[] { billNo, judgeNo, orderStart, orderEnd }, this.ob);
  73. GridHelper.CopyDataToDatatable(ref dt, ref this.dataTable1, true);
  74. GridHelper.RefreshAndAutoSize(this.ultraGrid1);
  75. }
  76. private void doConfirm()
  77. {
  78. if (ultraGrid1.ActiveRow == null)
  79. {
  80. MessageUtil.ShowWarning("请选择提单信息!");
  81. return;
  82. }
  83. ArrayList list = new ArrayList();
  84. UltraGridRow row = ultraGrid1.ActiveRow;
  85. list.Add("");
  86. list.Add(row.Cells["STOVE_NO"].Value.ToString());
  87. list.Add(row.Cells["JUDGE_STOVE_NO"].Value.ToString());
  88. list.Add(row.Cells["BATCH_NO"].Value.ToString());
  89. list.Add(row.Cells["PLINE_CODE"].Value.ToString());
  90. list.Add("40740101");
  91. list.Add("40740201");
  92. list.Add("40740601");
  93. list.Add("40740301");
  94. list.Add("40740401");
  95. list.Add("40740501");
  96. list.Add("40740801");
  97. list.Add("40740701");
  98. list.Add(UserInfo.GetUserName());
  99. list.Add(row.Cells["ACT_COUNT"].Value.ToString());
  100. list.Add(row.Cells["ACT_WEIGHT"].Value.ToString());
  101. list.Add(row.Cells["ACT_WEIGHT"].Value.ToString());
  102. list.Add(row.Cells["STEELCODE"].Value.ToString());
  103. list.Add(row.Cells["GRADECODE"].Value.ToString());
  104. list.Add(row.Cells["STEELNAME"].Value.ToString());
  105. list.Add(row.Cells["GRADENAME"].Value.ToString());
  106. list.Add(row.Cells["CUSTOMER_NO"].Value.ToString());
  107. list.Add(row.Cells["CUSTOMER_NM"].Value.ToString());
  108. list.Add(row.Cells["RECEIV_NO"].Value.ToString());
  109. list.Add(row.Cells["RECEIV_NM"].Value.ToString());
  110. list.Add(row.Cells["ORDER_NO"].Value.ToString());
  111. list.Add(row.Cells["ORDER_SEQ"].Value.ToString());
  112. list.Add(row.Cells["STD_CODE"].Value.ToString());
  113. list.Add(row.Cells["STD_NAME"].Value.ToString());
  114. list.Add(row.Cells["STD_STYLE"].Value.ToString());
  115. list.Add(row.Cells["STD_STYLE_DESC"].Value.ToString());
  116. list.Add(row.Cells["PRODUCCODE"].Value.ToString());
  117. list.Add(row.Cells["PRODUCNAME"].Value.ToString());
  118. list.Add(row.Cells["ORDER_SPEC_CODE"].Value.ToString());
  119. list.Add(row.Cells["ORDER_SPEC_DESC"].Value.ToString());
  120. list.Add(row.Cells["MODEL_CODE"].Value.ToString());
  121. list.Add(row.Cells["MODEL_DESC"].Value.ToString());
  122. list.Add(row.Cells["OUTPUT_STD_NO"].Value.ToString());
  123. list.Add(row.Cells["LEN_NO"].Value.ToString());
  124. list.Add(row.Cells["USE_CODE"].Value.ToString());
  125. list.Add(row.Cells["USE_DESC"].Value.ToString());
  126. list.Add(row.Cells["CUSTM_ORDER_NO"].Value.ToString());
  127. list.Add(row.Cells["SPEC_CODE"].Value.ToString());
  128. list.Add(row.Cells["SPEC_NAME"].Value.ToString());
  129. list.Add(row.Cells["LEN_UNIT"].Value.ToString());
  130. list.Add(row.Cells["LEN_MIN"].Value.ToString());
  131. list.Add(row.Cells["LEN_MAX"].Value.ToString());
  132. list.Add(row.Cells["LEN_DESC"].Value.ToString());
  133. list.Add(row.Cells["LEN_DESC"].Value.ToString());
  134. list.Add(row.Cells["ORD_LN_PK"].Value.ToString());
  135. list.Add(row.Cells["ORD_LN_DLY_PK"].Value.ToString());
  136. if (MessageUtil.ShowYesNoAndQuestion("是否确认新增质保书主信息?") == DialogResult.No) return;
  137. CoreClientParam ccp = new CoreClientParam();
  138. ccp.ServerName = "com.steering.pss.judge.DAL.ZbsInfoInput";
  139. ccp.MethodName = "addZbsInfo";
  140. ccp.ServerParams = new object[] { list, row.Cells["BILL_NO"].Value.ToString() };
  141. ccp.IfShowErrMsg = false;
  142. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  143. if (ccp != null)
  144. {
  145. if (ccp.ReturnCode == -1)
  146. {
  147. MessageUtil.ShowWarning(ccp.ReturnInfo);
  148. return;
  149. }
  150. MessageUtil.ShowTips("新增成功!");
  151. this.CloseEvent = "Add";
  152. this.Close();
  153. }
  154. else
  155. {
  156. return;
  157. }
  158. }
  159. private void ZbsChooseBillInfo_Load(object sender, EventArgs e)
  160. {
  161. //默认查询当前日期-1月——当前日期数据。
  162. udtStart.DateTime = Convert.ToDateTime(DateTime.Now.AddMonths(-1).ToShortDateString());
  163. udtEnd.DateTime = Convert.ToDateTime(DateTime.Now.ToShortDateString());
  164. }
  165. private void chkBillNo_CheckedChanged(object sender, EventArgs e)
  166. {
  167. if (chkBillNo.Checked)
  168. txtBillNo.ReadOnly = false;
  169. else
  170. txtBillNo.ReadOnly = true;
  171. }
  172. private void ckJudgeNo_CheckedChanged(object sender, EventArgs e)
  173. {
  174. if (ckJudgeNo.Checked)
  175. utJudgeNo.ReadOnly = false;
  176. else
  177. utJudgeNo.ReadOnly = true;
  178. }
  179. }
  180. }