QCM031010.cs 155 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003
  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;
  10. using CoreFS.CA06;
  11. using Infragistics.Win.UltraWinGrid;
  12. using System.Collections;
  13. using System.Diagnostics;
  14. using Core.LZMes.Client.QCM;
  15. namespace Core.LZMes.Client.QCM
  16. {
  17. public partial class QCM031010 : FrmBase
  18. {
  19. public QCM031010()
  20. {
  21. InitializeComponent();
  22. }
  23. // public DataSet ds = new DataSet();
  24. private string SLSelected = null;
  25. string strQxly = "";
  26. string strMian = "";
  27. string strCe = "";
  28. string strTou = "";
  29. string strDaxiao = "";
  30. string strDuoshao = "";
  31. string strShougan = "";
  32. string strChengdu = "";
  33. string strMemo = "";
  34. string strRepair = "";
  35. string strPrimary_flag = "";
  36. string defect_desc = "";
  37. string strMianval = "";
  38. string strCeval = "";
  39. string strTouval = "";
  40. string strDaxiaoval = "";
  41. string strDuoshaoval = "";
  42. string strShouganval = "";
  43. string strChengduval = "";
  44. string strMemoval = "";
  45. string strRepairval = "";
  46. string strPrimary_flagval = "";
  47. string defect_descval = "";
  48. string count = "";
  49. string strPline_Code = "";
  50. //string strQxly = "";
  51. List<SortedList> a = new List<SortedList>();
  52. int c;
  53. int jx = 1;
  54. public override void ToolBar_Click(object sender, string ToolbarKey)
  55. {
  56. switch (ToolbarKey)
  57. {
  58. case "Query":
  59. this.DoQuery();
  60. break;
  61. case "Save":
  62. this.DoSave();
  63. break;
  64. //case "Judge":
  65. // Operate();
  66. // break;
  67. case "FB":
  68. fb();
  69. break;
  70. case "Cancel_FB":
  71. cancel_fb();
  72. break;
  73. //case "FanXiu":
  74. // this.FanXiu();
  75. //break;
  76. case "Export":
  77. this.DoExport();
  78. break;
  79. }
  80. }
  81. private void DoQuery()
  82. {
  83. try
  84. {
  85. if (this.checkBox1.Checked)
  86. {
  87. DateTime dt1 = Convert.ToDateTime(this.ultraDateTimeEditor1.DateTime.ToString("yyyy-MM-dd"));
  88. DateTime dt2 = Convert.ToDateTime(this.ultraDateTimeEditor2.DateTime.ToString("yyyy-MM-dd"));
  89. TimeSpan span = dt2.Subtract(dt1);
  90. int dayDiff = span.Days + 1;
  91. if (dayDiff < 0 || dayDiff >30)
  92. {
  93. this.alert("查询时间不能大于30天,请核实查询时间条件!");
  94. return;
  95. }
  96. }
  97. ArrayList al = new ArrayList();
  98. SLSelected = this.comboBox3.Text;
  99. if (textBox1.Text == "" && !this.checkBox1.Checked && this.textBox3.Text == "")
  100. {
  101. MessageBox.Show("请选择查询条件!", "提示");
  102. return;
  103. }
  104. //SQL
  105. if (this.comboBox3.Text == "酸轧")
  106. {
  107. al.Add("UIB030110_01.SELECT");
  108. al.Add(textBox1.Text.ToString());//轧制单元
  109. }
  110. else if (this.comboBox3.Text == "酸洗")
  111. {
  112. al.Add("UIB030110_11.SELECT");
  113. al.Add(textBox1.Text.ToString());//轧制单元
  114. }
  115. else if (this.comboBox3.Text == "连退")
  116. //al.Add("UIB030110_01_LIAN.SELECT");
  117. //20151103修改查询sql语句去掉重复的卷
  118. al.Add("UIB030110_01_LIAN_QC.SELECT");
  119. else if (this.comboBox3.Text == "重卷")//重卷
  120. {
  121. //20151103修改查询sql语句去掉重复的卷
  122. //al.Add("UIB030110_01_CJ_QC.SELECT");
  123. if (this.checkBox1.Checked)
  124. {
  125. al.Add("UIB030110_01_CJ.SELECT");
  126. al.Add(this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd"));//日期
  127. al.Add(this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd"));//日期
  128. }
  129. else
  130. {
  131. al.Add("UIB030110_03_CJ.SELECT");
  132. }
  133. }
  134. //查询条件
  135. if (this.comboBox3.Text == "连退" || this.comboBox3.Text == "酸轧" || this.comboBox3.Text == "酸洗")
  136. {
  137. if (this.checkBox1.Checked)
  138. {
  139. al.Add(this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") + "000000");//日期
  140. al.Add(this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd") + "999999");//日期
  141. }
  142. else
  143. {
  144. al.Add("");
  145. al.Add("");
  146. }
  147. }
  148. al.Add(this.textBox3.Text.Trim());//钢卷号
  149. if (!this.checkBox1.Checked && this.textBox3.Text.Trim() == "")
  150. return;
  151. OperateConditionRecode.WriteCondition("UIB030110", this.textBox1.Text.ToString());
  152. OperateConditionRecode.WriteCondition("UIB030110_1", this.comboBox3.SelectedIndex.ToString());
  153. this.dataSet1.Tables[0].Clear();
  154. CoreClientParam ccp = new CoreClientParam();
  155. ccp.ServerName = "QCM.COMMUNAL.ComDBQueryQCM";
  156. ccp.MethodName = "doSimpleQuery";
  157. ccp.ServerParams = new object[] { al };
  158. ccp.SourceDataTable = this.dataSet1.Tables[0];
  159. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  160. //MessageBox.Show(ccp.ReturnInfo, "调试信息");
  161. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  162. {
  163. if (ugr.Cells["SMP_DIR_PIC_YN"].Text == "Y"
  164. && ugr.Cells["SMP_PICK_YN"].Text == "")
  165. {
  166. //ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  167. //ugr.Delete();
  168. //ugr.Hidden = true;
  169. }
  170. //判断人工录入宽度判定值与机器测量宽度实际值之差,若≥10则显示红色
  171. string COILWTH = ugr.Cells["COIL_WTH"].Text;
  172. string DCSWTH = ugr.Cells["DCS_WTH"].Text;
  173. if (COILWTH != null && COILWTH != "" && DCSWTH != null && DCSWTH != "" && DCSWTH != "0")
  174. {
  175. double chazhi = double.Parse(DCSWTH) - double.Parse(COILWTH);
  176. if (System.Math.Abs(chazhi) >= 10)
  177. {
  178. ugr.Cells["COIL_WTH"].Appearance.BackColor = Color.Red;
  179. ugr.Cells["DCS_WTH"].Appearance.BackColor = Color.Red;
  180. }
  181. else
  182. {
  183. ugr.Cells["COIL_WTH"].Appearance.BackColor = Color.White;
  184. ugr.Cells["DCS_WTH"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
  185. }
  186. }
  187. else
  188. {
  189. ugr.Cells["COIL_WTH"].Appearance.BackColor = Color.White;
  190. ugr.Cells["DCS_WTH"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
  191. }
  192. //判断人工录入厚度判定值与机器测量厚度实际值之差,若≥0.01则显示红色
  193. string COILTHK = ugr.Cells["COIL_THK"].Text;
  194. string DCSTHK = ugr.Cells["DCS_THK"].Text;
  195. if (COILTHK != null && COILTHK != "" && DCSTHK != null && DCSTHK != "" && DCSTHK != "0")
  196. {
  197. double chazhi = double.Parse(DCSTHK) - double.Parse(COILTHK);
  198. if (System.Math.Abs(chazhi) >= 0.01)
  199. {
  200. ugr.Cells["COIL_THK"].Appearance.BackColor = Color.Red;
  201. ugr.Cells["DCS_THK"].Appearance.BackColor = Color.Red;
  202. }
  203. else
  204. {
  205. ugr.Cells["COIL_THK"].Appearance.BackColor = Color.White;
  206. ugr.Cells["DCS_THK"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
  207. }
  208. }
  209. else
  210. {
  211. ugr.Cells["COIL_THK"].Appearance.BackColor = Color.White;
  212. ugr.Cells["DCS_THK"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
  213. }
  214. }
  215. }
  216. catch (Exception ex)
  217. {
  218. MessageBox.Show(ex.ToString());
  219. }
  220. }
  221. private void fb()
  222. {
  223. try
  224. {
  225. if (comboBox3.Text.ToString() == "连退" || comboBox3.Text.ToString() == "重卷")
  226. {
  227. strPline_Code = "LT1";
  228. }
  229. else
  230. {
  231. strPline_Code = "SZ1";
  232. }
  233. List<UltraGridRow> lists = new List<UltraGridRow>();
  234. foreach (UltraGridRow ugr in ultraGrid1.Rows)
  235. {
  236. if (ugr.Cells["CHK"].Text.ToString() == "True")
  237. {
  238. CoreClientParam ccp = new CoreClientParam();
  239. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  240. ccp.MethodName = "coiljudge_status_call_commit";
  241. ccp.ServerParams = new object[] { strPline_Code
  242. , ugr.Cells["COIL_NO"].Value.ToString()
  243. , ""
  244. , ""
  245. , ""
  246. , ""
  247. , ""
  248. , "Y"
  249. , textBox4.Text};
  250. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  251. if (ccp.ReturnCode == -1)
  252. {
  253. return;
  254. }
  255. lists.Add(ugr);
  256. }
  257. }
  258. //for (int i = 0; i < lists.Count; i++)
  259. //{
  260. // lists[i].Delete(false);
  261. //}
  262. //DoQuery();
  263. MessageBox.Show("封闭成功!");
  264. }
  265. catch (Exception ex)
  266. {
  267. System.Diagnostics.Debug.WriteLine(ex.ToString());
  268. MessageBox.Show("系统出错,请联系管理人员", "警告");
  269. }
  270. }
  271. private void cancel_fb()
  272. {
  273. try
  274. {
  275. if (comboBox3.Text.ToString() == "连退" || comboBox3.Text.ToString() == "重卷")
  276. {
  277. strPline_Code = "LT1";
  278. }
  279. else
  280. {
  281. strPline_Code = "SZ1";
  282. }
  283. List<UltraGridRow> lists = new List<UltraGridRow>();
  284. foreach (UltraGridRow ugr in ultraGrid1.Rows)
  285. {
  286. if (ugr.Cells["CHECK"].Text.ToString() == "True")
  287. {
  288. CoreClientParam ccp = new CoreClientParam();
  289. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  290. ccp.MethodName = "coiljudge_status_call_commit";
  291. ccp.ServerParams = new object[] { strPline_Code
  292. , ugr.Cells["COIL_NO"].Value.ToString()
  293. , ""
  294. , ""
  295. , ""
  296. , ""
  297. , ""
  298. , "N"
  299. , textBox4.Text,""};
  300. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  301. if (ccp.ReturnCode == -1)
  302. {
  303. return;
  304. }
  305. lists.Add(ugr);
  306. }
  307. }
  308. for (int i = 0; i < lists.Count; i++)
  309. {
  310. lists[i].Delete(false);
  311. }
  312. //DoQuery();
  313. MessageBox.Show("解除封闭成功!");
  314. }
  315. catch (Exception ex)
  316. {
  317. System.Diagnostics.Debug.WriteLine(ex.ToString());
  318. MessageBox.Show("系统出错,请联系管理人员", "警告");
  319. }
  320. }
  321. private void DoSave()
  322. {
  323. try
  324. {
  325. //this.ultraGrid1.UpdateData();//选择以后,这里必须要updatedata。
  326. ArrayList list = new ArrayList();
  327. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  328. {
  329. if (Convert.ToBoolean(ugr.Cells["CHK"].Value))
  330. {
  331. /*if (ugr.Cells["EXSHAPE_TP"].Text.ToString() == "Y" || ugr.Cells["CRK_TP"].Text.ToString() == "Y")
  332. {
  333. ArrayList list1 = new ArrayList();
  334. List<ArrayList> list2 = new List<ArrayList>();
  335. string is_pass = "";
  336. string is_zl1 = "";
  337. list1.Add(ugr.Cells["COIL_NO"].Value.ToString());
  338. list1.Add("");//检验结果代码
  339. list1.Add("");//检验结果
  340. list1.Add(ultraComboEditor1.Text.Trim().ToString());//质量等级代码
  341. list1.Add(ultraComboEditor1.Text.Trim().ToString());//质量等级名称
  342. list1.Add("");
  343. list1.Add(this.UserInfo.GetUserName());//操作人
  344. list1.Add(this.UserInfo.GetUserOrderText());//班次
  345. list1.Add(this.UserInfo.GetUserGroupText());//班组
  346. int count1 = 0;
  347. int i = 0;
  348. for (int c1 = 0; c1 < c; c1++)
  349. {
  350. // MessageBox.Show(CWindow.al[i].ToString() +"---------"+ CWindow.al[i].ToString().Substring(2));
  351. if (ugr.Cells["CRK_CD" + Convert.ToString((c1 + 1)) + "_TYPE"].Text.ToString() != "")
  352. {
  353. string[] sArray = ugr.Cells["CRK_CD" + Convert.ToString((c1 + 1)) + "_TYPE"].Text.ToString().Split(';');
  354. defect_desc = sArray[0];
  355. strRepair = sArray[1];
  356. strPrimary_flag = sArray[2];
  357. strMian = sArray[3];
  358. strTou = sArray[4];
  359. strCe = sArray[5];
  360. strDaxiao = sArray[6];
  361. strDuoshao = sArray[7];
  362. strChengdu = sArray[8];
  363. strMemo = sArray[9];
  364. defect_descval = sArray[10];
  365. strRepairval = sArray[11];
  366. strPrimary_flagval = sArray[12];
  367. strMianval = sArray[13];
  368. strCeval = sArray[15];
  369. strTouval = sArray[14];
  370. strDaxiaoval = sArray[16];
  371. strDuoshaoval = sArray[17];
  372. strChengduval = sArray[18];
  373. strMemoval = sArray[19];
  374. ArrayList listbm = new ArrayList();
  375. if (strPrimary_flag == "")
  376. {
  377. listbm.Add(strPrimary_flag);
  378. }
  379. else
  380. {
  381. listbm.Add(strPrimary_flagval);
  382. }
  383. //int j = c1+1;
  384. if (strPrimary_flag == "1" && c1 + 1 == 1)
  385. {
  386. i++;
  387. listbm.Add("1");
  388. //j = j - 1;
  389. }
  390. else if (strPrimary_flag == "1" && c1 + 1 != 1)
  391. {
  392. MessageBox.Show("请把序号为1的缺陷选为主要缺陷!");
  393. return;
  394. }
  395. else
  396. {
  397. listbm.Add(Convert.ToString(c1 + 1));
  398. }
  399. if (defect_desc == "")
  400. {
  401. listbm.Add(defect_desc);
  402. }
  403. else
  404. {
  405. listbm.Add(defect_descval);
  406. }
  407. listbm.Add(defect_desc);
  408. if (strMian == "上表面")
  409. {
  410. listbm.Add("U");
  411. }
  412. else if (strMian == "下表面")
  413. {
  414. listbm.Add("D");
  415. }
  416. else if (strMian == "边部")
  417. {
  418. listbm.Add("E");
  419. }
  420. else
  421. {
  422. listbm.Add("");
  423. }
  424. //list.Add(strMian);
  425. if (strTou == "")
  426. {
  427. listbm.Add(strTou);
  428. }
  429. else
  430. {
  431. listbm.Add(strTouval);
  432. }
  433. listbm.Add(strTou);
  434. if (strCe == "")
  435. {
  436. listbm.Add(strCe);
  437. }
  438. else
  439. {
  440. listbm.Add(strCeval);
  441. }
  442. listbm.Add(strCe);
  443. if (strDaxiao == "")
  444. {
  445. listbm.Add(strDaxiao);
  446. }
  447. else
  448. {
  449. listbm.Add(strDaxiaoval);
  450. }
  451. listbm.Add(strDaxiao);
  452. if (strChengdu == "")
  453. {
  454. listbm.Add(strChengdu);
  455. }
  456. else
  457. {
  458. listbm.Add(strChengduval);
  459. }
  460. listbm.Add(strChengdu);
  461. listbm.Add(strDuoshao);
  462. listbm.Add(strMemo);
  463. if (strRepair == "")
  464. {
  465. listbm.Add("0");
  466. }
  467. else
  468. {
  469. listbm.Add(strRepairval);
  470. }
  471. list2.Add(listbm);
  472. }
  473. }
  474. if (i > 1)
  475. {
  476. MessageBox.Show("请不要录入多条主要缺陷!");
  477. return;
  478. }
  479. CoreClientParam ccp = new CoreClientParam();
  480. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  481. ccp.MethodName = "doAddFlawL1";
  482. ccp.ServerParams = new object[] { list2, list1 };
  483. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  484. if (ccp.ReturnCode == -1)
  485. {
  486. return;
  487. }
  488. MessageBox.Show("表面检验登记成功!");
  489. }*/
  490. if (ugr.Cells["SMPPICK_TP"].Text == "Y")
  491. {
  492. // smpList = new ArrayList();
  493. //取样操作
  494. jx = 1;
  495. CoreClientParam ccp = new CoreClientParam();
  496. Hashtable ht = new Hashtable();
  497. ht.Add("i" + jx, SLSelected); jx++;//产线
  498. ht.Add("i" + jx, ugr.Cells["COIL_NO"].Text); jx++;//钢卷号
  499. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//试样号
  500. ht.Add("i" + jx, ugr.Cells["SMP_CUT_LOC"].Text); jx++;//位置
  501. ht.Add("i" + jx, ""); jx++;//去向
  502. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//外观等级
  503. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//录入厚度
  504. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//录入宽度
  505. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//温度
  506. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//粗糙度
  507. ht.Add("i" + jx, ugr.Cells["SMP_PICK_YN"].Text); jx++;//是否取样
  508. ht.Add("i" + jx, ""); jx++;//外观缺陷1
  509. ht.Add("i" + jx, ""); jx++;
  510. ht.Add("i" + jx, ""); jx++;
  511. ht.Add("i" + jx, ""); jx++;
  512. ht.Add("i" + jx, ""); jx++;
  513. ht.Add("i" + jx, ""); jx++;
  514. ht.Add("i" + jx, ""); jx++;
  515. ht.Add("i" + jx, ""); jx++;
  516. ht.Add("i" + jx, ""); jx++;//外观缺陷5
  517. ht.Add("i" + jx, ""); jx++;
  518. ht.Add("i" + jx, this.UserInfo.GetUserName().ToString()); jx++;//操作人
  519. ht.Add("i" + jx, "取样登记"); jx++;//操作标志
  520. ht.Add("o" + jx, ""); jx = 1;
  521. ccp.ServerName = "QCM.COMMUNAL.ComDBProcedureQCM";
  522. ccp.MethodName = "doXmlProcedure";
  523. ccp.ServerParams = new object[] { "UIB030110_01.CALL", ht };
  524. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  525. ugr.Cells["SMPPICK_TP"].Value = "";
  526. ArrayList all = ccp.ReturnObject as ArrayList;
  527. if (all[0].ToString() != "YY")//确认是否存在问题
  528. {
  529. MessageBox.Show(all[0].ToString(), "提示");
  530. }
  531. }
  532. if (ugr.Cells["CRK_TP"].Text == "Y")//外观缺陷
  533. {
  534. jx = 1;
  535. CoreClientParam ccp = new CoreClientParam();
  536. Hashtable ht = new Hashtable();
  537. ht.Add("i" + jx, SLSelected); jx++;//产线
  538. ht.Add("i" + jx, ugr.Cells["COIL_NO"].Text); jx++;//钢卷号
  539. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//试样号
  540. ht.Add("i" + jx, ugr.Cells["SMP_CUT_LOC"].Text); jx++;//位置
  541. ht.Add("i" + jx, ""); jx++;//去向
  542. ht.Add("i" + jx, ugr.Cells["EXTSHAPE_QUALITY"].Text); jx++;//外观等级
  543. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//录入厚度
  544. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//录入宽度
  545. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//温度
  546. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//粗糙度
  547. ht.Add("i" + jx, ugr.Cells["SMP_PICK_YN"].Text); jx++;//是否取样
  548. ht.Add("i" + jx, ugr.Cells["CRK_CD1"].Value.ToString()); jx++;//外观缺陷1
  549. ht.Add("i" + jx, ugr.Cells["CRK_CD1_TYPE"].Text); jx++;
  550. ht.Add("i" + jx, ugr.Cells["CRK_CD2"].Value.ToString()); jx++;
  551. ht.Add("i" + jx, ugr.Cells["CRK_CD2_TYPE"].Text); jx++;
  552. ht.Add("i" + jx, ugr.Cells["CRK_CD3"].Value.ToString()); jx++;
  553. ht.Add("i" + jx, ugr.Cells["CRK_CD3_TYPE"].Text); jx++;
  554. ht.Add("i" + jx, ugr.Cells["CRK_CD4"].Value.ToString()); jx++;
  555. ht.Add("i" + jx, ugr.Cells["CRK_CD4_TYPE"].Text); jx++;
  556. ht.Add("i" + jx, ugr.Cells["CRK_CD5"].Value.ToString()); jx++;//外观缺陷5
  557. ht.Add("i" + jx, ugr.Cells["CRK_CD5_TYPE"].Text); jx++;
  558. ht.Add("i" + jx, this.UserInfo.GetUserName().ToString()); jx++;//操作人
  559. ht.Add("i" + jx, "外观缺陷录入N"); jx++;//操作标志
  560. ht.Add("o" + jx, ""); jx = 1;
  561. ccp.ServerName = "QCM.COMMUNAL.ComDBProcedureQCM";
  562. ccp.MethodName = "doXmlProcedure";
  563. ccp.ServerParams = new object[] { "UIB030110_01.CALL", ht };
  564. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  565. ugr.Cells["CRK_TP"].Value = "";
  566. ArrayList all = ccp.ReturnObject as ArrayList;
  567. if (all[0].ToString() != "YY")//确认是否存在问题
  568. {
  569. MessageBox.Show(all[0].ToString(), "提示");
  570. }
  571. }
  572. if (ugr.Cells["EXSHAPE_TP"].Text == "Y")//外观等级
  573. {
  574. jx = 1;
  575. CoreClientParam ccp = new CoreClientParam();
  576. Hashtable ht = new Hashtable();
  577. ht.Add("i" + jx, SLSelected); jx++;//产线
  578. ht.Add("i" + jx, ugr.Cells["COIL_NO"].Text); jx++;//钢卷号
  579. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//试样号
  580. ht.Add("i" + jx, ugr.Cells["SMP_CUT_LOC"].Text); jx++;//位置
  581. // ht.Add("i" + jx, ugr.Cells["COIL_RT"].Text); jx++;//去向
  582. ht.Add("i" + jx, ugr.Cells["CUR_PROG_CD"].Text); jx++;//20190228指定钢卷去向
  583. ht.Add("i" + jx, ugr.Cells["EXTSHAPE_QUALITY"].Text); jx++;//外观等级
  584. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//录入厚度
  585. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//录入宽度
  586. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//温度
  587. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//粗糙度
  588. ht.Add("i" + jx, ugr.Cells["SMP_PICK_YN"].Text); jx++;//是否取样
  589. ht.Add("i" + jx, ugr.Cells["CRK_CD1"].Value.ToString()); jx++;//外观缺陷1
  590. ht.Add("i" + jx, ugr.Cells["CRK_CD1_TYPE"].Text); jx++;
  591. ht.Add("i" + jx, ugr.Cells["CRK_CD2"].Value.ToString()); jx++;
  592. ht.Add("i" + jx, ugr.Cells["CRK_CD2_TYPE"].Text); jx++;
  593. ht.Add("i" + jx, ugr.Cells["CRK_CD3"].Value.ToString()); jx++;
  594. ht.Add("i" + jx, ugr.Cells["CRK_CD3_TYPE"].Text); jx++;
  595. ht.Add("i" + jx, ugr.Cells["CRK_CD4"].Value.ToString()); jx++;
  596. ht.Add("i" + jx, ugr.Cells["CRK_CD4_TYPE"].Text); jx++;
  597. ht.Add("i" + jx, ugr.Cells["CRK_CD5"].Value.ToString()); jx++;//外观缺陷5
  598. ht.Add("i" + jx, ugr.Cells["CRK_CD5_TYPE"].Text); jx++;
  599. ht.Add("i" + jx, this.UserInfo.GetUserName().ToString()); jx++;//操作人
  600. ht.Add("i" + jx, "外观等级录入"); jx++;//操作标志
  601. ht.Add("o" + jx, ""); jx = 1;
  602. ccp.ServerName = "QCM.COMMUNAL.ComDBProcedureQCM";
  603. ccp.MethodName = "doXmlProcedure";
  604. ccp.ServerParams = new object[] { "UIB030110_LTWG.CALL", ht };
  605. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  606. ugr.Cells["EXSHAPE_TP"].Value = "";
  607. ArrayList all = ccp.ReturnObject as ArrayList;
  608. if (all[0].ToString() != "YY")//确认是否存在问题
  609. {
  610. MessageBox.Show(all[0].ToString(), "提示");
  611. }
  612. }
  613. /*if (ugr.Cells["DCS_YP"].Text == "Y")//是否更改公差
  614. {
  615. if ((ugr.Cells["DCS_THK"].Text.ToString() != "") && (ugr.Cells["DCS_WTH"].Text.ToString() != ""))
  616. {
  617. ArrayList list1 = new ArrayList();
  618. List<ArrayList> list2 = new List<ArrayList>();
  619. List<ArrayList> list3 = new List<ArrayList>();
  620. list1.Add(ugr.Cells["ORD_NO"].Value.ToString() + ugr.Cells["ORD_SEQ"].Value.ToString());
  621. list1.Add(ugr.Cells["COIL_NO"].Value.ToString());
  622. list1.Add("");
  623. list1.Add("");
  624. string is_zl = "";
  625. if (comboBox7.Text.ToString() == "正品")
  626. {
  627. is_zl = "512601";
  628. }
  629. else if (comboBox7.Text.ToString() == "次品")
  630. {
  631. is_zl = "512602";
  632. }
  633. else if (comboBox7.Text.ToString() == "废品")
  634. {
  635. is_zl = "512603";
  636. }
  637. else if (comboBox7.Text.ToString() == "协议品")
  638. {
  639. is_zl = "512604";
  640. }
  641. else if (comboBox7.Text.ToString() == "订单外")
  642. {
  643. is_zl = "512605";
  644. }
  645. list1.Add("");
  646. list1.Add(this.UserInfo.GetUserName());
  647. list1.Add(this.UserInfo.GetUserOrderText());
  648. list1.Add(this.UserInfo.GetUserGroupText());
  649. list1.Add(is_zl);//质量等级代码
  650. list1.Add(comboBox7.Text.Trim().ToString());//质量等级名称
  651. ArrayList a3 = new ArrayList();
  652. this.dataSet4.Clear();
  653. string design_key = ugr.Cells["ORD_NO"].Value.ToString() + ugr.Cells["ORD_SEQ"].Value.ToString();
  654. a3.Add("QCM031010_SELECT_01");
  655. a3.Add(design_key);
  656. //string material_no = ugr.Cells["COIL_NO"].Value.ToString();
  657. CoreClientParam ccp = new CoreClientParam();
  658. ccp.ServerName = "QCM.COMMUNAL.ComDBQueryQCM";
  659. ccp.MethodName = "doSimpleQuery";
  660. ccp.ServerParams = new object[] { a3 };
  661. ccp.SourceDataTable = this.dataSet4.Tables[0];
  662. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  663. foreach (System.Data.DataRow row in dataSet4.Tables[0].Rows)
  664. {
  665. if (row["BIAS_CODE"].ToString() == "" || row["BIAS_CODE_2"].ToString() == "")
  666. {
  667. MessageBox.Show(ugr.Cells["COIL_NO"].Value.ToString() + "卷没有判定标准");
  668. return;
  669. }
  670. ArrayList listgc = new ArrayList();
  671. listgc.Add(row["BIAS_CODE"].ToString());
  672. listgc.Add(ugr.Cells["DCS_THK"].Text.ToString());
  673. listgc.Add(row["BIAS_NAME"].ToString());
  674. listgc.Add(ugr.Cells["C_ORD_THK"].Text.ToString());
  675. listgc.Add(ugr.Cells["COIL_THK"].Text.ToString());
  676. list2.Add(listgc);
  677. listgc = new ArrayList();
  678. listgc.Add(row["BIAS_CODE_2"].ToString());
  679. listgc.Add(ugr.Cells["DCS_WTH"].Text.ToString());
  680. listgc.Add(row["BIAS_NAME_2"].ToString());
  681. listgc.Add(ugr.Cells["C_ORD_WTH"].Text.ToString());
  682. listgc.Add(ugr.Cells["COIL_WTH"].Text.ToString());
  683. list2.Add(listgc);
  684. }
  685. dataSet4.Clear();
  686. ArrayList listc1 = new ArrayList();
  687. listc1.Add("传动侧");
  688. listc1.Add(ugr.Cells["THICK_VAL1"].Text.ToString());
  689. listc1.Add(ugr.Cells["H_VAL1"].Value.ToString());
  690. listc1.Add(ugr.Cells["M_VAL1"].Value.ToString());
  691. listc1.Add(ugr.Cells["R_VAL1"].Value.ToString());
  692. list3.Add(listc1);
  693. listc1 = new ArrayList();
  694. listc1.Add("中间");
  695. listc1.Add(ugr.Cells["THICK_VAL2"].Text.ToString());
  696. listc1.Add(ugr.Cells["H_VAL2"].Value.ToString());
  697. listc1.Add(ugr.Cells["M_VAL2"].Value.ToString());
  698. listc1.Add(ugr.Cells["R_VAL2"].Value.ToString());
  699. list3.Add(listc1);
  700. listc1 = new ArrayList();
  701. listc1.Add("操作侧");
  702. listc1.Add(ugr.Cells["THICK_VAL3"].Text.ToString());
  703. listc1.Add(ugr.Cells["H_VAL3"].Value.ToString());
  704. listc1.Add(ugr.Cells["M_VAL3"].Value.ToString());
  705. listc1.Add(ugr.Cells["R_VAL3"].Value.ToString());
  706. list3.Add(listc1);
  707. ccp = new CoreClientParam();
  708. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  709. ccp.MethodName = "judgeByHuman2";
  710. ccp.ServerParams = new object[] { list1, list2, list3 };
  711. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  712. if (ccp.ReturnCode == -1)
  713. {
  714. return;
  715. }
  716. }
  717. else
  718. {
  719. MessageBox.Show("未输入公差判定值,公差判定不成功!");
  720. return;
  721. }
  722. }*/
  723. }
  724. }
  725. MessageBox.Show("保存成功!");
  726. this.ultraGrid1.UpdateData();
  727. this.DoQuery();
  728. }
  729. catch (Exception ex)
  730. {
  731. System.Diagnostics.Debug.WriteLine(ex.ToString());
  732. }
  733. }
  734. //导出
  735. public void DoExport()
  736. {
  737. try
  738. {
  739. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  740. {
  741. string fName = this.saveFileDialog1.FileName;
  742. this.ultraGridExcelExporter1.Export(this.ultraGrid1, fName);
  743. Process.Start(fName);
  744. }
  745. }
  746. catch (Exception ex)
  747. {
  748. System.Diagnostics.Debug.WriteLine(ex.ToString());
  749. }
  750. }
  751. //页面初始化时加载钢卷缺陷
  752. public void initCoilDefect()
  753. {
  754. try
  755. {
  756. //缺陷
  757. ArrayList alt = new ArrayList();
  758. alt.Add("UIB030110_02.SELECT");
  759. //alt.Add("UIB030110_022.SELECT");
  760. this.ultraCombo1Dataset.Tables[0].Clear();
  761. CoreClientParam ccp = new CoreClientParam();
  762. ccp.ServerName = "QCM.COMMUNAL.ComDBQueryQCM";
  763. ccp.MethodName = "doSimpleQuery";
  764. ccp.ServerParams = new object[] { alt };
  765. ccp.SourceDataTable = this.ultraCombo1Dataset.Tables[0];
  766. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  767. //ccp.SourceDataTable = this.ultraCombo1Dataset.Tables[0].Merge(this.ultraCombo1Dataset.Tables[2]);
  768. //进程
  769. alt = new ArrayList();
  770. alt.Add("UIB030110_01.INIT_SELECT");
  771. this.ultraCombo1Dataset.Tables[1].Clear();
  772. ccp = new CoreClientParam();
  773. ccp.ServerName = "QCM.COMMUNAL.ComDBQueryQCM";
  774. ccp.MethodName = "doSimpleQuery";
  775. ccp.ServerParams = new object[] { alt };
  776. ccp.SourceDataTable = this.ultraCombo1Dataset.Tables[0];
  777. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  778. }
  779. catch (Exception ex)
  780. {
  781. System.Diagnostics.Debug.WriteLine(ex.ToString());
  782. }
  783. }
  784. private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
  785. {
  786. try
  787. {
  788. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  789. {
  790. if (ugr.Cells["SMP_DIR_PIC_YN"].Text.Equals("Y") && ugr.Cells["CHK"].Text.ToLower() == "true") //无取样指示则不允许进行取样操作
  791. {
  792. ugr.Cells["SMP_PICK_YN"].Value = this.comboBox1.SelectedItem.ToString();//执行取样操作,或者去除取样标记
  793. ugr.Cells["SMPPICK_TP"].Value = "Y";
  794. }
  795. }
  796. this.ultraGrid1.UpdateData();
  797. }
  798. catch (Exception ex)
  799. {
  800. System.Diagnostics.Debug.WriteLine(ex.ToString());
  801. }
  802. }
  803. private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
  804. {
  805. //取样后,重新去掉取样标记,便于下次取样操作
  806. this.comboBox1.SelectedIndex = 0;
  807. }
  808. private void UIB020310_Load(object sender, EventArgs e)
  809. {
  810. try
  811. {
  812. this.comboBox1.SelectedIndex = 0;
  813. this.comboBox2.SelectedIndex = 0;
  814. // this.comboBox3.SelectedIndex = 0;
  815. this.ultraDateTimeEditor1.Enabled = this.checkBox1.Checked;
  816. this.ultraDateTimeEditor2.Enabled = this.checkBox1.Checked;
  817. this.textBox1.Text = OperateConditionRecode.ReadCondition("UIB030110");
  818. //this.comboBox3.Text = OperateConditionRecode.ReadCondition("UIB030110_1");
  819. this.comboBox3.SelectedIndex = Convert.ToInt32(OperateConditionRecode.ReadCondition("UIB030110_1"));
  820. initCoilDefect();
  821. /*ValueList vsflv1 = new ValueList();
  822. CoreClientParam ccp = new CoreClientParam();
  823. ccp = new CoreClientParam();
  824. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  825. ccp.MethodName = "findSfLv";
  826. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  827. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  828. {
  829. vsflv1.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  830. }
  831. this.comboBox7.DataSource = vsflv1.ValueListItems;*/
  832. this.comboBox7.Text = "正品";
  833. ValueList ponpse_unit = new ValueList();
  834. ponpse_unit.ValueListItems.Add("操作类", "操作类");
  835. ponpse_unit.ValueListItems.Add("设备类", "设备类");
  836. ponpse_unit.ValueListItems.Add("生产计划类", "生产计划类");
  837. ponpse_unit.ValueListItems.Add("工艺类", "工艺类");
  838. ponpse_unit.ValueListItems.Add("其他类", "其他类");
  839. this.ultraGrid1.DisplayLayout.Bands[0].Columns["RSEPON_UNIT"].ValueList = ponpse_unit;
  840. }
  841. catch (Exception ex)
  842. {
  843. MessageBox.Show("初始化异常");
  844. }
  845. }
  846. private void button1_Click(object sender, EventArgs e)
  847. {
  848. try
  849. {
  850. if (comboBox3.Text.ToString() == "连退" || comboBox3.Text.ToString()=="重卷")
  851. {
  852. CUIB030110 CWindow = new CUIB030110();
  853. CWindow.ob = this.ob;
  854. //CWindow.frmdoquery += new CUIB030110.ddd(CWindow_frmdoquery);//委托
  855. if (CWindow.ShowDialog() == DialogResult.OK)
  856. {
  857. int arrayCount = CWindow.al.Count;
  858. //strRepair = CWindow.a2.GetByIndex(0).ToString();
  859. //strPrimary_flag = CWindow.a2.GetByIndex(1).ToString();
  860. //defect_desc = CWindow.a2.GetByIndex(2).ToString();
  861. //strMian = CWindow.a2.GetByIndex(3).ToString();
  862. //strTou = CWindow.a2.GetByIndex(4).ToString();
  863. //strCe = CWindow.a2.GetByIndex(5).ToString();
  864. //strDaxiao = CWindow.a2.GetByIndex(6).ToString();
  865. //strDuoshao = CWindow.a2.GetByIndex(7).ToString();
  866. //strChengdu = CWindow.a2.GetByIndex(8).ToString();
  867. //strMemo = CWindow.a2.GetByIndex(9).ToString();
  868. c = arrayCount;
  869. a = CWindow.a3;
  870. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  871. {
  872. if (ugr.Cells["CHK"].Text.ToLower() == "true")
  873. { //有选中项时,先进行清空。因为有初始选N个,第二次选M个。不清除,当M<N是,会残留N-M个。
  874. ugr.Cells["CRK_CD1"].Value = "";
  875. ugr.Cells["CRK_CD1_TYPE"].Value = "";
  876. ugr.Cells["CRK_CD2"].Value = "";
  877. ugr.Cells["CRK_CD2_TYPE"].Value = "";
  878. ugr.Cells["CRK_CD3"].Value = "";
  879. ugr.Cells["CRK_CD3_TYPE"].Value = "";
  880. ugr.Cells["CRK_CD4"].Value = "";
  881. ugr.Cells["CRK_CD4_TYPE"].Value = "";
  882. ugr.Cells["CRK_CD5"].Value = "";
  883. ugr.Cells["CRK_CD5_TYPE"].Value = "";
  884. for (int i = 0; i < arrayCount; i++)
  885. {
  886. string[] sArray2 = CWindow.al.GetByIndex(i).ToString().Split(new char[] { ';', '【' });
  887. string[] sArray1 = CWindow.a2.GetByIndex(i).ToString().Split(new char[] { ';', '【' });
  888. // MessageBox.Show(CWindow.al[i].ToString() +"---------"+ CWindow.al[i].ToString().Substring(2));
  889. ugr.Cells["CRK_CD" + Convert.ToString((i + 1))].Value = sArray1[1];
  890. //string s1 = ugr.Cells["CRK_CD1"].Value.ToString();
  891. //int t = ugr.Cells["CRK_CD" + Convert.ToString((i + 1))].Value.ToString().Length;
  892. ugr.Cells["CRK_CD" + Convert.ToString((i + 1)) + "_TYPE"].Value = CWindow.al.GetByIndex(i).ToString() + CWindow.a2.GetByIndex(i).ToString();
  893. }
  894. ugr.Cells["CRK_TP"].Value = "Y";
  895. }
  896. }
  897. }
  898. CWindow.Dispose();
  899. this.ultraGrid1.UpdateData();
  900. }
  901. else if (comboBox3.Text.ToString() == "酸轧")
  902. {
  903. CUIB030110SZ CWindow = new CUIB030110SZ();
  904. CWindow.ob = this.ob;
  905. //CWindow.frmdoquery += new CUIB030110.ddd(CWindow_frmdoquery);//委托
  906. if (CWindow.ShowDialog() == DialogResult.OK)
  907. {
  908. int arrayCount = CWindow.al.Count;
  909. //strRepair = CWindow.a2.GetByIndex(0).ToString();
  910. //strPrimary_flag = CWindow.a2.GetByIndex(1).ToString();
  911. //defect_desc = CWindow.a2.GetByIndex(2).ToString();
  912. //strMian = CWindow.a2.GetByIndex(3).ToString();
  913. //strTou = CWindow.a2.GetByIndex(4).ToString();
  914. //strCe = CWindow.a2.GetByIndex(5).ToString();
  915. //strDaxiao = CWindow.a2.GetByIndex(6).ToString();
  916. //strDuoshao = CWindow.a2.GetByIndex(7).ToString();
  917. //strChengdu = CWindow.a2.GetByIndex(8).ToString();
  918. //strMemo = CWindow.a2.GetByIndex(9).ToString();
  919. c = arrayCount;
  920. a = CWindow.a3;
  921. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  922. {
  923. if (ugr.Cells["CHK"].Text.ToLower() == "true")
  924. { //有选中项时,先进行清空。因为有初始选N个,第二次选M个。不清除,当M<N是,会残留N-M个。
  925. ugr.Cells["CRK_CD1"].Value = "";
  926. ugr.Cells["CRK_CD1_TYPE"].Value = "";
  927. ugr.Cells["CRK_CD2"].Value = "";
  928. ugr.Cells["CRK_CD2_TYPE"].Value = "";
  929. ugr.Cells["CRK_CD3"].Value = "";
  930. ugr.Cells["CRK_CD3_TYPE"].Value = "";
  931. ugr.Cells["CRK_CD4"].Value = "";
  932. ugr.Cells["CRK_CD4_TYPE"].Value = "";
  933. ugr.Cells["CRK_CD5"].Value = "";
  934. ugr.Cells["CRK_CD5_TYPE"].Value = "";
  935. for (int i = 0; i < arrayCount; i++)
  936. {
  937. string[] sArray2 = CWindow.al.GetByIndex(i).ToString().Split(new char[] { ';', '【' });
  938. string[] sArray1 = CWindow.a2.GetByIndex(i).ToString().Split(new char[] { ';', '【' });
  939. // MessageBox.Show(CWindow.al[i].ToString() +"---------"+ CWindow.al[i].ToString().Substring(2));
  940. ugr.Cells["CRK_CD" + Convert.ToString((i + 1))].Value = sArray1[1];
  941. ugr.Cells["CRK_CD" + Convert.ToString((i + 1)) + "_TYPE"].Value = CWindow.al.GetByIndex(i).ToString() + CWindow.a2.GetByIndex(i).ToString();
  942. string[] sArray = ugr.Cells["CRK_CD" + Convert.ToString((i + 1)) + "_TYPE"].Value.ToString().Split(new char[] { ';', '【', '】' });
  943. }
  944. ugr.Cells["CRK_TP"].Value = "Y";
  945. }
  946. }
  947. }
  948. CWindow.Dispose();
  949. this.ultraGrid1.UpdateData();
  950. }
  951. }
  952. catch (Exception ex)
  953. {
  954. System.Diagnostics.Debug.WriteLine(ex.ToString());
  955. }
  956. }
  957. //委托,暂未使用
  958. void CWindow_frmdoquery()
  959. {
  960. try
  961. {
  962. }
  963. catch (Exception ex)
  964. {
  965. MessageBox.Show(ex.ToString());
  966. }
  967. }
  968. private void ultraCombo1_InitializeLayout(object sender, InitializeLayoutEventArgs e)
  969. {
  970. }
  971. private void button2_Click(object sender, EventArgs e)
  972. {
  973. try
  974. {
  975. CUIB030110SP childCib02 = new CUIB030110SP();
  976. childCib02.ob = this.ob;
  977. if (childCib02.ShowDialog() == DialogResult.OK)
  978. {
  979. }
  980. childCib02.Close();
  981. }
  982. catch (Exception ex)
  983. {
  984. System.Diagnostics.Debug.WriteLine(ex.ToString());
  985. }
  986. }
  987. //回车保存返修温度、粗糙度、判定厚度、判定宽度
  988. private void ultraGrid1_KeyDown_1(object sender, KeyEventArgs e)
  989. {
  990. try
  991. {
  992. //if (SLSelected == "酸轧")
  993. // return;
  994. if (e.KeyCode != Keys.Enter)
  995. return; //只对回车事件操作
  996. if (this.ultraGrid1.ActiveCell.Column.Key != "DCS_THK"//只对判定厚度、返修温度、判定宽度操作
  997. && this.ultraGrid1.ActiveCell.Column.Key != "DCS_WTH"
  998. && this.ultraGrid1.ActiveCell.Column.Key != "CAL_TYPE_TEMP"
  999. && this.ultraGrid1.ActiveCell.Column.Key != "CU_CAO_DU"
  1000. && this.ultraGrid1.ActiveCell.Column.Key != "YUAN_COIL_THK"
  1001. && this.ultraGrid1.ActiveCell.Column.Key != "YUAN_COIL_WTH"
  1002. && this.ultraGrid1.ActiveCell.Column.Key != "RSEPON_UNIT"
  1003. && this.ultraGrid1.ActiveCell.Column.Key != "DETAINFO"
  1004. )
  1005. return;
  1006. if (this.ultraGrid1.ActiveCell.DataChanged == false) return;//无数据变更时不做修改操作
  1007. if (this.ultraGrid1.ActiveCell.Column.Key == "DCS_THK"//只对判定厚度、返修温度、判定宽度操作
  1008. || this.ultraGrid1.ActiveCell.Column.Key == "DCS_WTH"
  1009. || this.ultraGrid1.ActiveCell.Column.Key == "CAL_TYPE_TEMP"
  1010. || this.ultraGrid1.ActiveCell.Column.Key == "CU_CAO_DU"
  1011. || this.ultraGrid1.ActiveCell.Column.Key == "YUAN_COIL_THK"
  1012. || this.ultraGrid1.ActiveCell.Column.Key == "YUAN_COIL_WTH")
  1013. {
  1014. jx = 1;
  1015. CoreClientParam ccp = new CoreClientParam();
  1016. Hashtable ht = new Hashtable();
  1017. ht.Add("i" + jx, SLSelected); jx++;//产线
  1018. ht.Add("i" + jx, this.ultraGrid1.ActiveRow.Cells["COIL_NO"].Text); jx++;//钢卷号
  1019. ht.Add("i" + jx, ""); jx++;//试样号
  1020. ht.Add("i" + jx, ""); jx++;//位置
  1021. ht.Add("i" + jx, ""); jx++;//去向
  1022. ht.Add("i" + jx, ""); jx++;//外观等级
  1023. ht.Add("i" + jx, this.ultraGrid1.ActiveRow.Cells["DCS_THK"].Text); jx++;//录入厚度
  1024. ht.Add("i" + jx, this.ultraGrid1.ActiveRow.Cells["DCS_WTH"].Text); jx++;//录入宽度
  1025. ht.Add("i" + jx, this.ultraGrid1.ActiveRow.Cells["CAL_TYPE_TEMP"].Text); jx++;//温度
  1026. ht.Add("i" + jx, this.ultraGrid1.ActiveRow.Cells["CU_CAO_DU"].Text); jx++;//粗糙度
  1027. ht.Add("i" + jx, ""); jx++;//是否取样
  1028. ht.Add("i" + jx, ""); jx++;//外观缺陷1
  1029. ht.Add("i" + jx, ""); jx++;
  1030. ht.Add("i" + jx, ""); jx++;
  1031. ht.Add("i" + jx, ""); jx++;
  1032. ht.Add("i" + jx, ""); jx++;
  1033. ht.Add("i" + jx, ""); jx++;
  1034. ht.Add("i" + jx, ""); jx++;
  1035. ht.Add("i" + jx, ""); jx++;
  1036. ht.Add("i" + jx, ""); jx++;//外观缺陷5
  1037. ht.Add("i" + jx, ""); jx++;
  1038. ht.Add("i" + jx, this.UserInfo.GetUserName().ToString()); jx++;//操作人
  1039. ht.Add("i" + jx, "判定规格录入"); jx++;//操作标志
  1040. ht.Add("o" + jx, ""); jx = 1;
  1041. ccp.ServerName = "QCM.COMMUNAL.ComDBProcedureQCM";
  1042. ccp.MethodName = "doXmlProcedure";
  1043. ccp.ServerParams = new object[] { "UIB030110_01.CALL", ht };
  1044. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1045. ArrayList all = ccp.ReturnObject as ArrayList;
  1046. if (all[0].ToString() != "YY")//确认是否存在问题
  1047. {
  1048. MessageBox.Show(all[0].ToString(), "提示");
  1049. }
  1050. int currentColIndex = this.ultraGrid1.ActiveCell.Column.Index;//换行前获取当前列的列序号
  1051. //取消录入判定宽度值覆盖原来的机器测量宽度实绩值
  1052. //this.ultraGrid1.ActiveRow.Cells["COIL_WTH"].Value = this.ultraGrid1.ActiveRow.Cells["DCS_WTH"].Text;////////
  1053. //判断人工录入判定值与机器测量实际值之差,若≥10则显示红色
  1054. string COILWTH = this.ultraGrid1.ActiveRow.Cells["COIL_WTH"].Text;
  1055. string DCSWTH = this.ultraGrid1.ActiveRow.Cells["DCS_WTH"].Text;
  1056. if (COILWTH != null && COILWTH != "" && DCSWTH != null && DCSWTH != "")
  1057. {
  1058. double chazhi = double.Parse(DCSWTH) - double.Parse(COILWTH);
  1059. if (System.Math.Abs(chazhi) >= 10)
  1060. {
  1061. this.ultraGrid1.ActiveRow.Cells["COIL_WTH"].Appearance.BackColor = Color.Red;
  1062. this.ultraGrid1.ActiveRow.Cells["DCS_WTH"].Appearance.BackColor = Color.Red;
  1063. }
  1064. else
  1065. {
  1066. this.ultraGrid1.ActiveRow.Cells["COIL_WTH"].Appearance.BackColor = Color.White;
  1067. this.ultraGrid1.ActiveRow.Cells["DCS_WTH"].Appearance.BackColor = Color.FromArgb(255, 255, 128); //黄色
  1068. }
  1069. }
  1070. else
  1071. {
  1072. this.ultraGrid1.ActiveRow.Cells["COIL_WTH"].Appearance.BackColor = Color.White;
  1073. this.ultraGrid1.ActiveRow.Cells["DCS_WTH"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
  1074. }
  1075. //判断人工录入厚度判定值与机器测量厚度实际值之差,若≥0.01则显示红色
  1076. string COILTHK = this.ultraGrid1.ActiveRow.Cells["COIL_THK"].Text;
  1077. string DCSTHK = this.ultraGrid1.ActiveRow.Cells["DCS_THK"].Text;
  1078. if (COILTHK != null && COILTHK != "" && DCSTHK != null && DCSTHK != "")
  1079. {
  1080. double chazhi = double.Parse(DCSTHK) - double.Parse(COILTHK);
  1081. if (System.Math.Abs(chazhi) >= 0.01)
  1082. {
  1083. this.ultraGrid1.ActiveRow.Cells["COIL_THK"].Appearance.BackColor = Color.Red;
  1084. this.ultraGrid1.ActiveRow.Cells["DCS_THK"].Appearance.BackColor = Color.Red;
  1085. }
  1086. else
  1087. {
  1088. this.ultraGrid1.ActiveRow.Cells["COIL_THK"].Appearance.BackColor = Color.White;
  1089. this.ultraGrid1.ActiveRow.Cells["DCS_THK"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
  1090. }
  1091. }
  1092. else
  1093. {
  1094. this.ultraGrid1.ActiveRow.Cells["COIL_THK"].Appearance.BackColor = Color.White;
  1095. this.ultraGrid1.ActiveRow.Cells["DCS_THK"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
  1096. }
  1097. //换行并使其可编辑
  1098. this.ultraGrid1.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.NextRow);
  1099. this.ultraGrid1.ActiveRow.Cells[currentColIndex].Activate();
  1100. this.ultraGrid1.PerformAction(UltraGridAction.EnterEditMode);
  1101. }
  1102. if(this.ultraGrid1.ActiveCell.Column.Key == "RSEPON_UNIT"
  1103. || this.ultraGrid1.ActiveCell.Column.Key == "DETAINFO")
  1104. {
  1105. int jx;
  1106. jx = 1;
  1107. CoreClientParam ccp = new CoreClientParam();
  1108. Hashtable ht = new Hashtable();
  1109. ht.Add("i" + jx, this.ultraGrid1.ActiveRow.Cells["COIL_NO"].Text.ToString()); jx++; //钢卷号
  1110. ht.Add("i" + jx, this.ultraGrid1.ActiveRow.Cells["RSEPON_UNIT"].Text.ToString()); jx++; //责任单位
  1111. ht.Add("i" + jx, this.UserInfo.GetUserName().ToString()); jx++; //录入人
  1112. ht.Add("i" + jx, this.ultraGrid1.ActiveRow.Cells["DETAINFO"].Text.ToString()); jx++; //详细信息
  1113. ht.Add("i" + jx, "1"); jx++; //缺陷5
  1114. ht.Add("i" + jx, "1"); jx++; //缺陷5
  1115. //ht.Add("i" + jx, ugr.Cells["QUEXIAN_TP"].Value.ToString()); jx++; //缺陷来源次
  1116. ht.Add("i" + jx, "卷板责任归属单位"); jx++;//操作标志
  1117. ht.Add("o" + jx, ""); jx = 1;
  1118. ccp.ServerName = "QCM.COMMUNAL.ComDBProcedureQCM";
  1119. ccp.MethodName = "doXmlProcedure";
  1120. ccp.ServerParams = new object[] { "UIB030110_RZQXLR.CALL", ht };
  1121. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1122. ArrayList all = ccp.ReturnObject as ArrayList;
  1123. if (all[0].ToString() != "YY")//确认是否存在问题
  1124. {
  1125. MessageBox.Show(all[0].ToString(), "提示");
  1126. return;
  1127. }
  1128. MessageBox.Show("责任归属单位录入成功");
  1129. }
  1130. }
  1131. catch (Exception ex)
  1132. {
  1133. MessageBox.Show(ex.ToString());
  1134. System.Diagnostics.Debug.WriteLine(ex.ToString());
  1135. }
  1136. }
  1137. //private void ultraGrid1_MouseDown(object sender, MouseEventArgs e)
  1138. //{
  1139. // try
  1140. // {
  1141. // if (this.ultraGrid1.ActiveCell.Column.Key == "ORD_NO")//链接到品质设计结果查询
  1142. // {
  1143. // UIB010301 frm = new UIB010301();
  1144. // frm.ob = this.ob;
  1145. // frm.OrderNO = this.ultraGrid1.ActiveRow.Cells["ORD_NO"].Text;
  1146. // frm.OrderSEQ = this.ultraGrid1.ActiveRow.Cells["ORD_SEQ"].Text;
  1147. // frm.ShowDialog();
  1148. // this.ultraGrid1.ActiveRow.Cells["SPEC_ABBSYM"].Activate();//换焦点
  1149. // }
  1150. // else if (this.ultraGrid1.ActiveCell.Column.Key == "COIL_NO")
  1151. // {
  1152. // this.dataSet2.Tables[0].Clear();
  1153. // if (this.ultraGrid1.ActiveRow.Cells["SMP_NO"].Text != "")
  1154. // {
  1155. // ArrayList al = new ArrayList();
  1156. // al.Add("UIB030110_03.SELECT");
  1157. // al.Add(this.ultraGrid1.ActiveRow.Cells["SMP_NO"].Text);
  1158. // al.Add(this.ultraGrid1.ActiveRow.Cells["SMP_CUT_LOC"].Text);
  1159. // this.dataSet2.Tables[0].Clear();
  1160. // CoreClientParam ccp = new CoreClientParam();
  1161. // ccp.ServerName = "UIB.COM.ComDBQuery";
  1162. // ccp.MethodName = "doSimpleQuery";
  1163. // ccp.ServerParams = new object[] { al };
  1164. // ccp.SourceDataTable = this.dataSet2.Tables[0];
  1165. // this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  1166. // }
  1167. // //this.ultraGrid1.ActiveRow.Cells["SPEC_ABBSYM"].Activate();//换焦点
  1168. // }
  1169. // }
  1170. // catch (Exception ex)
  1171. // {
  1172. // System.Diagnostics.Debug.WriteLine(ex.ToString());
  1173. // }
  1174. //}
  1175. private void textBox1_KeyDown(object sender, KeyEventArgs e)
  1176. {
  1177. try
  1178. {
  1179. if (e.KeyCode != Keys.Enter)
  1180. return; //只对回车事件操作
  1181. this.DoQuery();
  1182. }
  1183. catch (Exception ex)
  1184. {
  1185. System.Diagnostics.Debug.WriteLine(ex.ToString());
  1186. }
  1187. }
  1188. private void checkBox1_Click(object sender, EventArgs e)
  1189. {
  1190. this.ultraDateTimeEditor1.Enabled = this.checkBox1.Checked;
  1191. this.ultraDateTimeEditor2.Enabled = this.checkBox1.Checked;
  1192. }
  1193. private void ultraComboEditor1_SelectionChanged_1(object sender, EventArgs e)
  1194. {
  1195. try
  1196. {
  1197. object chk_ex = ultraComboEditor1.Value;
  1198. if (this.ultraGrid1.ActiveRow == null || chk_ex == null) return;
  1199. string chek_exs = chk_ex.ToString();
  1200. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  1201. {
  1202. if (ugr.Cells["CHK"].Text.ToLower() == "true")
  1203. {
  1204. string sz_exp = ugr.Cells["EXTSHAPE_QUALITY_S"].Text;
  1205. if (this.comboBox3.Text == "连退")
  1206. {
  1207. //与酸轧的外观等级进行比较是否一致,不一致则弹出提示
  1208. if (!sz_exp.Equals(chek_exs))
  1209. {
  1210. if (MessageBox.Show("所选外观等级与酸轧的外观等级不一致,确定要继续吗?", "确认提示", MessageBoxButtons.OKCancel) == DialogResult.OK)
  1211. {
  1212. ugr.Cells["EXSHAPE_TP"].Value = "Y";//表做了外观判定
  1213. ugr.Cells["EXTSHAPE_QUALITY"].Value = chek_exs;
  1214. }
  1215. }
  1216. else
  1217. {
  1218. ugr.Cells["EXSHAPE_TP"].Value = "Y";//表做了外观判定
  1219. ugr.Cells["EXTSHAPE_QUALITY"].Value = chek_exs;
  1220. }
  1221. }
  1222. else if (this.comboBox3.Text == "重卷")
  1223. {
  1224. string lt_exp = ugr.Cells["EXTSHAPE_QUALITY_L"].Text;
  1225. if (sz_exp.Equals(chek_exs) && lt_exp.Equals(chek_exs))
  1226. {
  1227. ugr.Cells["EXSHAPE_TP"].Value = "Y";//表做了外观判定
  1228. ugr.Cells["EXTSHAPE_QUALITY"].Value = chek_exs;
  1229. }
  1230. else
  1231. {
  1232. if (MessageBox.Show("所选外观等级与酸轧或连退的外观等级不一致,确定要继续吗?", "确认提示", MessageBoxButtons.OKCancel) == DialogResult.OK)
  1233. {
  1234. ugr.Cells["EXSHAPE_TP"].Value = "Y";//表做了外观判定
  1235. ugr.Cells["EXTSHAPE_QUALITY"].Value = chek_exs;
  1236. }
  1237. }
  1238. }
  1239. else
  1240. {
  1241. ugr.Cells["EXSHAPE_TP"].Value = "Y";//表做了外观判定
  1242. ugr.Cells["EXTSHAPE_QUALITY"].Value = chek_exs;
  1243. }
  1244. }
  1245. }
  1246. this.ultraGrid1.UpdateData();
  1247. }
  1248. catch (Exception ex)
  1249. {
  1250. System.Diagnostics.Debug.WriteLine(ex.ToString());
  1251. }
  1252. }
  1253. private void ultraGrid1_Click(object sender, EventArgs e)
  1254. {
  1255. }
  1256. //返修或降级处理
  1257. private void comboBox4_SelectedIndexChanged(object sender, EventArgs e)
  1258. {
  1259. try
  1260. {
  1261. string MES = "";
  1262. if (this.comboBox4.Text == "返修" || this.comboBox4.Text == "过渡")
  1263. {
  1264. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  1265. {
  1266. if (Convert.ToBoolean(ugr.Cells["CHK"].Value))
  1267. {
  1268. MES += string.Format(ugr.Cells["COIL_NO"].Value.ToString()+":");
  1269. if (ugr.Cells["COIL_THK"].Value.ToString() == "0")
  1270. MES += string.Format("厚度为0");
  1271. if (ugr.Cells["COIL_WTH"].Value.ToString() == "0")
  1272. MES += string.Format("宽度为0");
  1273. if (ugr.Cells["WGT_DEC_RST"].Value.ToString() == "")
  1274. MES += string.Format("重量未判");
  1275. if (ugr.Cells["EXTSHAPE_DEC_GRD"].Value.ToString() == "")
  1276. MES += string.Format("外观未判");
  1277. if (ugr.Cells["COIL_THK"].Value.ToString() != "0" && ugr.Cells["COIL_WTH"].Value.ToString() != "0"
  1278. && ugr.Cells["WGT_DEC_RST"].Value.ToString() != "" && ugr.Cells["EXTSHAPE_DEC_GRD"].Value.ToString() != "")
  1279. MES += string.Format("可以判过渡/返修");
  1280. MES += string.Format("\r\n");
  1281. }
  1282. }
  1283. if (MessageBox.Show(MES, "提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
  1284. return;
  1285. }
  1286. if (MessageBox.Show("确定执行该操作?", "提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
  1287. return;
  1288. if ((SLSelected == "酸轧")||(SLSelected == "酸洗"))//连退才有返修操作
  1289. {
  1290. if (this.comboBox4.Text == "封闭" || this.comboBox4.Text == "取消封闭"
  1291. || this.comboBox4.Text == "返修" || this.comboBox4.Text == "取消返修"
  1292. || this.comboBox4.Text == "过渡" || this.comboBox4.Text == "取消过渡")
  1293. {
  1294. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  1295. {
  1296. if (Convert.ToBoolean(ugr.Cells["CHK"].Value))
  1297. {
  1298. if (this.comboBox4.Text == "封闭")
  1299. {
  1300. object prog_cd = ugr.Cells["CUR_PROG_CD"].Value;
  1301. if (prog_cd != null && (prog_cd.ToString() == "运送待机" || prog_cd.ToString() == "运送完成" || prog_cd.ToString() == "DFB"
  1302. || prog_cd.ToString() == "DFF" || prog_cd.ToString() == "SFB" || prog_cd.ToString() == "SFF"))
  1303. {
  1304. MessageBox.Show("运送待机或运送完成的钢卷不能做封闭操作!", "提示");
  1305. return;
  1306. }
  1307. }
  1308. ugr.Cells["FB_YN"].Value = this.comboBox4.Text;
  1309. CoreClientParam ccp = new CoreClientParam();
  1310. Hashtable ht = new Hashtable();
  1311. ht.Add("i1", ugr.Cells["COIL_NO"].Text);
  1312. ht.Add("i2", this.comboBox4.Text);
  1313. ht.Add("i3", this.textBox4.Text);
  1314. ht.Add("i4", this.UserInfo.GetUserName().ToString());
  1315. ht.Add("o5", "");
  1316. ccp.ServerName = "QCM.COMMUNAL.ComDBProcedureQCM";
  1317. ccp.MethodName = "doXmlProcedure";
  1318. ccp.ServerParams = new object[] { "UIB030110_01_SUAN.CALL", ht };
  1319. CoreClientParam rccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1320. ArrayList all = rccp.ReturnObject as ArrayList;
  1321. if (all[0].ToString() != "YY")//确认是否存在问题
  1322. {
  1323. MessageBox.Show(all[0].ToString(), "提示");
  1324. }
  1325. }
  1326. }
  1327. }
  1328. return;
  1329. }
  1330. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  1331. {
  1332. if (Convert.ToBoolean(ugr.Cells["CHK"].Value))
  1333. {
  1334. if (this.comboBox4.Text == "封闭")
  1335. {
  1336. object prog_cd = ugr.Cells["CUR_PROG_CD"].Value;
  1337. if (prog_cd != null && (prog_cd.ToString() == "运送待机" || prog_cd.ToString() == "运送完成" || prog_cd.ToString() == "DFB"
  1338. || prog_cd.ToString() == "DFF" || prog_cd.ToString() == "SFB" || prog_cd.ToString() == "SFF"))
  1339. {
  1340. MessageBox.Show("运送待机或运送完成的钢卷不能做封闭操作!", "提示");
  1341. return;
  1342. }
  1343. }
  1344. if (this.comboBox4.Text == "" || this.comboBox4.Text == "返修")
  1345. {
  1346. ugr.Cells["FAN_XIU"].Value = this.comboBox4.Text;
  1347. }
  1348. else
  1349. {
  1350. ugr.Cells["RCAL_CNT"].Value = this.comboBox4.Text;
  1351. }
  1352. CoreClientParam ccp = new CoreClientParam();
  1353. Hashtable ht = new Hashtable();
  1354. ht.Add("i1", ugr.Cells["COIL_NO"].Text);
  1355. ht.Add("i2", this.comboBox4.Text);
  1356. ht.Add("i3", this.textBox4.Text);
  1357. ht.Add("i4", this.UserInfo.GetUserName().ToString());
  1358. ht.Add("o5", "");
  1359. ccp.ServerName = "QCM.COMMUNAL.ComDBProcedureQCM";
  1360. ccp.MethodName = "doXmlProcedure";
  1361. ccp.ServerParams = new object[] { "UIB030110_01_LIAN.CALL", ht };
  1362. CoreClientParam rccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1363. ArrayList all = rccp.ReturnObject as ArrayList;
  1364. if (all[0].ToString() != "YY")//确认是否存在问题
  1365. {
  1366. MessageBox.Show(all[0].ToString(), "提示");
  1367. }
  1368. }
  1369. }
  1370. this.DoQuery();
  1371. }
  1372. catch (Exception ex)
  1373. {
  1374. MessageBox.Show("系统发生错误", "提示");
  1375. }
  1376. }
  1377. private void comboBox5_SelectedIndexChanged(object sender, EventArgs e)
  1378. {
  1379. try
  1380. {
  1381. //foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  1382. //{
  1383. // if (ugr.Cells["CHK"].Text.ToLower() == "true") //无取样指示则不允许进行取样操作
  1384. // {
  1385. // ugr.Cells["COIL_RT"].Value = this.comboBox5.SelectedItem.ToString();//执行取样操作,或者去除取样标记
  1386. // ugr.Cells["EXSHAPE_TP"].Value = "Y";//与外观判定的更新放在一起
  1387. // }
  1388. //}
  1389. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  1390. {
  1391. if (ugr.Cells["CHK"].Text.ToLower() == "true") //无取样指示则不允许进行取样操作
  1392. {
  1393. ugr.Cells["CUR_PROG_CD"].Value = this.comboBox6.SelectedItem.ToString();//执行取样操作,或者去除取样标记
  1394. ugr.Cells["EXSHAPE_TP"].Value = "Y";//与外观判定的更新放在一起
  1395. }
  1396. }
  1397. this.ultraGrid1.UpdateData();
  1398. }
  1399. catch (Exception ex)
  1400. {
  1401. System.Diagnostics.Debug.WriteLine(ex.ToString());
  1402. }
  1403. }
  1404. private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
  1405. {
  1406. UltraGridBand band = this.ultraGrid1.DisplayLayout.Bands[0];
  1407. if (comboBox2.SelectedItem.ToString() == "全部"){
  1408. band.ColumnFilters["FB_YN"].ClearFilterConditions();
  1409. band.ColumnFilters["EXTSHAPE_DEC_GRD"].ClearFilterConditions();
  1410. band.ColumnFilters["SMP_DIR_PIC_YN"].ClearFilterConditions();
  1411. band.ColumnFilters["SMP_PICK_YN"].ClearFilterConditions();
  1412. }
  1413. else if (comboBox2.SelectedItem.ToString() == "封闭卷")
  1414. {
  1415. band.ColumnFilters["FB_YN"].ClearFilterConditions();
  1416. band.ColumnFilters["EXTSHAPE_DEC_GRD"].ClearFilterConditions();
  1417. band.ColumnFilters["SMP_DIR_PIC_YN"].ClearFilterConditions();
  1418. band.ColumnFilters["SMP_PICK_YN"].ClearFilterConditions();
  1419. band.ColumnFilters["FB_YN"].FilterConditions.Add(FilterComparisionOperator.Equals, "Y");
  1420. }
  1421. else if (comboBox2.SelectedItem.ToString() == "待判卷")
  1422. {
  1423. band.ColumnFilters["FB_YN"].ClearFilterConditions();
  1424. band.ColumnFilters["EXTSHAPE_DEC_GRD"].ClearFilterConditions();
  1425. band.ColumnFilters["SMP_DIR_PIC_YN"].ClearFilterConditions();
  1426. band.ColumnFilters["SMP_PICK_YN"].ClearFilterConditions();
  1427. band.ColumnFilters["EXTSHAPE_DEC_GRD"].FilterConditions.Add(FilterComparisionOperator.NotEquals,1);
  1428. band.ColumnFilters["EXTSHAPE_DEC_GRD"].FilterConditions.Add(FilterComparisionOperator.NotEquals, 2);
  1429. }
  1430. else if (comboBox2.SelectedItem.ToString() == "未取样卷")
  1431. {
  1432. band.ColumnFilters["FB_YN"].ClearFilterConditions();
  1433. band.ColumnFilters["EXTSHAPE_DEC_GRD"].ClearFilterConditions();
  1434. band.ColumnFilters["SMP_DIR_PIC_YN"].ClearFilterConditions();
  1435. band.ColumnFilters["SMP_PICK_YN"].ClearFilterConditions();
  1436. band.ColumnFilters["SMP_DIR_PIC_YN"].FilterConditions.Add(FilterComparisionOperator.Equals, "Y");
  1437. band.ColumnFilters["SMP_PICK_YN"].FilterConditions.Add(FilterComparisionOperator.NotEquals, "Y");
  1438. }
  1439. }
  1440. private void comboBox6_SelectedIndexChanged(object sender, EventArgs e)
  1441. {
  1442. try
  1443. {
  1444. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  1445. {
  1446. if (ugr.Cells["CHK"].Text.ToLower() == "true") //无取样指示则不允许进行取样操作
  1447. {
  1448. ugr.Cells["CUR_PROG_CD"].Value = this.comboBox6.SelectedItem.ToString();//执行取样操作,或者去除取样标记
  1449. ugr.Cells["EXSHAPE_TP"].Value = "Y";//与外观判定的更新放在一起
  1450. }
  1451. }
  1452. this.ultraGrid1.UpdateData();
  1453. }
  1454. catch (Exception ex)
  1455. {
  1456. System.Diagnostics.Debug.WriteLine(ex.ToString());
  1457. }
  1458. }
  1459. private void button3_Click(object sender, EventArgs e)
  1460. {
  1461. }
  1462. private void ultraGrid1_InitializeLayout(object sender, InitializeLayoutEventArgs e)
  1463. {
  1464. }
  1465. private void button4_Click_1(object sender, EventArgs e)
  1466. {
  1467. try
  1468. {
  1469. foreach (UltraGridRow ugr in ultraGrid1.Rows)
  1470. {
  1471. if (ugr.Cells["CHK"].Text.ToString() == "True")
  1472. {
  1473. ArrayList list1 = new ArrayList();
  1474. List<ArrayList> list2 = new List<ArrayList>();
  1475. string is_pass = "";
  1476. string is_zl1 = "";
  1477. list1.Add(ugr.Cells["COIL_NO"].Value.ToString());
  1478. list1.Add("");//检验结果代码
  1479. list1.Add("");//检验结果
  1480. list1.Add(ugr.Cells["EXTSHAPE_QUALITY"].Text.Trim().ToString());//质量等级代码
  1481. list1.Add(ugr.Cells["EXTSHAPE_QUALITY"].Text.Trim().ToString());//质量等级名称
  1482. list1.Add("");
  1483. list1.Add(this.UserInfo.GetUserName());//操作人
  1484. list1.Add(this.UserInfo.GetUserOrderText());//班次
  1485. list1.Add(this.UserInfo.GetUserGroupText());//班组
  1486. if (ugr.Cells["MAOCI"].Text.Trim().ToString()!="")
  1487. {
  1488. list1.Add(ugr.Cells["MAOCI"].Text.Trim().ToString());//边部毛刺
  1489. }
  1490. else
  1491. {
  1492. list1.Add(this.comboBox8.Text.ToString());//边部毛刺
  1493. }
  1494. int count1 = 0;
  1495. int i = 0;
  1496. for (int c1 = 0; c1 < 5; c1++)
  1497. {
  1498. // MessageBox.Show(CWindow.al[i].ToString() +"---------"+ CWindow.al[i].ToString().Substring(2));
  1499. if (ugr.Cells["CRK_CD" + Convert.ToString((c1 + 1)) + "_TYPE"].Text.ToString() != ""&&ugr.Cells["CRK_TP"].Text == "Y")
  1500. {
  1501. string[] sArray = ugr.Cells["CRK_CD" + Convert.ToString((c1 + 1)) + "_TYPE"].Value.ToString().Split(new char[] { ';', '【', '】' });
  1502. string strQxly = sArray[0];
  1503. string defect_desc = ugr.Cells["CRK_CD" + Convert.ToString((c1 + 1))].Text.ToString();
  1504. string strRepair = sArray[7];
  1505. string strPrimary_flag = sArray[8];
  1506. string strMian = sArray[1];
  1507. string strTou = sArray[2];
  1508. string strCe = sArray[3];
  1509. string strDaxiao = sArray[4];
  1510. string strDuoshao = sArray[5];
  1511. string strChengdu = sArray[6];
  1512. string strMemo = sArray[10];
  1513. string defect_descval = sArray[12];
  1514. string strRepairval = sArray[13];
  1515. string strPrimary_flagval = sArray[14];
  1516. string strMianval = sArray[15];
  1517. string strCeval = sArray[17];
  1518. string strTouval = sArray[16];
  1519. string strDaxiaoval = sArray[18];
  1520. string strDuoshaoval = sArray[19];
  1521. string strChengduval = sArray[20];
  1522. string strMemoval = sArray[21];
  1523. // string[] sArray = ugr.Cells["CRK_CD" + Convert.ToString((c1 + 1)) + "_TYPE"].Text.ToString().Split(';');
  1524. // defect_desc = sArray[0];
  1525. // strRepair = sArray[1];
  1526. // strPrimary_flag = sArray[2];
  1527. // strMian = sArray[3];
  1528. // strTou = sArray[4];
  1529. // strCe = sArray[5];
  1530. // strDaxiao = sArray[6];
  1531. // strDuoshao = sArray[7];
  1532. // strChengdu = sArray[8];
  1533. // strMemo = sArray[9];
  1534. // defect_descval = sArray[10];
  1535. // strRepairval = sArray[11];
  1536. // strPrimary_flagval = sArray[12];
  1537. // strMianval = sArray[13];
  1538. // strCeval = sArray[15];
  1539. // strTouval = sArray[14];
  1540. // strDaxiaoval = sArray[16];
  1541. // strDuoshaoval = sArray[17];
  1542. // strChengduval = sArray[18];
  1543. // strMemoval = sArray[19];
  1544. // strQxly = sArray[20];
  1545. ArrayList list = new ArrayList();
  1546. if (strPrimary_flag == "")
  1547. {
  1548. list.Add(strPrimary_flag);
  1549. }
  1550. else
  1551. {
  1552. list.Add(strPrimary_flagval);
  1553. }
  1554. //int j = c1+1;
  1555. if (strPrimary_flag == "1" && c1 + 1 == 1)
  1556. {
  1557. i++;
  1558. list.Add("1");
  1559. //j = j - 1;
  1560. }
  1561. else if (strPrimary_flag == "1" && c1 + 1 != 1)
  1562. {
  1563. MessageBox.Show("请把序号为1的缺陷选为主要缺陷!");
  1564. return;
  1565. }
  1566. else
  1567. {
  1568. list.Add(Convert.ToString(c1 + 1));
  1569. }
  1570. if (defect_desc == "")
  1571. {
  1572. list.Add(defect_desc);
  1573. }
  1574. else
  1575. {
  1576. list.Add(defect_descval);
  1577. }
  1578. list.Add(defect_desc);
  1579. if (strMian == "上表面")
  1580. {
  1581. list.Add("U");
  1582. }
  1583. else if (strMian == "下表面")
  1584. {
  1585. list.Add("D");
  1586. }
  1587. else if (strMian == "边部")
  1588. {
  1589. list.Add("E");
  1590. }
  1591. else if (strMian == "上下表面都有,且不对称")
  1592. {
  1593. list.Add("N");
  1594. }
  1595. else if (strMian == "上下表面都有,且对称")
  1596. {
  1597. list.Add("S");
  1598. }
  1599. else if (strMian == "钢卷侧面")
  1600. {
  1601. list.Add("A");
  1602. }
  1603. else if (strMian == "上凸下凹")
  1604. {
  1605. list.Add("T");
  1606. }
  1607. else if (strMian == "上凹下凸")
  1608. {
  1609. list.Add("B");
  1610. }
  1611. else if (strMian == "已跟踪去重卷切除")
  1612. {
  1613. list.Add("C");
  1614. }
  1615. else
  1616. {
  1617. list.Add("");
  1618. }
  1619. //list.Add(strMian);
  1620. if (strTou == "")
  1621. {
  1622. list.Add(strTou);
  1623. }
  1624. else
  1625. {
  1626. list.Add(strTouval);
  1627. }
  1628. list.Add(strTou);
  1629. if (strCe == "")
  1630. {
  1631. list.Add(strCe);
  1632. }
  1633. else
  1634. {
  1635. list.Add(strCeval);
  1636. }
  1637. list.Add(strCe);
  1638. if (strDaxiao == "")
  1639. {
  1640. list.Add(strDaxiao);
  1641. }
  1642. else
  1643. {
  1644. list.Add(strDaxiaoval);
  1645. }
  1646. list.Add(strDaxiao);
  1647. if (strChengdu == "")
  1648. {
  1649. list.Add(strChengdu);
  1650. }
  1651. else
  1652. {
  1653. list.Add(strChengduval);
  1654. }
  1655. list.Add(strChengdu);
  1656. list.Add(strDuoshao);
  1657. list.Add(strMemo);
  1658. if (strRepair == "")
  1659. {
  1660. list.Add("0");
  1661. }
  1662. else
  1663. {
  1664. list.Add(strRepairval);
  1665. }
  1666. list.Add(strQxly);
  1667. list2.Add(list);
  1668. }
  1669. }
  1670. if (i > 1)
  1671. {
  1672. MessageBox.Show("请不要录入多条主要缺陷!");
  1673. return;
  1674. }
  1675. CoreClientParam ccp = new CoreClientParam();
  1676. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  1677. ccp.MethodName = "doAddFlawL1";
  1678. ccp.ServerParams = new object[] { list2, list1 };
  1679. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1680. if (ccp.ReturnCode == -1)
  1681. {
  1682. return;
  1683. }
  1684. MessageBox.Show("表面检验登记成功!");
  1685. }
  1686. if (ugr.Cells["CHK"].Text.ToString() == "True")
  1687. {
  1688. if (ugr.Cells["CRK_TP"].Text == "Y")//外观缺陷
  1689. {
  1690. jx = 1;
  1691. CoreClientParam ccp = new CoreClientParam();
  1692. Hashtable ht = new Hashtable();
  1693. ht.Add("i" + jx, SLSelected); jx++;//产线
  1694. ht.Add("i" + jx, ugr.Cells["COIL_NO"].Text); jx++;//钢卷号
  1695. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//试样号
  1696. ht.Add("i" + jx, ugr.Cells["SMP_CUT_LOC"].Text); jx++;//位置
  1697. ht.Add("i" + jx, ""); jx++;//去向
  1698. ht.Add("i" + jx, ugr.Cells["EXTSHAPE_QUALITY"].Text); jx++;//外观等级
  1699. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//录入厚度
  1700. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//录入宽度
  1701. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//温度
  1702. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//粗糙度
  1703. ht.Add("i" + jx, ugr.Cells["SMP_PICK_YN"].Text); jx++;//是否取样
  1704. ht.Add("i" + jx, ugr.Cells["CRK_CD1"].Value.ToString()); jx++;
  1705. ht.Add("i" + jx, ugr.Cells["CRK_CD1_TYPE"].Text); jx++;
  1706. ht.Add("i" + jx, ugr.Cells["CRK_CD2"].Value.ToString()); jx++;
  1707. ht.Add("i" + jx, ugr.Cells["CRK_CD2_TYPE"].Text); jx++;
  1708. ht.Add("i" + jx, ugr.Cells["CRK_CD3"].Value.ToString()); jx++;
  1709. ht.Add("i" + jx, ugr.Cells["CRK_CD3_TYPE"].Text); jx++;
  1710. ht.Add("i" + jx, ugr.Cells["CRK_CD4"].Value.ToString()); jx++;
  1711. ht.Add("i" + jx, ugr.Cells["CRK_CD4_TYPE"].Text); jx++;
  1712. ht.Add("i" + jx, ugr.Cells["CRK_CD5"].Value.ToString()); jx++;
  1713. ht.Add("i" + jx, ugr.Cells["CRK_CD5_TYPE"].Text); jx++;
  1714. //ht.Add("i" + jx, ugr.Cells["CRK_CD1_TYPE"].Text); jx++;
  1715. //ht.Add("i" + jx, ugr.Cells["CRK_CD2"].Value.ToString().Substring(0, 4)); jx++;
  1716. //ht.Add("i" + jx, ugr.Cells["CRK_CD2_TYPE"].Text); jx++;
  1717. //ht.Add("i" + jx, ugr.Cells["CRK_CD3"].Value.ToString().Substring(0, 4)); jx++;
  1718. //ht.Add("i" + jx, ugr.Cells["CRK_CD3_TYPE"].Text); jx++;
  1719. //ht.Add("i" + jx, ugr.Cells["CRK_CD4"].Value.ToString().Substring(0, 4)); jx++;
  1720. //ht.Add("i" + jx, ugr.Cells["CRK_CD4_TYPE"].Text); jx++;
  1721. //ht.Add("i" + jx, ugr.Cells["CRK_CD5"].Value.ToString().Substring(0, 4)); jx++;//外观缺陷5
  1722. //ht.Add("i" + jx, ugr.Cells["CRK_CD5_TYPE"].Text); jx++;
  1723. ht.Add("i" + jx, this.UserInfo.GetUserID().ToString()); jx++;//操作人
  1724. ht.Add("i" + jx, "外观缺陷录入N"); jx++;//操作标志
  1725. ht.Add("o" + jx, ""); jx = 1;
  1726. ccp.ServerName = "QCM.COMMUNAL.ComDBProcedureQCM";
  1727. ccp.MethodName = "doXmlProcedure";
  1728. ccp.ServerParams = new object[] { "UIB030110_01.CALL", ht };
  1729. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1730. ugr.Cells["CRK_TP"].Value = "";
  1731. ArrayList all = ccp.ReturnObject as ArrayList;
  1732. if (all[0].ToString() != "YY")//确认是否存在问题
  1733. {
  1734. MessageBox.Show(all[0].ToString(), "提示");
  1735. }
  1736. }
  1737. }
  1738. if (ugr.Cells["CHK"].Text.ToString() == "True")
  1739. {
  1740. if (ugr.Cells["EXSHAPE_TP"].Text == "Y")//外观等级
  1741. {
  1742. jx = 1;
  1743. CoreClientParam ccp = new CoreClientParam();
  1744. Hashtable ht = new Hashtable();
  1745. ht.Add("i" + jx, SLSelected); jx++;//产线
  1746. ht.Add("i" + jx, ugr.Cells["COIL_NO"].Text); jx++;//钢卷号
  1747. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//试样号
  1748. ht.Add("i" + jx, ugr.Cells["SMP_CUT_LOC"].Text); jx++;//位置
  1749. // ht.Add("i" + jx, ugr.Cells["COIL_RT"].Text); jx++;//去向
  1750. ht.Add("i" + jx, ugr.Cells["CUR_PROG_CD"].Text); jx++;//20190228指定钢卷去向
  1751. ht.Add("i" + jx, ugr.Cells["EXTSHAPE_QUALITY"].Text); jx++;//外观等级
  1752. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//录入厚度
  1753. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//录入宽度
  1754. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//温度
  1755. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//粗糙度
  1756. ht.Add("i" + jx, ugr.Cells["SMP_PICK_YN"].Text); jx++;//是否取样
  1757. ht.Add("i" + jx, ugr.Cells["CRK_CD1"].Value.ToString()); jx++;//外观缺陷1
  1758. ht.Add("i" + jx, ugr.Cells["CRK_CD1_TYPE"].Text); jx++;
  1759. ht.Add("i" + jx, ugr.Cells["CRK_CD2"].Value.ToString()); jx++;
  1760. ht.Add("i" + jx, ugr.Cells["CRK_CD2_TYPE"].Text); jx++;
  1761. ht.Add("i" + jx, ugr.Cells["CRK_CD3"].Value.ToString()); jx++;
  1762. ht.Add("i" + jx, ugr.Cells["CRK_CD3_TYPE"].Text); jx++;
  1763. ht.Add("i" + jx, ugr.Cells["CRK_CD4"].Value.ToString()); jx++;
  1764. ht.Add("i" + jx, ugr.Cells["CRK_CD4_TYPE"].Text); jx++;
  1765. ht.Add("i" + jx, ugr.Cells["CRK_CD5"].Value.ToString()); jx++;//外观缺陷5
  1766. ht.Add("i" + jx, ugr.Cells["CRK_CD5_TYPE"].Text); jx++;
  1767. ht.Add("i" + jx, this.UserInfo.GetUserID().ToString()); jx++;//操作人
  1768. ht.Add("i" + jx, "外观等级录入"); jx++;//操作标志
  1769. ht.Add("o" + jx, ""); jx = 1;
  1770. ccp.ServerName = "QCM.COMMUNAL.ComDBProcedureQCM";
  1771. ccp.MethodName = "doXmlProcedure";
  1772. ccp.ServerParams = new object[] { "UIB030110_01.CALL", ht };
  1773. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1774. ugr.Cells["EXSHAPE_TP"].Value = "";
  1775. ArrayList all = ccp.ReturnObject as ArrayList;
  1776. if (all[0].ToString() != "YY")//确认是否存在问题
  1777. {
  1778. MessageBox.Show(all[0].ToString(), "提示");
  1779. }
  1780. }
  1781. }
  1782. if (ugr.Cells["CHK"].Text.ToString() == "True")
  1783. {
  1784. string ss = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss").Replace("/", "").Replace(":", "").Replace("-", "").Replace(".", "").Replace(" ", "");
  1785. jx = 1;
  1786. CoreClientParam ccp = new CoreClientParam();
  1787. Hashtable ht = new Hashtable();
  1788. ht.Add("i" + jx, SLSelected); jx++;//产线
  1789. ht.Add("i" + jx, ugr.Cells["COIL_NO"].Text); jx++;//钢卷号
  1790. ht.Add("i" + jx, this.UserInfo.GetUserName().ToString()); jx++;//
  1791. ht.Add("i" + jx, ss); jx++;//
  1792. ht.Add("o" + jx, ""); jx = 1;
  1793. ccp.ServerName = "QCM.COMMUNAL.ComDBProcedureQCM";
  1794. ccp.MethodName = "doXmlProcedure";
  1795. ccp.ServerParams = new object[] { "UIB030110_WAIGUAN.CALL", ht };
  1796. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1797. ArrayList all = ccp.ReturnObject as ArrayList;
  1798. if (all[0].ToString() != "YY")//确认是否存在问题
  1799. {
  1800. MessageBox.Show(all[0].ToString(), "提示");
  1801. }
  1802. }
  1803. }
  1804. this.ultraGrid1.UpdateData();
  1805. this.DoQuery();
  1806. }
  1807. catch (Exception EX)
  1808. {
  1809. MessageBox.Show(EX.ToString());
  1810. }
  1811. }
  1812. private void button5_Click(object sender, EventArgs e)
  1813. {
  1814. try
  1815. {
  1816. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  1817. {
  1818. if (ugr.Cells["CHK"].Text.ToString() == "True")
  1819. {
  1820. if ((ugr.Cells["DCS_THK"].Text.ToString() != "" && ugr.Cells["DCS_WTH"].Text.ToString() != "")
  1821. || (ugr.Cells["COIL_THK"].Text.ToString()!="" && ugr.Cells["COIL_WTH"].Text.ToString()!=""))
  1822. {
  1823. string ss = ugr.Cells["PRODNM_CD"].Text.ToString();
  1824. if (SLSelected == "酸轧"&&(ugr.Cells["PRODNM_CD"].Text.ToString() == "SD" || ugr.Cells["PRODNM_CD"].Text.ToString() == "SB"))
  1825. {
  1826. ArrayList list1 = new ArrayList();
  1827. List<ArrayList> list2 = new List<ArrayList>();
  1828. List<ArrayList> list3 = new List<ArrayList>();
  1829. list1.Add(ugr.Cells["ORD_NO"].Value.ToString() + ugr.Cells["ORD_SEQ"].Value.ToString());
  1830. list1.Add(ugr.Cells["COIL_NO"].Value.ToString());
  1831. list1.Add("1");
  1832. list1.Add("合格");
  1833. string is_zl = "";
  1834. if (comboBox7.Text.ToString() == "正品")
  1835. {
  1836. is_zl = "512601";
  1837. }
  1838. else if (comboBox7.Text.ToString() == "次品")
  1839. {
  1840. is_zl = "512602";
  1841. }
  1842. else if (comboBox7.Text.ToString() == "废品")
  1843. {
  1844. is_zl = "512603";
  1845. }
  1846. else if (comboBox7.Text.ToString() == "协议品")
  1847. {
  1848. is_zl = "512604";
  1849. }
  1850. else if (comboBox7.Text.ToString() == "订单外")
  1851. {
  1852. is_zl = "512605";
  1853. }
  1854. list1.Add("");
  1855. list1.Add(this.UserInfo.GetUserName());
  1856. list1.Add(this.UserInfo.GetUserOrderText());
  1857. list1.Add(this.UserInfo.GetUserGroupText());
  1858. list1.Add(is_zl);//质量等级代码
  1859. list1.Add(comboBox7.Text.Trim().ToString());//质量等级名称
  1860. ArrayList listc1 = new ArrayList();
  1861. listc1.Add("传动侧");
  1862. listc1.Add(ugr.Cells["THICK_VAL1"].Text.ToString());
  1863. listc1.Add(ugr.Cells["H_VAL1"].Value.ToString());
  1864. listc1.Add(ugr.Cells["M_VAL1"].Value.ToString());
  1865. listc1.Add(ugr.Cells["R_VAL1"].Value.ToString());
  1866. list3.Add(listc1);
  1867. listc1 = new ArrayList();
  1868. listc1.Add("中间");
  1869. listc1.Add(ugr.Cells["THICK_VAL2"].Text.ToString());
  1870. listc1.Add(ugr.Cells["H_VAL2"].Value.ToString());
  1871. listc1.Add(ugr.Cells["M_VAL2"].Value.ToString());
  1872. listc1.Add(ugr.Cells["R_VAL2"].Value.ToString());
  1873. list3.Add(listc1);
  1874. listc1 = new ArrayList();
  1875. listc1.Add("操作侧");
  1876. listc1.Add(ugr.Cells["THICK_VAL3"].Text.ToString());
  1877. listc1.Add(ugr.Cells["H_VAL3"].Value.ToString());
  1878. listc1.Add(ugr.Cells["M_VAL3"].Value.ToString());
  1879. listc1.Add(ugr.Cells["R_VAL3"].Value.ToString());
  1880. list3.Add(listc1);
  1881. CoreClientParam ccp = new CoreClientParam();
  1882. ccp = new CoreClientParam();
  1883. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  1884. ccp.MethodName = "judgeByHumanJ";
  1885. ccp.ServerParams = new object[] { list1, list3 };
  1886. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1887. if (ccp.ReturnCode == -1)
  1888. {
  1889. return;
  1890. }
  1891. }
  1892. else
  1893. {
  1894. ArrayList list1 = new ArrayList();
  1895. List<ArrayList> list2 = new List<ArrayList>();
  1896. List<ArrayList> list3 = new List<ArrayList>();
  1897. list1.Add(ugr.Cells["ORD_NO"].Value.ToString() + ugr.Cells["ORD_SEQ"].Value.ToString());
  1898. list1.Add(ugr.Cells["COIL_NO"].Value.ToString());
  1899. list1.Add("");
  1900. list1.Add("");
  1901. string is_zl = "";
  1902. if (comboBox7.Text.ToString() == "正品")
  1903. {
  1904. is_zl = "512601";
  1905. }
  1906. else if (comboBox7.Text.ToString() == "次品")
  1907. {
  1908. is_zl = "512602";
  1909. }
  1910. else if (comboBox7.Text.ToString() == "废品")
  1911. {
  1912. is_zl = "512603";
  1913. }
  1914. else if (comboBox7.Text.ToString() == "协议品")
  1915. {
  1916. is_zl = "512604";
  1917. }
  1918. else if (comboBox7.Text.ToString() == "订单外")
  1919. {
  1920. is_zl = "512605";
  1921. }
  1922. list1.Add("");
  1923. list1.Add(this.UserInfo.GetUserName());
  1924. list1.Add(this.UserInfo.GetUserOrderText());
  1925. list1.Add(this.UserInfo.GetUserGroupText());
  1926. list1.Add(is_zl);//质量等级代码
  1927. list1.Add(comboBox7.Text.Trim().ToString());//质量等级名称
  1928. ArrayList a7 = new ArrayList();
  1929. //界面的订单规格存在问题,从后台订单表获取送去判定
  1930. this.dataSet5.Clear();
  1931. string design_key1 = ugr.Cells["ORD_NO"].Value.ToString() + ugr.Cells["ORD_SEQ"].Value.ToString();
  1932. //string design_key = "W502024021086001";
  1933. a7.Add("QCM031010_SELECT_02");
  1934. a7.Add(design_key1);
  1935. CoreClientParam ccp5 = new CoreClientParam();
  1936. ccp5.ServerName = "QCM.COMMUNAL.ComDBQueryQCM";
  1937. ccp5.MethodName = "doSimpleQuery";
  1938. ccp5.ServerParams = new object[] { a7 };
  1939. ccp5.SourceDataTable = this.dataSet5.Tables[0];
  1940. this.ExecuteQueryToDataTable(ccp5, CoreInvokeType.Internal);
  1941. ArrayList a3 = new ArrayList();
  1942. this.dataSet4.Clear();
  1943. string design_key = ugr.Cells["ORD_NO"].Text.ToString() + ugr.Cells["ORD_SEQ"].Text.ToString();
  1944. a3.Add("QCM031010_SELECT_01");
  1945. a3.Add(design_key);
  1946. //string material_no = ugr.Cells["COIL_NO"].Value.ToString();
  1947. CoreClientParam ccp = new CoreClientParam();
  1948. ccp.ServerName = "QCM.COMMUNAL.ComDBQueryQCM";
  1949. ccp.MethodName = "doSimpleQuery";
  1950. ccp.ServerParams = new object[] { a3 };
  1951. ccp.SourceDataTable = this.dataSet4.Tables[0];
  1952. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  1953. if (dataSet4.Tables[0].Rows.Count != 0)
  1954. {
  1955. foreach (System.Data.DataRow row in dataSet4.Tables[0].Rows)
  1956. {
  1957. if (row["BIAS_CODE"].ToString() == "" || row["BIAS_CODE_2"].ToString() == "")
  1958. {
  1959. MessageBox.Show(ugr.Cells["COIL_NO"].Value.ToString() + "卷没有判定标准");
  1960. return;
  1961. }
  1962. ArrayList list = new ArrayList();
  1963. list.Add(row["BIAS_CODE"].ToString());
  1964. if (SLSelected == "酸轧")
  1965. {
  1966. list.Add(ugr.Cells["COIL_THK"].Text.ToString());
  1967. }
  1968. else if (ugr.Cells["DCS_THK"].Text.ToString() != "")
  1969. {
  1970. list.Add(ugr.Cells["DCS_THK"].Text.ToString());
  1971. }
  1972. else
  1973. {
  1974. list.Add(ugr.Cells["COIL_THK"].Text.ToString());
  1975. }
  1976. list.Add(row["BIAS_NAME"].ToString());
  1977. //list.Add(ugr.Cells["C_ORD_THK"].Text.ToString());
  1978. //修改订单规格为后台获取的
  1979. //list.Add(ugr.Cells["C_ORD_THK"].Text.ToString());
  1980. foreach (System.Data.DataRow row1 in dataSet5.Tables[0].Rows)
  1981. {
  1982. list.Add(row1["C_ORD_THK"].ToString());
  1983. }
  1984. list.Add(ugr.Cells["COIL_THK"].Text.ToString());
  1985. list2.Add(list);
  1986. list = new ArrayList();
  1987. list.Add(row["BIAS_CODE_2"].ToString());
  1988. if (SLSelected == "酸轧"&&ugr.Cells["DCS_WTH"].Text.ToString() != ""&&ugr.Cells["DCS_WTH"].Text.ToString() != "0")
  1989. {
  1990. list.Add(ugr.Cells["DCS_WTH"].Text.ToString());
  1991. }
  1992. else if (SLSelected != "酸轧" && ugr.Cells["DCS_WTH"].Text.ToString() != "")
  1993. {
  1994. list.Add(ugr.Cells["DCS_WTH"].Text.ToString());
  1995. }
  1996. else
  1997. {
  1998. list.Add(ugr.Cells["COIL_WTH"].Text.ToString());
  1999. }
  2000. list.Add(row["BIAS_NAME_2"].ToString());
  2001. //list.Add(ugr.Cells["C_ORD_WTH"].Text.ToString());
  2002. //修改订单规格为后台获取的
  2003. //list.Add(ugr.Cells["C_ORD_THK"].Text.ToString());
  2004. foreach (System.Data.DataRow row1 in dataSet5.Tables[0].Rows)
  2005. {
  2006. list.Add(row1["C_ORD_WTH"].ToString());
  2007. }
  2008. list.Add(ugr.Cells["COIL_WTH"].Text.ToString());
  2009. list2.Add(list);
  2010. }
  2011. }
  2012. else
  2013. {
  2014. MessageBox.Show(ugr.Cells["COIL_NO"].Value.ToString() + "卷没有判定标准");
  2015. return;
  2016. }
  2017. dataSet4.Clear();
  2018. ArrayList listc1 = new ArrayList();
  2019. listc1.Add("传动侧");
  2020. listc1.Add(ugr.Cells["THICK_VAL1"].Text.ToString());
  2021. listc1.Add(ugr.Cells["H_VAL1"].Value.ToString());
  2022. listc1.Add(ugr.Cells["M_VAL1"].Value.ToString());
  2023. listc1.Add(ugr.Cells["R_VAL1"].Value.ToString());
  2024. list3.Add(listc1);
  2025. listc1 = new ArrayList();
  2026. listc1.Add("中间");
  2027. listc1.Add(ugr.Cells["THICK_VAL2"].Text.ToString());
  2028. listc1.Add(ugr.Cells["H_VAL2"].Value.ToString());
  2029. listc1.Add(ugr.Cells["M_VAL2"].Value.ToString());
  2030. listc1.Add(ugr.Cells["R_VAL2"].Value.ToString());
  2031. list3.Add(listc1);
  2032. listc1 = new ArrayList();
  2033. listc1.Add("操作侧");
  2034. listc1.Add(ugr.Cells["THICK_VAL3"].Text.ToString());
  2035. listc1.Add(ugr.Cells["H_VAL3"].Value.ToString());
  2036. listc1.Add(ugr.Cells["M_VAL3"].Value.ToString());
  2037. listc1.Add(ugr.Cells["R_VAL3"].Value.ToString());
  2038. list3.Add(listc1);
  2039. ccp = new CoreClientParam();
  2040. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  2041. ccp.MethodName = "judgeByHuman2";
  2042. ccp.ServerParams = new object[] { list1, list2, list3 };
  2043. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  2044. if (ccp.ReturnCode == -1)
  2045. {
  2046. return;
  2047. }
  2048. }
  2049. }
  2050. else
  2051. {
  2052. MessageBox.Show("公差判定值为空,公差判定不成功!");
  2053. return;
  2054. }
  2055. }
  2056. }
  2057. //for (int i = 0; i < lists.Count; i++)
  2058. //{
  2059. // lists[i].Delete(false);
  2060. //}
  2061. MessageBox.Show("公差检验登记成功!");
  2062. }
  2063. catch (Exception EX)
  2064. {
  2065. MessageBox.Show(EX.ToString());
  2066. }
  2067. }
  2068. private void ultraGrid1_AfterCellUpdate(object sender, CellEventArgs e)
  2069. {
  2070. try
  2071. {
  2072. foreach (UltraGridRow ugr in ultraGrid1.Rows)
  2073. {
  2074. if (ugr.Cells["CHK"].Text.ToString() == "True")
  2075. {
  2076. if (ugr.Cells["DCS_THK"] == e.Cell || ugr.Cells["DCS_WTH"]== e.Cell)
  2077. {
  2078. ugr.Cells["DCS_YP"].Value = "Y";
  2079. }
  2080. }
  2081. }
  2082. }
  2083. catch
  2084. {
  2085. }
  2086. }
  2087. private void ultraGrid1_AfterEnterEditMode(object sender, EventArgs e)
  2088. {
  2089. }
  2090. private void ultraGrid1_MouseDown(object sender, MouseEventArgs e)
  2091. {
  2092. try
  2093. {
  2094. if (this.ultraGrid1.ActiveCell.Column.Key == "ORD_NO")//链接到品质设计结果查询
  2095. {
  2096. CUIB010301 frm = new CUIB010301();
  2097. frm.ob = this.ob;
  2098. frm.OrderNO = this.ultraGrid1.ActiveRow.Cells["ORD_NO"].Text;
  2099. frm.OrderSEQ = this.ultraGrid1.ActiveRow.Cells["ORD_SEQ"].Text;
  2100. frm.ShowDialog();
  2101. this.ultraGrid1.ActiveRow.Cells["SPEC_ABBSYM"].Activate();//换焦点
  2102. }
  2103. else if (this.ultraGrid1.ActiveCell.Column.Key == "COIL_NO")
  2104. {
  2105. this.dataSet2.Tables[0].Clear();
  2106. if (this.ultraGrid1.ActiveRow.Cells["SMP_NO"].Text != "")
  2107. {
  2108. ArrayList al = new ArrayList();
  2109. al.Add("UIB030110_033.SELECT");
  2110. al.Add(this.ultraGrid1.ActiveRow.Cells["SMP_NO"].Text);
  2111. /*al.Add(this.ultraGrid1.ActiveRow.Cells["SMP_NO"].Text);
  2112. al.Add(this.ultraGrid1.ActiveRow.Cells["SMP_CUT_LOC"].Text);*/
  2113. this.dataSet2.Tables[0].Clear();
  2114. CoreClientParam ccp = new CoreClientParam();
  2115. ccp.ServerName = "QCM.COMMUNAL.ComDBQueryQCM";
  2116. ccp.MethodName = "doSimpleQuery";
  2117. ccp.ServerParams = new object[] { al };
  2118. ccp.SourceDataTable = this.dataSet2.Tables[0];
  2119. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  2120. }
  2121. //this.ultraGrid1.ActiveRow.Cells["SPEC_ABBSYM"].Activate();//换焦点
  2122. }
  2123. }
  2124. catch (Exception ex)
  2125. {
  2126. System.Diagnostics.Debug.WriteLine(ex.ToString());
  2127. }
  2128. }
  2129. private void button6_Click(object sender, EventArgs e)
  2130. {
  2131. try
  2132. {
  2133. foreach (UltraGridRow ugr in ultraGrid1.Rows)
  2134. {
  2135. if (ugr.Cells["CHK"].Text.ToString() == "True")
  2136. {
  2137. ArrayList list1 = new ArrayList();
  2138. List<ArrayList> list2 = new List<ArrayList>();
  2139. string is_pass = "";
  2140. string is_zl1 = "";
  2141. ArrayList list4 = new ArrayList();
  2142. List<ArrayList> list5 = new List<ArrayList>();
  2143. List<ArrayList> list6 = new List<ArrayList>();
  2144. if ((ugr.Cells["DCS_THK"].Text.ToString() != "" && ugr.Cells["DCS_WTH"].Text.ToString() != "") ||
  2145. (ugr.Cells["COIL_THK"].Text.ToString() != "" && ugr.Cells["COIL_WTH"].Text.ToString() != ""))
  2146. {
  2147. string ss = ugr.Cells["PRODNM_CD"].Text.ToString();
  2148. if (SLSelected == "酸轧" && (ugr.Cells["PRODNM_CD"].Text.ToString() == "SD" || ugr.Cells["PRODNM_CD"].Text.ToString() == "SB"))
  2149. {
  2150. list4.Add(ugr.Cells["ORD_NO"].Value.ToString() + ugr.Cells["ORD_SEQ"].Value.ToString());
  2151. //list4.Add("W502024021086001");
  2152. list4.Add(ugr.Cells["COIL_NO"].Value.ToString());
  2153. list4.Add("1");
  2154. list4.Add("合格");
  2155. string is_zl = "";
  2156. if (comboBox7.Text.ToString() == "正品")
  2157. {
  2158. is_zl = "512601";
  2159. }
  2160. else if (comboBox7.Text.ToString() == "次品")
  2161. {
  2162. is_zl = "512602";
  2163. }
  2164. else if (comboBox7.Text.ToString() == "废品")
  2165. {
  2166. is_zl = "512603";
  2167. }
  2168. else if (comboBox7.Text.ToString() == "协议品")
  2169. {
  2170. is_zl = "512604";
  2171. }
  2172. else if (comboBox7.Text.ToString() == "订单外")
  2173. {
  2174. is_zl = "512605";
  2175. }
  2176. list4.Add("");
  2177. list4.Add(this.UserInfo.GetUserName());
  2178. list4.Add(this.UserInfo.GetUserOrderText());
  2179. list4.Add(this.UserInfo.GetUserGroupText());
  2180. list4.Add(is_zl);//质量等级代码
  2181. list4.Add(comboBox7.Text.Trim().ToString());//质量等级名称
  2182. ArrayList listc1 = new ArrayList();
  2183. listc1.Add("传动侧");
  2184. listc1.Add(ugr.Cells["THICK_VAL1"].Text.ToString());
  2185. listc1.Add(ugr.Cells["H_VAL1"].Value.ToString());
  2186. listc1.Add(ugr.Cells["M_VAL1"].Value.ToString());
  2187. listc1.Add(ugr.Cells["R_VAL1"].Value.ToString());
  2188. list6.Add(listc1);
  2189. listc1 = new ArrayList();
  2190. listc1.Add("中间");
  2191. listc1.Add(ugr.Cells["THICK_VAL2"].Text.ToString());
  2192. listc1.Add(ugr.Cells["H_VAL2"].Value.ToString());
  2193. listc1.Add(ugr.Cells["M_VAL2"].Value.ToString());
  2194. listc1.Add(ugr.Cells["R_VAL2"].Value.ToString());
  2195. list6.Add(listc1);
  2196. listc1 = new ArrayList();
  2197. listc1.Add("操作侧");
  2198. listc1.Add(ugr.Cells["THICK_VAL3"].Text.ToString());
  2199. listc1.Add(ugr.Cells["H_VAL3"].Value.ToString());
  2200. listc1.Add(ugr.Cells["M_VAL3"].Value.ToString());
  2201. listc1.Add(ugr.Cells["R_VAL3"].Value.ToString());
  2202. list6.Add(listc1);
  2203. }
  2204. else
  2205. {
  2206. list4.Add(ugr.Cells["ORD_NO"].Value.ToString() + ugr.Cells["ORD_SEQ"].Value.ToString());
  2207. list4.Add(ugr.Cells["COIL_NO"].Value.ToString());
  2208. list4.Add("");
  2209. list4.Add("");
  2210. string is_zl = "";
  2211. if (comboBox7.Text.ToString() == "正品")
  2212. {
  2213. is_zl = "512601";
  2214. }
  2215. else if (comboBox7.Text.ToString() == "次品")
  2216. {
  2217. is_zl = "512602";
  2218. }
  2219. else if (comboBox7.Text.ToString() == "废品")
  2220. {
  2221. is_zl = "512603";
  2222. }
  2223. else if (comboBox7.Text.ToString() == "协议品")
  2224. {
  2225. is_zl = "512604";
  2226. }
  2227. else if (comboBox7.Text.ToString() == "订单外")
  2228. {
  2229. is_zl = "512605";
  2230. }
  2231. list4.Add("");
  2232. list4.Add(this.UserInfo.GetUserName());
  2233. list4.Add(this.UserInfo.GetUserOrderText());
  2234. list4.Add(this.UserInfo.GetUserGroupText());
  2235. list4.Add(is_zl);//质量等级代码
  2236. list4.Add(comboBox7.Text.Trim().ToString());//质量等级名称
  2237. ArrayList a7 = new ArrayList();
  2238. //界面的订单规格存在问题,从后台订单表获取送去判定
  2239. this.dataSet5.Clear();
  2240. string design_key1 = ugr.Cells["ORD_NO"].Value.ToString() + ugr.Cells["ORD_SEQ"].Value.ToString();
  2241. //string design_key = "W502024021086001";
  2242. a7.Add("QCM031010_SELECT_02");
  2243. a7.Add(design_key1);
  2244. CoreClientParam ccp5 = new CoreClientParam();
  2245. ccp5.ServerName = "QCM.COMMUNAL.ComDBQueryQCM";
  2246. ccp5.MethodName = "doSimpleQuery";
  2247. ccp5.ServerParams = new object[] { a7 };
  2248. ccp5.SourceDataTable = this.dataSet5.Tables[0];
  2249. this.ExecuteQueryToDataTable(ccp5, CoreInvokeType.Internal);
  2250. ArrayList a3 = new ArrayList();
  2251. this.dataSet4.Clear();
  2252. string design_key = ugr.Cells["ORD_NO"].Value.ToString() + ugr.Cells["ORD_SEQ"].Value.ToString();
  2253. //string design_key = "W502024021086001";
  2254. a3.Add("QCM031010_SELECT_01");
  2255. a3.Add(design_key);
  2256. CoreClientParam ccp2 = new CoreClientParam();
  2257. ccp2.ServerName = "QCM.COMMUNAL.ComDBQueryQCM";
  2258. ccp2.MethodName = "doSimpleQuery";
  2259. ccp2.ServerParams = new object[] { a3 };
  2260. ccp2.SourceDataTable = this.dataSet4.Tables[0];
  2261. this.ExecuteQueryToDataTable(ccp2, CoreInvokeType.Internal);
  2262. if (dataSet4.Tables[0].Rows.Count != 0)
  2263. {
  2264. foreach (System.Data.DataRow row in dataSet4.Tables[0].Rows)
  2265. {
  2266. if (row["BIAS_CODE"].ToString() == "" || row["BIAS_CODE_2"].ToString() == "")
  2267. {
  2268. MessageBox.Show(ugr.Cells["COIL_NO"].Value.ToString() + "卷没有判定标准");
  2269. return;
  2270. }
  2271. ArrayList list = new ArrayList();
  2272. list.Add(row["BIAS_CODE"].ToString());
  2273. if (SLSelected == "酸轧")
  2274. {
  2275. list.Add(ugr.Cells["COIL_THK"].Text.ToString());
  2276. }
  2277. else if (ugr.Cells["DCS_THK"].Text.ToString() != "")
  2278. {
  2279. list.Add(ugr.Cells["DCS_THK"].Text.ToString());
  2280. }
  2281. else
  2282. {
  2283. list.Add(ugr.Cells["COIL_THK"].Text.ToString());
  2284. }
  2285. list.Add(row["BIAS_NAME"].ToString());
  2286. //修改订单规格为后台获取的
  2287. //list.Add(ugr.Cells["C_ORD_THK"].Text.ToString());
  2288. foreach (System.Data.DataRow row1 in dataSet5.Tables[0].Rows)
  2289. {
  2290. list.Add(row1["C_ORD_THK"].ToString());
  2291. }
  2292. list.Add(ugr.Cells["COIL_THK"].Text.ToString());
  2293. list5.Add(list);
  2294. list = new ArrayList();
  2295. list.Add(row["BIAS_CODE_2"].ToString());
  2296. if (SLSelected == "酸轧" && ugr.Cells["DCS_WTH"].Text.ToString() != "" && ugr.Cells["DCS_WTH"].Text.ToString() != "0")
  2297. {
  2298. list.Add(ugr.Cells["DCS_WTH"].Text.ToString());
  2299. }
  2300. else if (SLSelected != "酸轧" && ugr.Cells["DCS_WTH"].Text.ToString() != "")
  2301. {
  2302. list.Add(ugr.Cells["DCS_WTH"].Text.ToString());
  2303. }
  2304. else
  2305. {
  2306. list.Add(ugr.Cells["COIL_WTH"].Text.ToString());
  2307. }
  2308. list.Add(row["BIAS_NAME_2"].ToString());
  2309. //list.Add(ugr.Cells["C_ORD_WTH"].Text.ToString());
  2310. foreach (System.Data.DataRow row1 in dataSet5.Tables[0].Rows)
  2311. {
  2312. list.Add(row1["C_ORD_WTH"].ToString());
  2313. }
  2314. list.Add(ugr.Cells["COIL_WTH"].Text.ToString());
  2315. list5.Add(list);
  2316. }
  2317. }
  2318. else
  2319. {
  2320. MessageBox.Show(ugr.Cells["COIL_NO"].Value.ToString() + "卷没有判定标准");
  2321. return;
  2322. }
  2323. dataSet4.Clear();
  2324. ArrayList listc1 = new ArrayList();
  2325. listc1.Add("传动侧");
  2326. listc1.Add(ugr.Cells["THICK_VAL1"].Text.ToString());
  2327. listc1.Add(ugr.Cells["H_VAL1"].Value.ToString());
  2328. listc1.Add(ugr.Cells["M_VAL1"].Value.ToString());
  2329. listc1.Add(ugr.Cells["R_VAL1"].Value.ToString());
  2330. list6.Add(listc1);
  2331. listc1 = new ArrayList();
  2332. listc1.Add("中间");
  2333. listc1.Add(ugr.Cells["THICK_VAL2"].Text.ToString());
  2334. listc1.Add(ugr.Cells["H_VAL2"].Value.ToString());
  2335. listc1.Add(ugr.Cells["M_VAL2"].Value.ToString());
  2336. listc1.Add(ugr.Cells["R_VAL2"].Value.ToString());
  2337. list6.Add(listc1);
  2338. listc1 = new ArrayList();
  2339. listc1.Add("操作侧");
  2340. listc1.Add(ugr.Cells["THICK_VAL3"].Text.ToString());
  2341. listc1.Add(ugr.Cells["H_VAL3"].Value.ToString());
  2342. listc1.Add(ugr.Cells["M_VAL3"].Value.ToString());
  2343. listc1.Add(ugr.Cells["R_VAL3"].Value.ToString());
  2344. list6.Add(listc1);
  2345. }
  2346. }
  2347. list1.Add(ugr.Cells["COIL_NO"].Value.ToString());
  2348. list1.Add("");//检验结果代码
  2349. list1.Add("");//检验结果
  2350. list1.Add(ugr.Cells["EXTSHAPE_QUALITY"].Text.Trim().ToString());//质量等级代码
  2351. list1.Add(ugr.Cells["EXTSHAPE_QUALITY"].Text.Trim().ToString());//质量等级名称
  2352. list1.Add("");
  2353. list1.Add(this.UserInfo.GetUserName());//操作人
  2354. list1.Add(this.UserInfo.GetUserOrderText());//班次
  2355. list1.Add(this.UserInfo.GetUserGroupText());//班组
  2356. if (ugr.Cells["MAOCI"].Text.Trim().ToString() != "")
  2357. {
  2358. list1.Add(ugr.Cells["MAOCI"].Text.Trim().ToString());//边部毛刺
  2359. }
  2360. else
  2361. {
  2362. list1.Add(this.comboBox8.Text.ToString());//边部毛刺
  2363. }
  2364. int count1 = 0;
  2365. int i = 0;
  2366. for (int c1 = 0; c1 < 5; c1++)
  2367. {
  2368. // MessageBox.Show(CWindow.al[i].ToString() +"---------"+ CWindow.al[i].ToString().Substring(2));
  2369. if (ugr.Cells["CRK_CD" + Convert.ToString((c1 + 1)) + "_TYPE"].Text.ToString() != "")
  2370. {
  2371. string[] sArray = ugr.Cells["CRK_CD" + Convert.ToString((c1 + 1)) + "_TYPE"].Value.ToString().Split(new char[] { ';', '【', '】' });
  2372. string strQxly = sArray[0];
  2373. string defect_desc = ugr.Cells["CRK_CD" + Convert.ToString((c1 + 1))].Text.ToString();
  2374. string strRepair = sArray[7];
  2375. string strPrimary_flag = sArray[8];
  2376. string strMian = sArray[1];
  2377. string strTou = sArray[2];
  2378. string strCe = sArray[3];
  2379. string strDaxiao = sArray[4];
  2380. string strDuoshao = sArray[5];
  2381. string strChengdu = sArray[6];
  2382. string strMemo = sArray[10];
  2383. string defect_descval = sArray[12];
  2384. string strRepairval = sArray[13];
  2385. string strPrimary_flagval = sArray[14];
  2386. string strMianval = sArray[15];
  2387. string strCeval = sArray[17];
  2388. string strTouval = sArray[16];
  2389. string strDaxiaoval = sArray[18];
  2390. string strDuoshaoval = sArray[19];
  2391. string strChengduval = sArray[20];
  2392. string strMemoval = sArray[21];
  2393. ArrayList list = new ArrayList();
  2394. if (strPrimary_flag == "")
  2395. {
  2396. list.Add(strPrimary_flag);
  2397. }
  2398. else
  2399. {
  2400. list.Add(strPrimary_flagval);
  2401. }
  2402. //int j = c1+1;
  2403. if (strPrimary_flag == "1" && c1 + 1 == 1)
  2404. {
  2405. i++;
  2406. list.Add("1");
  2407. //j = j - 1;
  2408. }
  2409. else if (strPrimary_flag == "1" && c1 + 1 != 1)
  2410. {
  2411. MessageBox.Show("请把序号为1的缺陷选为主要缺陷!");
  2412. return;
  2413. }
  2414. else
  2415. {
  2416. list.Add(Convert.ToString(c1 + 1));
  2417. }
  2418. if (defect_desc == "")
  2419. {
  2420. list.Add(defect_desc);
  2421. }
  2422. else
  2423. {
  2424. list.Add(defect_descval);
  2425. }
  2426. list.Add(defect_desc);
  2427. if (strMian == "上表面")
  2428. {
  2429. list.Add("U");
  2430. }
  2431. else if (strMian == "下表面")
  2432. {
  2433. list.Add("D");
  2434. }
  2435. else if (strMian == "边部")
  2436. {
  2437. list.Add("E");
  2438. }
  2439. else if (strMian == "上下表面都有,且不对称")
  2440. {
  2441. list.Add("N");
  2442. }
  2443. else if (strMian == "上下表面都有,且对称")
  2444. {
  2445. list.Add("S");
  2446. }
  2447. else if (strMian == "钢卷侧面")
  2448. {
  2449. list.Add("A");
  2450. }
  2451. else if (strMian == "上凸下凹")
  2452. {
  2453. list.Add("T");
  2454. }
  2455. else if (strMian == "上凹下凸")
  2456. {
  2457. list.Add("B");
  2458. }
  2459. else if (strMian == "已跟踪去重卷切除")
  2460. {
  2461. list.Add("C");
  2462. }
  2463. else
  2464. {
  2465. list.Add("");
  2466. }
  2467. //list.Add(strMian);
  2468. if (strTou == "")
  2469. {
  2470. list.Add(strTou);
  2471. }
  2472. else
  2473. {
  2474. list.Add(strTouval);
  2475. }
  2476. list.Add(strTou);
  2477. if (strCe == "")
  2478. {
  2479. list.Add(strCe);
  2480. }
  2481. else
  2482. {
  2483. list.Add(strCeval);
  2484. }
  2485. list.Add(strCe);
  2486. if (strDaxiao == "")
  2487. {
  2488. list.Add(strDaxiao);
  2489. }
  2490. else
  2491. {
  2492. list.Add(strDaxiaoval);
  2493. }
  2494. list.Add(strDaxiao);
  2495. if (strChengdu == "")
  2496. {
  2497. list.Add(strChengdu);
  2498. }
  2499. else
  2500. {
  2501. list.Add(strChengduval);
  2502. }
  2503. list.Add(strChengdu);
  2504. list.Add(strDuoshao);
  2505. list.Add(strMemo);
  2506. if (strRepair == "")
  2507. {
  2508. list.Add("0");
  2509. }
  2510. else
  2511. {
  2512. list.Add(strRepairval);
  2513. }
  2514. list.Add(strQxly);
  2515. list2.Add(list);
  2516. }
  2517. }
  2518. if (i > 1)
  2519. {
  2520. MessageBox.Show("请不要录入多条主要缺陷!");
  2521. return;
  2522. }
  2523. CoreClientParam ccp = new CoreClientParam();
  2524. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  2525. ccp.MethodName = "judgeByHuman2LZBmgc";
  2526. ccp.ServerParams = new object[] { list2, list1,list4,list5,list6 };
  2527. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  2528. if (ccp.ReturnCode == -1)
  2529. {
  2530. return;
  2531. }
  2532. }
  2533. if (ugr.Cells["CHK"].Text.ToString() == "True")
  2534. {
  2535. if (ugr.Cells["CRK_TP"].Text == "Y")//外观缺陷
  2536. {
  2537. jx = 1;
  2538. CoreClientParam ccp = new CoreClientParam();
  2539. Hashtable ht = new Hashtable();
  2540. ht.Add("i" + jx, SLSelected); jx++;//产线
  2541. ht.Add("i" + jx, ugr.Cells["COIL_NO"].Text); jx++;//钢卷号
  2542. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//试样号
  2543. ht.Add("i" + jx, ugr.Cells["SMP_CUT_LOC"].Text); jx++;//位置
  2544. ht.Add("i" + jx, ""); jx++;//去向
  2545. ht.Add("i" + jx, ugr.Cells["EXTSHAPE_QUALITY"].Text); jx++;//外观等级
  2546. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//录入厚度
  2547. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//录入宽度
  2548. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//温度
  2549. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//粗糙度
  2550. ht.Add("i" + jx, ugr.Cells["SMP_PICK_YN"].Text); jx++;//是否取样
  2551. ht.Add("i" + jx, ugr.Cells["CRK_CD1"].Value.ToString()); jx++;
  2552. ht.Add("i" + jx, ugr.Cells["CRK_CD1_TYPE"].Text); jx++;
  2553. ht.Add("i" + jx, ugr.Cells["CRK_CD2"].Value.ToString()); jx++;
  2554. ht.Add("i" + jx, ugr.Cells["CRK_CD2_TYPE"].Text); jx++;
  2555. ht.Add("i" + jx, ugr.Cells["CRK_CD3"].Value.ToString()); jx++;
  2556. ht.Add("i" + jx, ugr.Cells["CRK_CD3_TYPE"].Text); jx++;
  2557. ht.Add("i" + jx, ugr.Cells["CRK_CD4"].Value.ToString()); jx++;
  2558. ht.Add("i" + jx, ugr.Cells["CRK_CD4_TYPE"].Text); jx++;
  2559. ht.Add("i" + jx, ugr.Cells["CRK_CD5"].Value.ToString()); jx++;
  2560. ht.Add("i" + jx, ugr.Cells["CRK_CD5_TYPE"].Text); jx++;
  2561. ht.Add("i" + jx, this.UserInfo.GetUserName().ToString()); jx++;//操作人
  2562. ht.Add("i" + jx, "外观缺陷录入N"); jx++;//操作标志
  2563. ht.Add("o" + jx, ""); jx = 1;
  2564. ccp.ServerName = "QCM.COMMUNAL.ComDBProcedureQCM";
  2565. ccp.MethodName = "doXmlProcedure";
  2566. ccp.ServerParams = new object[] { "UIB030110_01.CALL", ht };
  2567. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  2568. ugr.Cells["CRK_TP"].Value = "";
  2569. ArrayList all = ccp.ReturnObject as ArrayList;
  2570. if (all[0].ToString() != "YY")//确认是否存在问题
  2571. {
  2572. MessageBox.Show(all[0].ToString(), "提示");
  2573. }
  2574. }
  2575. }
  2576. if (ugr.Cells["CHK"].Text.ToString() == "True")
  2577. {
  2578. if (ugr.Cells["EXSHAPE_TP"].Text == "Y")//外观等级
  2579. {
  2580. jx = 1;
  2581. CoreClientParam ccp = new CoreClientParam();
  2582. Hashtable ht = new Hashtable();
  2583. ht.Add("i" + jx, SLSelected); jx++;//产线
  2584. ht.Add("i" + jx, ugr.Cells["COIL_NO"].Text); jx++;//钢卷号
  2585. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//试样号
  2586. ht.Add("i" + jx, ugr.Cells["SMP_CUT_LOC"].Text); jx++;//位置
  2587. // ht.Add("i" + jx, ugr.Cells["COIL_RT"].Text); jx++;//去向
  2588. ht.Add("i" + jx, ugr.Cells["CUR_PROG_CD"].Text); jx++;//20190228指定钢卷去向
  2589. ht.Add("i" + jx, ugr.Cells["EXTSHAPE_QUALITY"].Text); jx++;//外观等级
  2590. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//录入厚度
  2591. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//录入宽度
  2592. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//温度
  2593. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//粗糙度
  2594. ht.Add("i" + jx, ugr.Cells["SMP_PICK_YN"].Text); jx++;//是否取样
  2595. ht.Add("i" + jx, ugr.Cells["CRK_CD1"].Value.ToString()); jx++;//外观缺陷1
  2596. ht.Add("i" + jx, ugr.Cells["CRK_CD1_TYPE"].Text); jx++;
  2597. ht.Add("i" + jx, ugr.Cells["CRK_CD2"].Value.ToString()); jx++;
  2598. ht.Add("i" + jx, ugr.Cells["CRK_CD2_TYPE"].Text); jx++;
  2599. ht.Add("i" + jx, ugr.Cells["CRK_CD3"].Value.ToString()); jx++;
  2600. ht.Add("i" + jx, ugr.Cells["CRK_CD3_TYPE"].Text); jx++;
  2601. ht.Add("i" + jx, ugr.Cells["CRK_CD4"].Value.ToString()); jx++;
  2602. ht.Add("i" + jx, ugr.Cells["CRK_CD4_TYPE"].Text); jx++;
  2603. ht.Add("i" + jx, ugr.Cells["CRK_CD5"].Value.ToString()); jx++;//外观缺陷5
  2604. ht.Add("i" + jx, ugr.Cells["CRK_CD5_TYPE"].Text); jx++;
  2605. ht.Add("i" + jx, this.UserInfo.GetUserName().ToString()); jx++;//操作人
  2606. ht.Add("i" + jx, "外观等级录入"); jx++;//操作标志
  2607. ht.Add("o" + jx, ""); jx = 1;
  2608. ccp.ServerName = "QCM.COMMUNAL.ComDBProcedureQCM";
  2609. ccp.MethodName = "doXmlProcedure";
  2610. ccp.ServerParams = new object[] { "UIB030110_01.CALL", ht };
  2611. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  2612. ugr.Cells["EXSHAPE_TP"].Value = "";
  2613. ArrayList all = ccp.ReturnObject as ArrayList;
  2614. if (all[0].ToString() != "YY")//确认是否存在问题
  2615. {
  2616. MessageBox.Show(all[0].ToString(), "提示");
  2617. }
  2618. }
  2619. }
  2620. if (ugr.Cells["CHK"].Text.ToString() == "True")
  2621. {
  2622. string ss = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss").Replace("/", "").Replace(":", "").Replace("-", "").Replace(".", "").Replace(" ", ""); jx = 1;
  2623. CoreClientParam ccp = new CoreClientParam();
  2624. Hashtable ht = new Hashtable();
  2625. ht.Add("i" + jx, SLSelected); jx++;//产线
  2626. ht.Add("i" + jx, ugr.Cells["COIL_NO"].Text); jx++;//钢卷号
  2627. ht.Add("i" + jx, this.UserInfo.GetUserName().ToString()); jx++;//
  2628. ht.Add("i" + jx, ss); jx++;//
  2629. ht.Add("o" + jx, ""); jx = 1;
  2630. ccp.ServerName = "QCM.COMMUNAL.ComDBProcedureQCM";
  2631. ccp.MethodName = "doXmlProcedure";
  2632. ccp.ServerParams = new object[] { "UIB030110_WAIGUAN.CALL", ht };
  2633. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  2634. ArrayList all = ccp.ReturnObject as ArrayList;
  2635. if (all[0].ToString() != "YY")//确认是否存在问题
  2636. {
  2637. MessageBox.Show(all[0].ToString(), "提示");
  2638. }
  2639. }
  2640. }
  2641. MessageBox.Show("表面公差检验登记成功!");
  2642. this.ultraGrid1.UpdateData();
  2643. this.DoQuery();
  2644. }
  2645. catch (Exception EX)
  2646. {
  2647. MessageBox.Show(EX.ToString());
  2648. }
  2649. }
  2650. private void button6_Click_1(object sender, EventArgs e)
  2651. {
  2652. int jx;
  2653. jx = 1;
  2654. CoreClientParam ccp = new CoreClientParam();
  2655. Hashtable ht = new Hashtable();
  2656. ht.Add("i" + jx, this.ultraGrid1.ActiveRow.Cells["COIL_NO"].Text.ToString()); jx++; //钢卷号
  2657. ht.Add("i" + jx, this.ultraGrid1.ActiveRow.Cells["RSEPON_UNIT"].Text.ToString()); jx++; //责任单位
  2658. ht.Add("i" + jx, this.UserInfo.GetUserName().ToString()); jx++; //录入人
  2659. ht.Add("i" + jx, this.ultraGrid1.ActiveRow.Cells["RSEPON_UNIT"].Text.ToString()); jx++; //缺陷4
  2660. ht.Add("i" + jx, "1"); jx++; //缺陷5
  2661. ht.Add("i" + jx, "1"); jx++; //缺陷5
  2662. //ht.Add("i" + jx, ugr.Cells["QUEXIAN_TP"].Value.ToString()); jx++; //缺陷来源次
  2663. ht.Add("i" + jx, "卷板责任归属单位"); jx++;//操作标志
  2664. ht.Add("o" + jx, ""); jx = 1;
  2665. ccp.ServerName = "QCM.COMMUNAL.ComDBProcedureQCM";
  2666. ccp.MethodName = "doXmlProcedure";
  2667. ccp.ServerParams = new object[] { "UIB030110_RZQXLR.CALL", ht };
  2668. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  2669. ArrayList all = ccp.ReturnObject as ArrayList;
  2670. if (all[0].ToString() != "YY")//确认是否存在问题
  2671. {
  2672. MessageBox.Show(all[0].ToString(), "提示");
  2673. return;
  2674. }
  2675. MessageBox.Show("责任归属单位录入成功");
  2676. }
  2677. private void comboBox8_SelectedValueChanged(object sender, EventArgs e)
  2678. {
  2679. try
  2680. {
  2681. object chk_ex = comboBox8.Text;
  2682. if (this.ultraGrid1.ActiveRow == null || chk_ex == null) return;
  2683. string chek_exs = chk_ex.ToString();
  2684. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  2685. {
  2686. if (ugr.Cells["CHK"].Text.ToLower() == "true")
  2687. {
  2688. ugr.Cells["MAOCI"].Value = chek_exs;
  2689. this.ultraGrid1.UpdateData();
  2690. }
  2691. }
  2692. }
  2693. catch (Exception ex)
  2694. {
  2695. System.Diagnostics.Debug.WriteLine(ex.ToString());
  2696. }
  2697. }
  2698. //private void ultraGrid1_KeyUp(object sender, KeyEventArgs e)
  2699. //{
  2700. // int currentColIndex = this.ultraGrid1.ActiveCell.Column.Index;
  2701. // switch (e.KeyCode)
  2702. // {
  2703. // case Keys.Up:
  2704. // this.ultraGrid1.PerformAction(UltraGridAction.ExitEditMode);
  2705. // this.ultraGrid1.PerformAction(UltraGridAction.AboveRow);
  2706. // this.ultraGrid1.ActiveRow.Cells[currentColIndex].Activate();
  2707. // e.Handled = true;
  2708. // this.ultraGrid1.PerformAction(UltraGridAction.EnterEditMode);
  2709. // break;
  2710. // case Keys.Down:
  2711. // this.ultraGrid1.PerformAction(UltraGridAction.ExitEditMode);
  2712. // this.ultraGrid1.PerformAction(UltraGridAction.NextRow);
  2713. // this.ultraGrid1.ActiveRow.Cells[currentColIndex].Activate();
  2714. // e.Handled = true;
  2715. // this.ultraGrid1.PerformAction(UltraGridAction.EnterEditMode);
  2716. // break;
  2717. // case Keys.Right:
  2718. // this.ultraGrid1.PerformAction(UltraGridAction.ExitEditMode);
  2719. // this.ultraGrid1.PerformAction(UltraGridAction.NextCell);
  2720. // e.Handled = true;
  2721. // this.ultraGrid1.PerformAction(UltraGridAction.EnterEditMode);
  2722. // break;
  2723. // case Keys.Left:
  2724. // this.ultraGrid1.PerformAction(UltraGridAction.ExitEditMode);
  2725. // this.ultraGrid1.PerformAction(UltraGridAction.PrevCell);
  2726. // e.Handled = true;
  2727. // this.ultraGrid1.PerformAction(UltraGridAction.EnterEditMode);
  2728. // break;
  2729. // }
  2730. //}
  2731. }
  2732. }