FrmExamineJudge.cs 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  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;
  10. using Core.Mes.Client.Comm.Tool;
  11. using Core.StlMes.Client.YdmPipeManage.Entity;
  12. using System.Collections;
  13. using Core.StlMes.Client.YdmPipeManage.Tool;
  14. using Infragistics.Win.UltraWinGrid;
  15. using Core.Mes.Client.Comm.Server;
  16. namespace Core.StlMes.Client.YdmPipeManage
  17. {
  18. public partial class FrmExamineJudge : FrmBase
  19. {
  20. public FrmExamineJudge()
  21. {
  22. InitializeComponent();
  23. }
  24. private void FrmExamineJudge_Load(object sender, EventArgs e)
  25. {
  26. this.TextStoveNo.Enabled = false;
  27. EntityHelper.ShowGridCaption<QcmZgJudgeChangeEntity>(ultraGrid1.DisplayLayout.Bands[0]);
  28. InitColums();
  29. }
  30. string stOutCode = "800808";//出库代码
  31. string stOutName = "改判出库";
  32. string stInCode = "800706";//入库代码
  33. string stInName = "改判入库";
  34. /// <summary>
  35. /// 绑定列
  36. /// </summary>
  37. private void InitColums()
  38. {
  39. }
  40. public override void ToolBar_Click(object sender, string ToolbarKey)
  41. {
  42. switch (ToolbarKey)
  43. {
  44. case "Query":
  45. QueryData();
  46. break;
  47. case"submit":
  48. submitData();
  49. break;
  50. case "examineData":
  51. examineData();
  52. break;
  53. case "NoexamineData":
  54. NoexamineData();
  55. break;
  56. case "Close":
  57. this.Close();
  58. break;
  59. }
  60. }
  61. /// <summary>
  62. /// 审核不通过
  63. /// </summary>
  64. private void NoexamineData()
  65. {
  66. this.ultraGrid1.UpdateData();
  67. ArrayList parm = new ArrayList();
  68. int m = 0;
  69. IQueryable<UltraGridRow> checkRows = ultraGrid1.Rows.AsQueryable().Where(" CHK = 'True'");
  70. if (checkRows.Count() == 0)
  71. {
  72. MessageUtil.ShowWarning("请选择需要操作的记录!");
  73. return;
  74. }
  75. foreach (UltraGridRow row in ultraGrid1.Rows)
  76. {
  77. if (Convert.ToBoolean(row.Cells["CHK"].Text) == true)
  78. {
  79. if (row.Cells["AgreeMemo"].Text == "")
  80. {
  81. m++;
  82. }
  83. }
  84. }
  85. if (m > 0)
  86. {
  87. MessageUtil.ShowWarning("审批不通过,必须写审批说明!");
  88. return;
  89. }
  90. foreach (UltraGridRow uRow in ultraGrid1.Rows)
  91. {
  92. if (Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
  93. {
  94. ArrayList list = new ArrayList();
  95. list.Add(uRow.Cells["JudgeId"].Text);
  96. list.Add(uRow.Cells["AgreeMemo"].Text);
  97. list.Add(this.UserInfo.GetUserName());
  98. parm.Add(list);
  99. }
  100. }
  101. CoreClientParam ccp = new CoreClientParam();
  102. ccp.ServerName = "com.steering.pss.ydm.pipemanage.FrmExamineJudge";
  103. ccp.MethodName = "noExamineData";
  104. ccp.ServerParams = new object[] { parm };
  105. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  106. if (ccp.ReturnCode != -1)
  107. {
  108. if (ccp.ReturnInfo.Equals("审批成功!"))
  109. {
  110. QueryData();
  111. MessageUtil.ShowTips("审批成功!");
  112. }
  113. else
  114. {
  115. MessageUtil.ShowTips(ccp.ReturnInfo);
  116. }
  117. }
  118. }
  119. /// <summary>
  120. /// 审核通过
  121. /// </summary>
  122. private void examineData()
  123. {
  124. this.ultraGrid1.UpdateData();
  125. ArrayList parm = new ArrayList();
  126. int m = 0;
  127. IQueryable<UltraGridRow> checkRows = ultraGrid1.Rows.AsQueryable().Where(" CHK = 'True'");
  128. if (checkRows.Count() == 0)
  129. {
  130. MessageUtil.ShowWarning("请选择需要操作的记录!");
  131. return;
  132. }
  133. string manNo = ClsBaseInfo.GetDepartIdBySectionId(UserInfo.GetDeptid(), this.ob);
  134. string manName = ClsBaseInfo.GetDepartBySectionId(UserInfo.GetDeptid(), this.ob);
  135. foreach (UltraGridRow uRow in ultraGrid1.Rows)
  136. {
  137. if (Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
  138. {
  139. ArrayList list = new ArrayList();
  140. list.Add(uRow.Cells["JudgeId"].Text);
  141. list.Add(uRow.Cells["AgreeMemo"].Text);
  142. list.Add(this.UserInfo.GetUserName());
  143. list.Add(manNo);//部门ID
  144. list.Add(manName);//部门
  145. list.Add(this.UserInfo.GetDeptid());
  146. list.Add(this.UserInfo.GetDepartment());
  147. list.Add(stOutCode);//7
  148. list.Add(stOutName);
  149. list.Add("OP");
  150. list.Add(uRow.Cells["judgeStoveNoOld"].Text);
  151. list.Add(uRow.Cells["batchNoOld"].Text);
  152. list.Add(uRow.Cells["produccode"].Text);//12
  153. list.Add(uRow.Cells["producname"].Text);
  154. list.Add(uRow.Cells["steelcode"].Text);
  155. list.Add(uRow.Cells["steelname"].Text);
  156. list.Add(uRow.Cells["specCode"].Text);
  157. list.Add(uRow.Cells["specName"].Text);
  158. list.Add(uRow.Cells["modelCode"].Text);
  159. list.Add(uRow.Cells["modelDesc"].Text);
  160. list.Add(uRow.Cells["stdStyle"].Text);
  161. list.Add(uRow.Cells["stdStyleDesc"].Text);
  162. list.Add(uRow.Cells["materialNo"].Text);
  163. list.Add(uRow.Cells["materialName"].Text);//23
  164. list.Add(stInCode);
  165. list.Add(stInName);
  166. list.Add("IP");
  167. parm.Add(list);
  168. }
  169. }
  170. CoreClientParam ccp = new CoreClientParam();
  171. ccp.ServerName = "com.steering.pss.ydm.pipemanage.FrmExamineJudge";
  172. ccp.MethodName = "examineData1";
  173. ccp.ServerParams = new object[] { parm,this.CustomInfo };
  174. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  175. if (ccp.ReturnCode != -1)
  176. {
  177. if (ccp.ReturnInfo.Equals("审批成功!"))
  178. {
  179. QueryData();
  180. MessageUtil.ShowTips("审批成功!");
  181. }
  182. else
  183. {
  184. MessageUtil.ShowTips(ccp.ReturnInfo);
  185. }
  186. }
  187. }
  188. /// <summary>
  189. /// 提交改判
  190. /// </summary>
  191. private void submitData()
  192. {
  193. this.ultraGrid1.UpdateData();
  194. ArrayList parm = new ArrayList();
  195. int m = 0;
  196. foreach (UltraGridRow row in ultraGrid1.Rows)
  197. {
  198. if (Convert.ToBoolean(row.Cells["CHK"].Text) == true)
  199. {
  200. m++;
  201. }
  202. }
  203. if (m < 1)
  204. {
  205. MessageUtil.ShowTips("请选择需要提交改判的数据!");
  206. return;
  207. }
  208. foreach (UltraGridRow uRow in ultraGrid1.Rows)
  209. {
  210. if(Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
  211. {
  212. ArrayList list = new ArrayList();
  213. list.Add(uRow.Cells["JudgeId"].Text);
  214. list.Add(uRow.Cells["SubmitMemo"].Text);
  215. list.Add(this.UserInfo.GetUserName());
  216. parm.Add(list);
  217. }
  218. }
  219. CoreClientParam ccp = new CoreClientParam();
  220. ccp.ServerName = "com.steering.pss.ydm.pipemanage.FrmExamineJudge";
  221. ccp.MethodName = "submitGpData";
  222. ccp.ServerParams = new object[] { parm };
  223. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  224. if (ccp.ReturnCode != -1)
  225. {
  226. if (ccp.ReturnInfo.Equals("提交改判成功!"))
  227. {
  228. QueryData();
  229. MessageUtil.ShowTips("提交改判成功!");
  230. }
  231. else
  232. {
  233. MessageUtil.ShowTips(ccp.ReturnInfo);
  234. }
  235. }
  236. }
  237. /// <summary>
  238. /// 查询改判实绩
  239. /// </summary>
  240. private void QueryData()
  241. {
  242. string heatNo = "";
  243. string start = "";
  244. string end = "";
  245. ArrayList list = new ArrayList();
  246. if (ChcStoveNo.Checked)
  247. {
  248. if (this.TextStoveNo.Text == "")
  249. {
  250. MessageUtil.ShowTips("请输入炉号!");
  251. return;
  252. }
  253. else
  254. {
  255. heatNo = this.TextStoveNo.Text;
  256. }
  257. }
  258. if (createTimeCheck.Checked)
  259. {
  260. start = startTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  261. end = endTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  262. }
  263. list.Add(heatNo);
  264. string[] arr = BaseMethod.InitPermissions(this.ValidDataPurviewIds, ob);
  265. List<QcmZgJudgeChangeEntity> listSource = EntityHelper.GetData<QcmZgJudgeChangeEntity>(
  266. "com.steering.pss.ydm.pipemanage.FrmExamineJudge.getGpData", new object[] { list, arr, this.CustomInfo, start, end }, this.ob);
  267. QcmZgJudgeChangeEntitybindingSource1.DataSource = listSource;
  268. }
  269. private void ChcStoveNo_CheckedChanged(object sender, EventArgs e)
  270. {
  271. this.TextStoveNo.Enabled = this.ChcStoveNo.Checked;
  272. }
  273. private void ultraGrid1_AfterSelectChange(object sender, AfterSelectChangeEventArgs e)
  274. {
  275. foreach (UltraGridRow uRow in ultraGrid1.Selected.Rows)
  276. {
  277. if (uRow.GetType() != typeof(Infragistics.Win.UltraWinGrid.UltraGridGroupByRow))
  278. {
  279. uRow.Cells["CHK"].Value = true;
  280. }
  281. }
  282. }
  283. private void TextStoveNo_KeyDown(object sender, KeyEventArgs e)
  284. {
  285. if (e.KeyValue == 13)
  286. {
  287. QueryData();
  288. }
  289. }
  290. }
  291. }