61683fd7d86edf8e0b1ae373de78ae2083cc3ed6.svn-base 154 KB

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