3857d8d536ba7bdb9eb75316f384e5d182f06369.svn-base 85 KB

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