QCM030507.cs 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390
  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 Infragistics.Win.UltraWinGrid;
  10. using Infragistics.Win;
  11. using System.Collections;
  12. using CoreFS.CA06;
  13. using System.Diagnostics;
  14. namespace Core.LZMes.Client.QCM
  15. {
  16. public partial class QCM030507 : FrmBase
  17. {
  18. public QCM030507()
  19. {
  20. InitializeComponent();
  21. }
  22. public override void ToolBar_Click(object sender, string ToolbarKey)
  23. {
  24. switch (ToolbarKey)
  25. {
  26. case "Query":
  27. this.DoQuery();
  28. break;
  29. case "Judge":
  30. Judge();
  31. break;
  32. case "Cancel_Judge":
  33. cancel_judge();
  34. break;
  35. case "Exit":
  36. this.Close();
  37. break;
  38. case "Export":
  39. this.DoExport();
  40. break;
  41. }
  42. }
  43. private void DoQuery()
  44. {
  45. if (this.ultraTabControl1.Tabs[0].Selected) //待判信息
  46. {
  47. DoQueryMe();
  48. }
  49. if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
  50. {
  51. DoQueryRe();
  52. }
  53. }
  54. private void DoQueryMe()
  55. {
  56. try
  57. {
  58. this.dataSet3.Clear();
  59. string heatno = this.textBox1.Text.Trim();
  60. string prod_line = this.comboBox3.Text.ToString();
  61. prod_line = "4001LG0";
  62. CoreClientParam ccp = new CoreClientParam();
  63. ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
  64. ccp.MethodName = "GetStorageInfo";
  65. ccp.ServerParams = new object[] { this.dateTimePicker1.Value.ToString("yyyy-MM-dd"), this.dateTimePicker2.Value.ToString("yyyy-MM-dd"), heatno, prod_line };
  66. ccp.SourceDataTable = this.dataSet3.Tables[0];
  67. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  68. }
  69. catch (Exception ex)
  70. {
  71. System.Diagnostics.Debug.WriteLine(ex.ToString());
  72. MessageBox.Show("系统出错,请联系管理人员", "警告");
  73. }
  74. }
  75. private void DoQueryRe()
  76. {
  77. try
  78. {
  79. this.dataSet2.Clear();
  80. string heatno = this.textBox1.Text.Trim();
  81. string prod_line = this.comboBox3.Text.ToString();
  82. if (prod_line == "一炼钢")
  83. {
  84. prod_line = "钢一区";
  85. }
  86. else
  87. {
  88. prod_line = "钢二区";
  89. }
  90. CoreClientParam ccp = new CoreClientParam();
  91. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  92. ccp.MethodName = "GetXiuMoJiLv";
  93. ccp.ServerParams = new object[] { this.dateTimePicker1.Value.ToString("yyyy-MM-dd"), this.dateTimePicker2.Value.ToString("yyyy-MM-dd"), heatno, prod_line };
  94. ccp.SourceDataTable = this.dataSet2.Tables[0];
  95. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  96. }
  97. catch (Exception ex)
  98. {
  99. System.Diagnostics.Debug.WriteLine(ex.ToString());
  100. MessageBox.Show("系统出错,请联系管理人员", "警告");
  101. }
  102. }
  103. private void cancel_judge()
  104. {
  105. try
  106. {
  107. UltraGridRow ugr = this.ultraGrid3.ActiveRow;
  108. if (ugr == null)
  109. return;
  110. if (MessageBox.Show("是否确认撤销表面判定!", "提示", MessageBoxButtons.YesNo) == DialogResult.No) return;
  111. ArrayList list1 = new ArrayList();
  112. list1.Add("4001LGX");
  113. list1.Add(ugr.Cells["PROD_NAME"].Value.ToString());
  114. list1.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
  115. list1.Add(this.UserInfo.GetUserName());//操作人
  116. CoreClientParam ccp = new CoreClientParam();
  117. ccp = new CoreClientParam();
  118. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  119. ccp.MethodName = "cancelSurfaceJudge";
  120. ccp.ServerParams = new object[] { list1 };
  121. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  122. this.DoQuery();
  123. }
  124. catch (Exception ex)
  125. {
  126. System.Diagnostics.Debug.WriteLine(ex.ToString());
  127. MessageBox.Show("系统出错,请联系管理人员", "警告");
  128. }
  129. }
  130. private void Judge()
  131. {
  132. try
  133. {
  134. //UltraGridRow ugr = this.ultraGrid3.ActiveRow;
  135. CoreClientParam ccp = new CoreClientParam();
  136. foreach (UltraGridRow ugrs in this.ultraGrid3.Rows)
  137. {
  138. if (ugrs.Cells["CHECK"].Text.ToString() == "True")
  139. {
  140. ArrayList list1 = new ArrayList();
  141. list1.Add(ugrs.Cells["FACECHECKID"].Value.ToString());
  142. list1.Add(ugrs.Cells["BILLETNO"].Value.ToString());
  143. list1.Add(ugrs.Cells["STATUS"].Value.ToString());
  144. list1.Add(ugrs.Cells["WEIGHT"].Value.ToString());
  145. list1.Add(ugrs.Cells["THICK"].Value.ToString());
  146. list1.Add(ugrs.Cells["WIDTH"].Value.ToString());
  147. list1.Add(ugrs.Cells["LENGTH"].Value.ToString());
  148. list1.Add(ugrs.Cells["PRODNAME"].Value.ToString());
  149. list1.Add(ugrs.Cells["PROD_NAME"].Value.ToString());
  150. list1.Add(ugrs.Cells["PROD_THK"].Value.ToString());
  151. list1.Add(ugrs.Cells["PROD_WTH"].Value.ToString());
  152. list1.Add(ugrs.Cells["STEELCODE"].Value.ToString());
  153. list1.Add(ugrs.Cells["ORDERNO"].Value.ToString());
  154. list1.Add(ugrs.Cells["HEATNO"].Value.ToString());
  155. list1.Add(ugrs.Cells["PLANSTEEL"].Value.ToString());
  156. list1.Add(this.comboBox1.Text.ToString());
  157. string bmqx = this.comboBox1.Text.ToString();
  158. string surfaceid = ugrs.Cells["FACECHECKID"].Value.ToString();
  159. string username = this.UserInfo.GetUserName();
  160. string userorder = this.UserInfo.GetUserOrderText();
  161. string usergroup = this.UserInfo.GetUserGroupText();
  162. string fixed_type_desc = this.comboBox2.Text.ToString();//修磨结果
  163. if (fixed_type_desc == "")
  164. {
  165. MessageBox.Show("请输入修磨结果!");
  166. return;
  167. }
  168. if (this.comboBox2.Text.ToString() == "全剥" && this.textBox2.Text.ToString() == "")
  169. {
  170. MessageBox.Show("请输入修改后厚度!");
  171. return;
  172. }
  173. string fixed_thick = this.textBox2.Text.ToString();
  174. string flag = "1";
  175. /*if (ugrs.Cells["PRIMARY_FLAG"].Text.ToString().Contains("是"))
  176. {
  177. flag = "1";
  178. }
  179. else
  180. {
  181. flag = "0";
  182. }*/
  183. ccp = new CoreClientParam();
  184. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  185. ccp.MethodName = "BMQX";
  186. ccp.ServerParams = new object[] { surfaceid, flag, username, userorder, usergroup, fixed_type_desc, fixed_thick,bmqx,list1 };
  187. ccp = this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  188. if (ccp.ReturnCode == -1)
  189. {
  190. return;
  191. }
  192. MessageBox.Show(ugrs.Cells["BILLETNO"].Value.ToString() + "修磨发送成功");
  193. }
  194. }
  195. }
  196. catch (Exception ex)
  197. {
  198. System.Diagnostics.Debug.WriteLine(ex.ToString());
  199. MessageBox.Show("系统出错,请联系管理人员", "警告");
  200. }
  201. }
  202. private void QCM0305_Load(object sender, EventArgs e)
  203. {
  204. //this.comboBox2.Visible = false;
  205. this.ultraGrid1.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
  206. this.ultraGrid3.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
  207. this.dateTimePicker1.Value = System.DateTime.Now.AddDays(-3);
  208. this.comboBox3.SelectedIndex = 0;
  209. this.ultraGrid1.DisplayLayout.Bands[0].Header.Appearance.BackColor = Color.LightBlue;
  210. this.ultraGrid3.DisplayLayout.Bands[0].Header.Appearance.BackColor = Color.LightBlue;
  211. /*ValueList vis_repair = new ValueList();
  212. vis_repair.ValueListItems.Add("0", "待修复");
  213. vis_repair.ValueListItems.Add("1", "已修复");
  214. ValueList vprimary_flag = new ValueList();
  215. vprimary_flag.ValueListItems.Add("1", "是");
  216. vprimary_flag.ValueListItems.Add("0", "否");*/
  217. ValueList vFLAW_DESC = new ValueList();
  218. CoreClientParam ccp = new CoreClientParam();
  219. ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
  220. ccp.MethodName = "findFlawData";
  221. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  222. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  223. {
  224. vFLAW_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["ID_"].ToString(), ccp.SourceDataTable.Rows[i]["NAME_"].ToString());
  225. }
  226. this.comboBox1.DataSource = vFLAW_DESC.ValueListItems;
  227. ValueList vflaw_pos_desc = new ValueList();
  228. ccp = new CoreClientParam();
  229. ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
  230. ccp.MethodName = "findMemo";
  231. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  232. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  233. {
  234. vflaw_pos_desc.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["ID_"].ToString(), ccp.SourceDataTable.Rows[i]["NAME_"].ToString());
  235. }
  236. this.comboBox2.DataSource = vflaw_pos_desc.ValueListItems;
  237. /*ValueList VFLAW_SIZE_DESC = new ValueList();
  238. ccp = new CoreClientParam();
  239. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  240. ccp.MethodName = "findFlawSizeDesc";
  241. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  242. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  243. {
  244. VFLAW_SIZE_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  245. }*/
  246. /*ValueList vsflv = new ValueList();
  247. ccp = new CoreClientParam();
  248. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  249. ccp.MethodName = "findSfLv";
  250. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  251. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  252. {
  253. vsflv.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  254. }
  255. this.comboBox2.DataSource = vsflv.ValueListItems;
  256. ValueList VFLAW_LV_DESC = new ValueList();
  257. ccp = new CoreClientParam();
  258. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  259. ccp.MethodName = "findFlawLvDesc";
  260. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  261. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  262. {
  263. VFLAW_LV_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  264. }
  265. ValueList VFLAW_DIR_DESC = new ValueList();
  266. ccp = new CoreClientParam();
  267. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  268. ccp.MethodName = "findFlawDirDesc";
  269. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  270. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  271. {
  272. VFLAW_DIR_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  273. }
  274. ValueList VFIXED_TYPE_DESC = new ValueList();
  275. ccp = new CoreClientParam();
  276. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  277. ccp.MethodName = "GetXmResult";
  278. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  279. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  280. {
  281. VFIXED_TYPE_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["XMRESULT"].ToString(), ccp.SourceDataTable.Rows[i]["XMRESULT"].ToString());
  282. }
  283. ccp = new CoreClientParam();
  284. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  285. ccp.MethodName = "findFlawDataLg";
  286. ccp.ServerParams = new object[] { "LG2" };
  287. ccp.SourceDataTable = this.dataSet6.Tables[0];
  288. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  289. //ValueList VDEFECT_DESC = new ValueList();
  290. //for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  291. //{
  292. // VDEFECT_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["DEFECT_CODE"].ToString(), ccp.SourceDataTable.Rows[i]["DEFECT_DESC"].ToString());
  293. //}
  294. //this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].ValueList = VDEFECT_DESC;
  295. UltraCombo uc;
  296. this.ultraCombo1.DataSource = ccp.SourceDataTable;
  297. //uc.DisplayMember = ccp.SourceDataTable.Columns["DEFECT_NAME"].ToString();
  298. //uc.ValueMember = ccp.SourceDataTable.Columns["DEFECT_CODE"].ToString();*/
  299. //DoQuery();
  300. }
  301. private void ultraGrid3_AfterRowActivate(object sender, EventArgs e)
  302. {
  303. }
  304. private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
  305. {
  306. }
  307. private void checkBox1_CheckedChanged(object sender, EventArgs e)
  308. {
  309. foreach (UltraGridRow ugr in this.ultraGrid3.Rows)
  310. {
  311. if (checkBox1.Checked)
  312. {
  313. ugr.Cells["CHECK"].Value = "True";
  314. }
  315. else
  316. {
  317. ugr.Cells["CHECK"].Value = "False";
  318. }
  319. }
  320. }
  321. private void ultraTabControl1_Click(object sender, EventArgs e)
  322. {
  323. if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
  324. {
  325. //this.checkBox2.Visible = true;
  326. this.label11.Text = "判定时间";
  327. }
  328. if (this.ultraTabControl1.Tabs[0].Selected) //判定记录
  329. {
  330. //this.checkBox2.Visible = false;
  331. this.label11.Text = "生产时间";
  332. }
  333. }
  334. private void DoExport()
  335. {
  336. try
  337. {
  338. if (this.ultraGrid1.Rows.Count == 0)
  339. {
  340. MessageBox.Show("没有可以导出的数据", "提示");
  341. return;
  342. }
  343. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  344. {
  345. string fName = this.saveFileDialog1.FileName;
  346. this.ultraGridExcelExporter1.Export(this.ultraGrid1, fName);
  347. Process.Start(fName);
  348. }
  349. }
  350. catch (Exception ex)
  351. {
  352. System.Diagnostics.Debug.WriteLine(ex.ToString());
  353. }
  354. }
  355. }
  356. }