7012b75ba4dfba02ae234435ac40bf85c232b7cc.svn-base 76 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600
  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 QCM030305LT : FrmBase
  17. {
  18. public QCM030305LT()
  19. {
  20. InitializeComponent();
  21. }
  22. //private string prodline = "";
  23. public override void ToolBar_Click(object sender, string ToolbarKey)
  24. {
  25. switch (ToolbarKey)
  26. {
  27. case "Query":
  28. this.DoQuery();
  29. break;
  30. case "Judge":
  31. Operate();
  32. break;
  33. case "FB":
  34. fb();
  35. break;
  36. case "Cancel_FB":
  37. cancel_fb();
  38. break;
  39. case "Exit":
  40. this.Close();
  41. break;
  42. case "Export":
  43. this.DoExport();
  44. break;
  45. }
  46. }
  47. private void DoQuery()
  48. {
  49. if (this.ultraTabControl1.Tabs[0].Selected) //待判信息
  50. {
  51. DoQueryMe();
  52. }
  53. if (this.ultraTabControl1.Tabs[1].Selected) //表面判定记录
  54. {
  55. DoQueryRe();
  56. }
  57. if (this.ultraTabControl1.Tabs[2].Selected) //公差判定记录
  58. {
  59. DoQueryRe1();
  60. }
  61. }
  62. private void DoQueryMe()
  63. {
  64. //查询探伤待检信息(轧批号、计划号)
  65. try
  66. {
  67. this.dataSet3.Clear();
  68. dataSet6.Clear();
  69. string starttime = "";
  70. string endtime = "";
  71. if (checkBox2.Checked)
  72. {
  73. starttime = this.dateTimePicker1.Value.ToString("yyyyMMdd");
  74. endtime = this.dateTimePicker2.Value.AddDays(1).ToString("yyyyMMdd");
  75. }
  76. string sbatchno = "";
  77. string ebatchno = "";
  78. if (checkBox3.Checked)
  79. {
  80. sbatchno = this.textBox2.Text.Trim();
  81. if (textBox1.Text.ToString() == "")
  82. {
  83. ebatchno = this.textBox2.Text.Trim();
  84. }
  85. else
  86. {
  87. ebatchno = this.textBox1.Text.Trim();
  88. }
  89. }
  90. if (!checkBox2.Checked && !checkBox3.Checked)
  91. {
  92. MessageBox.Show("时间与轧批号必须选择其中一个条件!");
  93. return;
  94. }
  95. string orderno = this.textBox4.Text.Trim();// 订单号
  96. string psc = textBox3.Text.Trim(); //产品描述
  97. string stellname = this.textBox7.Text.Trim();
  98. string prodline = "连退";
  99. string isjudge = this.comboBox4.Text.ToString();
  100. CoreClientParam ccp = new CoreClientParam();
  101. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  102. ccp.MethodName = "doQueryMaterialDetailsJ2";
  103. ccp.ServerParams = new object[] { starttime, endtime, sbatchno, ebatchno, orderno, psc, "MB", prodline, isjudge, stellname };
  104. ccp.SourceDataTable = this.dataSet3.Tables[0];
  105. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  106. ccp = new CoreClientParam();
  107. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  108. ccp.MethodName = "findFlawDataJ";
  109. ccp.ServerParams = new object[] { prodline };
  110. ccp.SourceDataTable = this.dataSet6.Tables[0];
  111. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  112. ultraCombo1.DataSource = ccp.SourceDataTable;
  113. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].EditorComponent = ultraCombo1;
  114. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDown;
  115. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].AutoCompleteMode = Infragistics.Win.AutoCompleteMode.SuggestAppend;
  116. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].FilterOperandDropDownItems = FilterOperandDropDownItems.CellValues;
  117. //this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].AllowRowFiltering = Infragistics.Win.AutoCompleteMode.Append;
  118. }
  119. catch (Exception ex)
  120. {
  121. System.Diagnostics.Debug.WriteLine(ex.ToString());
  122. MessageBox.Show("系统出错,请联系管理人员", "警告");
  123. }
  124. }
  125. private void DoQueryRe()
  126. {
  127. //查询判定记录
  128. try
  129. {
  130. this.dataSet2.Clear();
  131. string starttime = "";
  132. string endtime = "";
  133. if (checkBox2.Checked)
  134. {
  135. starttime = this.dateTimePicker1.Value.ToString("yyyyMMdd");
  136. endtime = this.dateTimePicker2.Value.ToString("yyyyMMdd");
  137. }
  138. string sbatchno = "";
  139. string ebatchno = "";
  140. if (checkBox3.Checked)
  141. {
  142. sbatchno = this.textBox2.Text.Trim();
  143. if (textBox1.Text.ToString() == "")
  144. {
  145. ebatchno = this.textBox2.Text.Trim();
  146. }
  147. else
  148. {
  149. ebatchno = this.textBox1.Text.Trim();
  150. }
  151. }
  152. if (!checkBox2.Checked && !checkBox3.Checked)
  153. {
  154. MessageBox.Show("时间与轧批号必须选择其中一个条件!");
  155. return;
  156. }
  157. string orderno = textBox4.Text.Trim();
  158. string psc = textBox3.Text.Trim();
  159. string stellname = this.textBox7.Text.Trim();
  160. string prodline = "连退";
  161. CoreClientParam ccp = new CoreClientParam();
  162. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  163. ccp.MethodName = "GetSurfaceInfoJ";
  164. ccp.ServerParams = new object[] { starttime, endtime, sbatchno, ebatchno, orderno, psc, prodline, stellname };
  165. ccp.SourceDataTable = this.dataSet2.Tables[0];
  166. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  167. }
  168. catch (Exception ex)
  169. {
  170. System.Diagnostics.Debug.WriteLine(ex.ToString());
  171. MessageBox.Show("系统出错,请联系管理人员", "警告");
  172. }
  173. }
  174. private void DoQueryRe1()
  175. {
  176. try
  177. {
  178. this.dataSet9.Clear();
  179. string starttime = "";
  180. string endtime = "";
  181. if (checkBox2.Checked)
  182. {
  183. starttime = this.dateTimePicker1.Value.ToString("yyyyMMdd");
  184. endtime = this.dateTimePicker2.Value.ToString("yyyyMMdd");
  185. }
  186. string sbatchno = "";
  187. string ebatchno = "";
  188. if (checkBox3.Checked)
  189. {
  190. sbatchno = this.textBox1.Text.Trim();
  191. if (textBox2.Text.ToString() == "")
  192. {
  193. ebatchno = this.textBox1.Text.Trim();
  194. }
  195. else
  196. {
  197. ebatchno = this.textBox2.Text.Trim();
  198. }
  199. }
  200. if (!checkBox2.Checked && !checkBox3.Checked)
  201. {
  202. MessageBox.Show("时间与轧批号必须选择其中一个条件!");
  203. return;
  204. }
  205. string orderno = this.textBox4.Text.Trim();// 订单号
  206. string psc = textBox3.Text.Trim(); //产品描述
  207. string stellname = this.textBox7.Text.Trim();
  208. string prodline = "连退";
  209. CoreClientParam ccp = new CoreClientParam();
  210. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  211. ccp.MethodName = "GetMeasureInfoJ";
  212. ccp.ServerParams = new object[] { starttime, endtime, sbatchno, ebatchno, orderno, psc, prodline, stellname };
  213. ccp.SourceDataTable = this.dataSet9.Tables[0];
  214. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  215. }
  216. catch (Exception ex)
  217. {
  218. System.Diagnostics.Debug.WriteLine(ex.ToString());
  219. MessageBox.Show("系统出错,请联系管理人员", "警告");
  220. }
  221. }
  222. private void Operate()
  223. {
  224. string material_no = "";
  225. try
  226. {
  227. UltraGridRow ugr = this.ultraGrid3.ActiveRow;
  228. if (ugr == null)
  229. return;
  230. CoreClientParam ccp = new CoreClientParam();
  231. foreach (UltraGridRow ugrs in this.ultraGrid4.Rows)
  232. {
  233. if (ugrs.Cells["CHECKBOX"].Text.ToString() == "True")
  234. {
  235. string surfaceid = ugrs.Cells["SURFACE_ID"].Value.ToString();
  236. string username = this.UserInfo.GetUserName();
  237. string userorder = this.UserInfo.GetUserOrderText();
  238. string usergroup = this.UserInfo.GetUserGroupText();
  239. string flag = "";
  240. if (ugrs.Cells["PRIMARY_FLAG"].Text.ToString().Contains("是"))
  241. {
  242. flag = "1";
  243. }
  244. else
  245. {
  246. flag = "0";
  247. }
  248. ccp = new CoreClientParam();
  249. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  250. ccp.MethodName = "repairFlaw";
  251. ccp.ServerParams = new object[] { surfaceid, ugrs.Cells["FLAW_SEQ"].Value.ToString(), flag, username, userorder, usergroup };
  252. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  253. }
  254. }
  255. this.dataSet4.Clear();
  256. string surface_id = ugr.Cells["SURFACE_ID"].Value.ToString();
  257. ccp = new CoreClientParam();
  258. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  259. ccp.MethodName = "findNameByMN";
  260. ccp.ServerParams = new object[] { surface_id };
  261. ccp.SourceDataTable = this.dataSet4.Tables[0];
  262. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  263. }
  264. catch (Exception ex)
  265. {
  266. System.Diagnostics.Debug.WriteLine(ex.ToString());
  267. MessageBox.Show("系统出错,请联系管理人员", "警告");
  268. }
  269. }
  270. private void fb()
  271. {
  272. try
  273. {
  274. List<UltraGridRow> lists = new List<UltraGridRow>();
  275. foreach (UltraGridRow ugr in ultraGrid3.Rows)
  276. {
  277. if (ugr.Cells["CHECK"].Text.ToString() == "True")
  278. {
  279. CoreClientParam ccp = new CoreClientParam();
  280. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  281. ccp.MethodName = "coiljudge_status_call_commit";
  282. ccp.ServerParams = new object[] { ugr.Cells["PLINE_CODE"].Value.ToString()
  283. , ugr.Cells["MATERIAL_NO"].Value.ToString()
  284. , ""
  285. , ""
  286. , ""
  287. , ""
  288. , ""
  289. , "Y"
  290. , txt_fb_reason.Text,""};
  291. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  292. if (ccp.ReturnCode == -1)
  293. {
  294. return;
  295. }
  296. lists.Add(ugr);
  297. }
  298. }
  299. for (int i = 0; i < lists.Count; i++)
  300. {
  301. lists[i].Delete(false);
  302. }
  303. //DoQuery();
  304. MessageBox.Show("封闭成功!");
  305. }
  306. catch (Exception ex)
  307. {
  308. System.Diagnostics.Debug.WriteLine(ex.ToString());
  309. MessageBox.Show("系统出错,请联系管理人员", "警告");
  310. }
  311. }
  312. private void cancel_fb()
  313. {
  314. try
  315. {
  316. List<UltraGridRow> lists = new List<UltraGridRow>();
  317. foreach (UltraGridRow ugr in ultraGrid3.Rows)
  318. {
  319. if (ugr.Cells["CHECK"].Text.ToString() == "True")
  320. {
  321. CoreClientParam ccp = new CoreClientParam();
  322. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  323. ccp.MethodName = "coiljudge_status_call_commit";
  324. ccp.ServerParams = new object[] { ugr.Cells["PLINE_CODE"].Value.ToString()
  325. , ugr.Cells["MATERIAL_NO"].Value.ToString()
  326. , ""
  327. , ""
  328. , ""
  329. , ""
  330. , ""
  331. , "N"
  332. , txt_fb_reason.Text,""};
  333. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  334. if (ccp.ReturnCode == -1)
  335. {
  336. return;
  337. }
  338. lists.Add(ugr);
  339. }
  340. }
  341. for (int i = 0; i < lists.Count; i++)
  342. {
  343. lists[i].Delete(false);
  344. }
  345. //DoQuery();
  346. MessageBox.Show("解除封闭成功!");
  347. }
  348. catch (Exception ex)
  349. {
  350. System.Diagnostics.Debug.WriteLine(ex.ToString());
  351. MessageBox.Show("系统出错,请联系管理人员", "警告");
  352. }
  353. }
  354. private void label9_Click(object sender, EventArgs e)
  355. {
  356. try
  357. {
  358. List<UltraGridRow> lists = new List<UltraGridRow>();
  359. foreach (UltraGridRow ugr in ultraGrid3.Rows)
  360. {
  361. if (ugr.Cells["CHECK"].Text.ToString() == "True")
  362. {
  363. ArrayList list1 = new ArrayList();
  364. List<ArrayList> list2 = new List<ArrayList>();
  365. //if (comboBox1.Text.Trim() == "")
  366. //{
  367. // MessageBox.Show("请输入检验结果!");
  368. // return;
  369. //}
  370. if (comboBox2.Text.Trim() == "")
  371. {
  372. MessageBox.Show("请输入质量等级!");
  373. return;
  374. }
  375. string is_pass = "";
  376. string is_zl1 = "";
  377. if (comboBox1.Text.ToString() == "合格")
  378. {
  379. is_pass = "1";
  380. }
  381. else if (comboBox1.Text.ToString() == "不合格")
  382. {
  383. is_pass = "2";
  384. }
  385. else if (comboBox1.Text.ToString() == "待判")
  386. {
  387. is_pass = "0";
  388. }
  389. else
  390. {
  391. is_pass = "";
  392. }
  393. list1.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
  394. list1.Add(is_pass);//检验结果代码
  395. list1.Add(comboBox1.Text.Trim().ToString());//检验结果
  396. list1.Add(comboBox2.Text.Trim().ToString());//质量等级代码
  397. list1.Add(comboBox2.Text.Trim().ToString());//质量等级名称
  398. list1.Add(textBox5.Text.ToString().Trim());
  399. list1.Add(this.UserInfo.GetUserName());//操作人
  400. list1.Add(this.UserInfo.GetUserOrderText());//班次
  401. list1.Add(this.UserInfo.GetUserGroupText());//班组
  402. int count = 0;
  403. int i = 0;
  404. foreach (UltraGridRow ugrs in this.ultraGrid4.Rows)
  405. {
  406. if (ugrs.Cells["CHECKBOX"].Text.ToString() == "True")
  407. {
  408. int j = 2;
  409. ArrayList list = new ArrayList();
  410. if (ugrs.Cells["PRIMARY_FLAG"].Value.ToString() == "1")
  411. i++;
  412. list.Add(ugrs.Cells["PRIMARY_FLAG"].Value.ToString());
  413. if (ugrs.Cells["PRIMARY_FLAG"].Value.ToString() == "1")
  414. {
  415. list.Add("1");
  416. j = j - 1;
  417. }
  418. else
  419. {
  420. list.Add(j);
  421. }
  422. if (ugrs.Cells["FLAW_DESC"].Text.ToString() == "")
  423. {
  424. list.Add(ugrs.Cells["FLAW_DESC"].Text.ToString());
  425. }
  426. else
  427. {
  428. list.Add(ugrs.Cells["FLAW_DESC"].Value.ToString());
  429. }
  430. list.Add(ugrs.Cells["FLAW_DESC"].Text.ToString());
  431. if (ugrs.Cells["FLAW_DESC"].Text.ToString() == "")
  432. {
  433. MessageBox.Show("已选择的请录入缺陷信息!");
  434. return;
  435. }
  436. if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "上表面")
  437. {
  438. list.Add("U");
  439. }
  440. else if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "下表面")
  441. {
  442. list.Add("D");
  443. }
  444. else if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "边部")
  445. {
  446. list.Add("E");
  447. }
  448. else
  449. {
  450. list.Add("");
  451. }
  452. //list.Add(ugrs.Cells["FLAW_TYPE_DESC"].Value.ToString());
  453. //list.Add(ugrs.Cells["FLAW_TYPE_DESC"].Text.ToString());
  454. if (ugrs.Cells["FLAW_POS_DESC"].Text.ToString() == "")
  455. {
  456. list.Add(ugrs.Cells["FLAW_POS_DESC"].Text.ToString());
  457. }
  458. else
  459. {
  460. list.Add(ugrs.Cells["FLAW_POS_DESC"].Value.ToString());
  461. }
  462. list.Add(ugrs.Cells["FLAW_POS_DESC"].Text.ToString());
  463. if (ugrs.Cells["FLAW_DIR_DESC"].Text.ToString() == "")
  464. {
  465. list.Add(ugrs.Cells["FLAW_DIR_DESC"].Text.ToString());
  466. }
  467. else
  468. {
  469. list.Add(ugrs.Cells["FLAW_DIR_DESC"].Value.ToString());
  470. }
  471. list.Add(ugrs.Cells["FLAW_DIR_DESC"].Text.ToString());
  472. if (ugrs.Cells["FLAW_SIZE_DESC"].Text.ToString() == "")
  473. {
  474. list.Add(ugrs.Cells["FLAW_SIZE_DESC"].Text.ToString());
  475. }
  476. else
  477. {
  478. list.Add(ugrs.Cells["FLAW_SIZE_DESC"].Value.ToString());
  479. }
  480. list.Add(ugrs.Cells["FLAW_SIZE_DESC"].Text.ToString());
  481. if (ugrs.Cells["FLAW_LV_DESC"].Text.ToString() == "")
  482. {
  483. list.Add(ugrs.Cells["FLAW_LV_DESC"].Text.ToString());
  484. }
  485. else
  486. {
  487. list.Add(ugrs.Cells["FLAW_LV_DESC"].Value.ToString());
  488. }
  489. list.Add(ugrs.Cells["FLAW_LV_DESC"].Text.ToString());
  490. //if (!IsNumberal(ugrs.Cells["FLAW_QUANTITY"].Text))
  491. //{
  492. // MessageBox.Show("数量请输入数字!");
  493. // return;
  494. //}
  495. list.Add(ugrs.Cells["FLAW_QUANTITY"].Text.ToString());
  496. list.Add(ugrs.Cells["MEMO"].Text.ToString());
  497. if (ugrs.Cells["IS_REPAIR"].Text.ToString() == "")
  498. {
  499. list.Add("0");
  500. }
  501. else
  502. {
  503. list.Add(ugrs.Cells["IS_REPAIR"].Value.ToString());
  504. }
  505. count++;
  506. j++;
  507. list2.Add(list);
  508. }
  509. }
  510. if (count == 0 && comboBox1.Text.ToString() == "不合格")
  511. {
  512. MessageBox.Show("请录入缺陷信息并选择!");
  513. return;
  514. }
  515. if (i == 0 && comboBox1.Text.ToString() == "不合格")
  516. {
  517. MessageBox.Show("请录入主要缺陷!");
  518. return;
  519. }
  520. if (i > 1)
  521. {
  522. MessageBox.Show("请不要录入多条主要缺陷!");
  523. return;
  524. }
  525. CoreClientParam ccp = new CoreClientParam();
  526. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  527. ccp.MethodName = "doAddFlawL";
  528. ccp.ServerParams = new object[] { list2, list1 };
  529. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  530. if (ccp.ReturnCode == -1)
  531. {
  532. return;
  533. }
  534. lists.Add(ugr);
  535. }
  536. }
  537. for (int i = 0; i < lists.Count; i++)
  538. {
  539. lists[i].Delete(false);
  540. }
  541. //DoQuery();
  542. MessageBox.Show("登记成功!");
  543. }
  544. catch (Exception ex)
  545. {
  546. System.Diagnostics.Debug.WriteLine(ex.ToString());
  547. MessageBox.Show("系统出错,请联系管理人员", "警告");
  548. }
  549. }
  550. public static bool IsNumberal(string input)
  551. {
  552. bool flag = true;
  553. int count = 0;
  554. int count1 = 0;
  555. if (input.Length == 0)
  556. {
  557. flag = false;
  558. }
  559. else
  560. {
  561. char[] x = input.ToCharArray();
  562. for (int i = 0; i < input.Length; i++)
  563. {
  564. if (!char.IsNumber(x[i]) && x[i] != '.' && x[i] != '-')
  565. {
  566. flag = false; break;
  567. }
  568. if (x[i] == '.')
  569. {
  570. count++;
  571. if (i == 0 || i == input.Length - 1) flag = false;
  572. }
  573. if (x[i] == '-')
  574. {
  575. count1++;
  576. if (i > 1) flag = false;
  577. }
  578. }
  579. if (count > 1 || count1 > 1) flag = false;
  580. }
  581. return flag;
  582. }
  583. private void QCM030305LT_Load(object sender, EventArgs e)
  584. {
  585. //this.comboBox3.SelectedIndex = 0;
  586. this.comboBox4.SelectedIndex = 0;
  587. string prodline = "连退";
  588. this.ultraGrid1.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
  589. this.ultraGrid3.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
  590. this.dateTimePicker1.Value = System.DateTime.Now.AddDays(-3);
  591. this.ultraGrid1.DisplayLayout.Bands[0].Header.Appearance.BackColor = Color.LightBlue;
  592. this.ultraGrid3.DisplayLayout.Bands[0].Header.Appearance.BackColor = Color.LightBlue;
  593. this.ultraGrid4.DisplayLayout.Bands[0].Header.Appearance.BackColor = Color.LightBlue;
  594. ValueList vis_repair = new ValueList();
  595. vis_repair.ValueListItems.Add("0", "待修复");
  596. vis_repair.ValueListItems.Add("1", "已修复");
  597. this.ultraGrid4.DisplayLayout.Bands[0].Columns["IS_REPAIR"].ValueList = vis_repair;
  598. ValueList vprimary_flag = new ValueList();
  599. vprimary_flag.ValueListItems.Add("1", "是");
  600. vprimary_flag.ValueListItems.Add("0", "否");
  601. this.ultraGrid4.DisplayLayout.Bands[0].Columns["PRIMARY_FLAG"].ValueList = vprimary_flag;
  602. ValueList vFLAW_DESC = new ValueList();
  603. CoreClientParam ccp = new CoreClientParam();
  604. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  605. ccp.MethodName = "findFlawArea";
  606. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  607. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  608. {
  609. vFLAW_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  610. }
  611. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_AREA"].ValueList = vFLAW_DESC;
  612. ValueList vflaw_pos_desc = new ValueList();
  613. ccp = new CoreClientParam();
  614. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  615. ccp.MethodName = "findFlawPosDesc";
  616. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  617. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  618. {
  619. vflaw_pos_desc.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  620. }
  621. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_POS_DESC"].ValueList = vflaw_pos_desc;
  622. ValueList vsflv1 = new ValueList();
  623. ccp = new CoreClientParam();
  624. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  625. ccp.MethodName = "findSfLv";
  626. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  627. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  628. {
  629. vsflv1.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  630. }
  631. ValueList vsflv = new ValueList();
  632. ccp = new CoreClientParam();
  633. this.comboBox3.DataSource = vsflv1.ValueListItems;
  634. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  635. ccp.MethodName = "findZlLevel";
  636. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  637. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  638. {
  639. vsflv.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CD"].ToString());
  640. }
  641. vsflv.ValueListItems.Add("");
  642. this.comboBox2.DataSource = vsflv.ValueListItems;
  643. ValueList VFLAW_SIZE_DESC = new ValueList();
  644. ccp = new CoreClientParam();
  645. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  646. ccp.MethodName = "findFlawSizeDesc";
  647. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  648. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  649. {
  650. VFLAW_SIZE_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  651. }
  652. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_SIZE_DESC"].ValueList = VFLAW_SIZE_DESC;
  653. ValueList VFLAW_LV_DESC = new ValueList();
  654. ccp = new CoreClientParam();
  655. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  656. ccp.MethodName = "findFlawLvDesc";
  657. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  658. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  659. {
  660. VFLAW_LV_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  661. }
  662. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_LV_DESC"].ValueList = VFLAW_LV_DESC;
  663. ValueList VFLAW_DIR_DESC = new ValueList();
  664. ccp = new CoreClientParam();
  665. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  666. ccp.MethodName = "findJFlawDirDesc";
  667. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  668. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  669. {
  670. VFLAW_DIR_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  671. }
  672. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DIR_DESC"].ValueList = VFLAW_DIR_DESC;
  673. //ccp = new CoreClientParam();
  674. //ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  675. //ccp.MethodName = "findFlawDataJ";
  676. //ccp.ServerParams = new object[] {prodline };
  677. //ccp.SourceDataTable = this.dataSet6.Tables[0];
  678. //this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  679. ////ValueList VDEFECT_DESC = new ValueList();
  680. ////for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  681. ////{
  682. //// VDEFECT_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["DEFECT_CODE"].ToString(), ccp.SourceDataTable.Rows[i]["DEFECT_DESC"].ToString());
  683. ////}
  684. ////this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].ValueList = VDEFECT_DESC;
  685. ////this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].EditorComponent = VDEFECT_DESC;
  686. //UltraCombo uc;
  687. //uc = new UltraCombo();
  688. //uc.BindingContext = this.BindingContext;
  689. //uc.DataSource = ccp.SourceDataTable;
  690. //this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].ValueList = new BindableValueList(ccp.SourceDataTable, "", "DEFECT_NAME", "DEFECT_CODE", this.ultraGrid4);
  691. DoQuery();
  692. }
  693. private void ultraGrid3_AfterRowActivate(object sender, EventArgs e)
  694. {
  695. try
  696. {
  697. UltraGridRow ugr = this.ultraGrid3.ActiveRow;
  698. this.dataSet4.Clear();
  699. string surface_id = ugr.Cells["SURFACE_ID"].Value.ToString();
  700. if (surface_id != "")
  701. {
  702. CoreClientParam ccp = new CoreClientParam();
  703. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  704. ccp.MethodName = "findNameByMN";
  705. ccp.ServerParams = new object[] { surface_id };
  706. ccp.SourceDataTable = this.dataSet4.Tables[0];
  707. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  708. }
  709. string design_key = ugr.Cells["DESIGN_KEY"].Value.ToString();
  710. if (design_key != "")
  711. {
  712. CoreClientParam ccp = new CoreClientParam();
  713. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  714. ccp.MethodName = "GetMemo";
  715. ccp.ServerParams = new object[] { design_key };
  716. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  717. if (ccp.SourceDataTable.Rows.Count == 0)
  718. {
  719. this.textBox6.Text = "";
  720. }
  721. else
  722. {
  723. this.textBox6.Text = ccp.SourceDataTable.Rows[0]["MEMO"].ToString();
  724. }
  725. }
  726. this.dataSet7.Clear();
  727. string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString();
  728. CoreClientParam ccp1 = new CoreClientParam();
  729. ccp1.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  730. ccp1.MethodName = "getToleranceJ";
  731. ccp1.ServerParams = new object[] { design_key, material_no };
  732. ccp1.SourceDataTable = this.dataSet7.Tables[0];
  733. this.ExecuteQueryToDataTable(ccp1, CoreInvokeType.Internal);
  734. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].EditorComponent = ultraCombo1;
  735. foreach (UltraGridRow ugrs in this.ultraGrid4.Rows)
  736. {
  737. if (ugrs.Cells["IS_REPAIR"].Text.ToString().Contains("已修复"))
  738. {
  739. ugrs.Appearance.BackColor = Color.Pink;
  740. }
  741. }
  742. }
  743. catch (Exception ex)
  744. {
  745. System.Diagnostics.Debug.WriteLine(ex.ToString());
  746. MessageBox.Show("系统出错,请联系管理人员", "警告");
  747. }
  748. }
  749. private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
  750. {
  751. try
  752. {
  753. UltraGridRow ugr = this.ultraGrid1.ActiveRow;
  754. if (ugr == null)
  755. return;
  756. this.dataSet5.Clear();
  757. string surface_id = ugr.Cells["SURFACE_ID"].Value.ToString();
  758. CoreClientParam ccp = new CoreClientParam();
  759. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  760. ccp.MethodName = "findNameByMN";
  761. ccp.ServerParams = new object[] { surface_id };
  762. ccp.SourceDataTable = this.dataSet5.Tables[0];
  763. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  764. foreach (UltraGridRow ugrs in this.ultraGrid5.Rows)
  765. {
  766. if (ugrs.Cells["IS_REPAIR"].Text.ToString().Contains("已修复"))
  767. {
  768. ugrs.Appearance.BackColor = Color.Pink;
  769. }
  770. }
  771. }
  772. catch (Exception ex)
  773. {
  774. System.Diagnostics.Debug.WriteLine(ex.ToString());
  775. MessageBox.Show("系统出错,请联系管理人员", "警告");
  776. }
  777. }
  778. private void checkBox1_CheckedChanged(object sender, EventArgs e)
  779. {
  780. foreach (UltraGridRow ugr in this.ultraGrid3.Rows.Where(p => p.IsFilteredOut == false).ToList())
  781. {
  782. if (checkBox1.Checked)
  783. {
  784. ugr.Cells["CHECK"].Value = "True";
  785. }
  786. else
  787. {
  788. ugr.Cells["CHECK"].Value = "False";
  789. }
  790. }
  791. }
  792. private void ultraTabControl1_Click(object sender, EventArgs e)
  793. {
  794. if (this.ultraTabControl1.Tabs[1].Selected || this.ultraTabControl1.Tabs[2].Selected) //判定记录
  795. {
  796. this.label11.Visible = false;
  797. this.comboBox4.Visible = false;
  798. this.label12.Text = "判定时间";
  799. }
  800. if (this.ultraTabControl1.Tabs[0].Selected) //判定记录
  801. {
  802. this.label11.Visible = true;
  803. this.comboBox4.Visible = true;
  804. this.label12.Text = "生产时间";
  805. }
  806. }
  807. private void DoExport()
  808. {
  809. try
  810. {
  811. if (this.ultraGrid1.Rows.Count == 0)
  812. {
  813. MessageBox.Show("没有可以导出的已检验的表面数据", "提示");
  814. return;
  815. }
  816. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  817. {
  818. string fName = this.saveFileDialog1.FileName;
  819. this.ultraGridExcelExporter1.Export(this.ultraGrid1, fName);
  820. Process.Start(fName);
  821. }
  822. }
  823. catch (Exception ex)
  824. {
  825. System.Diagnostics.Debug.WriteLine(ex.ToString());
  826. }
  827. }
  828. private void button1_Click(object sender, EventArgs e)
  829. {
  830. try
  831. {
  832. int count = 0;
  833. foreach (UltraGridRow ugr in this.ultraGrid3.Rows)
  834. {
  835. if (ugr.Cells["CHECK"].Text.ToString() == "True")
  836. {
  837. count++;
  838. }
  839. }
  840. List<UltraGridRow> lists = new List<UltraGridRow>();
  841. foreach (UltraGridRow ugr in this.ultraGrid3.Rows)
  842. {
  843. if (ugr.Cells["CHECK"].Text.ToString() == "True")
  844. {
  845. if ((ugr.Cells["VAL"].Text.ToString() != null) || (ugr.Cells["VAL_2"].Text.ToString() != null))
  846. {
  847. ArrayList list1 = new ArrayList();
  848. List<ArrayList> list2 = new List<ArrayList>();
  849. List<ArrayList> list3 = new List<ArrayList>();
  850. list1.Add(ugr.Cells["DESIGN_KEY"].Value.ToString());
  851. list1.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
  852. if (comboBox1.Text.ToString() == "")
  853. {
  854. list1.Add("");
  855. list1.Add("");
  856. }
  857. else
  858. {
  859. if (comboBox1.Text.ToString() == "合格")
  860. {
  861. list1.Add("1");
  862. list1.Add("合格");
  863. }
  864. else if (comboBox1.Text.ToString() == "不合格")
  865. {
  866. list1.Add("2");
  867. list1.Add("不合格");
  868. }
  869. else
  870. {
  871. list1.Add("0");
  872. list1.Add("待判");
  873. }
  874. }
  875. string is_zl = "";
  876. if (comboBox3.Text.ToString() == "正品")
  877. {
  878. is_zl = "512601";
  879. }
  880. else if (comboBox3.Text.ToString() == "次品")
  881. {
  882. is_zl = "512602";
  883. }
  884. else if (comboBox3.Text.ToString() == "废品")
  885. {
  886. is_zl = "512603";
  887. }
  888. else if (comboBox3.Text.ToString() == "协议品")
  889. {
  890. is_zl = "512604";
  891. }
  892. else if (comboBox3.Text.ToString() == "订单外")
  893. {
  894. is_zl = "512605";
  895. }
  896. list1.Add(textBox5.Text.Trim().ToString());
  897. list1.Add(this.UserInfo.GetUserName());
  898. list1.Add(this.UserInfo.GetUserOrderText());
  899. list1.Add(this.UserInfo.GetUserGroupText());
  900. list1.Add(is_zl);//质量等级代码
  901. list1.Add(comboBox3.Text.Trim().ToString());//质量等级名称
  902. ArrayList list = new ArrayList();
  903. if (ugr.Cells["BIAS_CODE"].Text.ToString() == "" || ugr.Cells["BIAS_CODE_2"].Text.ToString() == "")
  904. {
  905. MessageBox.Show(ugr.Cells["MATERIAL_NO"].Value.ToString() + "卷没有判定标准");
  906. return;
  907. }
  908. list.Add(ugr.Cells["BIAS_CODE"].Text.ToString());
  909. list.Add(ugr.Cells["VAL"].Text.ToString());
  910. list.Add(ugr.Cells["BIAS_NAME"].Text.ToString());
  911. list.Add(ugr.Cells["PLAN"].Text.ToString());
  912. list.Add(ugr.Cells["VAL2"].Text.ToString());
  913. list2.Add(list);
  914. list = new ArrayList();
  915. list.Add(ugr.Cells["BIAS_CODE_2"].Text.ToString());
  916. list.Add(ugr.Cells["VAL_2"].Text.ToString());
  917. list.Add(ugr.Cells["BIAS_NAME_2"].Text.ToString());
  918. list.Add(ugr.Cells["PLAN_2"].Text.ToString());
  919. list.Add(ugr.Cells["VAL2_2"].Text.ToString());
  920. list2.Add(list);
  921. ArrayList listc1 = new ArrayList();
  922. listc1.Add("传动侧");
  923. listc1.Add(ugr.Cells["THICK_VAL1"].Text.ToString());
  924. listc1.Add(ugr.Cells["H_VAL1"].Value.ToString());
  925. listc1.Add(ugr.Cells["M_VAL1"].Value.ToString());
  926. listc1.Add(ugr.Cells["R_VAL1"].Value.ToString());
  927. list3.Add(listc1);
  928. listc1 = new ArrayList();
  929. listc1.Add("中间");
  930. listc1.Add(ugr.Cells["THICK_VAL2"].Text.ToString());
  931. listc1.Add(ugr.Cells["H_VAL2"].Value.ToString());
  932. listc1.Add(ugr.Cells["M_VAL2"].Value.ToString());
  933. listc1.Add(ugr.Cells["R_VAL2"].Value.ToString());
  934. list3.Add(listc1);
  935. listc1 = new ArrayList();
  936. listc1.Add("操作侧");
  937. listc1.Add(ugr.Cells["THICK_VAL3"].Text.ToString());
  938. listc1.Add(ugr.Cells["H_VAL3"].Value.ToString());
  939. listc1.Add(ugr.Cells["M_VAL3"].Value.ToString());
  940. listc1.Add(ugr.Cells["R_VAL3"].Value.ToString());
  941. list3.Add(listc1);
  942. if ((comboBox1.Text.ToString() == "合格" && comboBox3.Text.ToString() != "正品") || (comboBox1.Text.ToString() == "不合格" && comboBox3.Text.ToString() == "正品"))
  943. {
  944. MessageBox.Show("检验结果与质量等级不一致!");
  945. return;
  946. }
  947. CoreClientParam ccp = new CoreClientParam();
  948. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  949. ccp.MethodName = "judgeByHuman2";
  950. ccp.ServerParams = new object[] { list1, list2, list3 };
  951. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  952. if (ccp.ReturnCode == -1)
  953. {
  954. return;
  955. }
  956. lists.Add(ugr);
  957. }
  958. else
  959. {
  960. ArrayList list1 = new ArrayList();
  961. List<ArrayList> list3 = new List<ArrayList>();
  962. list1.Add(ugr.Cells["DESIGN_KEY"].Value.ToString());
  963. list1.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
  964. if (comboBox1.Text.ToString() == "")
  965. {
  966. MessageBox.Show("请输入公差登记结果!或输入判定值!");
  967. return;
  968. }
  969. else
  970. {
  971. if (comboBox1.Text.ToString() == "合格")
  972. {
  973. list1.Add("1");
  974. list1.Add("合格");
  975. }
  976. else if (comboBox1.Text.ToString() == "待判")
  977. {
  978. list1.Add("0");
  979. list1.Add("待判");
  980. }
  981. else
  982. {
  983. list1.Add("2");
  984. list1.Add("不合格");
  985. }
  986. }
  987. string is_zl = "";
  988. if (comboBox3.Text.ToString() == "正品")
  989. {
  990. is_zl = "512601";
  991. }
  992. else if (comboBox3.Text.ToString() == "次品")
  993. {
  994. is_zl = "512602";
  995. }
  996. else if (comboBox3.Text.ToString() == "废品")
  997. {
  998. is_zl = "512603";
  999. }
  1000. else if (comboBox3.Text.ToString() == "协议品")
  1001. {
  1002. is_zl = "512604";
  1003. }
  1004. else if (comboBox3.Text.ToString() == "订单外")
  1005. {
  1006. is_zl = "512605";
  1007. }
  1008. list1.Add(textBox5.Text.Trim().ToString());
  1009. list1.Add(this.UserInfo.GetUserName());
  1010. list1.Add(this.UserInfo.GetUserOrderText());
  1011. list1.Add(this.UserInfo.GetUserGroupText());
  1012. list1.Add(is_zl);//质量等级代码
  1013. list1.Add(comboBox3.Text.Trim().ToString());//质量等级名称
  1014. ArrayList listc1 = new ArrayList();
  1015. listc1.Add("传动侧");
  1016. listc1.Add(ugr.Cells["THICK_VAL1"].Text.ToString());
  1017. listc1.Add(ugr.Cells["H_VAL1"].Value.ToString());
  1018. listc1.Add(ugr.Cells["M_VAL1"].Value.ToString());
  1019. listc1.Add(ugr.Cells["R_VAL1"].Value.ToString());
  1020. list3.Add(listc1);
  1021. listc1 = new ArrayList();
  1022. listc1.Add("中间");
  1023. listc1.Add(ugr.Cells["THICK_VAL2"].Text.ToString());
  1024. listc1.Add(ugr.Cells["H_VAL2"].Value.ToString());
  1025. listc1.Add(ugr.Cells["M_VAL2"].Value.ToString());
  1026. listc1.Add(ugr.Cells["R_VAL2"].Value.ToString());
  1027. list3.Add(listc1);
  1028. listc1 = new ArrayList();
  1029. listc1.Add("操作侧");
  1030. listc1.Add(ugr.Cells["THICK_VAL3"].Text.ToString());
  1031. listc1.Add(ugr.Cells["H_VAL3"].Value.ToString());
  1032. listc1.Add(ugr.Cells["M_VAL3"].Value.ToString());
  1033. listc1.Add(ugr.Cells["R_VAL3"].Value.ToString());
  1034. list3.Add(listc1);
  1035. if ((comboBox1.Text.ToString() == "合格" && comboBox3.Text.ToString() != "正品") || (comboBox1.Text.ToString() == "不合格" && comboBox3.Text.ToString() == "正品"))
  1036. {
  1037. MessageBox.Show("检验结果与质量等级不一致!");
  1038. return;
  1039. }
  1040. CoreClientParam ccp = new CoreClientParam();
  1041. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  1042. ccp.MethodName = "judgeByHumanJ";
  1043. ccp.ServerParams = new object[] { list1, list3 };
  1044. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1045. if (ccp.ReturnCode == -1)
  1046. {
  1047. return;
  1048. }
  1049. lists.Add(ugr);
  1050. }
  1051. }
  1052. }
  1053. for (int i = 0; i < lists.Count; i++)
  1054. {
  1055. lists[i].Delete(false);
  1056. }
  1057. MessageBox.Show("检验登记成功!");
  1058. }
  1059. catch (Exception EX)
  1060. {
  1061. MessageBox.Show(EX.ToString());
  1062. }
  1063. //DoQuery();
  1064. }
  1065. private void ultraGrid4_InitializeLayout(object sender, InitializeLayoutEventArgs e)
  1066. {
  1067. }
  1068. private void ultraGrid2_AfterRowActivate(object sender, EventArgs e)
  1069. {
  1070. try
  1071. {
  1072. UltraGridRow ugr = this.ultraGrid2.ActiveRow;
  1073. if (ugr == null)
  1074. return;
  1075. this.dataSet10.Clear();
  1076. string sic = ugr.Cells["SIC_ID"].Value.ToString();
  1077. CoreClientParam ccp = new CoreClientParam();
  1078. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  1079. ccp.MethodName = "getToleranceInfoNew";
  1080. ccp.ServerParams = new object[] { sic };
  1081. ccp.SourceDataTable = this.dataSet10.Tables[0];
  1082. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  1083. this.dataSet8.Clear();
  1084. ccp = new CoreClientParam();
  1085. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  1086. ccp.MethodName = "getQcmJudgeMeasureJ";
  1087. ccp.ServerParams = new object[] { sic };
  1088. ccp.SourceDataTable = this.dataSet8.Tables[0];
  1089. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  1090. }
  1091. catch (Exception ex)
  1092. {
  1093. System.Diagnostics.Debug.WriteLine(ex.ToString());
  1094. MessageBox.Show("系统出错,请联系管理人员", "警告");
  1095. }
  1096. }
  1097. private void ultraGrid2_InitializeLayout(object sender, InitializeLayoutEventArgs e)
  1098. {
  1099. }
  1100. private void button2_Click(object sender, EventArgs e)
  1101. {
  1102. try
  1103. {
  1104. if (this.ultraGrid2.Rows.Count == 0)
  1105. {
  1106. MessageBox.Show("没有可以导出的已检验公差数据", "提示");
  1107. return;
  1108. }
  1109. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  1110. {
  1111. string fName = this.saveFileDialog1.FileName;
  1112. this.ultraGridExcelExporter1.Export(this.ultraGrid2, fName);
  1113. Process.Start(fName);
  1114. }
  1115. }
  1116. catch (Exception ex)
  1117. {
  1118. System.Diagnostics.Debug.WriteLine(ex.ToString());
  1119. }
  1120. }
  1121. private void ultraGrid3_InitializeLayout(object sender, InitializeLayoutEventArgs e)
  1122. {
  1123. }
  1124. private void label16_Click(object sender, EventArgs e)
  1125. {
  1126. try
  1127. {
  1128. int count = 0;
  1129. foreach (UltraGridRow ugr in this.ultraGrid3.Rows)
  1130. {
  1131. if (ugr.Cells["CHECK"].Text.ToString() == "True")
  1132. {
  1133. count++;
  1134. }
  1135. }
  1136. List<UltraGridRow> lists = new List<UltraGridRow>();
  1137. foreach (UltraGridRow ugr in ultraGrid3.Rows)
  1138. {
  1139. if (ugr.Cells["CHECK"].Text.ToString() == "True")
  1140. {
  1141. ArrayList list1 = new ArrayList();
  1142. List<ArrayList> list2 = new List<ArrayList>();
  1143. //if (comboBox1.Text.Trim() == "")
  1144. //{
  1145. // MessageBox.Show("请输入检验结果!");
  1146. // return;
  1147. //}
  1148. //if (comboBox2.Text.Trim() == "")
  1149. //{
  1150. // MessageBox.Show("请输入质量等级!");
  1151. // return;
  1152. //}
  1153. string is_pass = "";
  1154. string is_zl1 = "";
  1155. //if (comboBox1.Text.ToString() == "合格")
  1156. //{
  1157. // is_pass = "1";
  1158. //}
  1159. //else if (comboBox1.Text.ToString() == "不合格")
  1160. //{
  1161. // is_pass = "2";
  1162. //}
  1163. //else if (comboBox1.Text.ToString() == "待判")
  1164. //{
  1165. // is_pass = "0";
  1166. //}
  1167. //else
  1168. //{
  1169. // is_pass = "";
  1170. //}
  1171. list1.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
  1172. list1.Add("");//检验结果代码
  1173. list1.Add("");//检验结果
  1174. list1.Add(comboBox2.Text.Trim().ToString());//质量等级代码
  1175. list1.Add(comboBox2.Text.Trim().ToString());//质量等级名称
  1176. list1.Add(textBox5.Text.ToString().Trim());
  1177. list1.Add(this.UserInfo.GetUserName());//操作人
  1178. list1.Add(this.UserInfo.GetUserOrderText());//班次
  1179. list1.Add(this.UserInfo.GetUserGroupText());//班组
  1180. int count1 = 0;
  1181. int i = 0;
  1182. foreach (UltraGridRow ugrs in this.ultraGrid4.Rows)
  1183. {
  1184. if (ugrs.Cells["CHECKBOX"].Text.ToString() == "True")
  1185. {
  1186. int j = 2;
  1187. ArrayList list = new ArrayList();
  1188. if (ugrs.Cells["PRIMARY_FLAG"].Value.ToString() == "1")
  1189. i++;
  1190. list.Add(ugrs.Cells["PRIMARY_FLAG"].Value.ToString());
  1191. if (ugrs.Cells["PRIMARY_FLAG"].Value.ToString() == "1")
  1192. {
  1193. list.Add("1");
  1194. j = j - 1;
  1195. }
  1196. else
  1197. {
  1198. list.Add(j);
  1199. }
  1200. if (ugrs.Cells["FLAW_DESC"].Text.ToString() == "")
  1201. {
  1202. list.Add(ugrs.Cells["FLAW_DESC"].Text.ToString());
  1203. }
  1204. else
  1205. {
  1206. list.Add(ugrs.Cells["FLAW_DESC"].Value.ToString());
  1207. }
  1208. list.Add(ugrs.Cells["FLAW_DESC"].Text.ToString());
  1209. if (ugrs.Cells["FLAW_DESC"].Text.ToString() == "")
  1210. {
  1211. MessageBox.Show("已选择的请录入缺陷信息!");
  1212. return;
  1213. }
  1214. if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "上表面")
  1215. {
  1216. list.Add("U");
  1217. }
  1218. else if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "下表面")
  1219. {
  1220. list.Add("D");
  1221. }
  1222. else if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "边部")
  1223. {
  1224. list.Add("E");
  1225. }
  1226. else
  1227. {
  1228. list.Add("");
  1229. }
  1230. //list.Add(ugrs.Cells["FLAW_TYPE_DESC"].Value.ToString());
  1231. //list.Add(ugrs.Cells["FLAW_TYPE_DESC"].Text.ToString());
  1232. if (ugrs.Cells["FLAW_POS_DESC"].Text.ToString() == "")
  1233. {
  1234. list.Add(ugrs.Cells["FLAW_POS_DESC"].Text.ToString());
  1235. }
  1236. else
  1237. {
  1238. list.Add(ugrs.Cells["FLAW_POS_DESC"].Value.ToString());
  1239. }
  1240. list.Add(ugrs.Cells["FLAW_POS_DESC"].Text.ToString());
  1241. if (ugrs.Cells["FLAW_DIR_DESC"].Text.ToString() == "")
  1242. {
  1243. list.Add(ugrs.Cells["FLAW_DIR_DESC"].Text.ToString());
  1244. }
  1245. else
  1246. {
  1247. list.Add(ugrs.Cells["FLAW_DIR_DESC"].Value.ToString());
  1248. }
  1249. list.Add(ugrs.Cells["FLAW_DIR_DESC"].Text.ToString());
  1250. if (ugrs.Cells["FLAW_SIZE_DESC"].Text.ToString() == "")
  1251. {
  1252. list.Add(ugrs.Cells["FLAW_SIZE_DESC"].Text.ToString());
  1253. }
  1254. else
  1255. {
  1256. list.Add(ugrs.Cells["FLAW_SIZE_DESC"].Value.ToString());
  1257. }
  1258. list.Add(ugrs.Cells["FLAW_SIZE_DESC"].Text.ToString());
  1259. if (ugrs.Cells["FLAW_LV_DESC"].Text.ToString() == "")
  1260. {
  1261. list.Add(ugrs.Cells["FLAW_LV_DESC"].Text.ToString());
  1262. }
  1263. else
  1264. {
  1265. list.Add(ugrs.Cells["FLAW_LV_DESC"].Value.ToString());
  1266. }
  1267. list.Add(ugrs.Cells["FLAW_LV_DESC"].Text.ToString());
  1268. //if (!IsNumberal(ugrs.Cells["FLAW_QUANTITY"].Text))
  1269. //{
  1270. // MessageBox.Show("数量请输入数字!");
  1271. // return;
  1272. //}
  1273. list.Add(ugrs.Cells["FLAW_QUANTITY"].Text.ToString());
  1274. list.Add(ugrs.Cells["MEMO"].Text.ToString());
  1275. if (ugrs.Cells["IS_REPAIR"].Text.ToString() == "")
  1276. {
  1277. list.Add("0");
  1278. }
  1279. else
  1280. {
  1281. list.Add(ugrs.Cells["IS_REPAIR"].Value.ToString());
  1282. }
  1283. count1++;
  1284. j++;
  1285. list2.Add(list);
  1286. }
  1287. }
  1288. if (count1 == 0 && comboBox1.Text.ToString() == "不合格")
  1289. {
  1290. MessageBox.Show("请录入缺陷信息并选择!");
  1291. return;
  1292. }
  1293. if (i == 0 && comboBox1.Text.ToString() == "不合格")
  1294. {
  1295. MessageBox.Show("请录入主要缺陷!");
  1296. return;
  1297. }
  1298. if (i > 1)
  1299. {
  1300. MessageBox.Show("请不要录入多条主要缺陷!");
  1301. return;
  1302. }
  1303. CoreClientParam ccp = new CoreClientParam();
  1304. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  1305. ccp.MethodName = "doAddFlawL1";
  1306. ccp.ServerParams = new object[] { list2, list1 };
  1307. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1308. if (ccp.ReturnCode == -1)
  1309. {
  1310. return;
  1311. }
  1312. }
  1313. }
  1314. foreach (UltraGridRow ugr in this.ultraGrid3.Rows)
  1315. {
  1316. if (ugr.Cells["CHECK"].Text.ToString() == "True")
  1317. {
  1318. if ((ugr.Cells["VAL"].Text.ToString() != null) || (ugr.Cells["VAL_2"].Text.ToString() != null))
  1319. {
  1320. ArrayList list1 = new ArrayList();
  1321. List<ArrayList> list2 = new List<ArrayList>();
  1322. List<ArrayList> list3 = new List<ArrayList>();
  1323. list1.Add(ugr.Cells["DESIGN_KEY"].Value.ToString());
  1324. list1.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
  1325. if (comboBox1.Text.ToString() == "")
  1326. {
  1327. {
  1328. MessageBox.Show("请输入登记结果!");
  1329. return;
  1330. }
  1331. }
  1332. else
  1333. {
  1334. if (comboBox1.Text.ToString() == "合格")
  1335. {
  1336. list1.Add("1");
  1337. list1.Add("合格");
  1338. }
  1339. else if (comboBox1.Text.ToString() == "不合格")
  1340. {
  1341. list1.Add("2");
  1342. list1.Add("不合格");
  1343. }
  1344. else
  1345. {
  1346. list1.Add("0");
  1347. list1.Add("待判");
  1348. }
  1349. }
  1350. string is_zl = "";
  1351. if (comboBox3.Text.ToString() == "正品")
  1352. {
  1353. is_zl = "512601";
  1354. }
  1355. else if (comboBox3.Text.ToString() == "次品")
  1356. {
  1357. is_zl = "512602";
  1358. }
  1359. else if (comboBox3.Text.ToString() == "废品")
  1360. {
  1361. is_zl = "512603";
  1362. }
  1363. else if (comboBox3.Text.ToString() == "协议品")
  1364. {
  1365. is_zl = "512604";
  1366. }
  1367. else if (comboBox3.Text.ToString() == "订单外")
  1368. {
  1369. is_zl = "512605";
  1370. }
  1371. list1.Add(textBox5.Text.Trim().ToString());
  1372. list1.Add(this.UserInfo.GetUserName());
  1373. list1.Add(this.UserInfo.GetUserOrderText());
  1374. list1.Add(this.UserInfo.GetUserGroupText());
  1375. list1.Add(is_zl);//质量等级代码
  1376. list1.Add(comboBox3.Text.Trim().ToString());//质量等级名称
  1377. ArrayList list = new ArrayList();
  1378. if (ugr.Cells["BIAS_CODE"].Text.ToString() == "" || ugr.Cells["BIAS_CODE_2"].Text.ToString() == "")
  1379. {
  1380. MessageBox.Show(ugr.Cells["MATERIAL_NO"].Value.ToString() + "卷没有判定标准");
  1381. return;
  1382. }
  1383. list.Add(ugr.Cells["BIAS_CODE"].Text.ToString());
  1384. list.Add(ugr.Cells["VAL"].Text.ToString());
  1385. list.Add(ugr.Cells["BIAS_NAME"].Text.ToString());
  1386. list.Add(ugr.Cells["PLAN"].Text.ToString());
  1387. list.Add(ugr.Cells["VAL2"].Text.ToString());
  1388. list2.Add(list);
  1389. list = new ArrayList();
  1390. list.Add(ugr.Cells["BIAS_CODE_2"].Text.ToString());
  1391. list.Add(ugr.Cells["VAL_2"].Text.ToString());
  1392. list.Add(ugr.Cells["BIAS_NAME_2"].Text.ToString());
  1393. list.Add(ugr.Cells["PLAN_2"].Text.ToString());
  1394. list.Add(ugr.Cells["VAL2_2"].Text.ToString());
  1395. list2.Add(list);
  1396. ArrayList listc1 = new ArrayList();
  1397. listc1.Add("传动侧");
  1398. listc1.Add(ugr.Cells["THICK_VAL1"].Text.ToString());
  1399. listc1.Add(ugr.Cells["H_VAL1"].Value.ToString());
  1400. listc1.Add(ugr.Cells["M_VAL1"].Value.ToString());
  1401. listc1.Add(ugr.Cells["R_VAL1"].Value.ToString());
  1402. list3.Add(listc1);
  1403. listc1 = new ArrayList();
  1404. listc1.Add("中间");
  1405. listc1.Add(ugr.Cells["THICK_VAL2"].Text.ToString());
  1406. listc1.Add(ugr.Cells["H_VAL2"].Value.ToString());
  1407. listc1.Add(ugr.Cells["M_VAL2"].Value.ToString());
  1408. listc1.Add(ugr.Cells["R_VAL2"].Value.ToString());
  1409. list3.Add(listc1);
  1410. listc1 = new ArrayList();
  1411. listc1.Add("操作侧");
  1412. listc1.Add(ugr.Cells["THICK_VAL3"].Text.ToString());
  1413. listc1.Add(ugr.Cells["H_VAL3"].Value.ToString());
  1414. listc1.Add(ugr.Cells["M_VAL3"].Value.ToString());
  1415. listc1.Add(ugr.Cells["R_VAL3"].Value.ToString());
  1416. list3.Add(listc1);
  1417. if ((comboBox1.Text.ToString() == "合格" && comboBox3.Text.ToString() != "正品") || (comboBox1.Text.ToString() == "不合格" && comboBox3.Text.ToString() == "正品"))
  1418. {
  1419. MessageBox.Show("检验结果与质量等级不一致!");
  1420. return;
  1421. }
  1422. CoreClientParam ccp = new CoreClientParam();
  1423. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  1424. ccp.MethodName = "judgeByHuman2";
  1425. ccp.ServerParams = new object[] { list1, list2, list3 };
  1426. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1427. if (ccp.ReturnCode == -1)
  1428. {
  1429. return;
  1430. }
  1431. lists.Add(ugr);
  1432. }
  1433. else
  1434. {
  1435. ArrayList list1 = new ArrayList();
  1436. List<ArrayList> list3 = new List<ArrayList>();
  1437. list1.Add(ugr.Cells["DESIGN_KEY"].Value.ToString());
  1438. list1.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
  1439. if (comboBox1.Text.ToString() == "")
  1440. {
  1441. MessageBox.Show("请输入公差登记结果!或输入判定值!");
  1442. return;
  1443. }
  1444. else
  1445. {
  1446. if (comboBox1.Text.ToString() == "合格")
  1447. {
  1448. list1.Add("1");
  1449. list1.Add("合格");
  1450. }
  1451. else if (comboBox1.Text.ToString() == "待判")
  1452. {
  1453. list1.Add("0");
  1454. list1.Add("待判");
  1455. }
  1456. else
  1457. {
  1458. list1.Add("2");
  1459. list1.Add("不合格");
  1460. }
  1461. }
  1462. string is_zl = "";
  1463. if (comboBox3.Text.ToString() == "正品")
  1464. {
  1465. is_zl = "512601";
  1466. }
  1467. else if (comboBox3.Text.ToString() == "次品")
  1468. {
  1469. is_zl = "512602";
  1470. }
  1471. else if (comboBox3.Text.ToString() == "废品")
  1472. {
  1473. is_zl = "512603";
  1474. }
  1475. else if (comboBox3.Text.ToString() == "协议品")
  1476. {
  1477. is_zl = "512604";
  1478. }
  1479. else if (comboBox3.Text.ToString() == "订单外")
  1480. {
  1481. is_zl = "512605";
  1482. }
  1483. list1.Add(textBox5.Text.Trim().ToString());
  1484. list1.Add(this.UserInfo.GetUserName());
  1485. list1.Add(this.UserInfo.GetUserOrderText());
  1486. list1.Add(this.UserInfo.GetUserGroupText());
  1487. list1.Add(is_zl);//质量等级代码
  1488. list1.Add(comboBox3.Text.Trim().ToString());//质量等级名称
  1489. ArrayList listc1 = new ArrayList();
  1490. listc1.Add("传动侧");
  1491. listc1.Add(ugr.Cells["THICK_VAL1"].Text.ToString());
  1492. listc1.Add(ugr.Cells["H_VAL1"].Value.ToString());
  1493. listc1.Add(ugr.Cells["M_VAL1"].Value.ToString());
  1494. listc1.Add(ugr.Cells["R_VAL1"].Value.ToString());
  1495. list3.Add(listc1);
  1496. listc1 = new ArrayList();
  1497. listc1.Add("中间");
  1498. listc1.Add(ugr.Cells["THICK_VAL2"].Text.ToString());
  1499. listc1.Add(ugr.Cells["H_VAL2"].Value.ToString());
  1500. listc1.Add(ugr.Cells["M_VAL2"].Value.ToString());
  1501. listc1.Add(ugr.Cells["R_VAL2"].Value.ToString());
  1502. list3.Add(listc1);
  1503. listc1 = new ArrayList();
  1504. listc1.Add("操作侧");
  1505. listc1.Add(ugr.Cells["THICK_VAL3"].Text.ToString());
  1506. listc1.Add(ugr.Cells["H_VAL3"].Value.ToString());
  1507. listc1.Add(ugr.Cells["M_VAL3"].Value.ToString());
  1508. listc1.Add(ugr.Cells["R_VAL3"].Value.ToString());
  1509. list3.Add(listc1);
  1510. if ((comboBox1.Text.ToString() == "合格" && comboBox3.Text.ToString() != "正品") || (comboBox1.Text.ToString() == "不合格" && comboBox3.Text.ToString() == "正品"))
  1511. {
  1512. MessageBox.Show("检验结果与质量等级不一致!");
  1513. return;
  1514. }
  1515. CoreClientParam ccp = new CoreClientParam();
  1516. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  1517. ccp.MethodName = "judgeByHumanJ";
  1518. ccp.ServerParams = new object[] { list1, list3 };
  1519. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1520. if (ccp.ReturnCode == -1)
  1521. {
  1522. return;
  1523. }
  1524. lists.Add(ugr);
  1525. }
  1526. }
  1527. }
  1528. for (int i = 0; i < lists.Count; i++)
  1529. {
  1530. lists[i].Delete(false);
  1531. }
  1532. MessageBox.Show("表面公差检验登记成功!");
  1533. }
  1534. catch (Exception EX)
  1535. {
  1536. MessageBox.Show(EX.ToString());
  1537. }
  1538. }
  1539. }
  1540. }