96b2bc62939bac1583c9d58e27cd9f080aa0ab7e.svn-base 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650
  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 QCM030509 : FrmBase
  17. {
  18. public QCM030509()
  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. Operate();
  31. break;
  32. case "Exit":
  33. this.Close();
  34. break;
  35. case "Export":
  36. this.DoExport();
  37. break;
  38. }
  39. }
  40. private void DoQuery()
  41. {
  42. if (this.ultraTabControl1.Tabs[0].Selected) //待判信息
  43. {
  44. DoQueryMe();
  45. }
  46. if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
  47. {
  48. DoQueryRe();
  49. }
  50. }
  51. private void DoQueryMe()
  52. {
  53. //查询探伤待检信息(轧批号、计划号)
  54. try
  55. {
  56. this.dataSet3.Clear();
  57. dataSet6.Clear();
  58. string starttime = "";
  59. string endtime = "";
  60. if (checkBox2.Checked)
  61. {
  62. starttime = this.dateTimePicker1.Value.ToString("yyyyMMdd");
  63. endtime = this.dateTimePicker2.Value.AddDays(1).ToString("yyyyMMdd");
  64. }
  65. string material_no = textBox2.Text.ToString();
  66. if (!checkBox2.Checked && !checkBox3.Checked)
  67. {
  68. MessageBox.Show("时间与产品序号必须选择其中一个条件!");
  69. return;
  70. }
  71. string orderno = this.textBox4.Text.Trim();// 订单号
  72. string prodline = this.comboBox3.Text.ToString();
  73. string processes = this.comboBox5.Text.ToString();
  74. string isjudge = this.comboBox4.Text.ToString();
  75. if (processes == "")
  76. {
  77. MessageBox.Show("请选择工序!");
  78. return;
  79. }
  80. CoreClientParam ccp = new CoreClientParam();
  81. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  82. ccp.MethodName = "doQueryMaterialDetailsY1";
  83. ccp.ServerParams = new object[] { starttime, endtime, material_no, orderno, "B", prodline, isjudge, processes };
  84. ccp.SourceDataTable = this.dataSet3.Tables[0];
  85. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  86. ccp = new CoreClientParam();
  87. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  88. ccp.MethodName = "findFlawDataY";
  89. ccp.ServerParams = new object[] { prodline };
  90. ccp.SourceDataTable = this.dataSet6.Tables[0];
  91. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  92. this.ultraCombo1.DataSource = ccp.SourceDataTable;
  93. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].EditorComponent = ultraCombo1;
  94. }
  95. catch (Exception ex)
  96. {
  97. System.Diagnostics.Debug.WriteLine(ex.ToString());
  98. MessageBox.Show("系统出错,请联系管理人员", "警告");
  99. }
  100. }
  101. private void DoQueryRe()
  102. {
  103. //查询判定记录
  104. try
  105. {
  106. this.dataSet2.Clear();
  107. string starttime = "";
  108. string endtime = "";
  109. if (checkBox2.Checked)
  110. {
  111. starttime = this.dateTimePicker1.Value.ToString("yyyyMMdd");
  112. endtime = this.dateTimePicker2.Value.ToString("yyyyMMdd");
  113. }
  114. string material_no = textBox2.Text.ToString();
  115. if (!checkBox2.Checked && !checkBox3.Checked)
  116. {
  117. MessageBox.Show("时间与产品序号必须选择其中一个条件!");
  118. return;
  119. }
  120. string orderno = textBox4.Text.Trim();
  121. string prodline = this.comboBox3.Text.ToString();
  122. string processes = this.comboBox5.Text.ToString();
  123. if (processes == "")
  124. {
  125. MessageBox.Show("请选择工序!");
  126. return;
  127. }
  128. CoreClientParam ccp = new CoreClientParam();
  129. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  130. ccp.MethodName = "GetSurfaceInfoY";
  131. ccp.ServerParams = new object[] { starttime, endtime, material_no, orderno, prodline, processes };
  132. ccp.SourceDataTable = this.dataSet2.Tables[0];
  133. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  134. }
  135. catch (Exception ex)
  136. {
  137. System.Diagnostics.Debug.WriteLine(ex.ToString());
  138. MessageBox.Show("系统出错,请联系管理人员", "警告");
  139. }
  140. }
  141. private void Operate()
  142. {
  143. string material_no = "";
  144. try
  145. {
  146. UltraGridRow ugr = this.ultraGrid3.ActiveRow;
  147. if (ugr == null)
  148. return;
  149. CoreClientParam ccp = new CoreClientParam();
  150. foreach (UltraGridRow ugrs in this.ultraGrid4.Rows)
  151. {
  152. if (ugrs.Cells["CHECKBOX"].Text.ToString() == "True")
  153. {
  154. string surfaceid = ugrs.Cells["SURFACE_ID"].Value.ToString();
  155. string username = this.UserInfo.GetUserName();
  156. string userorder = this.UserInfo.GetUserOrderText();
  157. string usergroup = this.UserInfo.GetUserGroupText();
  158. string flag = "";
  159. if(ugrs.Cells["PRIMARY_FLAG"].Text.ToString().Contains("是"))
  160. {
  161. flag = "1";
  162. }
  163. else
  164. {
  165. flag = "0";
  166. }
  167. ccp = new CoreClientParam();
  168. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  169. ccp.MethodName = "repairFlaw";
  170. ccp.ServerParams = new object[] { surfaceid, ugrs.Cells["FLAW_SEQ"].Value.ToString(), flag, username, userorder, usergroup };
  171. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  172. }
  173. }
  174. this.dataSet4.Clear();
  175. string surface_id = ugr.Cells["SURFACE_ID"].Value.ToString();
  176. ccp = new CoreClientParam();
  177. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  178. ccp.MethodName = "findNameByMN";
  179. ccp.ServerParams = new object[] { surface_id };
  180. ccp.SourceDataTable = this.dataSet4.Tables[0];
  181. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  182. }
  183. catch (Exception ex)
  184. {
  185. System.Diagnostics.Debug.WriteLine(ex.ToString());
  186. MessageBox.Show("系统出错,请联系管理人员", "警告");
  187. }
  188. }
  189. private void label9_Click(object sender, EventArgs e)
  190. {
  191. try
  192. {
  193. List<UltraGridRow> lists = new List<UltraGridRow>();
  194. foreach (UltraGridRow ugr in ultraGrid3.Rows)
  195. {
  196. if (ugr.Cells["CHECK"].Text.ToString() == "True")
  197. {
  198. ArrayList list1 = new ArrayList();
  199. List<ArrayList> list2 = new List<ArrayList>();
  200. if (comboBox2.Text.Trim() == "")
  201. {
  202. MessageBox.Show("请输入质量等级!");
  203. return;
  204. }
  205. string is_pass = "";
  206. string is_zl = "";
  207. if (comboBox1.Text.ToString() == "合格")
  208. {
  209. is_pass = "1";
  210. }
  211. else if (comboBox1.Text.ToString() == "不合格")
  212. {
  213. is_pass = "2";
  214. }
  215. else if (comboBox1.Text.ToString() == "判次")
  216. {
  217. is_pass = "3";
  218. }
  219. else if (comboBox1.Text.ToString() == "判废")
  220. {
  221. is_pass = "4";
  222. }
  223. else
  224. {
  225. is_pass = "";
  226. }
  227. list1.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
  228. list1.Add(is_pass);//检验结果代码
  229. list1.Add(comboBox1.Text.Trim().ToString());//检验结果
  230. list1.Add(comboBox2.Text.Trim().ToString());//质量等级代码
  231. list1.Add(comboBox2.Text.Trim().ToString());//质量等级名称
  232. list1.Add(textBox5.Text.ToString().Trim());
  233. list1.Add(this.UserInfo.GetUserName());//操作人
  234. list1.Add(this.UserInfo.GetUserOrderText());//班次
  235. list1.Add(this.UserInfo.GetUserGroupText());//班组
  236. int count = 0;
  237. int i = 0;
  238. int j = 1;
  239. foreach (UltraGridRow ugrs in this.ultraGrid4.Rows)
  240. {
  241. if (ugrs.Cells["CHECKBOX"].Text.ToString() == "True")
  242. {
  243. ArrayList list = new ArrayList();
  244. if (ugrs.Cells["PRIMARY_FLAG"].Value.ToString() == "1" || ugrs.Cells["PRIMARY_FLAG"].Value.ToString() == "" || ugrs.Cells["PRIMARY_FLAG"].Text.ToString() == "是")
  245. {
  246. list.Add("1");
  247. }
  248. else
  249. {
  250. list.Add("0");
  251. }
  252. list.Add(j);
  253. if (ugrs.Cells["FLAW_DESC"].Text.ToString() == "")
  254. {
  255. list.Add(ugrs.Cells["FLAW_DESC"].Text.ToString());
  256. }
  257. else
  258. {
  259. list.Add(ugrs.Cells["FLAW_DESC"].Value.ToString());
  260. }
  261. list.Add(ugrs.Cells["FLAW_DESC"].Text.ToString());
  262. if (ugrs.Cells["FLAW_DESC"].Text.ToString() == "")
  263. {
  264. MessageBox.Show("已选择的请录入缺陷信息!");
  265. return;
  266. }
  267. if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "上表面")
  268. {
  269. list.Add("U");
  270. }
  271. else if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "下表面")
  272. {
  273. list.Add("D");
  274. }
  275. else if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "边部")
  276. {
  277. list.Add("E");
  278. }
  279. else
  280. {
  281. list.Add("");
  282. }
  283. //list.Add(ugrs.Cells["FLAW_TYPE_DESC"].Value.ToString());
  284. //list.Add(ugrs.Cells["FLAW_TYPE_DESC"].Text.ToString());
  285. if (ugrs.Cells["FLAW_POS_DESC"].Text.ToString() == "")
  286. {
  287. list.Add(ugrs.Cells["FLAW_POS_DESC"].Text.ToString());
  288. }
  289. else
  290. {
  291. list.Add(ugrs.Cells["FLAW_POS_DESC"].Value.ToString());
  292. }
  293. list.Add(ugrs.Cells["FLAW_POS_DESC"].Text.ToString());
  294. if (ugrs.Cells["FLAW_DIR_DESC"].Text.ToString() == "")
  295. {
  296. list.Add(ugrs.Cells["FLAW_DIR_DESC"].Text.ToString());
  297. }
  298. else
  299. {
  300. list.Add(ugrs.Cells["FLAW_DIR_DESC"].Value.ToString());
  301. }
  302. list.Add(ugrs.Cells["FLAW_DIR_DESC"].Text.ToString());
  303. if (ugrs.Cells["FLAW_SIZE_DESC"].Text.ToString() == "")
  304. {
  305. list.Add(ugrs.Cells["FLAW_SIZE_DESC"].Text.ToString());
  306. }
  307. else
  308. {
  309. list.Add(ugrs.Cells["FLAW_SIZE_DESC"].Value.ToString());
  310. }
  311. list.Add(ugrs.Cells["FLAW_SIZE_DESC"].Text.ToString());
  312. if (ugrs.Cells["FLAW_LV_DESC"].Text.ToString() == "")
  313. {
  314. list.Add(ugrs.Cells["FLAW_LV_DESC"].Text.ToString());
  315. }
  316. else
  317. {
  318. list.Add(ugrs.Cells["FLAW_LV_DESC"].Value.ToString());
  319. }
  320. list.Add(ugrs.Cells["FLAW_LV_DESC"].Text.ToString());
  321. //if (ugrs.Cells["FLAW_QUANTITY"].Text == "")
  322. //{
  323. // MessageBox.Show("请输入数量!");
  324. // return;
  325. //}
  326. list.Add(ugrs.Cells["FLAW_QUANTITY"].Text.ToString());
  327. list.Add(ugrs.Cells["MEMO"].Text.ToString());
  328. list.Add("0");
  329. count++;
  330. j++;
  331. list2.Add(list);
  332. }
  333. }
  334. if (count == 0 && comboBox1.Text.ToString() == "不合格")
  335. {
  336. MessageBox.Show("请录入缺陷信息并选择!");
  337. return;
  338. }
  339. CoreClientParam ccp = new CoreClientParam();
  340. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  341. ccp.MethodName = "doAddFlawY";
  342. ccp.ServerParams = new object[] { list2, list1 };
  343. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  344. if (ccp.ReturnCode == -1)
  345. {
  346. return;
  347. }
  348. lists.Add(ugr);
  349. }
  350. }
  351. for (int i = 0; i < lists.Count; i++)
  352. {
  353. lists[i].Delete(false);
  354. }
  355. // DoQuery();
  356. MessageBox.Show("登记成功!");
  357. }catch(Exception ex)
  358. {
  359. System.Diagnostics.Debug.WriteLine(ex.ToString());
  360. MessageBox.Show("系统出错,请联系管理人员", "警告");
  361. }
  362. }
  363. private void QCM0305_Load(object sender, EventArgs e)
  364. {
  365. this.comboBox3.SelectedIndex = 0;
  366. this.comboBox4.SelectedIndex = 0;
  367. string prodline = comboBox3.Text.ToString();
  368. this.ultraGrid1.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
  369. this.ultraGrid3.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
  370. this.dateTimePicker1.Value = System.DateTime.Now.AddDays(-7);
  371. this.ultraGrid1.DisplayLayout.Bands[0].Header.Appearance.BackColor = Color.LightBlue;
  372. this.ultraGrid3.DisplayLayout.Bands[0].Header.Appearance.BackColor = Color.LightBlue;
  373. this.ultraGrid4.DisplayLayout.Bands[0].Header.Appearance.BackColor = Color.LightBlue;
  374. ValueList vis_repair = new ValueList();
  375. vis_repair.ValueListItems.Add("0", "待修复");
  376. vis_repair.ValueListItems.Add("1", "已修复");
  377. this.ultraGrid4.DisplayLayout.Bands[0].Columns["IS_REPAIR"].ValueList = vis_repair;
  378. ValueList vprimary_flag = new ValueList();
  379. vprimary_flag.ValueListItems.Add("1", "是");
  380. vprimary_flag.ValueListItems.Add("0", "否");
  381. this.ultraGrid4.DisplayLayout.Bands[0].Columns["PRIMARY_FLAG"].ValueList = vprimary_flag;
  382. ValueList vFLAW_DESC = new ValueList();
  383. CoreClientParam ccp = new CoreClientParam();
  384. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  385. ccp.MethodName = "findFlawArea";
  386. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  387. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  388. {
  389. vFLAW_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  390. }
  391. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_AREA"].ValueList = vFLAW_DESC;
  392. ValueList vsflv = new ValueList();
  393. ccp = new CoreClientParam();
  394. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  395. ccp.MethodName = "findSfLvY";
  396. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  397. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  398. {
  399. vsflv.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  400. }
  401. this.comboBox2.DataSource = vsflv.ValueListItems;
  402. ValueList vflaw_pos_desc = new ValueList();
  403. ccp = new CoreClientParam();
  404. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  405. ccp.MethodName = "findFlawPosDesc";
  406. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  407. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  408. {
  409. vflaw_pos_desc.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  410. }
  411. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_POS_DESC"].ValueList = vflaw_pos_desc;
  412. ValueList VFLAW_SIZE_DESC = new ValueList();
  413. ccp = new CoreClientParam();
  414. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  415. ccp.MethodName = "findFlawSizeDesc";
  416. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  417. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  418. {
  419. VFLAW_SIZE_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  420. }
  421. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_SIZE_DESC"].ValueList = VFLAW_SIZE_DESC;
  422. ValueList VFLAW_LV_DESC = new ValueList();
  423. ccp = new CoreClientParam();
  424. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  425. ccp.MethodName = "findFlawLvDesc";
  426. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  427. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  428. {
  429. VFLAW_LV_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  430. }
  431. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_LV_DESC"].ValueList = VFLAW_LV_DESC;
  432. ValueList VFLAW_DIR_DESC = new ValueList();
  433. ccp = new CoreClientParam();
  434. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  435. ccp.MethodName = "findFlawDirDesc";
  436. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  437. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  438. {
  439. VFLAW_DIR_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  440. }
  441. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DIR_DESC"].ValueList = VFLAW_DIR_DESC;
  442. ccp = new CoreClientParam();
  443. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  444. ccp.MethodName = "findFlawDataY";
  445. ccp.ServerParams = new object[] { prodline };
  446. ccp.SourceDataTable = this.dataSet6.Tables[0];
  447. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  448. //ValueList VDEFECT_DESC = new ValueList();
  449. //for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  450. //{
  451. // VDEFECT_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["DEFECT_CODE"].ToString(), ccp.SourceDataTable.Rows[i]["DEFECT_DESC"].ToString());
  452. //}
  453. //this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].ValueList = VDEFECT_DESC;
  454. ultraCombo1.DataSource = ccp.SourceDataTable;
  455. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].EditorComponent = ultraCombo1;
  456. string userid = this.UserInfo.GetUserID();
  457. if (userid.Equals("X15797") || userid.Equals("X15798") || userid.Equals("X15801") || userid.Equals("X15804") || userid.Equals("X15805") || userid.Equals("X15815") || userid.Equals("X15806") || userid.Equals("X15795"))
  458. {
  459. for (int i = 0; comboBox5.Items.Count > 0; )
  460. {
  461. comboBox5.Items.RemoveAt(0);
  462. }
  463. comboBox5.Items.Add("酸洗机组");
  464. }
  465. else if (userid.Equals("X15724") || userid.Equals("X15833") || userid.Equals("X15816") || userid.Equals("X15734") || userid.Equals("X15827") || userid.Equals("X15830"))
  466. {
  467. for (int i = 0; comboBox5.Items.Count > 0; )
  468. {
  469. comboBox5.Items.RemoveAt(0);
  470. }
  471. comboBox5.Items.Add("轧机机组");
  472. }
  473. else if (userid.Equals("X15824") || userid.Equals("X15818") || userid.Equals("X15825") || userid.Equals("X15826") || userid.Equals("X15817"))
  474. {
  475. for (int i = 0; comboBox5.Items.Count > 0; )
  476. {
  477. comboBox5.Items.RemoveAt(0);
  478. }
  479. comboBox5.Items.Add("退火炉宝信");
  480. comboBox5.Items.Add("退火炉南方D");
  481. comboBox5.Items.Add("退火炉艾伯纳");
  482. comboBox5.Items.Add("退火炉南方G");
  483. }
  484. else if (userid.Equals("X15763") || userid.Equals("X15764") || userid.Equals("X15760") || userid.Equals("X15736"))
  485. {
  486. for (int i = 0; comboBox5.Items.Count > 0; )
  487. {
  488. comboBox5.Items.RemoveAt(0);
  489. }
  490. comboBox5.Items.Add("平整机组");
  491. }
  492. else if (userid.Equals("X15720") || userid.Equals("X15719") || userid.Equals("X15726") || userid.Equals("X15743"))
  493. {
  494. for (int i = 0; comboBox5.Items.Count > 0; )
  495. {
  496. comboBox5.Items.RemoveAt(0);
  497. }
  498. comboBox5.Items.Add("4mm分条机组");
  499. comboBox5.Items.Add("12mm分条机组");
  500. comboBox5.Items.Add("3mm横剪机组");
  501. }
  502. //DoQuery();
  503. }
  504. private void ultraGrid3_AfterRowActivate(object sender, EventArgs e)
  505. {
  506. try
  507. {
  508. UltraGridRow ugr = this.ultraGrid3.ActiveRow;
  509. this.dataSet4.Clear();
  510. //this.dataSet4.Clear();
  511. //string surface_id = ugr.Cells["SURFACE_ID"].Value.ToString();
  512. //if (surface_id != "")
  513. //{
  514. // CoreClientParam ccp = new CoreClientParam();
  515. // ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  516. // ccp.MethodName = "findNameByMN";
  517. // ccp.ServerParams = new object[] { surface_id };
  518. // ccp.SourceDataTable = this.dataSet4.Tables[0];
  519. // this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  520. //}
  521. string design_key = ugr.Cells["DESIGN_KEY"].Value.ToString();
  522. if (design_key != "")
  523. {
  524. CoreClientParam ccp = new CoreClientParam();
  525. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  526. ccp.MethodName = "GetMemo";
  527. ccp.ServerParams = new object[] { design_key };
  528. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  529. if (ccp.SourceDataTable.Rows.Count == 0)
  530. {
  531. this.textBox6.Text = "";
  532. }
  533. else
  534. {
  535. this.textBox6.Text = ccp.SourceDataTable.Rows[0]["MEMO"].ToString();
  536. }
  537. }
  538. //this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].EditorComponent = ultraCombo1;
  539. //foreach (UltraGridRow ugrs in this.ultraGrid4.Rows)
  540. //{
  541. // if (ugrs.Cells["IS_REPAIR"].Text.ToString().Contains("已修复"))
  542. // {
  543. // ugrs.Appearance.BackColor = Color.Pink;
  544. // }
  545. //}
  546. }
  547. catch (Exception ex)
  548. {
  549. System.Diagnostics.Debug.WriteLine(ex.ToString());
  550. MessageBox.Show("系统出错,请联系管理人员", "警告");
  551. }
  552. }
  553. private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
  554. {
  555. try
  556. {
  557. UltraGridRow ugr = this.ultraGrid1.ActiveRow;
  558. if (ugr == null)
  559. return;
  560. this.dataSet5.Clear();
  561. string surface_id = ugr.Cells["SURFACE_ID"].Value.ToString();
  562. CoreClientParam ccp = new CoreClientParam();
  563. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  564. ccp.MethodName = "findNameByMN";
  565. ccp.ServerParams = new object[] { surface_id };
  566. ccp.SourceDataTable = this.dataSet5.Tables[0];
  567. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  568. foreach (UltraGridRow ugrs in this.ultraGrid5.Rows)
  569. {
  570. if (ugrs.Cells["IS_REPAIR"].Text.ToString().Contains("已修复"))
  571. {
  572. ugrs.Appearance.BackColor = Color.Pink;
  573. }
  574. }
  575. }
  576. catch (Exception ex)
  577. {
  578. System.Diagnostics.Debug.WriteLine(ex.ToString());
  579. MessageBox.Show("系统出错,请联系管理人员", "警告");
  580. }
  581. }
  582. private void checkBox1_CheckedChanged(object sender, EventArgs e)
  583. {
  584. foreach (UltraGridRow ugr in this.ultraGrid3.Rows.Where(p => p.IsFilteredOut == false).ToList())
  585. {
  586. if (checkBox1.Checked)
  587. {
  588. ugr.Cells["CHECK"].Value = "True";
  589. }
  590. else
  591. {
  592. ugr.Cells["CHECK"].Value = "False";
  593. }
  594. }
  595. }
  596. private void ultraTabControl1_Click(object sender, EventArgs e)
  597. {
  598. if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
  599. {
  600. this.label11.Visible = false;
  601. this.comboBox4.Visible = false;
  602. this.label12.Text = "判定时间";
  603. }
  604. if (this.ultraTabControl1.Tabs[0].Selected) //判定记录
  605. {
  606. this.label11.Visible = true;
  607. this.comboBox4.Visible = true;
  608. this.label12.Text = "生产时间";
  609. }
  610. }
  611. private void DoExport()
  612. {
  613. try
  614. {
  615. if (this.ultraGrid1.Rows.Count == 0)
  616. {
  617. MessageBox.Show("没有可以导出的数据", "提示");
  618. return;
  619. }
  620. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  621. {
  622. string fName = this.saveFileDialog1.FileName;
  623. this.ultraGridExcelExporter1.Export(this.ultraGrid1, fName);
  624. Process.Start(fName);
  625. }
  626. }
  627. catch (Exception ex)
  628. {
  629. System.Diagnostics.Debug.WriteLine(ex.ToString());
  630. }
  631. }
  632. }
  633. }