QCM0201ZHB.cs 142 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188
  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 CoreFS.CA06;
  10. using System.Collections;
  11. using Infragistics.Win.UltraWinGrid;
  12. using Infragistics.Win;
  13. using System.Drawing.Printing;
  14. using System.IO;
  15. using System.Drawing.Imaging;
  16. using System.Drawing.Drawing2D;
  17. using ThoughtWorks.QRCode.Codec;
  18. namespace Core.LZMes.Client.QCM
  19. {
  20. public partial class QCM0201ZHB : FrmBase
  21. {
  22. #region 初始化
  23. //Boolean textboxHasText = false;//判断输入框是否有文本
  24. private String v_line_no = "";//RZ1-热轧 ZB1-中板线 HB1-厚板线 LT1-连退
  25. Image image2;//二维码
  26. private String v_BATCH_NO = "";//轧批号
  27. private String PRINT_SEQV = "";//打印序号
  28. private int lennum = 0;//长度
  29. public QCM0201ZHB()
  30. {
  31. InitializeComponent();
  32. }
  33. private void QCM0201ZHB_Load(object sender, EventArgs e)
  34. {
  35. //获取自定义参数
  36. if (!this.CustomInfo.Equals(""))
  37. {
  38. v_line_no = this.CustomInfo;
  39. }
  40. this.ultraGrid1.DisplayLayout.Bands[0].Columns["PHY_NAME_L_bj"].Header.Caption = "检验项目";
  41. this.ultraGrid4.DisplayLayout.Bands[0].Columns["PHY_NAME_L_bj"].Header.Caption = "检验项目";
  42. // dateTimePicker1.Value = DateTime.Now.Date.AddDays(-1);
  43. dateTimePicker2.Value = DateTime.Now.Date.AddDays(1);
  44. ValueList v = new ValueList();
  45. v.ValueListItems.Add("1", "是");
  46. v.ValueListItems.Add("0", "否");
  47. this.ultraGrid3.DisplayLayout.Bands[0].Columns["ISJUDGE"].ValueList = v.Clone();
  48. ValueList v1 = new ValueList();
  49. v1.ValueListItems.Add("0", "订单");
  50. v1.ValueListItems.Add("1", "人工");
  51. this.ultraGrid3.DisplayLayout.Bands[0].Columns["ITEM_FLAG"].ValueList = v1.Clone();
  52. this.ultraGrid6.DisplayLayout.Bands[0].Columns["ITEM_FLAG"].ValueList = v1.Clone();
  53. v1 = new ValueList();
  54. v1.ValueListItems.Add("0", "订单");
  55. v1.ValueListItems.Add("1", "人工复制");
  56. this.ultraGrid1.DisplayLayout.Bands[0].Columns["ITEM_FLAG"].ValueList = v1.Clone();
  57. this.ultraGrid4.DisplayLayout.Bands[0].Columns["ITEM_FLAG"].ValueList = v1.Clone();
  58. ValueList v2 = new ValueList();
  59. v2.ValueListItems.Add("A", "成分");
  60. v2.ValueListItems.Add("B", "材质");
  61. this.ultraGrid1.DisplayLayout.Bands[0].Columns["smp_catg"].ValueList = v2.Clone();
  62. this.ultraGrid4.DisplayLayout.Bands[0].Columns["smp_catg"].ValueList = v2.Clone();
  63. this.ultraGrid8.DisplayLayout.Bands[0].Columns["SMP_CATG"].ValueList = v2.Clone();
  64. ValueList v3 = new ValueList();
  65. v3.ValueListItems.Add("0", "未发送");
  66. v3.ValueListItems.Add("1", "已引用");
  67. v3.ValueListItems.Add("2", "已接收");
  68. v3.ValueListItems.Add("3", "已完成");
  69. v3.ValueListItems.Add("7", "确认接收样");
  70. this.ultraGrid8.DisplayLayout.Bands[0].Columns["STATUS"].ValueList = v3.Clone();
  71. ValueList v4 = new ValueList();
  72. v4.ValueListItems.Add("ZB1", "中板线");
  73. v4.ValueListItems.Add("HB1", "厚板线");
  74. this.ultraGrid4.DisplayLayout.Bands[0].Columns["PLINE_CODE_LIMS"].ValueList = v4.Clone();
  75. if ("ZB".Equals(v_line_no))
  76. {
  77. this.button3.Enabled = false;
  78. this.button4.Enabled = false;
  79. this.ultraGrid1.DisplayLayout.Bands[0].Columns["RZ_MIXROLL"].Hidden = true;
  80. this.ultraGrid1.DisplayLayout.Bands[0].Columns["RZ_OLD_SAMPL_NO"].Hidden = true;
  81. this.ultraGrid1.DisplayLayout.Bands[0].Columns["CHEM_INTERNALCONTROL"].Hidden = true;
  82. this.ultraGrid1.DisplayLayout.Bands[0].Columns["CRAFT_EXECUTE"].Hidden = true;
  83. this.ultraGrid1.DisplayLayout.Bands[0].Columns["FUNCTION_FUHE"].Hidden = true;
  84. this.ultraGrid1.DisplayLayout.Bands[0].Columns["SHOULD_SAMPLE"].Hidden = true;
  85. this.ultraGrid1.DisplayLayout.Bands[0].Columns["STOVE_TIME"].Hidden = true;
  86. this.ultraGrid4.DisplayLayout.Bands[0].Columns["RZ_MIXROLL"].Hidden = true;
  87. this.ultraGrid4.DisplayLayout.Bands[0].Columns["RZ_OLD_SAMPL_NO"].Hidden = true;
  88. this.ultraGrid4.DisplayLayout.Bands[0].Columns["CHEM_INTERNALCONTROL"].Hidden = true;
  89. this.ultraGrid4.DisplayLayout.Bands[0].Columns["CRAFT_EXECUTE"].Hidden = true;
  90. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FUNCTION_FUHE"].Hidden = true;
  91. this.ultraGrid4.DisplayLayout.Bands[0].Columns["SHOULD_SAMPLE"].Hidden = true;
  92. this.ultraGrid4.DisplayLayout.Bands[0].Columns["STOVE_TIME"].Hidden = true;
  93. this.ultraGrid7.DisplayLayout.Bands[0].Columns["组批区间"].Hidden = true;
  94. this.ultraGrid7.DisplayLayout.Bands[0].Columns["成分是否符合"].Hidden = true;
  95. this.ultraGrid7.DisplayLayout.Bands[0].Columns["工艺是否符合"].Hidden = true;
  96. this.ultraGrid7.DisplayLayout.Bands[0].Columns["预测性能"].Hidden = true;
  97. this.ultraGrid7.DisplayLayout.Bands[0].Columns["是否预测抽样"].Hidden = true;
  98. this.ultraGrid7.DisplayLayout.Bands[0].Columns["加热炉出炉时间"].Hidden = true;
  99. }
  100. }
  101. #endregion
  102. #region 功能
  103. public override void ToolBar_Click(object sender, string ToolbarKey)
  104. {
  105. switch (ToolbarKey)
  106. {
  107. case "Query":
  108. this.DoQuery();
  109. break;
  110. case "Send":
  111. this.DoSend();
  112. break;
  113. case "Unsend":
  114. this.DoUnsend();//撤销委托
  115. break;
  116. case "Unsend19":
  117. this.DoUnsend19();//撤销19委托
  118. break;
  119. case "Add":
  120. this.AddBasePhy();//新增检验项
  121. break;
  122. case "AddArtificial":
  123. this.AddArtificial();//新增人工委托
  124. break;
  125. case "Update":
  126. this.DoUpdate();//修改取样材料号
  127. break;
  128. case "AddWt":
  129. this.DoAddWt();//新增复制单条委托
  130. break;
  131. case "DelWt":
  132. this.DoDelWt();//撤销复制单条委托
  133. break;
  134. case "DoDelete":
  135. this.DoDelete();//删除委托
  136. break;
  137. case "UpBatchNo":
  138. this.DoUpBatchNo();//复样 修改轧批号 (一炉5个轧批 1 2 3 4 5 取1号轧批委托 夹杂不合格 复 2 3轧批)
  139. break;
  140. case "UpRefBatchNo":
  141. this.DoUpRefBatchNo();//初样 修改指定的按炉引用 (一炉5个轧批 1 2 3 4 5 系统默认为 1 但是现场实际取的是3 所以要人工修改)
  142. break;
  143. case "DoQuote":
  144. //this.DoQuote();//引用实绩
  145. this.DoQuoteKY();
  146. break;
  147. case "AllUpdate":
  148. this.DoAllUpdate();//修改 全部修改的方法
  149. break;
  150. case "InExport": // 导出
  151. ClsControlPack.ExportDataWithSaveDialog2(ref ultraGrid7, this.Text);
  152. // ClsControlPack.ExportDataWithSaveDialog2(ref ultraGrid4, this.Text);
  153. // this.inExport();
  154. break;
  155. case "DoProcessNo":
  156. this.DoProcessNo();//调整热处理号
  157. break;
  158. case "doPrint":
  159. this.doPrint();//打印
  160. break;
  161. }
  162. }
  163. #region 打印
  164. private void doPrint()
  165. {
  166. RowsCollection rowsCollection = this.ultraGrid1.Rows;
  167. if (this.ultraTabControl1.Tabs[0].Selected) //检验委托
  168. {
  169. rowsCollection = this.ultraGrid1.Rows;
  170. }
  171. else if (this.ultraTabControl1.Tabs[1].Selected)
  172. {
  173. rowsCollection = this.ultraGrid4.Rows;
  174. }
  175. foreach (UltraGridRow ugr in rowsCollection)
  176. {
  177. if (ugr.Cells["CHK"].Value.ToString().ToLower() == "true")
  178. {
  179. String specimenNo = ugr.Cells["SPECIMEN_NO"].Value.ToString();//取样编号
  180. String materialNo = ugr.Cells["MATERIAL_NO"].Value.ToString();//子板号
  181. String batchNO = ugr.Cells["BATCH_NO"].Value.ToString();//轧批号
  182. String steelName = ugr.Cells["STEEL_NAME"].Value.ToString();//钢种
  183. String thck = ugr.Cells["THICK"].Value.ToString();//规格
  184. String phyNameLbj = ugr.Cells["PHY_NAME_L_bj"].Value.ToString();//项目
  185. String STATUS = ugr.Cells["STATUS"].Value.ToString();//发送状态
  186. String PRINT_SEQ = ugr.Cells["PRINT_SEQ"].Value.ToString();//打印序号
  187. if (STATUS.Equals("未发送"))
  188. {
  189. this.alert("当前委托还未发送!请先发送委托");
  190. return;
  191. }
  192. if (string.IsNullOrEmpty(specimenNo))
  193. {
  194. this.alert("未找到相应委托数据!请核实!!!");
  195. return;
  196. }
  197. if (string.IsNullOrEmpty(PRINT_SEQ))
  198. {
  199. PRINT_SEQ = "1";
  200. }
  201. v_BATCH_NO = materialNo;//轧批号 batchNO 换成子板号240126
  202. PRINT_SEQV = PRINT_SEQ;
  203. //二维码内容
  204. String qrCodeContent = specimenNo;
  205. QRCodeEncoder qrCodeEncoder = new QRCodeEncoder();
  206. qrCodeEncoder.QRCodeEncodeMode = QRCodeEncoder.ENCODE_MODE.BYTE;//二维码编码格式
  207. int num = qrCodeContent.Length;
  208. lennum = num;
  209. if (num <= 90)
  210. {
  211. qrCodeEncoder.QRCodeScale = 5;
  212. qrCodeEncoder.QRCodeVersion = 2;
  213. }
  214. else
  215. {
  216. qrCodeEncoder.QRCodeScale = 6;//二维码大小比例4
  217. qrCodeEncoder.QRCodeVersion = 14;//设置二维码的版本,默认7 该值影响二维码最高数据容量 7大致对应40个汉字长度,内容超出择需提升该数值
  218. }
  219. //设置错误校验级别,默认中等,二维码被遮挡住一部分实际上也是能扫出内容的,这个效验级别的意思就是
  220. //当遮挡部分最大占整体多少时仍然可以被扫出来,M大概在20%左右,H为30%,级别越高相应的数据容量会缩小
  221. qrCodeEncoder.QRCodeErrorCorrect = QRCodeEncoder.ERROR_CORRECTION.M;
  222. System.Drawing.Image image = qrCodeEncoder.Encode(qrCodeContent, Encoding.UTF8);//生成二维码图片 第一个参数打印内容
  223. image2 = image;
  224. string FilePath = @"C:\二维码";
  225. if (!Directory.Exists(FilePath))
  226. {
  227. Directory.CreateDirectory(FilePath);//判断是否有相应文件夹
  228. }
  229. PrintDocument printDocument = new PrintDocument();
  230. printDocument.PrinterSettings.PrinterName = "Deli DL-888T";//打印机名
  231. printDocument.PrintPage += new PrintPageEventHandler(pdt_PrintPage);//设置字体
  232. try
  233. {
  234. if (!printDocument.PrinterSettings.IsValid)
  235. {
  236. MessageBox.Show("打印设置无效!", "出错", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  237. return;
  238. }
  239. printDocument.Print();
  240. }
  241. catch (Exception ex)
  242. {
  243. MessageBox.Show("打印过程出现异常!\n" + ex.Message, "出错", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  244. }
  245. finally
  246. {
  247. printDocument.Dispose();
  248. }
  249. //增加打印标识
  250. CoreClientParam ccp = new CoreClientParam();
  251. ccp.ServerName = "QCM.JHY01.JHY0102.UpdateInfo";
  252. ccp.MethodName = "doPrintLog";
  253. ccp.ServerParams = new object[] { specimenNo };
  254. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  255. //保存二维码
  256. //FilePath = @"C:\二维码\" + batchNO + "二维码.jpg";
  257. //System.IO.FileStream fs = new System.IO.FileStream(FilePath, System.IO.FileMode.Create, System.IO.FileAccess.Write, System.IO.FileShare.None);
  258. //image.Save(fs, System.Drawing.Imaging.ImageFormat.Jpeg);
  259. //fs.Close();
  260. image.Dispose();
  261. }
  262. }
  263. }
  264. void pdt_PrintPage(object sender, PrintPageEventArgs e)
  265. {
  266. Graphics grfx = e.Graphics;
  267. grfx.DrawString(PRINT_SEQV, new Font("宋体", 15), Brushes.Black, 22, 70);//打印内容、字体、颜色、X、Y
  268. grfx.DrawString(v_BATCH_NO, new Font("宋体", 14), Brushes.Black, 68, 130);//打印内容、字体、颜色、X、Y
  269. grfx.DrawImage(image2, 70, 15, 120, 110);//图片、X、Y、宽、高
  270. }
  271. #endregion
  272. #endregion
  273. #region 功能方法
  274. #region 调整热处理号
  275. private void DoProcessNo()
  276. {
  277. String tabstr = "1";
  278. RowsCollection rowsCollection = this.ultraGrid1.Rows;
  279. if (this.ultraTabControl1.Tabs[0].Selected) //检验委托
  280. {
  281. rowsCollection = this.ultraGrid1.Rows;
  282. tabstr = "1";
  283. }
  284. else if (this.ultraTabControl1.Tabs[1].Selected)
  285. {
  286. rowsCollection = this.ultraGrid4.Rows;
  287. tabstr = "2";
  288. }
  289. foreach (UltraGridRow ugr in rowsCollection)
  290. {
  291. if (ugr.Cells["CHK"].Value.ToString().ToLower() == "true")
  292. {
  293. String PROCESS_NOS = ugr.Cells["PROCESS_NOS"].Value.ToString();//热处理号
  294. String RCL_STATE = ugr.Cells["RCL_STATE"].Value.ToString();//库存热处理号
  295. String SPECIMEN_NO = ugr.Cells["SPECIMEN_NO"].Value.ToString();//取样编号
  296. String MATERIAL_NO = ugr.Cells["MATERIAL_NO"].Value.ToString();
  297. String BATCH_NO = ugr.Cells["BATCH_NO"].Value.ToString();
  298. String SMP_NO = ugr.Cells["SMP_NO"].Value.ToString();
  299. String PLINE_CODE = ugr.Cells["PLINE_CODE"].Value.ToString();
  300. String userName = this.UserInfo.GetUserName().ToString();
  301. if (RCL_STATE.Contains("G"))
  302. {
  303. if (!PROCESS_NOS.Equals(RCL_STATE))
  304. {
  305. this.alert(MATERIAL_NO + "实时库存热处理号为:[" + RCL_STATE + "]请调整为正确的送样热处理号!");
  306. return;
  307. }
  308. }
  309. Hashtable ht = new Hashtable();
  310. ht.Add("PROCESS_NOS", PROCESS_NOS);
  311. ht.Add("SPECIMEN_NO", SPECIMEN_NO);
  312. ht.Add("MATERIAL_NO", MATERIAL_NO);
  313. ht.Add("BATCH_NO", BATCH_NO);
  314. ht.Add("SMP_NO", SMP_NO);
  315. ht.Add("PLINE_CODE", PLINE_CODE);
  316. ht.Add("USER_NAME", userName);
  317. CoreClientParam ccp = new CoreClientParam();
  318. ccp.ServerName = "QCM.JHY01.JHY0102.UpdateInfo";
  319. ccp.MethodName = "doProcessNos";
  320. ccp.ServerParams = new object[] { ht };
  321. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  322. if (ccp.ReturnCode == -1)
  323. {
  324. return;
  325. }
  326. }
  327. }
  328. MessageBox.Show("调整热处理号成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);
  329. this.DoQuery();
  330. }
  331. #endregion
  332. #region 导出
  333. private void inExport()
  334. {
  335. try
  336. {
  337. String checkboxVal = "";
  338. String STARTTIME = this.dateTimePicker1.Value.ToString("yyyy-MM-dd");
  339. String ENDTIME = this.dateTimePicker2.Value.ToString("yyyy-MM-dd");
  340. String BATCH_NO = this.textBox1.Text.Trim();
  341. String BATCH_NO2 = this.BATCH_NO2.Text.Trim();
  342. String VALIDFLAG = "1";
  343. String CERT_INST_NAME = this.textBox2.Text.Trim();//认证机构
  344. String PLINE_NAME = this.PLINE_NAME.Text.Trim();
  345. String PLINE_CODE = v_line_no;
  346. String STEEL_NAME = this.txt_steel_name.Text.Trim();
  347. String SMP_CATG = this.cbx_smp_catg.Text.Trim();
  348. String heatNo = this.selheatNo.Text.Trim();
  349. String DESIGNKEY = this.sel_design_key.Text.Trim();
  350. String SAMPLE_DELIVERY_TIME = this.SAMPLE_DELIVERY_TIME2.Text.Trim();//查询 送样时间点
  351. String sdtime = this.dateTimePicker4.Text.ToString();
  352. SAMPLE_DELIVERY_TIME = sdtime + " " + SAMPLE_DELIVERY_TIME;//送样时间点
  353. if (PLINE_NAME.Equals("全部"))
  354. {
  355. PLINE_NAME = "";
  356. }
  357. if (CERT_INST_NAME.Equals("全部"))
  358. {
  359. CERT_INST_NAME = "";
  360. }
  361. if (SMP_CATG.Equals("全部"))
  362. {
  363. SMP_CATG = "";
  364. }
  365. else if (SMP_CATG.Equals("成分"))
  366. {
  367. SMP_CATG = "A";
  368. }
  369. else
  370. {
  371. SMP_CATG = "B";
  372. }
  373. if (this.CustomInfo == "HB")
  374. {
  375. PLINE_NAME = "厚板线";
  376. }
  377. else if (this.CustomInfo == "ZB")
  378. {
  379. PLINE_NAME = "中板线";
  380. }
  381. //轧批号 小框框 是否勾选
  382. if (this.checkBox1.Checked)
  383. {
  384. checkboxVal = "1";
  385. STARTTIME = "";
  386. ENDTIME = "";
  387. }
  388. else
  389. {
  390. BATCH_NO = "";
  391. BATCH_NO2 = "";
  392. }
  393. if (this.checkBox2.Checked)
  394. {
  395. STARTTIME = "";
  396. ENDTIME = "";
  397. }
  398. else
  399. {
  400. heatNo = "";
  401. }
  402. if (this.checkBox3.Checked)
  403. {
  404. //STARTTIME = "";
  405. //ENDTIME = "";
  406. }
  407. else
  408. {
  409. DESIGNKEY = "";
  410. }
  411. if (!this.checkBox4.Checked)
  412. {
  413. SAMPLE_DELIVERY_TIME = "";
  414. }
  415. String checkbokTxtL = "F";//同轧批合并委托
  416. if (this.checkBox6.Checked)
  417. {
  418. checkbokTxtL = "T";
  419. }
  420. Hashtable ht = new Hashtable();
  421. ht.Add("BATCH_NO", BATCH_NO);
  422. ht.Add("BATCH_NO2", BATCH_NO2);
  423. ht.Add("STARTTIME", STARTTIME);
  424. ht.Add("ENDTIME", ENDTIME);
  425. ht.Add("VALIDFLAG", VALIDFLAG);
  426. ht.Add("CERT_INST_NAME", CERT_INST_NAME);
  427. ht.Add("PLINE_NAME", PLINE_NAME);
  428. ht.Add("PLINE_CODE", PLINE_CODE);
  429. ht.Add("checkboxVal", checkboxVal);
  430. if (this.ultraTabControl1.Tabs[0].Selected)
  431. {
  432. ht.Add("STATUS", "0");
  433. }
  434. if (this.ultraTabControl1.Tabs[1].Selected || this.ultraTabControl1.Tabs[2].Selected)
  435. {
  436. ht.Add("TAB_NAME", "1");
  437. }
  438. ht.Add("STEEL_NAME", STEEL_NAME);
  439. ht.Add("SMP_CATG", SMP_CATG);
  440. ht.Add("HEAT_NO", heatNo);
  441. ht.Add("DESIGN_KEY", DESIGNKEY);
  442. ht.Add("SAMPLE_DELIVERY_TIME", SAMPLE_DELIVERY_TIME);
  443. ht.Add("CHECKBOKTXTL", checkbokTxtL);
  444. String PLINE_NAME2 = "导出数据";
  445. if (this.CustomInfo == "HB")
  446. {
  447. PLINE_NAME2 = "厚板线导出";
  448. }
  449. else if (this.CustomInfo == "ZB")
  450. {
  451. PLINE_NAME2 = "中板线导出";
  452. }
  453. this.dataSet8.Clear();
  454. CoreClientParam ccp = new CoreClientParam();
  455. ccp.ServerName = "QCM.JHY01.JHY0101.QuerryQltySample";
  456. ccp.MethodName = "ZHBQueryExcel";
  457. ccp.ServerParams = new object[] {ht};
  458. ccp.SourceDataTable = this.dataSet8.Tables[0];
  459. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  460. // ClsControlPack.RefreshAndAutoSize(ultraGrid7);
  461. foreach (UltraGridRow ugr in this.ultraGrid7.Rows)
  462. {
  463. string specimen_no = ugr.Cells["取样编号"].Value.ToString();
  464. if (!string.IsNullOrEmpty(specimen_no))
  465. {
  466. CoreClientParam ccp2 = new CoreClientParam();
  467. ccp2.ServerName = "QCM.JHY01.JHY0101.QuerryQltySample";
  468. ccp2.MethodName = "getQltySampleItemNew2";
  469. ccp2.ServerParams = new object[] { specimen_no };
  470. ccp2.SourceDataTable = this.dataSet8.Tables[1];
  471. ultraGrid7.BeginUpdate();
  472. //重绘控件直到endupdate 不会每次就重绘控件 避免闪烁
  473. for (int idx = this.dataTable9.Rows.Count - 1; idx >= 0; idx--)
  474. {
  475. if (Convert.ToString(this.dataTable9.Rows[idx]["取样编号"]) == specimen_no)
  476. this.dataTable9.Rows[idx].Delete();
  477. }
  478. this.dataTable9.AcceptChanges();
  479. this.ExecuteQueryToDataTable(ccp2, CoreInvokeType.Internal);
  480. ultraGrid7.EndUpdate();
  481. }
  482. }
  483. }
  484. catch (Exception ex)
  485. {
  486. System.Diagnostics.Debug.WriteLine(ex.ToString());
  487. MessageBox.Show("系统出错,请联系管理人员", "警告");
  488. }
  489. }
  490. #endregion
  491. #region 全部修改
  492. private void DoAllUpdate()
  493. {
  494. if (this.ultraTabControl1.Tabs[0].Selected) //检验委托
  495. {
  496. UltraGridRow row = this.ultraGrid1.ActiveRow;
  497. String type = row.Cells["SMP_TYPE_CODE"].Value.ToString();
  498. if (type.Equals("0"))
  499. {
  500. //初样修改 夹杂按炉已不用这个按钮了
  501. // DoUpRefBatchNo();
  502. }
  503. else if (type.Equals("1"))
  504. {
  505. //复样修改
  506. DoUpBatchNo();
  507. }
  508. }
  509. else if (this.ultraTabControl1.Tabs[1].Selected)
  510. {
  511. //委托记录
  512. //修改热处理号 取样材料号
  513. doAllUpdate();
  514. }
  515. }
  516. #endregion
  517. #region 初样 修改取样轧批号按炉初样比如:夹杂
  518. private void DoUpRefBatchNo()
  519. {
  520. try
  521. {
  522. CoreClientParam ccp = new CoreClientParam();
  523. ArrayList smpNo = new ArrayList();//试样号
  524. ArrayList specimenNo = new ArrayList();//取样编号
  525. ArrayList batchNo = new ArrayList();//轧批号
  526. ArrayList heatnNo = new ArrayList();//炉号
  527. ArrayList materialNo = new ArrayList();//取样材料号
  528. ArrayList send_memo = new ArrayList();//发送备注
  529. ArrayList inspectionLot = new ArrayList();//检验号
  530. ArrayList plineCode = new ArrayList();
  531. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  532. {
  533. if (ugr.Cells["CHK"].Value.ToString().ToLower() == "true")
  534. {
  535. if (!ugr.Cells["SMP_TYPE_CODE"].Value.ToString().Equals("0") || !ugr.Cells["FREQ_CODE"].Value.ToString().Equals("D"))
  536. {
  537. this.alert("修改初样取样轧批号按钮是用来修改【初样】【按炉取样】的轧批,请谨慎操作!");
  538. return;
  539. }
  540. smpNo.Add(ugr.Cells["SMP_NO"].Value.ToString());
  541. specimenNo.Add(ugr.Cells["SPECIMEN_NO"].Value.ToString());
  542. batchNo.Add(ugr.Cells["BATCH_NO"].Value.ToString());
  543. heatnNo.Add(ugr.Cells["HEAT_NO"].Value.ToString());
  544. materialNo.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
  545. send_memo.Add(ugr.Cells["SEND_MEMO"].Value.ToString());
  546. inspectionLot.Add(ugr.Cells["INSPECTION_LOT"].Value.ToString());
  547. plineCode.Add(ugr.Cells["PLINE_CODE"].Value.ToString());
  548. }
  549. }
  550. ccp.ServerName = "QCM.JHY01.JHY0102.UpdateInfo";
  551. ccp.MethodName = "DoUpRefBatchNo";
  552. ccp.ServerParams = new object[] { smpNo, specimenNo, batchNo, heatnNo, materialNo, send_memo, inspectionLot, plineCode };
  553. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  554. if (ccp.ReturnCode != -1)
  555. {
  556. MessageBox.Show("修改成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);
  557. this.DoQuery();
  558. }
  559. }
  560. catch (Exception ex)
  561. {
  562. System.Diagnostics.Debug.WriteLine(ex.ToString());
  563. MessageBox.Show("系统出错【初样修改轧批号】,请联系管理人员", "警告");
  564. }
  565. }
  566. #endregion
  567. #region 复样 修改轧批号
  568. private void DoUpBatchNo()
  569. {
  570. try
  571. {
  572. CoreClientParam ccp = new CoreClientParam();
  573. ArrayList smpNo = new ArrayList();//试样号
  574. ArrayList specimenNo = new ArrayList();//取样编号
  575. ArrayList batchNo = new ArrayList();//轧批号
  576. ArrayList materialNo = new ArrayList();//取样材料号
  577. ArrayList send_memo = new ArrayList();//发送备注
  578. ArrayList inspectionLot = new ArrayList();//检验号
  579. ArrayList plineCode = new ArrayList();
  580. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  581. {
  582. if (ugr.Cells["CHK"].Value.ToString().ToLower() == "true")
  583. {
  584. if ((!ugr.Cells["SMP_TYPE_CODE"].Value.ToString().Equals("1") && !ugr.Cells["SMP_TYPE_CODE"].Value.ToString().Equals("3")) || !ugr.Cells["FREQ_CODE"].Value.ToString().Equals("D"))
  585. {
  586. this.alert("修改复样轧批号按钮是用来修改【复样】【按炉取样】的轧批,请谨慎操作!");
  587. return;
  588. }
  589. smpNo.Add(ugr.Cells["SMP_NO"].Value.ToString());
  590. specimenNo.Add(ugr.Cells["SPECIMEN_NO"].Value.ToString());
  591. batchNo.Add(ugr.Cells["BATCH_NO"].Value.ToString());
  592. materialNo.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
  593. send_memo.Add(this.UserInfo.GetUserName().ToString());//ugr.Cells["SEND_MEMO"].Value.ToString()
  594. inspectionLot.Add(ugr.Cells["INSPECTION_LOT"].Value.ToString());
  595. plineCode.Add(ugr.Cells["PLINE_CODE"].Value.ToString());
  596. }
  597. }
  598. ccp.ServerName = "QCM.JHY01.JHY0102.UpdateInfo";
  599. ccp.MethodName = "updateBatchNo";
  600. ccp.ServerParams = new object[] { smpNo, specimenNo, batchNo, materialNo, send_memo, inspectionLot, plineCode };
  601. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  602. if (ccp.ReturnCode != -1)
  603. {
  604. MessageBox.Show("修改成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);
  605. this.DoQuery();
  606. }
  607. }
  608. catch (Exception ex)
  609. {
  610. System.Diagnostics.Debug.WriteLine(ex.ToString());
  611. MessageBox.Show("系统出错【复样修改轧批号】,请联系管理人员", "警告");
  612. }
  613. }
  614. #endregion
  615. #region 修改热处理号 取样材料号
  616. public void doAllUpdate()
  617. {
  618. UltraGridRow row = this.ultraGrid4.ActiveRow;
  619. String PROCESS_NOS = row.Cells["PROCESS_NOS"].Value.ToString().Trim();
  620. String MATERIAL_NO = row.Cells["MATERIAL_NO"].Value.ToString();
  621. String BATCH_NO = row.Cells["BATCH_NO"].Value.ToString();
  622. String SPECIMEN_NO = row.Cells["SPECIMEN_NO"].Value.ToString();
  623. String SMP_NO = row.Cells["SMP_NO"].Value.ToString();
  624. String PLINE_CODE = row.Cells["PLINE_CODE"].Value.ToString();
  625. Hashtable ht = new Hashtable();
  626. ht.Add("PROCESS_NOS", PROCESS_NOS);
  627. ht.Add("MATERIAL_NO", MATERIAL_NO);
  628. ht.Add("BATCH_NO", BATCH_NO);
  629. ht.Add("SPECIMEN_NO", SPECIMEN_NO);
  630. ht.Add("SMP_NO", SMP_NO);
  631. ht.Add("PLINE_CODE", PLINE_CODE);
  632. ht.Add("USER_NAME", this.UserInfo.GetUserName().ToString());
  633. CoreClientParam ccp = new CoreClientParam();
  634. ccp.ServerName = "QCM.JHY01.JHY0102.UpdateInfo";
  635. ccp.MethodName = "doAllUpdate";
  636. ccp.ServerParams = new object[] { ht };
  637. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  638. if (ccp.ReturnCode == -1)
  639. {
  640. return;
  641. }
  642. MessageBox.Show("修改成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);
  643. this.DoQuery();
  644. }
  645. #endregion
  646. #region 修改取样材料号
  647. private void DoUpdate()
  648. {
  649. try
  650. {
  651. // String plineCode = this.CustomInfo;
  652. CoreClientParam ccp = new CoreClientParam();
  653. ArrayList smpNo = new ArrayList();//试样号
  654. ArrayList specimenNo = new ArrayList();//取样编号
  655. ArrayList batchNo = new ArrayList();//轧批号
  656. ArrayList materialNo = new ArrayList();//取样材料号
  657. ArrayList send_memo = new ArrayList();//发送备注
  658. ArrayList inspectionLot = new ArrayList();//检验号
  659. ArrayList plineCode = new ArrayList();
  660. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  661. {
  662. if (ugr.Cells["CHK"].Value.ToString().ToLower() == "true")
  663. {
  664. smpNo.Add(ugr.Cells["SMP_NO"].Value.ToString());
  665. specimenNo.Add(ugr.Cells["SPECIMEN_NO"].Value.ToString());
  666. batchNo.Add(ugr.Cells["BATCH_NO"].Value.ToString());
  667. if (string.IsNullOrEmpty(ugr.Cells["MATERIAL_NO"].Value.ToString()))
  668. {
  669. this.alert("取样材料号不能为空!!!!");
  670. return;
  671. }
  672. materialNo.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
  673. send_memo.Add(ugr.Cells["SEND_MEMO"].Value.ToString());
  674. inspectionLot.Add(ugr.Cells["INSPECTION_LOT"].Value.ToString());
  675. plineCode.Add(ugr.Cells["PLINE_CODE"].Value.ToString());
  676. }
  677. }
  678. ccp.ServerName = "QCM.JHY01.JHY0102.UpdateInfo";
  679. ccp.MethodName = "updateMaterialNo";
  680. ccp.ServerParams = new object[] { smpNo, specimenNo, batchNo, materialNo, send_memo, inspectionLot, plineCode };
  681. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  682. }
  683. catch (Exception ex)
  684. {
  685. System.Diagnostics.Debug.WriteLine(ex.ToString());
  686. MessageBox.Show("系统出错【修改取样材料号】,请联系管理人员", "警告");
  687. }
  688. }
  689. #endregion
  690. #region 新增人工委托
  691. private void AddArtificial()
  692. {
  693. try
  694. {
  695. QCM0205ZHB frmRbp = new QCM0205ZHB();
  696. frmRbp.StartPosition = FormStartPosition.CenterScreen;
  697. frmRbp.ob = this.ob;
  698. if(v_line_no.Equals("ZB")){
  699. frmRbp.plineCode = "ZB1";
  700. }else if(v_line_no.Equals("HB")){
  701. frmRbp.plineCode = "HB1";
  702. }
  703. frmRbp.ShowDialog();
  704. this.DoQuery();
  705. }
  706. catch (Exception ex)
  707. {
  708. MessageBox.Show("操作过程出现异常!\n" + ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  709. }
  710. }
  711. #endregion
  712. #region 新增检验项
  713. private void AddBasePhy()
  714. {
  715. try
  716. {
  717. UltraGridRow row = this.ultraGrid1.ActiveRow;
  718. if (row == null)
  719. {
  720. this.alert("检验委托为空!请选择检验委托数据!!!");
  721. return;
  722. }
  723. if (!row.Cells["SMP_CATG"].Text.ToString().Equals("材质"))
  724. {
  725. this.alert("只有材质数据才可以新增检验项!!!");
  726. return;
  727. }
  728. QCM0204 frmRbp = new QCM0204();
  729. frmRbp.StartPosition = FormStartPosition.CenterScreen;
  730. frmRbp.ob = this.ob;
  731. frmRbp.specimenNo = row.Cells["SPECIMEN_NO"].Value.ToString();
  732. frmRbp.smpNo = row.Cells["SMP_NO"].Value.ToString();
  733. frmRbp.plineCode = "ZHB";
  734. frmRbp.ShowDialog();
  735. this.DoQueryPrg(row);//右下角
  736. }
  737. catch (Exception ex)
  738. {
  739. MessageBox.Show("操作过程出现异常!\n" + ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  740. }
  741. }
  742. #endregion
  743. #region 新增复制单条委托
  744. private void DoAddWt()
  745. {
  746. try
  747. {
  748. int num = 0;
  749. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  750. {
  751. if (ugr.Cells["CHK"].Value.ToString().ToLower() == "true")
  752. {
  753. num = num + 1;
  754. }
  755. }
  756. if (num > 1)
  757. {
  758. this.alert("只能单条复制!为防止数据差错谢谢配合【谨慎复制】");
  759. return;
  760. }
  761. UltraGridRow row = this.ultraGrid1.ActiveRow;
  762. if (row == null)
  763. {
  764. this.alert("检验委托为空!请选择检验委托数据!!!");
  765. return;
  766. }
  767. String batchNo = row.Cells["BATCH_NO"].Value.ToString();//轧批号
  768. String designKey = row.Cells["DESIGN_KEY"].Value.ToString();//订单号
  769. String smpNo = row.Cells["SMP_NO"].Value.ToString();//试样号
  770. String specimenNo = row.Cells["SPECIMEN_NO"].Value.ToString();//取样编号
  771. String smpTypeName = row.Cells["SMP_TYPE_NAME"].Value.ToString();//取样类型
  772. if (MessageBox.Show("轧批号【" + batchNo + "】,确认复制当前委托一条?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
  773. {
  774. return;
  775. }
  776. CoreClientParam ccp = new CoreClientParam();
  777. ccp.ServerName = "QCM.JHY01.JHY0102.UpdateInfo";
  778. if (smpTypeName.Equals("初样"))
  779. {
  780. ccp.MethodName = "DoAddWtZy";
  781. }
  782. else if (smpTypeName.Equals("复样"))
  783. {
  784. ccp.MethodName = "DoAddWtFy";
  785. }
  786. ccp.ServerParams = new object[] { batchNo, designKey, smpNo, specimenNo, this.UserInfo.GetUserName() };
  787. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  788. if (ccp.ReturnCode != -1)
  789. {
  790. MessageBox.Show("复制委托成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);
  791. }
  792. this.DoQuery();
  793. }
  794. catch (Exception ex)
  795. {
  796. MessageBox.Show("操作过程出现异常!\n" + ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  797. }
  798. }
  799. #endregion
  800. #region 撤销复制单条委托
  801. private void DoDelWt()
  802. {
  803. try
  804. {
  805. int num = 0;
  806. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  807. {
  808. if (ugr.Cells["CHK"].Value.ToString().ToLower() == "true")
  809. {
  810. num = num + 1;
  811. }
  812. }
  813. if (num > 1)
  814. {
  815. this.alert("只能单条删除!为防止数据差错谢谢配合【谨慎删除】");
  816. return;
  817. }
  818. UltraGridRow row = this.ultraGrid1.ActiveRow;
  819. if (row == null)
  820. {
  821. this.alert("检验委托为空!请选择检验委托数据!!!");
  822. return;
  823. }
  824. String batchNo = row.Cells["BATCH_NO"].Value.ToString();//轧批号
  825. String designKey = row.Cells["DESIGN_KEY"].Value.ToString();//订单号
  826. String smpNo = row.Cells["SMP_NO"].Value.ToString();//试样号
  827. String specimenNo = row.Cells["SPECIMEN_NO"].Value.ToString();//取样编号
  828. String smpTypeName = row.Cells["SMP_TYPE_NAME"].Value.ToString();//取样类型
  829. String item_flag = row.Cells["ITEM_FLAG"].Value.ToString();//项目来源(0-订单,1-人工)
  830. if (MessageBox.Show("轧批号【" + batchNo + "】,确认撤销当前委托?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
  831. {
  832. return;
  833. }
  834. if (!item_flag.Equals("1"))
  835. {
  836. this.alert("只能撤销人工复制委托");
  837. return;
  838. }
  839. CoreClientParam ccp = new CoreClientParam();
  840. ccp.ServerName = "QCM.JHY01.JHY0102.UpdateInfo";
  841. if (smpTypeName.Equals("初样"))
  842. {
  843. ccp.MethodName = "DoDelWtZy";
  844. }
  845. else if (smpTypeName.Equals("复样"))
  846. {
  847. ccp.MethodName = "DoDelWtFy";
  848. }
  849. ccp.ServerParams = new object[] { batchNo, designKey, smpNo, specimenNo };
  850. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  851. if (ccp.ReturnCode != -1)
  852. {
  853. MessageBox.Show("撤销复制委托成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);//ccp.ReturnInfo "发送成功" ccp.ReturnInfo
  854. }
  855. this.DoQuery();
  856. }
  857. catch (Exception ex)
  858. {
  859. MessageBox.Show("操作过程出现异常!\n" + ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  860. }
  861. }
  862. #endregion
  863. #region 删除委托
  864. private void DoDelete()
  865. {
  866. try
  867. {
  868. UltraGridRow row = this.ultraGrid1.ActiveRow;
  869. if (row == null)
  870. {
  871. this.alert("检验委托为空!请选择检验委托数据!!!");
  872. return;
  873. }
  874. String batchNoViw = row.Cells["BATCH_NO"].Value.ToString();//轧批号
  875. ArrayList batchNo = new ArrayList();//轧批号
  876. ArrayList designKey = new ArrayList();//订单号
  877. ArrayList smpNo = new ArrayList();//试样号
  878. ArrayList specimenNo = new ArrayList();//取样编号
  879. ArrayList smpTypeName = new ArrayList();//取样类型
  880. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  881. {
  882. if (ugr.Cells["CHK"].Value.ToString().ToLower() == "true")
  883. {
  884. batchNo.Add(ugr.Cells["BATCH_NO"].Value.ToString());//轧批号
  885. designKey.Add(ugr.Cells["DESIGN_KEY"].Value.ToString());//订单号
  886. smpNo.Add(ugr.Cells["SMP_NO"].Value.ToString());//试样号
  887. specimenNo.Add(ugr.Cells["SPECIMEN_NO"].Value.ToString());//取样编号
  888. if (ugr.Cells["SMP_TYPE_NAME"].Value.ToString().Contains("模拟焊后"))
  889. {
  890. smpTypeName.Add("初样");//取样类型
  891. }
  892. else
  893. {
  894. smpTypeName.Add(ugr.Cells["SMP_TYPE_NAME"].Value.ToString());//取样类型
  895. }
  896. if (ugr.Cells["SMP_TYPE_CODE"].Value.ToString().Equals("3"))
  897. {
  898. this.alert("件件取样暂时不支持删除!!!");
  899. return;
  900. }
  901. }
  902. }
  903. if (MessageBox.Show("确认删除轧批号【" + batchNoViw + "】委托?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
  904. {
  905. return;
  906. }
  907. CoreClientParam ccp = new CoreClientParam();
  908. ccp.ServerName = "QCM.JHY01.JHY0102.UpdateInfo";
  909. ccp.MethodName = "DoDelete";
  910. ccp.ServerParams = new object[] { batchNo, designKey, smpNo, specimenNo, smpTypeName, this.UserInfo.GetUserName() };
  911. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  912. if (ccp.ReturnCode != -1)
  913. {
  914. MessageBox.Show("删除委托成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);
  915. }
  916. this.DoQuery();
  917. }
  918. catch (Exception ex)
  919. {
  920. MessageBox.Show("操作过程出现异常!\n" + ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  921. }
  922. }
  923. #endregion
  924. #region 人工引用界面
  925. private void DoQuoteKY()
  926. {
  927. try
  928. {
  929. UltraGridRow row = this.ultraGrid1.ActiveRow;
  930. if (row == null)
  931. {
  932. this.alert("检验委托为空!请选择检验委托数据!!!");
  933. return;
  934. }
  935. if (!row.Cells["SMP_CATG"].Text.ToString().Equals("材质"))
  936. {
  937. this.alert("只有材质数据才可以引用!!!");
  938. return;
  939. }
  940. if (row.Cells["FREQ_CODE"].Value.ToString().Equals("D"))
  941. {
  942. this.alert("夹杂不能使用当前按钮!");
  943. return;
  944. }
  945. String PLINE_CODE = row.Cells["PLINE_CODE"].Value.ToString();
  946. String txt_DESIGN_KEY = row.Cells["DESIGN_KEY"].Value.ToString();
  947. String txtDK = txt_DESIGN_KEY.Substring(0, 2);
  948. String SMP_TYPE_CODE = row.Cells["SMP_TYPE_CODE"].Value.ToString();
  949. // if ("ZB1".Equals(PLINE_CODE) && "1".Equals(SMP_TYPE_CODE))
  950. //{
  951. // //复样引用
  952. // foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  953. // {
  954. // if (ugr.Cells["CHK"].Value.ToString().ToLower() == "true")
  955. // {
  956. // if (ugr.Cells["FREQ_CODE"].Value.ToString().Equals("D"))
  957. // {
  958. // this.alert("夹杂不能使用当前按钮!!!");
  959. // return;
  960. // }
  961. // if (ugr.Cells["PLINE_CODE"].Value.ToString().Equals("ZB1") && ugr.Cells["SMP_TYPE_CODE"].Value.ToString().Equals("1"))
  962. // {
  963. // Hashtable ht = new Hashtable();
  964. // ht.Add("HEAT_NO", ugr.Cells["HEAT_NO"].Value.ToString());
  965. // ht.Add("BATCH_NO", ugr.Cells["BATCH_NO"].Value.ToString());
  966. // ht.Add("SMP_NO", ugr.Cells["SMP_NO"].Value.ToString());
  967. // ht.Add("SPECIMEN_NO", ugr.Cells["SPECIMEN_NO"].Value.ToString());
  968. // ht.Add("FREQ_CODE", ugr.Cells["FREQ_CODE"].Value.ToString());
  969. // ht.Add("PLINE_CODE", ugr.Cells["PLINE_CODE"].Value.ToString());
  970. // ht.Add("SMP_TYPE_CODE", ugr.Cells["SMP_TYPE_CODE"].Value.ToString());
  971. // ht.Add("SEND_ID", this.UserInfo.GetUserID());
  972. // ht.Add("CREATE_NAME", this.UserInfo.GetUserName());
  973. // ht.Add("THICK", ugr.Cells["THICK"].Value.ToString());
  974. // ht.Add("DESIGN_KEY", ugr.Cells["DESIGN_KEY"].Value.ToString());
  975. // CoreClientParam ccp = new CoreClientParam();
  976. // ccp.ServerName = "QCM.JHY01.JHY0102.UpdateInfo";
  977. // ccp.MethodName = "DoQuoteBatchNo";
  978. // ccp.ServerParams = new object[] { ht };
  979. // ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  980. // }
  981. // }
  982. // }
  983. // this.DoQuery();
  984. // return;
  985. //}
  986. int num = 0;
  987. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  988. {
  989. if (ugr.Cells["CHK"].Value.ToString().ToLower() == "true")
  990. {
  991. if (ugr.Cells["FREQ_CODE"].Value.ToString().Equals("D"))
  992. {
  993. this.alert("夹杂不能使用当前按钮!!!");
  994. return;
  995. }
  996. String CERT_INST_CODE = ugr.Cells["CERT_INST_CODE"].Value.ToString();
  997. if (CERT_INST_CODE.Equals("IC005"))//美国船级社
  998. {
  999. String CERT_INST_NAME = ugr.Cells["CERT_INST_NAME"].Value.ToString();
  1000. this.alert("【"+CERT_INST_NAME+"】认证机构不能引用!请核实数据");
  1001. return;
  1002. }
  1003. num = num + 1;
  1004. }
  1005. }
  1006. if (num!=1)
  1007. {
  1008. this.alert("要勾选委托并且只能勾选一条引用!");
  1009. return;
  1010. }
  1011. String zbstr = "0";
  1012. if ("ZB1".Equals(PLINE_CODE))
  1013. {
  1014. CoreClientParam ccp2 = new CoreClientParam();
  1015. ccp2.ServerName = "QCM.JHY01.JHY0101.QuerryQltySample";//调用java地址
  1016. ccp2.MethodName = "getDuplicateSample";//调用的方法
  1017. ccp2.ServerParams = new object[] { row.Cells["BATCH_NO"].Value.ToString(), PLINE_CODE, row.Cells["INSPECTION_LOT"].Value.ToString() };
  1018. ccp2.SourceDataTable = this.dataSet9.Tables[0];
  1019. this.ExecuteQueryToDataTable(ccp2, CoreInvokeType.Internal);
  1020. for (int i = 0; i < ccp2.SourceDataTable.Rows.Count; i++)
  1021. {
  1022. String count= ccp2.SourceDataTable.Rows[i]["COUNT"].ToString();
  1023. if (!"".Equals(count) && count!=null && !count.Equals("0"))
  1024. {
  1025. zbstr = "1";
  1026. }
  1027. }
  1028. }
  1029. if ("19".Equals(txtDK))
  1030. {
  1031. this.DoQuote();
  1032. }
  1033. else if ("ZB1".Equals(PLINE_CODE) && zbstr.Equals("0"))
  1034. {
  1035. this.DoQuote();
  1036. }
  1037. else {
  1038. QCM0206 frmRbp = new QCM0206();
  1039. frmRbp.StartPosition = FormStartPosition.CenterScreen;
  1040. frmRbp.ob = this.ob;
  1041. frmRbp.specimenNo = row.Cells["SPECIMEN_NO"].Value.ToString();
  1042. frmRbp.smpNo = row.Cells["SMP_NO"].Value.ToString();
  1043. frmRbp.batchNo = row.Cells["BATCH_NO"].Value.ToString();
  1044. frmRbp.designKey = row.Cells["DESIGN_KEY"].Value.ToString();
  1045. frmRbp.steelCode = row.Cells["STEEL_NAME"].Value.ToString();
  1046. frmRbp.thick = row.Cells["THICK"].Value.ToString();
  1047. frmRbp.ShowDialog();
  1048. this.DoQuery();
  1049. }
  1050. }
  1051. catch (Exception ex)
  1052. {
  1053. MessageBox.Show("操作过程出现异常!\n" + ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  1054. }
  1055. }
  1056. #endregion
  1057. #region 查询
  1058. private void DoQuery()
  1059. {
  1060. try
  1061. {
  1062. //导出
  1063. if (this.ultraTabControl1.Tabs[2].Selected)
  1064. {
  1065. inExport();
  1066. return;
  1067. }
  1068. //LIMS退回轧批
  1069. if (this.ultraTabControl1.Tabs[3].Selected)
  1070. {
  1071. inLIMSQuery();
  1072. return;
  1073. }
  1074. String RZ_MIXROLL = "";
  1075. String checkboxVal = "";
  1076. String STARTTIME = this.dateTimePicker1.Value.ToString("yyyy-MM-dd");
  1077. String ENDTIME = this.dateTimePicker2.Value.ToString("yyyy-MM-dd");
  1078. String BATCH_NO = this.textBox1.Text.Trim();
  1079. String BATCH_NO2 = this.BATCH_NO2.Text.Trim();
  1080. String VALIDFLAG = "1";
  1081. String CERT_INST_NAME = this.textBox2.Text.Trim();//认证机构
  1082. String PLINE_NAME = this.PLINE_NAME.Text.Trim();
  1083. String PLINE_CODE = v_line_no;
  1084. String STEEL_NAME = this.txt_steel_name.Text.Trim();
  1085. String SMP_CATG = this.cbx_smp_catg.Text.Trim();
  1086. String heatNo = this.selheatNo.Text.Trim();
  1087. String DESIGNKEY = this.sel_design_key.Text.Trim();
  1088. String SAMPLE_DELIVERY_TIME = this.SAMPLE_DELIVERY_TIME2.Text.Trim();//查询 送样时间点
  1089. String sdtime = this.dateTimePicker4.Text.ToString();
  1090. SAMPLE_DELIVERY_TIME = sdtime + " " + SAMPLE_DELIVERY_TIME;//送样时间点
  1091. if (PLINE_NAME.Equals("全部"))
  1092. {
  1093. PLINE_NAME = "";
  1094. }
  1095. if (CERT_INST_NAME.Equals("全部"))
  1096. {
  1097. CERT_INST_NAME = "";
  1098. }
  1099. if (SMP_CATG.Equals("全部"))
  1100. {
  1101. SMP_CATG = "";
  1102. }
  1103. else if (SMP_CATG.Equals("成分"))
  1104. {
  1105. SMP_CATG = "A";
  1106. }
  1107. else
  1108. {
  1109. SMP_CATG = "B";
  1110. }
  1111. if (this.CustomInfo == "HB")
  1112. {
  1113. PLINE_NAME = "厚板线";
  1114. }
  1115. else if (this.CustomInfo == "ZB")
  1116. {
  1117. PLINE_NAME = "中板线";
  1118. }
  1119. //轧批号 小框框 是否勾选
  1120. if (this.checkBox1.Checked)
  1121. {
  1122. checkboxVal = "1";
  1123. STARTTIME = "";
  1124. ENDTIME = "";
  1125. if (string.IsNullOrEmpty(BATCH_NO))
  1126. {
  1127. this.alert("请输入轧批号!!!");
  1128. this.textBox1.Focus();
  1129. return;
  1130. }
  1131. }
  1132. else
  1133. {
  1134. BATCH_NO = "";
  1135. BATCH_NO2 = "";
  1136. }
  1137. if (this.checkBox2.Checked)
  1138. {
  1139. STARTTIME = "";
  1140. ENDTIME = "";
  1141. }
  1142. else
  1143. {
  1144. heatNo = "";
  1145. }
  1146. if (this.checkBox3.Checked)
  1147. {
  1148. //STARTTIME = "";
  1149. //ENDTIME = "";
  1150. }
  1151. else
  1152. {
  1153. DESIGNKEY = "";
  1154. }
  1155. if (this.checkBox5.Checked)
  1156. {
  1157. STARTTIME = "";
  1158. ENDTIME = "";
  1159. RZ_MIXROLL = this.textBox3.Text.Trim();
  1160. }
  1161. if (!string.IsNullOrEmpty(BATCH_NO2))
  1162. {
  1163. if (string.IsNullOrEmpty(BATCH_NO))
  1164. {
  1165. this.alert("请输入轧批号!!!");
  1166. this.textBox1.Focus();
  1167. return;
  1168. }
  1169. }
  1170. if (!this.checkBox4.Checked)
  1171. {
  1172. SAMPLE_DELIVERY_TIME = "";
  1173. }
  1174. CoreClientParam ccp = new CoreClientParam();
  1175. if (this.ultraTabControl1.Tabs[0].Selected) //检验委托
  1176. {
  1177. this.dataSet1.Clear();
  1178. ccp.ServerName = "QCM.JHY01.JHY0101.QuerryQltySample";
  1179. ccp.MethodName = "getQltySampleInfoZHB";
  1180. ccp.SourceDataTable = this.dataSet1.Tables[0];
  1181. }
  1182. else if (this.ultraTabControl1.Tabs[1].Selected)
  1183. {
  1184. this.dataSet5.Clear();
  1185. ccp.ServerName = "QCM.JHY01.JHY0101.QuerryQltySample";
  1186. ccp.MethodName = "getQltySampleInfoZHB";
  1187. ccp.SourceDataTable = this.dataSet5.Tables[0];
  1188. }
  1189. Hashtable ht = new Hashtable();
  1190. ht.Add("BATCH_NO", BATCH_NO);
  1191. ht.Add("BATCH_NO2", BATCH_NO2);
  1192. ht.Add("STARTTIME", STARTTIME);
  1193. ht.Add("ENDTIME", ENDTIME);
  1194. ht.Add("VALIDFLAG", VALIDFLAG);
  1195. ht.Add("CERT_INST_NAME", CERT_INST_NAME);
  1196. ht.Add("PLINE_NAME", PLINE_NAME);
  1197. ht.Add("PLINE_CODE", PLINE_CODE);
  1198. ht.Add("checkboxVal", checkboxVal);
  1199. if (this.ultraTabControl1.Tabs[0].Selected)
  1200. {
  1201. ht.Add("STATUS", "0");
  1202. }
  1203. if (this.ultraTabControl1.SelectedTab.Text.Equals("委托记录"))
  1204. {
  1205. ht.Add("TAB_NAME", "1");
  1206. }
  1207. ht.Add("STEEL_NAME", STEEL_NAME);
  1208. ht.Add("SMP_CATG", SMP_CATG);
  1209. ht.Add("HEAT_NO", heatNo);
  1210. ht.Add("DESIGN_KEY", DESIGNKEY);
  1211. ht.Add("SAMPLE_DELIVERY_TIME", SAMPLE_DELIVERY_TIME);
  1212. ht.Add("RZ_MIXROLL", RZ_MIXROLL);
  1213. String checkbokTxtL = "F";//同轧批合并委托
  1214. if (this.checkBox6.Checked)
  1215. {
  1216. if (this.ultraTabControl1.Tabs[1].Selected) { checkbokTxtL = "T"; }
  1217. }
  1218. ht.Add("CHECKBOKTXTL", checkbokTxtL);
  1219. ccp.ServerParams = new object[] { ht };
  1220. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  1221. if (this.ultraTabControl1.Tabs[0].Selected) //检验委托
  1222. {
  1223. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  1224. {
  1225. switch (ugr.Cells["STATUS"].Text.ToString())
  1226. {
  1227. case "0":
  1228. ugr.Cells["STATUS"].Value = "未发送";
  1229. break;
  1230. case "1":
  1231. ugr.Cells["STATUS"].Value = "已引用";
  1232. break;
  1233. case "2":
  1234. ugr.Cells["STATUS"].Value = "已接收";
  1235. break;
  1236. case "3":
  1237. ugr.Cells["STATUS"].Value = "已完成";
  1238. break;
  1239. case "4":
  1240. ugr.Cells["STATUS"].Value = "检化验系统退回";
  1241. break;
  1242. case "5":
  1243. ugr.Cells["STATUS"].Value = "重判";
  1244. break;
  1245. case "7":
  1246. ugr.Cells["STATUS"].Value = "确认接收样";
  1247. break;
  1248. }
  1249. if (ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "复样")
  1250. {
  1251. ugr.Cells["SMP_TYPE_NAME"].Appearance.ForeColor = Color.Red;
  1252. }
  1253. if (ugr.Cells["SMP_LOCATION"].Value.ToString().Contains("一次模拟焊后"))
  1254. {
  1255. if (ugr.Cells["SMP_LOCATION"].Value.ToString().Contains("一次模拟焊后")
  1256. && (ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "复样" || ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "卷卷取样"
  1257. || ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "按母板取样"))
  1258. {
  1259. ugr.Cells["SMP_TYPE_NAME"].Value = "一次模拟焊后" + ugr.Cells["SMP_TYPE_NAME"].Value.ToString();
  1260. }
  1261. else
  1262. {
  1263. ugr.Cells["SMP_TYPE_NAME"].Value = "一次模拟焊后";
  1264. }
  1265. }
  1266. else if (ugr.Cells["SMP_LOCATION"].Value.ToString().Contains("二次模拟焊后"))
  1267. {
  1268. if (ugr.Cells["SMP_LOCATION"].Value.ToString().Contains("二次模拟焊后")
  1269. && (ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "复样" || ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "卷卷取样"
  1270. || ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "按母板取样"))
  1271. {
  1272. ugr.Cells["SMP_TYPE_NAME"].Value = "二次模拟焊后" + ugr.Cells["SMP_TYPE_NAME"].Value.ToString();
  1273. }
  1274. else
  1275. {
  1276. ugr.Cells["SMP_TYPE_NAME"].Value = "二次模拟焊后";
  1277. }
  1278. }
  1279. else if (ugr.Cells["SMP_LOCATION"].Value.ToString().Contains("三次模拟焊后"))
  1280. {
  1281. if (ugr.Cells["SMP_LOCATION"].Value.ToString().Contains("三次模拟焊后")
  1282. && (ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "复样" || ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "卷卷取样"
  1283. || ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "按母板取样"))
  1284. {
  1285. ugr.Cells["SMP_TYPE_NAME"].Value = "三次模拟焊后" + ugr.Cells["SMP_TYPE_NAME"].Value.ToString();
  1286. }
  1287. else
  1288. {
  1289. ugr.Cells["SMP_TYPE_NAME"].Value = "三次模拟焊后";
  1290. }
  1291. }
  1292. else if (ugr.Cells["SMP_LOCATION"].Value.ToString().Contains("四次模拟焊后"))
  1293. {
  1294. if (ugr.Cells["SMP_LOCATION"].Value.ToString().Contains("四次模拟焊后")
  1295. && (ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "复样" || ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "卷卷取样"
  1296. || ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "按母板取样"))
  1297. {
  1298. ugr.Cells["SMP_TYPE_NAME"].Value = "四次模拟焊后" + ugr.Cells["SMP_TYPE_NAME"].Value.ToString();
  1299. }
  1300. else
  1301. {
  1302. ugr.Cells["SMP_TYPE_NAME"].Value = "四次模拟焊后";
  1303. }
  1304. }
  1305. if (ugr.Cells["SMP_CATG"].Value.ToString().Equals("A"))
  1306. {
  1307. ugr.Appearance.BackColor = Color.Aqua;
  1308. }
  1309. }
  1310. }
  1311. else if (this.ultraTabControl1.Tabs[1].Selected)
  1312. {
  1313. foreach (UltraGridRow ugr in this.ultraGrid4.Rows)
  1314. {
  1315. switch (ugr.Cells["STATUS"].Text.ToString())
  1316. {
  1317. case "0":
  1318. ugr.Cells["STATUS"].Value = "未发送";
  1319. break;
  1320. case "1":
  1321. ugr.Cells["STATUS"].Value = "已引用";
  1322. break;
  1323. case "2":
  1324. ugr.Cells["STATUS"].Value = "已接收";
  1325. break;
  1326. case "3":
  1327. ugr.Cells["STATUS"].Value = "已完成";
  1328. break;
  1329. case "4":
  1330. ugr.Cells["STATUS"].Value = "检化验系统退回";
  1331. break;
  1332. case "5":
  1333. ugr.Cells["STATUS"].Value = "重判";
  1334. break;
  1335. case "7":
  1336. ugr.Cells["STATUS"].Value = "确认接收样";
  1337. break;
  1338. }
  1339. if (ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "复样")
  1340. {
  1341. ugr.Cells["SMP_TYPE_NAME"].Appearance.ForeColor = Color.Red;
  1342. }
  1343. if (ugr.Cells["SMP_LOCATION"].Value.ToString().Contains("一次模拟焊后"))
  1344. {
  1345. if (ugr.Cells["SMP_LOCATION"].Value.ToString().Contains("一次模拟焊后")
  1346. && (ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "复样" || ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "卷卷取样"
  1347. || ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "按母板取样"))
  1348. {
  1349. ugr.Cells["SMP_TYPE_NAME"].Value = "一次模拟焊后" + ugr.Cells["SMP_TYPE_NAME"].Value.ToString();
  1350. }
  1351. else
  1352. {
  1353. ugr.Cells["SMP_TYPE_NAME"].Value = "一次模拟焊后";
  1354. }
  1355. }
  1356. else if (ugr.Cells["SMP_LOCATION"].Value.ToString().Contains("二次模拟焊后"))
  1357. {
  1358. if (ugr.Cells["SMP_LOCATION"].Value.ToString().Contains("二次模拟焊后")
  1359. && (ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "复样" || ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "卷卷取样"
  1360. || ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "按母板取样"))
  1361. {
  1362. ugr.Cells["SMP_TYPE_NAME"].Value = "二次模拟焊后" + ugr.Cells["SMP_TYPE_NAME"].Value.ToString();
  1363. }
  1364. else
  1365. {
  1366. ugr.Cells["SMP_TYPE_NAME"].Value = "二次模拟焊后";
  1367. }
  1368. }
  1369. else if (ugr.Cells["SMP_LOCATION"].Value.ToString().Contains("三次模拟焊后"))
  1370. {
  1371. if (ugr.Cells["SMP_LOCATION"].Value.ToString().Contains("三次模拟焊后")
  1372. && (ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "复样" || ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "卷卷取样"
  1373. || ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "按母板取样"))
  1374. {
  1375. ugr.Cells["SMP_TYPE_NAME"].Value = "三次模拟焊后" + ugr.Cells["SMP_TYPE_NAME"].Value.ToString();
  1376. }
  1377. else
  1378. {
  1379. ugr.Cells["SMP_TYPE_NAME"].Value = "三次模拟焊后";
  1380. }
  1381. }
  1382. else if (ugr.Cells["SMP_LOCATION"].Value.ToString().Contains("四次模拟焊后"))
  1383. {
  1384. if (ugr.Cells["SMP_LOCATION"].Value.ToString().Contains("四次模拟焊后")
  1385. && (ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "复样" || ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "卷卷取样"
  1386. || ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "按母板取样"))
  1387. {
  1388. ugr.Cells["SMP_TYPE_NAME"].Value = "四次模拟焊后" + ugr.Cells["SMP_TYPE_NAME"].Value.ToString();
  1389. }
  1390. else
  1391. {
  1392. ugr.Cells["SMP_TYPE_NAME"].Value = "四次模拟焊后";
  1393. }
  1394. }
  1395. if (!String.IsNullOrEmpty(ugr.Cells["ZHB_SPECIMEN_NO"].Value.ToString()))
  1396. {
  1397. ugr.Appearance.BackColor = Color.LightGreen;
  1398. }
  1399. if (ugr.Cells["SMP_CATG"].Value.ToString().Equals("A"))
  1400. {
  1401. ugr.Appearance.BackColor = Color.Aqua;
  1402. }
  1403. if (ugr.Cells["FREQ_CODE"].Value.ToString().Equals("D") && String.IsNullOrEmpty(ugr.Cells["QUOTE_CONSIGN_NO"].Value.ToString())
  1404. && ugr.Cells["SMP_TYPE_CODE"].Value.ToString().Equals("0"))
  1405. {
  1406. ugr.Appearance.BackColor = Color.Red;
  1407. }
  1408. }
  1409. }
  1410. int num = 0;
  1411. if (this.ultraTabControl1.Tabs[0].Selected) //检验委托
  1412. {
  1413. num = this.ultraGrid1.Rows.Count();
  1414. if (num <= 0)
  1415. {
  1416. this.dataSet2.Clear();
  1417. this.dataSet3.Clear();
  1418. }
  1419. }
  1420. else if (this.ultraTabControl1.Tabs[1].Selected)
  1421. {
  1422. num = this.ultraGrid4.Rows.Count();
  1423. if (num <= 0)
  1424. {
  1425. this.dataSet6.Clear();
  1426. this.dataSet7.Clear();
  1427. }
  1428. }
  1429. // ClsControlPack.RefreshAndAutoSize(ultraGrid1);
  1430. // ClsControlPack.RefreshAndAutoSize(ultraGrid4);
  1431. }
  1432. catch (Exception ex)
  1433. {
  1434. System.Diagnostics.Debug.WriteLine(ex.ToString());
  1435. MessageBox.Show("系统出错,请联系管理人员", "警告");
  1436. }
  1437. }
  1438. private void inLIMSQuery()
  1439. {
  1440. try
  1441. {
  1442. String checkboxVal = "";
  1443. String STARTTIME = this.dateTimePicker1.Value.ToString("yyyy-MM-dd");
  1444. String ENDTIME = this.dateTimePicker2.Value.ToString("yyyy-MM-dd");
  1445. String BATCH_NO = this.textBox1.Text.Trim();
  1446. String BATCH_NO2 = this.BATCH_NO2.Text.Trim();
  1447. String VALIDFLAG = "1";
  1448. String CERT_INST_NAME = this.textBox2.Text.Trim();//认证机构
  1449. String PLINE_NAME = this.PLINE_NAME.Text.Trim();
  1450. String PLINE_CODE = v_line_no;
  1451. String STEEL_NAME = this.txt_steel_name.Text.Trim();
  1452. String SMP_CATG = this.cbx_smp_catg.Text.Trim();
  1453. String heatNo = this.selheatNo.Text.Trim();
  1454. String DESIGNKEY = this.sel_design_key.Text.Trim();
  1455. String SAMPLE_DELIVERY_TIME = this.SAMPLE_DELIVERY_TIME2.Text.Trim();//查询 送样时间点
  1456. String sdtime = this.dateTimePicker4.Text.ToString();
  1457. SAMPLE_DELIVERY_TIME = sdtime + " " + SAMPLE_DELIVERY_TIME;//送样时间点
  1458. if (PLINE_NAME.Equals("全部"))
  1459. {
  1460. PLINE_NAME = "";
  1461. }
  1462. if (CERT_INST_NAME.Equals("全部"))
  1463. {
  1464. CERT_INST_NAME = "";
  1465. }
  1466. if (SMP_CATG.Equals("全部"))
  1467. {
  1468. SMP_CATG = "";
  1469. }
  1470. else if (SMP_CATG.Equals("成分"))
  1471. {
  1472. SMP_CATG = "A";
  1473. }
  1474. else
  1475. {
  1476. SMP_CATG = "B";
  1477. }
  1478. if (this.CustomInfo == "HB")
  1479. {
  1480. PLINE_NAME = "厚板线";
  1481. }
  1482. else if (this.CustomInfo == "ZB")
  1483. {
  1484. PLINE_NAME = "中板线";
  1485. }
  1486. //轧批号 小框框 是否勾选
  1487. if (this.checkBox1.Checked)
  1488. {
  1489. checkboxVal = "1";
  1490. STARTTIME = "";
  1491. ENDTIME = "";
  1492. }
  1493. else
  1494. {
  1495. BATCH_NO = "";
  1496. BATCH_NO2 = "";
  1497. }
  1498. if (this.checkBox2.Checked)
  1499. {
  1500. STARTTIME = "";
  1501. ENDTIME = "";
  1502. }
  1503. else
  1504. {
  1505. heatNo = "";
  1506. }
  1507. if (this.checkBox3.Checked)
  1508. {
  1509. //STARTTIME = "";
  1510. //ENDTIME = "";
  1511. }
  1512. else
  1513. {
  1514. DESIGNKEY = "";
  1515. }
  1516. if (!this.checkBox4.Checked)
  1517. {
  1518. SAMPLE_DELIVERY_TIME = "";
  1519. }
  1520. Hashtable ht = new Hashtable();
  1521. ht.Add("BATCH_NO", BATCH_NO);
  1522. ht.Add("BATCH_NO2", BATCH_NO2);
  1523. ht.Add("STARTTIME", STARTTIME);
  1524. ht.Add("ENDTIME", ENDTIME);
  1525. ht.Add("VALIDFLAG", VALIDFLAG);
  1526. ht.Add("CERT_INST_NAME", CERT_INST_NAME);
  1527. ht.Add("PLINE_NAME", PLINE_NAME);
  1528. ht.Add("PLINE_CODE", PLINE_CODE);
  1529. ht.Add("checkboxVal", checkboxVal);
  1530. ht.Add("STATUS", "0");
  1531. ht.Add("STEEL_NAME", STEEL_NAME);
  1532. ht.Add("SMP_CATG", SMP_CATG);
  1533. ht.Add("HEAT_NO", heatNo);
  1534. ht.Add("DESIGN_KEY", DESIGNKEY);
  1535. ht.Add("SAMPLE_DELIVERY_TIME", SAMPLE_DELIVERY_TIME);
  1536. CoreClientParam ccp = new CoreClientParam();
  1537. this.dataSet10.Clear();
  1538. ccp.ServerName = "QCM.JHY01.JHY0102.QuerryJhyQtly";
  1539. ccp.MethodName = "ZHBQueryLims";
  1540. ccp.SourceDataTable = this.dataSet10.Tables[0];
  1541. ccp.ServerParams = new object[] { ht };
  1542. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  1543. }
  1544. catch (Exception ex)
  1545. {
  1546. System.Diagnostics.Debug.WriteLine(ex.ToString());
  1547. MessageBox.Show("系统出错,请联系管理人员", "警告");
  1548. }
  1549. }
  1550. #endregion
  1551. #region 查找检验项目
  1552. private void DoQueryPrg(UltraGridRow ugr)
  1553. {
  1554. try
  1555. {
  1556. this.dataSet3.Clear();
  1557. String specimen_no = ugr.Cells["SPECIMEN_NO"].Value.ToString();
  1558. CoreClientParam ccp = new CoreClientParam();
  1559. ccp.ServerName = "QCM.JHY01.JHY0101.QuerryQltySample";
  1560. ccp.MethodName = "getQltySampleItem";
  1561. ccp.ServerParams = new object[] { specimen_no };
  1562. ccp.SourceDataTable = this.dataSet3.Tables[0];
  1563. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  1564. }
  1565. catch (Exception ex)
  1566. {
  1567. System.Diagnostics.Debug.WriteLine(ex.ToString());
  1568. MessageBox.Show("系统出错,请联系管理人员", "警告");
  1569. }
  1570. }
  1571. #endregion
  1572. #region 查询订单信息
  1573. private void DoQueryOrder(UltraGridRow ugr)
  1574. {
  1575. try
  1576. {
  1577. this.dataSet2.Clear();
  1578. CoreClientParam ccp = new CoreClientParam();
  1579. ccp.ServerName = "QCM.JHY01.JHY0101.QuerryQltySample";
  1580. ccp.MethodName = "getQltySampleOrd";
  1581. ccp.ServerParams = new object[] { ugr.Cells["SMP_NO"].Text.ToString() };
  1582. ccp.SourceDataTable = this.dataSet2.Tables[0];
  1583. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  1584. foreach (UltraGridRow ugr2 in this.ultraGrid2.Rows)
  1585. {
  1586. ugr2.Cells["Column1"].Value = ugr2.Cells["THICK"].Value + "*" + ugr2.Cells["WIDTH"].Value + "*" + ugr2.Cells["LENGTH"].Value;
  1587. }
  1588. }
  1589. catch (Exception ex)
  1590. {
  1591. System.Diagnostics.Debug.WriteLine(ex.ToString());
  1592. MessageBox.Show("系统出错,请联系管理人员", "警告");
  1593. }
  1594. }
  1595. #endregion
  1596. #region 发送检验委托
  1597. private void DoSend()
  1598. {
  1599. try
  1600. {
  1601. String sdeltime = this.SAMPLE_DELIVERY_TIME.Text.Trim().ToString();
  1602. if (!sdeltime.Equals("24:00:00"))
  1603. {
  1604. String strDocond = DoCondition();//委托人员限制
  1605. if ("0".Equals(strDocond))
  1606. {
  1607. return;
  1608. }
  1609. //当前时间小于送样时间15分钟,不能选择当前送样时间发送委托
  1610. //送样时间小于当前时间,不能选择肖妆送样时间发送委托
  1611. String sdtime0 = this.dateTimePicker3.Text.ToString();
  1612. String sampleDeliveryTime0 = this.SAMPLE_DELIVERY_TIME.Text.ToString();
  1613. String dbtime = sdtime0 + " " + sampleDeliveryTime0;//送样时间点
  1614. DateTime historyTime = Convert.ToDateTime(dbtime);//转换日期格式
  1615. System.DateTime currentTime = new System.DateTime();
  1616. currentTime = System.DateTime.Now;//系统时间
  1617. TimeSpan ts = historyTime - currentTime;
  1618. double getHours = ts.TotalMinutes;
  1619. //产品名称
  1620. String PROD_NAME = "";
  1621. UltraGridRow rowp = this.ultraGrid1.ActiveRow;
  1622. if (rowp != null)
  1623. {
  1624. PROD_NAME = rowp.Cells["PROD_NAME"].Text.ToString();
  1625. }
  1626. if (!PROD_NAME.Contains("模具"))
  1627. {
  1628. if (getHours <= -1)
  1629. {
  1630. this.alert("送样时间截点不能小于当前系统时间截点,请选择一个大于当前系统时间截点并且不能小于15分钟的送样时间截点,谢谢!");
  1631. return;
  1632. }
  1633. else if (getHours <= 15)
  1634. {
  1635. this.alert("当前系统时间截点小于送样时间截点15分钟,不能在当前送样时间点进行委托,请选择另一个送样时间点,谢谢!");
  1636. return;
  1637. }
  1638. }
  1639. }
  1640. //判断是否有合并的委托
  1641. String spNoSel = "";
  1642. string fh1 = "";
  1643. int num1 = 0;
  1644. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  1645. {
  1646. if (ugr.Cells["CHK"].Value.ToString().ToLower() == "true")
  1647. {
  1648. String specimeNoSel = ugr.Cells["SPECIMEN_NO"].Value.ToString();
  1649. num1 = num1 + 1;
  1650. if (num1 <= 1)
  1651. {
  1652. spNoSel = specimeNoSel;
  1653. fh1 = ",";
  1654. }
  1655. else
  1656. {
  1657. spNoSel = spNoSel + fh1 + specimeNoSel;
  1658. }
  1659. }
  1660. }
  1661. CoreClientParam ccpSel = new CoreClientParam();
  1662. ccpSel.ServerName = "QCM.JHY01.JHY0102.QuerryJhyQtly";
  1663. ccpSel.MethodName = "Sel_ZHB_HB";
  1664. ccpSel.ServerParams = new object[] { spNoSel };
  1665. ccpSel = this.ExecuteNonQuery(ccpSel, CoreInvokeType.Internal);
  1666. if (ccpSel.ReturnCode == -1)
  1667. {
  1668. if (MessageBox.Show("是否继续发送委托?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
  1669. {
  1670. return;
  1671. }
  1672. }
  1673. DoUpdate();//先修改取样材料号
  1674. String sampleDeliveryTime = this.SAMPLE_DELIVERY_TIME.Text.ToString();
  1675. if (!sampleDeliveryTime.Equals("03:00:00") && !sampleDeliveryTime.Equals("06:30:00") && !sampleDeliveryTime.Equals("10:30:00") &&
  1676. !sampleDeliveryTime.Equals("11:00:00") && !sampleDeliveryTime.Equals("15:00:00") && !sampleDeliveryTime.Equals("17:30:00") &&
  1677. !sampleDeliveryTime.Equals("18:00:00") && !sampleDeliveryTime.Equals("20:30:00") && !sampleDeliveryTime.Equals("21:00:00") &&
  1678. !sampleDeliveryTime.Equals("06:00:00") && !sampleDeliveryTime.Equals("24:00:00"))
  1679. {
  1680. this.alert("请在下拉框中选择正确的时间点不要手动更改时间点格式,当前时间点格式【"+ sampleDeliveryTime+"】不在规定时间格式中!");
  1681. return;
  1682. }
  1683. String sdtime = this.dateTimePicker3.Text.ToString();
  1684. if (String.IsNullOrEmpty(sampleDeliveryTime) || String.IsNullOrEmpty(sdtime))
  1685. {
  1686. this.alert("请选择送样时间点!");
  1687. return;
  1688. }
  1689. //DateTime dt = DateTime.Now;
  1690. //String sdtime = string.Format("{0:yyyy-MM-dd}", dt);
  1691. sampleDeliveryTime = sdtime + " " + sampleDeliveryTime;//送样时间点
  1692. List<UltraGridRow> lists = new List<UltraGridRow>();
  1693. CoreClientParam ccp = new CoreClientParam();
  1694. string SPECIMEN_NO = "";
  1695. string fh = "";
  1696. int num = 0;
  1697. string dnum = "0";
  1698. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  1699. {
  1700. string specimeNo = "";
  1701. if (ugr.Cells["CHK"].Value.ToString().ToLower() == "true")
  1702. {
  1703. if (string.IsNullOrEmpty(ugr.Cells["MATERIAL_NO"].Value.ToString()))
  1704. {
  1705. return;
  1706. }
  1707. specimeNo = ugr.Cells["SPECIMEN_NO"].Value.ToString();
  1708. num = num + 1;
  1709. if (num <= 1)
  1710. {
  1711. SPECIMEN_NO = specimeNo;
  1712. fh = ",";
  1713. }
  1714. else
  1715. {
  1716. SPECIMEN_NO = SPECIMEN_NO + fh + specimeNo;
  1717. }
  1718. lists.Add(ugr);
  1719. if (ugr.Cells["FREQ_CODE"].Value.ToString().Equals("D"))
  1720. {
  1721. dnum = "1";
  1722. }
  1723. }
  1724. }
  1725. ccp.ServerName = "QCM.JHY01.JHY0102.Send2";
  1726. ccp.MethodName = "SendLIMES";
  1727. ccp.ServerParams = new object[] { SPECIMEN_NO, this.UserInfo.GetUserID(), this.UserInfo.GetUserName(), sampleDeliveryTime };
  1728. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1729. if (ccp.ReturnCode != -1)
  1730. {
  1731. for (int i = 0; i < lists.Count; i++)
  1732. {
  1733. lists[i].Delete(false);
  1734. }
  1735. MessageBox.Show("发送成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);//ccp.ReturnInfo "发送成功" ccp.ReturnInfo
  1736. }
  1737. //夹杂按炉
  1738. if ("1".Equals(dnum))
  1739. {
  1740. this.DoQuery();
  1741. }
  1742. int conut = this.ultraGrid1.Rows.Count();
  1743. if (conut <= 0)
  1744. {
  1745. this.dataSet2.Clear();
  1746. this.dataSet3.Clear();
  1747. }
  1748. }
  1749. catch (Exception ex)
  1750. {
  1751. System.Diagnostics.Debug.WriteLine(ex.ToString());
  1752. MessageBox.Show("系统出错,请联系管理人员", "警告");
  1753. }
  1754. }
  1755. #endregion
  1756. #region 撤销检验委托
  1757. private void DoUnsend()
  1758. {
  1759. try
  1760. {
  1761. if (MessageBox.Show("确认撤销发送?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
  1762. {
  1763. return;
  1764. }
  1765. List<UltraGridRow> lists = new List<UltraGridRow>();
  1766. String zhyy = "MES撤回";
  1767. CoreClientParam ccp = new CoreClientParam();
  1768. string SPECIMEN_NO = "";
  1769. string fh = "";
  1770. int num = 0;
  1771. int numy = 0;
  1772. int numzhb = 0;
  1773. string dnum = "0";
  1774. foreach (UltraGridRow ugr in this.ultraGrid4.Rows)
  1775. {
  1776. string specimeNo = "";
  1777. if (ugr.Cells["CHK"].Value.ToString().ToLower() == "true")
  1778. {
  1779. specimeNo = ugr.Cells["SPECIMEN_NO"].Value.ToString();
  1780. String status = ugr.Cells["STATUS"].Value.ToString();
  1781. if ("7".Equals(status) || "确认接收样".Equals(status))
  1782. {
  1783. this.alert("该委托样品已接收, 不允许撤回, 请联系LIMS实验室退回");
  1784. return;
  1785. }
  1786. String zhbsno = ugr.Cells["ZHB_SPECIMEN_NO"].Value.ToString();
  1787. if ("1".Equals(status) || "已引用".Equals(status))
  1788. {
  1789. numy = 1;
  1790. }
  1791. if (!String.IsNullOrEmpty(zhbsno))
  1792. {
  1793. numzhb = 1;
  1794. }
  1795. num = num + 1;
  1796. if (num <= 1)
  1797. {
  1798. SPECIMEN_NO = specimeNo;
  1799. fh = ",";
  1800. }
  1801. else
  1802. {
  1803. SPECIMEN_NO = SPECIMEN_NO + fh + specimeNo;
  1804. }
  1805. lists.Add(ugr);
  1806. if (ugr.Cells["FREQ_CODE"].Value.ToString().Equals("D"))
  1807. {
  1808. dnum = "1";
  1809. }
  1810. }
  1811. }
  1812. if (numy == 1)
  1813. {
  1814. this.alert("不能撤销引用的轧批号!!!");
  1815. return;
  1816. }
  1817. if (numzhb == 1)
  1818. {
  1819. this.alert("合并委托撤销请点击【撤销同批合并发送】按钮!");
  1820. return;
  1821. }
  1822. ccp.ServerName = "QCM.JHY01.JHY0102.Send2";
  1823. ccp.MethodName = "CancelLIMES";
  1824. ccp.ServerParams = new object[] { SPECIMEN_NO, this.UserInfo.GetUserName(), zhyy };
  1825. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1826. if (ccp.ReturnCode != -1)
  1827. {
  1828. for (int i = 0; i < lists.Count; i++)
  1829. {
  1830. lists[i].Delete(false);
  1831. }
  1832. MessageBox.Show("撤销发送成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);//ccp.ReturnInfo "发送成功" ccp.ReturnInfo
  1833. }
  1834. //夹杂按炉
  1835. if ("1".Equals(dnum))
  1836. {
  1837. this.DoQuery();
  1838. }
  1839. int conut = this.ultraGrid4.Rows.Count();
  1840. if (conut <= 0)
  1841. {
  1842. this.dataSet6.Clear();
  1843. this.dataSet7.Clear();
  1844. }
  1845. }
  1846. catch (Exception ex)
  1847. {
  1848. System.Diagnostics.Debug.WriteLine(ex.ToString());
  1849. MessageBox.Show("系统出错,请联系管理人员", "警告");
  1850. }
  1851. }
  1852. #endregion
  1853. #region 撤销检验委托19
  1854. private void DoUnsend19()
  1855. {
  1856. try
  1857. {
  1858. if (MessageBox.Show("确认撤销19订单?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
  1859. {
  1860. return;
  1861. }
  1862. List<UltraGridRow> lists = new List<UltraGridRow>();
  1863. String zhyy = "MES撤回";
  1864. CoreClientParam ccp = new CoreClientParam();
  1865. string SPECIMEN_NO = "";
  1866. string fh = "";
  1867. int num = 0;
  1868. int num19 = 0;
  1869. foreach (UltraGridRow ugr in this.ultraGrid4.Rows)
  1870. {
  1871. string specimeNo = "";
  1872. if (ugr.Cells["CHK"].Value.ToString().ToLower() == "true")
  1873. {
  1874. specimeNo = ugr.Cells["SPECIMEN_NO"].Value.ToString();
  1875. String designKey = ugr.Cells["DESIGN_KEY"].Value.ToString();
  1876. designKey=designKey.Substring(0, 2);
  1877. if (!"19".Equals(designKey))
  1878. {
  1879. num19 = 1;
  1880. }
  1881. num = num + 1;
  1882. if (num <= 1)
  1883. {
  1884. SPECIMEN_NO = specimeNo;
  1885. fh = ",";
  1886. }
  1887. else
  1888. {
  1889. SPECIMEN_NO = SPECIMEN_NO + fh + specimeNo;
  1890. }
  1891. lists.Add(ugr);
  1892. }
  1893. }
  1894. if (num19==1)
  1895. {
  1896. this.alert("撤销19订单按钮只能撤销19订单!!!");
  1897. return;
  1898. }
  1899. ccp.ServerName = "QCM.JHY01.JHY0102.Send2";
  1900. ccp.MethodName = "CancelLIMES19";
  1901. ccp.ServerParams = new object[] { SPECIMEN_NO, this.UserInfo.GetUserName(), zhyy };
  1902. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1903. if (ccp.ReturnCode != -1)
  1904. {
  1905. for (int i = 0; i < lists.Count; i++)
  1906. {
  1907. lists[i].Delete(false);
  1908. }
  1909. MessageBox.Show("撤销19订单成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);//ccp.ReturnInfo "发送成功" ccp.ReturnInfo
  1910. }
  1911. //this.DoQuery();
  1912. int conut = this.ultraGrid4.Rows.Count();
  1913. if (conut <= 0)
  1914. {
  1915. this.dataSet6.Clear();
  1916. this.dataSet7.Clear();
  1917. }
  1918. }
  1919. catch (Exception ex)
  1920. {
  1921. System.Diagnostics.Debug.WriteLine(ex.ToString());
  1922. MessageBox.Show("系统出错,请联系管理人员", "警告");
  1923. }
  1924. }
  1925. #endregion
  1926. #region 同轧批牌号合并发送按钮
  1927. private void button1_Click(object sender, EventArgs e)
  1928. {
  1929. try
  1930. {
  1931. String sdeltime = this.SAMPLE_DELIVERY_TIME.Text.Trim().ToString();
  1932. if (!sdeltime.Equals("24:00:00"))
  1933. {
  1934. String strDocond = DoCondition();//委托人员限制
  1935. if ("0".Equals(strDocond))
  1936. {
  1937. return;
  1938. }
  1939. //当前时间小于送样时间15分钟,不能选择当前送样时间发送委托
  1940. //送样时间小于当前时间,不能选择肖妆送样时间发送委托
  1941. String sdtime0 = this.dateTimePicker3.Text.ToString();
  1942. String sampleDeliveryTime0 = this.SAMPLE_DELIVERY_TIME.Text.ToString();
  1943. String dbtime = sdtime0 + " " + sampleDeliveryTime0;//送样时间点
  1944. DateTime historyTime = Convert.ToDateTime(dbtime);//转换日期格式
  1945. System.DateTime currentTime = new System.DateTime();
  1946. currentTime = System.DateTime.Now;//系统时间
  1947. TimeSpan ts = historyTime - currentTime;
  1948. double getHours = ts.TotalMinutes;
  1949. if (getHours <= -1)
  1950. {
  1951. this.alert("送样时间截点不能小于当前系统时间截点,请选择一个大于当前系统时间截点并且不能小于15分钟的送样时间截点,谢谢!");
  1952. return;
  1953. }
  1954. else if (getHours <= 15)
  1955. {
  1956. this.alert("当前系统时间截点小于送样时间截点15分钟,不能在当前送样时间点进行委托,请选择另一个送样时间点,谢谢!");
  1957. return;
  1958. }
  1959. }
  1960. // DoUpdate();//先修改取样材料号
  1961. String sampleDeliveryTime = this.SAMPLE_DELIVERY_TIME.Text.ToString();
  1962. if (!sampleDeliveryTime.Equals("03:00:00") && !sampleDeliveryTime.Equals("06:00:00") && !sampleDeliveryTime.Equals("10:30:00") &&
  1963. !sampleDeliveryTime.Equals("11:00:00") && !sampleDeliveryTime.Equals("15:00:00") && !sampleDeliveryTime.Equals("17:30:00") &&
  1964. !sampleDeliveryTime.Equals("18:00:00") && !sampleDeliveryTime.Equals("20:30:00") && !sampleDeliveryTime.Equals("21:00:00") &&
  1965. !sampleDeliveryTime.Equals("06:30:00") && !sampleDeliveryTime.Equals("24:00:00") )
  1966. {
  1967. this.alert("请在下拉框中选择正确的时间点不要手动更改时间点格式,当前时间点格式【" + sampleDeliveryTime + "】不在规定时间格式中!");
  1968. return;
  1969. }
  1970. String sdtime = this.dateTimePicker3.Text.ToString();
  1971. if (String.IsNullOrEmpty(sampleDeliveryTime) || String.IsNullOrEmpty(sdtime))
  1972. {
  1973. this.alert("请选择送样时间点!");
  1974. return;
  1975. }
  1976. //DateTime dt = DateTime.Now;
  1977. //String sdtime = string.Format("{0:yyyy-MM-dd}", dt);
  1978. sampleDeliveryTime = sdtime + " " + sampleDeliveryTime;//送样时间点
  1979. CoreClientParam ccp = new CoreClientParam();
  1980. string SPECIMEN_NO = "";
  1981. string BATCH_NO = "";
  1982. string fh = "";
  1983. int num = 0;
  1984. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  1985. {
  1986. string specimeNo = "";
  1987. if (ugr.Cells["CHK"].Value.ToString().ToLower() == "true")
  1988. {
  1989. specimeNo = ugr.Cells["SPECIMEN_NO"].Value.ToString();
  1990. BATCH_NO = ugr.Cells["BATCH_NO"].Value.ToString();
  1991. num = num + 1;
  1992. if (num <= 1)
  1993. {
  1994. SPECIMEN_NO = specimeNo;
  1995. fh = ",";
  1996. }
  1997. else
  1998. {
  1999. SPECIMEN_NO = SPECIMEN_NO + fh + specimeNo;
  2000. }
  2001. }
  2002. }
  2003. if (num>=2)
  2004. {
  2005. this.alert("只允许对一个牌号打勾[勾选一条委托即可,无需勾选多条委托]");
  2006. return;
  2007. }
  2008. //主题:关于DNV性能引用 技术中心李娇丽提出 申报时间2024-10-28 11:06:27
  2009. //2024年挪威船级社年审提出,低等级不能引用高等级性能,因为低等级的冲击未进行试验,没有试验原始记录,挪威船级社DNV需要在冲击温度相同的情况下才能引用性能。
  2010. if ("".Equals(BATCH_NO))
  2011. {
  2012. this.alert("请勾选委托!");
  2013. return;
  2014. }
  2015. Hashtable ht = new Hashtable();
  2016. ht.Add("BATCH_NO", BATCH_NO);
  2017. CoreClientParam ccpSel = new CoreClientParam();
  2018. ccpSel.ServerName = "QCM.JHY01.JHY0102.QuerryJhyQtly";
  2019. ccpSel.MethodName = "getZHBDNV";
  2020. ccpSel.ServerParams = new object[] { ht };
  2021. ccpSel = this.ExecuteNonQuery(ccpSel, CoreInvokeType.Internal);
  2022. if (ccpSel.ReturnCode == -1)
  2023. {
  2024. return;
  2025. }
  2026. ccp.ServerName = "QCM.JHY01.JHY0102.Send2";
  2027. ccp.MethodName = "ZHBmergeSendLIMES";
  2028. ccp.ServerParams = new object[] { SPECIMEN_NO, this.UserInfo.GetUserID(), this.UserInfo.GetUserName(), sampleDeliveryTime };
  2029. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  2030. if (ccp.ReturnCode != -1)
  2031. {
  2032. MessageBox.Show("合并发送成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);
  2033. }
  2034. this.DoQuery();
  2035. int conut = this.ultraGrid1.Rows.Count();
  2036. if (conut <= 0)
  2037. {
  2038. this.dataSet2.Clear();
  2039. this.dataSet3.Clear();
  2040. }
  2041. }
  2042. catch (Exception ex)
  2043. {
  2044. System.Diagnostics.Debug.WriteLine(ex.ToString());
  2045. MessageBox.Show("系统出错,请联系管理人员", "警告");
  2046. }
  2047. }
  2048. #endregion
  2049. #region 撤销合并同批发送委托
  2050. private void button2_Click(object sender, EventArgs e)
  2051. {
  2052. try
  2053. {
  2054. if (MessageBox.Show("确认撤销同批合并发送委托?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
  2055. {
  2056. return;
  2057. }
  2058. String zhyy = "MES撤回";
  2059. CoreClientParam ccp = new CoreClientParam();
  2060. string SPECIMEN_NO = "";
  2061. string fh = "";
  2062. int num = 0;
  2063. int numy = 0;
  2064. foreach (UltraGridRow ugr in this.ultraGrid4.Rows)
  2065. {
  2066. string specimeNo = "";
  2067. if (ugr.Cells["CHK"].Value.ToString().ToLower() == "true")
  2068. {
  2069. specimeNo = ugr.Cells["ZHB_SPECIMEN_NO"].Value.ToString();//合并取样编号
  2070. if (String.IsNullOrEmpty(specimeNo))
  2071. {
  2072. this.alert("【撤销同批合并发送】按钮只能撤销合并委托!");
  2073. return;
  2074. }
  2075. String status = ugr.Cells["STATUS"].Value.ToString();
  2076. if ("7".Equals(status) || "确认接收样".Equals(status))
  2077. {
  2078. this.alert("该委托样品已接收, 不允许撤回, 请联系系统管理员");
  2079. return;
  2080. }
  2081. String quoteConsignNo = ugr.Cells["QUOTE_CONSIGN_NO"].Value.ToString();
  2082. if ("1".Equals(status) || !String.IsNullOrEmpty(quoteConsignNo))
  2083. {
  2084. numy = 1;
  2085. }
  2086. num = num + 1;
  2087. if (num <= 1)
  2088. {
  2089. SPECIMEN_NO = specimeNo;
  2090. fh = ",";
  2091. }
  2092. else
  2093. {
  2094. SPECIMEN_NO = SPECIMEN_NO + fh + specimeNo;
  2095. }
  2096. }
  2097. }
  2098. if (numy == 1)
  2099. {
  2100. this.alert("不能撤销引用的轧批号!!!");
  2101. return;
  2102. }
  2103. ccp.ServerName = "QCM.JHY01.JHY0102.Send2";
  2104. ccp.MethodName = "ZHBCancelLIMES";
  2105. ccp.ServerParams = new object[] { SPECIMEN_NO, this.UserInfo.GetUserName(), zhyy };
  2106. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  2107. if (ccp.ReturnCode != -1)
  2108. {
  2109. MessageBox.Show("撤销同批合并发送成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);//ccp.ReturnInfo "发送成功" ccp.ReturnInfo
  2110. }
  2111. this.DoQuery();
  2112. int conut = this.ultraGrid4.Rows.Count();
  2113. if (conut <= 0)
  2114. {
  2115. this.dataSet6.Clear();
  2116. this.dataSet7.Clear();
  2117. }
  2118. }
  2119. catch (Exception ex)
  2120. {
  2121. System.Diagnostics.Debug.WriteLine(ex.ToString());
  2122. MessageBox.Show("系统出错,请联系管理人员", "警告");
  2123. }
  2124. }
  2125. #endregion
  2126. #region 引用实绩
  2127. private void DoQuote()
  2128. {
  2129. UltraGridRow row = this.ultraGrid1.ActiveRow;
  2130. if (row == null)
  2131. {
  2132. this.alert("检验委托为空!请选择检验委托数据!!!");
  2133. return;
  2134. }
  2135. if (MessageBox.Show("轧批号【" + row.Cells["BATCH_NO"].Value.ToString() + "】,确认引用?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
  2136. {
  2137. return;
  2138. }
  2139. if (!String.IsNullOrEmpty(row.Cells["QUOTE_MEMO"].Value.ToString()))
  2140. {
  2141. this.alert("已引用不可重复引用!!!");
  2142. return;
  2143. }
  2144. String DESIGN_KEY = row.Cells["DESIGN_KEY"].Value.ToString();
  2145. String HEAT_NO = row.Cells["HEAT_NO"].Value.ToString();
  2146. String BATCH_NO = row.Cells["BATCH_NO"].Value.ToString();
  2147. String SMP_NO = row.Cells["SMP_NO"].Value.ToString();
  2148. String SPECIMEN_NO = row.Cells["SPECIMEN_NO"].Value.ToString();
  2149. String FREQ_CODE = row.Cells["FREQ_CODE"].Value.ToString();
  2150. String PLINE_CODE = row.Cells["PLINE_CODE"].Value.ToString();
  2151. String SMP_TYPE_CODE = row.Cells["SMP_TYPE_CODE"].Value.ToString();
  2152. String THICK = row.Cells["THICK"].Value.ToString();
  2153. String STEEL_NAME = row.Cells["STEEL_NAME"].Value.ToString();
  2154. Hashtable ht = new Hashtable();
  2155. ht.Add("HEAT_NO", HEAT_NO);
  2156. ht.Add("BATCH_NO", BATCH_NO);
  2157. ht.Add("SMP_NO", SMP_NO);
  2158. ht.Add("SPECIMEN_NO", SPECIMEN_NO);
  2159. ht.Add("FREQ_CODE", FREQ_CODE);
  2160. ht.Add("PLINE_CODE", PLINE_CODE);
  2161. ht.Add("SMP_TYPE_CODE", SMP_TYPE_CODE);
  2162. ht.Add("SEND_ID", this.UserInfo.GetUserID());
  2163. ht.Add("CREATE_NAME", this.UserInfo.GetUserName());
  2164. ht.Add("THICK", THICK);
  2165. ht.Add("DESIGN_KEY", DESIGN_KEY);
  2166. ht.Add("STEEL_NAME", STEEL_NAME);
  2167. CoreClientParam ccp = new CoreClientParam();
  2168. ccp.ServerName = "QCM.JHY01.JHY0102.UpdateInfo";
  2169. ccp.MethodName = "DoQuoteBatchNo";
  2170. ccp.ServerParams = new object[] { ht };
  2171. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  2172. if (ccp.ReturnCode != -1)
  2173. {
  2174. MessageBox.Show("引用成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);
  2175. }
  2176. this.DoQuery();
  2177. }
  2178. #endregion
  2179. #region 预测抽样
  2180. private void button3_Click(object sender, EventArgs e)
  2181. {
  2182. try
  2183. {
  2184. String sdeltime = this.SAMPLE_DELIVERY_TIME.Text.Trim().ToString();
  2185. if (!sdeltime.Equals("24:00:00"))
  2186. {
  2187. //当前时间小于送样时间15分钟,不能选择当前送样时间发送委托
  2188. //送样时间小于当前时间,不能选择肖妆送样时间发送委托
  2189. String sdtime0 = this.dateTimePicker3.Text.ToString();
  2190. String sampleDeliveryTime0 = this.SAMPLE_DELIVERY_TIME.Text.ToString();
  2191. String dbtime = sdtime0 + " " + sampleDeliveryTime0;//送样时间点
  2192. DateTime historyTime = Convert.ToDateTime(dbtime);//转换日期格式
  2193. System.DateTime currentTime = new System.DateTime();
  2194. currentTime = System.DateTime.Now;//系统时间
  2195. TimeSpan ts = historyTime - currentTime;
  2196. double getHours = ts.TotalMinutes;
  2197. if (getHours <= -1)
  2198. {
  2199. this.alert("送样时间截点不能小于当前系统时间截点,请选择一个大于当前系统时间截点并且不能小于15分钟的送样时间截点,谢谢!");
  2200. return;
  2201. }
  2202. else if (getHours <= 15)
  2203. {
  2204. this.alert("当前系统时间截点小于送样时间截点15分钟,不能在当前送样时间点进行委托,请选择另一个送样时间点,谢谢!");
  2205. return;
  2206. }
  2207. }
  2208. // DoUpdate();//先修改取样材料号
  2209. String sampleDeliveryTime = this.SAMPLE_DELIVERY_TIME.Text.ToString();
  2210. if (!sampleDeliveryTime.Equals("03:00:00") && !sampleDeliveryTime.Equals("06:00:00") && !sampleDeliveryTime.Equals("10:30:00") &&
  2211. !sampleDeliveryTime.Equals("11:00:00") && !sampleDeliveryTime.Equals("15:00:00") && !sampleDeliveryTime.Equals("17:30:00") &&
  2212. !sampleDeliveryTime.Equals("18:00:00") && !sampleDeliveryTime.Equals("20:30:00") && !sampleDeliveryTime.Equals("21:00:00") &&
  2213. !sampleDeliveryTime.Equals("06:30:00") && !sampleDeliveryTime.Equals("24:00:00") )
  2214. {
  2215. this.alert("请在下拉框中选择正确的时间点不要手动更改时间点格式,当前时间点格式【" + sampleDeliveryTime + "】不在规定时间格式中!");
  2216. return;
  2217. }
  2218. String sdtime = this.dateTimePicker3.Text.ToString();
  2219. if (String.IsNullOrEmpty(sampleDeliveryTime) || String.IsNullOrEmpty(sdtime))
  2220. {
  2221. this.alert("请选择送样时间点!");
  2222. return;
  2223. }
  2224. sampleDeliveryTime = sdtime + " " + sampleDeliveryTime;//送样时间点
  2225. CoreClientParam ccp = new CoreClientParam();
  2226. string SPECIMEN_NO = "";
  2227. string fh = "";
  2228. int num = 0;
  2229. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  2230. {
  2231. string specimeNo = "";
  2232. if (ugr.Cells["CHK"].Value.ToString().ToLower() == "true")
  2233. {
  2234. specimeNo = ugr.Cells["SPECIMEN_NO"].Value.ToString();
  2235. num = num + 1;
  2236. if (num <= 1)
  2237. {
  2238. SPECIMEN_NO = specimeNo;
  2239. fh = ",";
  2240. }
  2241. else
  2242. {
  2243. SPECIMEN_NO = SPECIMEN_NO + fh + specimeNo;
  2244. }
  2245. }
  2246. }
  2247. ccp.ServerName = "QCM.JHY01.JHY0102.Send2";
  2248. ccp.MethodName = "ZHBYuCeSample";
  2249. ccp.ServerParams = new object[] { SPECIMEN_NO, this.UserInfo.GetUserID(), this.UserInfo.GetUserName(), sampleDeliveryTime };
  2250. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  2251. if (ccp.ReturnCode != -1)
  2252. {
  2253. MessageBox.Show("预测成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);
  2254. }
  2255. this.DoQuery();
  2256. int conut = this.ultraGrid1.Rows.Count();
  2257. if (conut <= 0)
  2258. {
  2259. this.dataSet2.Clear();
  2260. this.dataSet3.Clear();
  2261. }
  2262. }
  2263. catch (Exception ex)
  2264. {
  2265. System.Diagnostics.Debug.WriteLine(ex.ToString());
  2266. MessageBox.Show("系统出错,请联系管理人员", "警告");
  2267. }
  2268. }
  2269. #endregion
  2270. #region 撤销预测抽样
  2271. private void button4_Click(object sender, EventArgs e)
  2272. {
  2273. try
  2274. {
  2275. if (MessageBox.Show("确认撤销发送?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
  2276. {
  2277. return;
  2278. }
  2279. String zhyy = "MES撤回";
  2280. CoreClientParam ccp = new CoreClientParam();
  2281. string SPECIMEN_NO = "";
  2282. string fh = "";
  2283. int num = 0;
  2284. foreach (UltraGridRow ugr in this.ultraGrid4.Rows)
  2285. {
  2286. string specimeNo = "";
  2287. if (ugr.Cells["CHK"].Value.ToString().ToLower() == "true")
  2288. {
  2289. specimeNo = ugr.Cells["SPECIMEN_NO"].Value.ToString();//取样编号
  2290. String status = ugr.Cells["STATUS"].Value.ToString();//状态
  2291. if ("7".Equals(status) || "确认接收样".Equals(status))
  2292. {
  2293. this.alert("该委托样品已接收, 不允许撤回, 请联系系统管理员");
  2294. return;
  2295. }
  2296. String zhbsno = ugr.Cells["RZ_OLD_SAMPL_NO"].Value.ToString();//抽样取样编号
  2297. String RZ_MIXROLL = ugr.Cells["RZ_MIXROLL"].Value.ToString();//组批区间
  2298. if (String.IsNullOrEmpty(RZ_MIXROLL) || !specimeNo.Equals(zhbsno) )
  2299. {
  2300. this.alert("【撤销抽样】按钮只能撤销预测抽样委托!");
  2301. return;
  2302. }
  2303. num = num + 1;
  2304. if (num <= 1)
  2305. {
  2306. SPECIMEN_NO = specimeNo;
  2307. fh = ",";
  2308. }
  2309. else
  2310. {
  2311. SPECIMEN_NO = SPECIMEN_NO + fh + specimeNo;
  2312. }
  2313. }
  2314. }
  2315. ccp.ServerName = "QCM.JHY01.JHY0102.Send2";
  2316. ccp.MethodName = "CancelZHBYuCeSample";
  2317. ccp.ServerParams = new object[] { SPECIMEN_NO, this.UserInfo.GetUserName(), zhyy };
  2318. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  2319. if (ccp.ReturnCode != -1)
  2320. {
  2321. MessageBox.Show("撤销预测抽样成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);//ccp.ReturnInfo "发送成功" ccp.ReturnInfo
  2322. }
  2323. this.DoQuery();
  2324. int conut = this.ultraGrid4.Rows.Count();
  2325. if (conut <= 0)
  2326. {
  2327. this.dataSet6.Clear();
  2328. this.dataSet7.Clear();
  2329. }
  2330. }
  2331. catch (Exception ex)
  2332. {
  2333. System.Diagnostics.Debug.WriteLine(ex.ToString());
  2334. MessageBox.Show("系统出错,请联系管理人员", "警告");
  2335. }
  2336. }
  2337. #endregion
  2338. #region 条件
  2339. private String DoCondition()
  2340. {
  2341. try
  2342. {
  2343. String userid=this.UserInfo.GetUserID();//员工ID
  2344. String stime = this.SAMPLE_DELIVERY_TIME.Text.ToString();//送样时间点
  2345. //厚板操作员 userid.Equals("X16962") || userid.Equals("X16961") ||
  2346. if (userid.Equals("X16975") || userid.Equals("X16984") || userid.Equals("X16972") || userid.Equals("X16968") ||
  2347. userid.Equals("X16965") || userid.Equals("X16978") || userid.Equals("X16964") || userid.Equals("X16981") || userid.Equals("X17002") ||
  2348. userid.Equals("X16989") || userid.Equals("X16995") || userid.Equals("X16986") || userid.Equals("X16982") || userid.Equals("X16976") ||
  2349. userid.Equals("X17022") || userid.Equals("X16999") || userid.Equals("X16979") || userid.Equals("X16966") || userid.Equals("X17008") ||
  2350. userid.Equals("X16941") || userid.Equals("X16988") || userid.Equals("X16994") || userid.Equals("X16993") || userid.Equals("X16969") ||
  2351. userid.Equals("X17003") || userid.Equals("X16997") || userid.Equals("X16987") || userid.Equals("X16998") || userid.Equals("X16973"))
  2352. {
  2353. if (!stime.Equals("06:30:00") && !stime.Equals("10:30:00") && !stime.Equals("17:30:00") && !stime.Equals("20:30:00"))
  2354. {
  2355. this.alert("选择的送样时间点错误!无法发送委托!您是厚板操作员请您选择厚板送样时间点!");
  2356. return "0";
  2357. }
  2358. }
  2359. else if (userid.Equals("X17020") || userid.Equals("X17019") || userid.Equals("X17038") || userid.Equals("X17028") ||
  2360. userid.Equals("X17044") || userid.Equals("X17036") || userid.Equals("X17034") || userid.Equals("X17009") || userid.Equals("X17011") ||
  2361. userid.Equals("X17047") || userid.Equals("X17039") || userid.Equals("X17030") || userid.Equals("X17026") || userid.Equals("X17010") ||
  2362. userid.Equals("X17037") || userid.Equals("X17040") || userid.Equals("X17045") || userid.Equals("X17033") || userid.Equals("X17041") ||
  2363. userid.Equals("X17014") || userid.Equals("X17021") || userid.Equals("X17027") || userid.Equals("X17052") || userid.Equals("X17012") ||
  2364. userid.Equals("X17017") || userid.Equals("X17018") || userid.Equals("X17032") || userid.Equals("X17053"))
  2365. {
  2366. //中板操作员
  2367. if (!stime.Equals("03:00:00") && !stime.Equals("06:00:00") && !stime.Equals("11:00:00") && !stime.Equals("15:00:00") &&
  2368. !stime.Equals("18:00:00") && !stime.Equals("21:00:00"))
  2369. {
  2370. this.alert("选择的送样时间点错误!无法发送委托!您是中板操作员请您选择中板送样时间点!");
  2371. return "0";
  2372. }
  2373. }
  2374. }
  2375. catch (Exception ex)
  2376. {
  2377. System.Diagnostics.Debug.WriteLine(ex.ToString());
  2378. MessageBox.Show("系统出错,请联系管理人员", "警告");
  2379. }
  2380. return "1";
  2381. }
  2382. #endregion
  2383. #endregion
  2384. #region 其它事件
  2385. #region 查询下拉框 取样材料号 轧批号
  2386. private void ultraGrid1_AfterCellActivate(object sender, EventArgs e)
  2387. {
  2388. //this.dataSet4.Clear();
  2389. //String heatNo = this.ultraGrid1.ActiveRow.Cells["HEAT_NO"].Value.ToString();
  2390. //CoreClientParam ccp2 = new CoreClientParam();
  2391. //ccp2.ServerName = "QCM.JHY01.JHY0101.QuerryQltySample";//调用java地址
  2392. //ccp2.MethodName = "getBatchNo";//调用的方法
  2393. //ccp2.ServerParams = new object[] { heatNo };
  2394. //ccp2.SourceDataTable = this.dataSet4.Tables[0];
  2395. //this.ExecuteQueryToDataTable(ccp2, CoreInvokeType.Internal);
  2396. //ValueList VDEFECT_DESC2 = new ValueList();
  2397. //for (int i = 0; i < ccp2.SourceDataTable.Rows.Count; i++)
  2398. //{
  2399. // VDEFECT_DESC2.ValueListItems.Add(ccp2.SourceDataTable.Rows[i]["BATCH_NO"].ToString(), ccp2.SourceDataTable.Rows[i]["BATCH_NO"].ToString());
  2400. //}
  2401. //this.ultraGrid1.DisplayLayout.Bands[0].Columns["BATCH_NO"].ValueList = VDEFECT_DESC2;
  2402. this.dataSet4.Clear();
  2403. String batchNo = this.ultraGrid1.ActiveRow.Cells["BATCH_NO"].Value.ToString();
  2404. String plineCode = this.ultraGrid1.ActiveRow.Cells["PLINE_CODE"].Value.ToString();
  2405. CoreClientParam ccp = new CoreClientParam();
  2406. ccp.ServerName = "QCM.JHY01.JHY0101.QuerryQltySample";//调用java地址
  2407. ccp.MethodName = "getBilletId";//调用的方法
  2408. ccp.ServerParams = new object[] { batchNo, plineCode };
  2409. ccp.SourceDataTable = this.dataSet4.Tables[0];
  2410. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  2411. ValueList VDEFECT_DESC = new ValueList();
  2412. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  2413. {
  2414. VDEFECT_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["MATERIAL_NO"].ToString(), ccp.SourceDataTable.Rows[i]["MATERIAL_NO"].ToString());
  2415. }
  2416. this.ultraGrid1.DisplayLayout.Bands[0].Columns["MATERIAL_NO"].ValueList = VDEFECT_DESC;
  2417. }
  2418. #endregion
  2419. private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
  2420. {
  2421. int num = this.ultraGrid1.Rows.Count();
  2422. if (num >= 1)
  2423. {
  2424. // this.DoQueryPrg(this.ultraGrid1.ActiveRow);//右下角
  2425. // this.DoQueryOrder(this.ultraGrid1.ActiveRow);//左下角
  2426. this.dataSet4.Clear();
  2427. String heatNo = this.ultraGrid1.ActiveRow.Cells["HEAT_NO"].Value.ToString();
  2428. String plineCode = this.ultraGrid1.ActiveRow.Cells["PLINE_CODE"].Value.ToString();
  2429. String batchNo = this.ultraGrid1.ActiveRow.Cells["BATCH_NO"].Value.ToString();
  2430. String freqCode = this.ultraGrid1.ActiveRow.Cells["FREQ_CODE"].Value.ToString();
  2431. if (freqCode.Equals("D"))
  2432. {
  2433. CoreClientParam ccp2 = new CoreClientParam();
  2434. ccp2.ServerName = "QCM.JHY01.JHY0101.QuerryQltySample";//调用java地址
  2435. ccp2.MethodName = "getBatchNo";//调用的方法
  2436. ccp2.ServerParams = new object[] { heatNo, plineCode };
  2437. ccp2.SourceDataTable = this.dataSet4.Tables[0];
  2438. this.ExecuteQueryToDataTable(ccp2, CoreInvokeType.Internal);
  2439. ValueList VDEFECT_DESC2 = new ValueList();
  2440. for (int i = 0; i < ccp2.SourceDataTable.Rows.Count; i++)
  2441. {
  2442. VDEFECT_DESC2.ValueListItems.Add(ccp2.SourceDataTable.Rows[i]["BATCH_NO"].ToString(), ccp2.SourceDataTable.Rows[i]["BATCH_NO"].ToString());
  2443. }
  2444. this.ultraGrid1.DisplayLayout.Bands[0].Columns["BATCH_NO"].ValueList = VDEFECT_DESC2;
  2445. }
  2446. Infragistics.Win.UltraWinGrid.UltraGrid uGrid = (Infragistics.Win.UltraWinGrid.UltraGrid)sender;
  2447. string specimen_no = uGrid.ActiveRow.Cells["SPECIMEN_NO"].Text.Trim();
  2448. string smp_no = uGrid.ActiveRow.Cells["SMP_NO"].Text.Trim();
  2449. this.dataSet3.Tables[0].Clear();
  2450. this.dataSet2.Tables[0].Clear();
  2451. CoreClientParam ccp = new CoreClientParam();
  2452. ccp.ServerName = "QCM.JHY01.JHY0101.QuerryQltySample";
  2453. ccp.MethodName = "getQltySampleItemNew";
  2454. ccp.ServerParams = new object[] { specimen_no };
  2455. ccp.SourceDataTable = this.dataSet3.Tables[0];
  2456. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  2457. CoreClientParam ccp1 = new CoreClientParam();
  2458. ccp1.ServerName = "QCM.JHY01.JHY0101.QuerryQltySample";
  2459. ccp1.MethodName = "getQltySampleOrdNew";
  2460. ccp1.ServerParams = new object[] { smp_no };
  2461. ccp1.SourceDataTable = this.dataSet2.Tables[0];
  2462. this.ExecuteQueryToDataTable(ccp1, CoreInvokeType.Internal);
  2463. //foreach (UltraGridRow ugr2 in this.ultraGrid2.Rows)
  2464. //{
  2465. // ugr2.Cells["Column1"].Value = ugr2.Cells["THICK"].Value + "*" + ugr2.Cells["WIDTH"].Value + "*" + ugr2.Cells["LENGTH"].Value;
  2466. //}
  2467. this.dataSet4.Clear();
  2468. CoreClientParam ccp3 = new CoreClientParam();
  2469. ccp3.ServerName = "QCM.JHY01.JHY0101.QuerryQltySample";//调用java地址
  2470. ccp3.MethodName = "getProcessNo";//调用的方法
  2471. ccp3.ServerParams = new object[] { batchNo, plineCode };
  2472. ccp3.SourceDataTable = this.dataSet4.Tables[0];
  2473. this.ExecuteQueryToDataTable(ccp3, CoreInvokeType.Internal);
  2474. ValueList VDEFECT_DESC3 = new ValueList();
  2475. for (int i = 0; i < ccp3.SourceDataTable.Rows.Count; i++)
  2476. {
  2477. VDEFECT_DESC3.ValueListItems.Add(ccp3.SourceDataTable.Rows[i]["RCL_STATE"].ToString(), ccp3.SourceDataTable.Rows[i]["RCL_STATE"].ToString());
  2478. }
  2479. this.ultraGrid1.DisplayLayout.Bands[0].Columns["PROCESS_NOS"].ValueList = VDEFECT_DESC3;
  2480. }
  2481. else
  2482. {
  2483. this.dataSet2.Clear();
  2484. this.dataSet3.Clear();
  2485. }
  2486. }
  2487. #region 选择tab 显示相应按钮
  2488. private void ultraTabControl1_SelectedTabChanged(object sender, Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventArgs e)
  2489. {
  2490. if (this.ultraTabControl1.SelectedTab.Index == 0)
  2491. {
  2492. this.ToolBarItemEnable(this, "Send", true);
  2493. this.ToolBarItemEnable(this, "Add", true);
  2494. this.ToolBarItemEnable(this, "AddArtificial", true);
  2495. this.ToolBarItemEnable(this, "Unsend", false);
  2496. this.ToolBarItemEnable(this, "Unsend19", false);
  2497. this.ToolBarItemEnable(this, "AddWt", true);
  2498. this.ToolBarItemEnable(this, "DelWt", true);
  2499. this.ToolBarItemEnable(this, "DoDelete", true);
  2500. this.ToolBarItemEnable(this, "UpBatchNo", true);
  2501. this.ToolBarItemEnable(this, "UpRefBatchNo", true);
  2502. this.ToolBarItemEnable(this, "DoQuote", true);
  2503. this.ToolBarItemEnable(this, "AllUpdate", true);
  2504. this.ToolBarItemEnable(this, "InExport", false);
  2505. this.ToolBarItemEnable(this, "DoProcessNo", true);
  2506. this.ToolBarItemEnable(this, "doPrint", false);
  2507. // this.DoQuery();
  2508. }
  2509. else if (this.ultraTabControl1.SelectedTab.Index == 1)
  2510. {
  2511. this.ToolBarItemEnable(this, "Send", false);
  2512. this.ToolBarItemEnable(this, "Add", false);
  2513. this.ToolBarItemEnable(this, "AddArtificial", false);
  2514. this.ToolBarItemEnable(this, "Unsend", true);
  2515. this.ToolBarItemEnable(this, "Unsend19", true);
  2516. this.ToolBarItemEnable(this, "AddWt", false);
  2517. this.ToolBarItemEnable(this, "DelWt", false);
  2518. this.ToolBarItemEnable(this, "DoDelete", false);
  2519. this.ToolBarItemEnable(this, "UpBatchNo", false);
  2520. this.ToolBarItemEnable(this, "UpRefBatchNo", false);
  2521. this.ToolBarItemEnable(this, "DoQuote", false);
  2522. this.ToolBarItemEnable(this, "AllUpdate", false);
  2523. this.ToolBarItemEnable(this, "InExport", false);
  2524. this.ToolBarItemEnable(this, "DoProcessNo", true);
  2525. this.ToolBarItemEnable(this, "doPrint", true);
  2526. // this.DoQuery();
  2527. }
  2528. else if (this.ultraTabControl1.SelectedTab.Index == 2)
  2529. {
  2530. this.ToolBarItemEnable(this, "Send", false);
  2531. this.ToolBarItemEnable(this, "Add", false);
  2532. this.ToolBarItemEnable(this, "AddArtificial", false);
  2533. this.ToolBarItemEnable(this, "Unsend", false);
  2534. this.ToolBarItemEnable(this, "Unsend19", false);
  2535. this.ToolBarItemEnable(this, "AddWt", false);
  2536. this.ToolBarItemEnable(this, "DelWt", false);
  2537. this.ToolBarItemEnable(this, "DoDelete", false);
  2538. this.ToolBarItemEnable(this, "UpBatchNo", false);
  2539. this.ToolBarItemEnable(this, "UpRefBatchNo", false);
  2540. this.ToolBarItemEnable(this, "DoQuote", false);
  2541. this.ToolBarItemEnable(this, "AllUpdate", false);
  2542. this.ToolBarItemEnable(this, "InExport", true);
  2543. this.ToolBarItemEnable(this, "DoProcessNo", false);
  2544. this.ToolBarItemEnable(this, "doPrint", false);
  2545. }
  2546. else if (this.ultraTabControl1.SelectedTab.Index == 3)
  2547. {
  2548. this.ToolBarItemEnable(this, "Send", false);
  2549. this.ToolBarItemEnable(this, "Add", false);
  2550. this.ToolBarItemEnable(this, "AddArtificial", false);
  2551. this.ToolBarItemEnable(this, "Unsend", false);
  2552. this.ToolBarItemEnable(this, "Unsend19", false);
  2553. this.ToolBarItemEnable(this, "AddWt", false);
  2554. this.ToolBarItemEnable(this, "DelWt", false);
  2555. this.ToolBarItemEnable(this, "DoDelete", false);
  2556. this.ToolBarItemEnable(this, "UpBatchNo", false);
  2557. this.ToolBarItemEnable(this, "UpRefBatchNo", false);
  2558. this.ToolBarItemEnable(this, "DoQuote", false);
  2559. this.ToolBarItemEnable(this, "AllUpdate", false);
  2560. this.ToolBarItemEnable(this, "InExport", false);
  2561. this.ToolBarItemEnable(this, "DoProcessNo", false);
  2562. this.ToolBarItemEnable(this, "doPrint", false);
  2563. }
  2564. }
  2565. #endregion
  2566. private void ultraGrid4_AfterRowActivate(object sender, EventArgs e)
  2567. {
  2568. // this.DoQueryPrg(this.ultraGrid4.ActiveRow);
  2569. // this.DoQueryOrder(this.ultraGrid4.ActiveRow);
  2570. Infragistics.Win.UltraWinGrid.UltraGrid uGrid = (Infragistics.Win.UltraWinGrid.UltraGrid)sender;
  2571. string specimen_no = uGrid.ActiveRow.Cells["SPECIMEN_NO"].Text.Trim();
  2572. string smp_no = uGrid.ActiveRow.Cells["SMP_NO"].Text.Trim();
  2573. this.dataSet6.Tables[0].Clear();
  2574. this.dataSet7.Tables[0].Clear();
  2575. CoreClientParam ccp = new CoreClientParam();
  2576. ccp.ServerName = "QCM.JHY01.JHY0101.QuerryQltySample";
  2577. ccp.MethodName = "getQltySampleItemNew";
  2578. ccp.ServerParams = new object[] { specimen_no };
  2579. ccp.SourceDataTable = this.dataSet7.Tables[0];
  2580. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  2581. CoreClientParam ccp1 = new CoreClientParam();
  2582. ccp1.ServerName = "QCM.JHY01.JHY0101.QuerryQltySample";
  2583. ccp1.MethodName = "getQltySampleOrdNew";
  2584. ccp1.ServerParams = new object[] { smp_no };
  2585. ccp1.SourceDataTable = this.dataSet6.Tables[0];
  2586. this.ExecuteQueryToDataTable(ccp1, CoreInvokeType.Internal);
  2587. //foreach (UltraGridRow ugr2 in this.ultraGrid2.Rows)
  2588. //{
  2589. // ugr2.Cells["Column1"].Value = ugr2.Cells["THICK"].Value + "*" + ugr2.Cells["WIDTH"].Value + "*" + ugr2.Cells["LENGTH"].Value;
  2590. //}
  2591. }
  2592. private void ultraGrid1_CellChange(object sender, CellEventArgs e)
  2593. {
  2594. ultraGrid1.UpdateData();
  2595. }
  2596. private void ultraGrid1_AfterHeaderCheckStateChanged(object sender, AfterHeaderCheckStateChangedEventArgs e)
  2597. {
  2598. ultraGrid1.UpdateData();
  2599. }
  2600. private void ultraGrid4_AfterHeaderCheckStateChanged(object sender, AfterHeaderCheckStateChangedEventArgs e)
  2601. {
  2602. ultraGrid4.UpdateData();
  2603. }
  2604. private void ultraGrid4_CellChange(object sender, CellEventArgs e)
  2605. {
  2606. ultraGrid4.UpdateData();
  2607. }
  2608. #endregion
  2609. #region 右下角 删除 名称
  2610. private void ultraGrid3_InitializeRow(object sender, InitializeRowEventArgs e)
  2611. {
  2612. e.Row.Cells["deletebol"].Value = "删除";
  2613. }
  2614. #endregion
  2615. #region 右下角 删除
  2616. private void ultraGrid3_ClickCellButton(object sender, CellEventArgs e)
  2617. {
  2618. ultraGrid3.UpdateData();
  2619. if (e.Cell.Column.Key == "deletebol")
  2620. {
  2621. if (MessageBox.Show("确定要删除这一项目?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk) == DialogResult.No)
  2622. {
  2623. return;
  2624. }
  2625. try
  2626. {
  2627. CoreClientParam ccp = new CoreClientParam();
  2628. String seq = "";//检验项目流水号
  2629. String specimenNo = "";//取样编号
  2630. UltraGridRow row = ultraGrid3.ActiveRow;
  2631. if (!row.Cells["ITEM_FLAG"].Value.ToString().Equals("1"))
  2632. {
  2633. MessageBox.Show("不能删除系统生成的项目,只能删除人工生成的项目!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  2634. return;
  2635. }
  2636. seq = row.Cells["SEQ"].Value.ToString();
  2637. specimenNo = row.Cells["SPECIMEN_NO"].Value.ToString();
  2638. ccp.ServerName = "QCM.JHY01.JHY0102.UpdateInfo";
  2639. ccp.MethodName = "deleteInfo";
  2640. ccp.ServerParams = new object[] { seq, specimenNo };
  2641. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  2642. if (ccp.ReturnCode != -1)
  2643. {
  2644. MessageBox.Show(ccp.ReturnInfo, "提示", MessageBoxButtons.OK, MessageBoxIcon.None);
  2645. }
  2646. this.DoQueryPrg(this.ultraGrid1.ActiveRow);
  2647. }
  2648. catch (Exception ex)
  2649. {
  2650. System.Diagnostics.Debug.WriteLine(ex.ToString());
  2651. MessageBox.Show("系统出错,请联系管理人员", "警告");
  2652. }
  2653. }
  2654. }
  2655. #endregion
  2656. #region 轧批号框勾选触发
  2657. private void checkBox1_Click(object sender, EventArgs e)
  2658. {
  2659. if (this.checkBox1.Checked)
  2660. {
  2661. this.dateTimePicker1.Enabled = false;
  2662. this.dateTimePicker2.Enabled = false;
  2663. this.textBox1.Enabled = true;
  2664. this.BATCH_NO2.Enabled = true;
  2665. }
  2666. else
  2667. {//&& !this.checkBox3.Checked
  2668. if (!this.checkBox1.Checked && !this.checkBox2.Checked && !this.checkBox5.Checked)
  2669. {
  2670. this.dateTimePicker1.Enabled = true;
  2671. this.dateTimePicker2.Enabled = true;
  2672. }
  2673. this.textBox1.Enabled = false;
  2674. this.BATCH_NO2.Enabled = false;
  2675. }
  2676. }
  2677. private void checkBox2_Click(object sender, EventArgs e)
  2678. {
  2679. if (this.checkBox2.Checked)
  2680. {
  2681. this.dateTimePicker1.Enabled = false;
  2682. this.dateTimePicker2.Enabled = false;
  2683. this.selheatNo.Enabled = true;
  2684. }
  2685. else
  2686. {//&& !this.checkBox3.Checked
  2687. if (!this.checkBox1.Checked && !this.checkBox2.Checked && !this.checkBox5.Checked)
  2688. {
  2689. this.dateTimePicker1.Enabled = true;
  2690. this.dateTimePicker2.Enabled = true;
  2691. }
  2692. this.selheatNo.Enabled = false;
  2693. }
  2694. }
  2695. private void checkBox3_Click(object sender, EventArgs e)
  2696. {
  2697. if (this.checkBox3.Checked)
  2698. {
  2699. //this.dateTimePicker1.Enabled = false;
  2700. //this.dateTimePicker2.Enabled = false;
  2701. this.sel_design_key.Enabled = true;
  2702. }
  2703. else
  2704. {
  2705. //if (!this.checkBox1.Checked && !this.checkBox2.Checked && !this.checkBox3.Checked)
  2706. //{
  2707. // this.dateTimePicker1.Enabled = true;
  2708. // this.dateTimePicker2.Enabled = true;
  2709. //}
  2710. this.sel_design_key.Enabled = false;
  2711. }
  2712. }
  2713. private void checkBox4_Click(object sender, EventArgs e)
  2714. {
  2715. if (this.checkBox4.Checked)
  2716. {
  2717. this.SAMPLE_DELIVERY_TIME2.Enabled = true;
  2718. this.dateTimePicker4.Enabled = true;
  2719. }
  2720. else
  2721. {
  2722. this.SAMPLE_DELIVERY_TIME2.Enabled = false;
  2723. this.dateTimePicker4.Enabled = false;
  2724. }
  2725. }
  2726. private void checkBox5_Click(object sender, EventArgs e)
  2727. {
  2728. if (this.checkBox5.Checked)
  2729. {
  2730. this.dateTimePicker1.Enabled = false;
  2731. this.dateTimePicker2.Enabled = false;
  2732. this.textBox3.Enabled = true;
  2733. }
  2734. else
  2735. {//&& !this.checkBox3.Checked
  2736. if (!this.checkBox1.Checked && !this.checkBox2.Checked && !this.checkBox5.Checked)
  2737. {
  2738. this.dateTimePicker1.Enabled = true;
  2739. this.dateTimePicker2.Enabled = true;
  2740. }
  2741. this.textBox3.Enabled = false;
  2742. }
  2743. }
  2744. #endregion
  2745. #region 子板号 热处理号
  2746. private void ultraGrid4_AfterCellActivate(object sender, EventArgs e)
  2747. {
  2748. this.dataSet4.Clear();
  2749. String batchNo = this.ultraGrid4.ActiveRow.Cells["BATCH_NO"].Value.ToString();
  2750. String plineCode = this.ultraGrid4.ActiveRow.Cells["PLINE_CODE"].Value.ToString();
  2751. CoreClientParam ccp = new CoreClientParam();
  2752. ccp.ServerName = "QCM.JHY01.JHY0101.QuerryQltySample";//调用java地址
  2753. ccp.MethodName = "getBilletId";//调用的方法
  2754. ccp.ServerParams = new object[] { batchNo, plineCode };
  2755. ccp.SourceDataTable = this.dataSet4.Tables[0];
  2756. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  2757. ValueList VDEFECT_DESC = new ValueList();
  2758. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  2759. {
  2760. VDEFECT_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["MATERIAL_NO"].ToString(), ccp.SourceDataTable.Rows[i]["MATERIAL_NO"].ToString());
  2761. }
  2762. this.ultraGrid4.DisplayLayout.Bands[0].Columns["MATERIAL_NO"].ValueList = VDEFECT_DESC;
  2763. this.dataSet4.Clear();
  2764. CoreClientParam ccp2 = new CoreClientParam();
  2765. ccp2.ServerName = "QCM.JHY01.JHY0101.QuerryQltySample";//调用java地址
  2766. ccp2.MethodName = "getProcessNo";//调用的方法
  2767. ccp2.ServerParams = new object[] { batchNo, plineCode };
  2768. ccp2.SourceDataTable = this.dataSet4.Tables[0];
  2769. this.ExecuteQueryToDataTable(ccp2, CoreInvokeType.Internal);
  2770. ValueList VDEFECT_DESC2 = new ValueList();
  2771. for (int i = 0; i < ccp2.SourceDataTable.Rows.Count; i++)
  2772. {
  2773. VDEFECT_DESC2.ValueListItems.Add(ccp2.SourceDataTable.Rows[i]["RCL_STATE"].ToString(), ccp2.SourceDataTable.Rows[i]["RCL_STATE"].ToString());
  2774. }
  2775. this.ultraGrid4.DisplayLayout.Bands[0].Columns["PROCESS_NOS"].ValueList = VDEFECT_DESC2;
  2776. }
  2777. #endregion
  2778. #region 颜色
  2779. private void ultraGrid4_InitializeRow(object sender, InitializeRowEventArgs e)
  2780. {
  2781. //预测抽样
  2782. //if (!String.IsNullOrEmpty(e.Row.Cells["RZ_OLD_SAMPL_NO"].Value.ToString()))
  2783. //{
  2784. // e.Row.Appearance.BackColor = Color.FromArgb(128, 255, 255);//浅蓝色
  2785. //}
  2786. if (e.Row.Cells["SHOULD_SAMPLE"].Value.ToString().Equals("Y") || e.Row.Cells["SHOULD_SAMPLE"].Value.ToString().Contains("Y(抽样)"))
  2787. {
  2788. e.Row.Appearance.BackColor = Color.FromArgb(128, 255, 255);//浅蓝色
  2789. }
  2790. if (e.Row.Cells["RZ_OLD_SAMPL_NO"].Value.ToString().Equals(e.Row.Cells["SPECIMEN_NO"].Value.ToString()))
  2791. {
  2792. e.Row.Appearance.ForeColor = Color.Red;
  2793. }
  2794. //LAR送样
  2795. if (!String.IsNullOrEmpty(e.Row.Cells["SPECIAL_QUOTE_MEMO"].Value.ToString()) && e.Row.Cells["STEEL_NAME"].Value.ToString().Contains("LRA"))
  2796. {
  2797. e.Row.Appearance.BackColor = Color.LightGoldenrodYellow;//黄色
  2798. }
  2799. }
  2800. private void ultraGrid1_InitializeRow(object sender, InitializeRowEventArgs e)
  2801. {
  2802. //LAR送样
  2803. if (!String.IsNullOrEmpty(e.Row.Cells["SPECIAL_QUOTE_MEMO"].Value.ToString()) && e.Row.Cells["STEEL_NAME"].Value.ToString().Contains("LRA"))
  2804. {
  2805. e.Row.Appearance.BackColor = Color.LightGoldenrodYellow;//黄色
  2806. }
  2807. //性能预测
  2808. if (e.Row.Cells["SHOULD_SAMPLE"].Value.ToString().Equals("Y") || e.Row.Cells["SHOULD_SAMPLE"].Value.ToString().Contains("Y(抽样)"))
  2809. {
  2810. e.Row.Appearance.BackColor = Color.FromArgb(128, 255, 255);//浅蓝色
  2811. }
  2812. if (e.Row.Cells["SHOULD_SAMPLE"].Value.ToString().Contains("Y(抽样)"))
  2813. {
  2814. e.Row.Appearance.ForeColor = Color.Red;
  2815. }
  2816. }
  2817. private void ultraGrid8_InitializeRow(object sender, InitializeRowEventArgs e)
  2818. {
  2819. //LIMS退回轧批
  2820. if (!e.Row.Cells["STATUS"].Text.ToString().Equals("未发送"))
  2821. {
  2822. e.Row.Appearance.BackColor = Color.LightGreen;//浅绿
  2823. }
  2824. }
  2825. #endregion
  2826. //private void ultraGrid7_AfterRowExpanded(object sender, RowEventArgs e)
  2827. //{
  2828. // try{
  2829. // if (e.Row == null)
  2830. // return;
  2831. // if (e.Row.Band.Index == 0 && !e.Row.HasParent())
  2832. // {
  2833. // string specimen_no = Convert.ToString(e.Row.Cells["取样编号"].Value);
  2834. // if (!string.IsNullOrEmpty(specimen_no))
  2835. // {
  2836. // CoreClientParam ccp = new CoreClientParam();
  2837. // ccp.ServerName = "QCM.JHY01.JHY0101.QuerryQltySample";
  2838. // ccp.MethodName = "getQltySampleItemNew2";
  2839. // ccp.ServerParams = new object[] { specimen_no };
  2840. // ccp.SourceDataTable = this.dataSet8.Tables[1];
  2841. // ultraGrid7.BeginUpdate();
  2842. // //重绘控件直到endupdate 不会每次就重绘控件 避免闪烁
  2843. // for (int idx = this.dataTable9.Rows.Count - 1; idx >= 0; idx--)
  2844. // {
  2845. // if (Convert.ToString(this.dataTable9.Rows[idx]["取样编号"]) == specimen_no)
  2846. // this.dataTable9.Rows[idx].Delete();
  2847. // }
  2848. // this.dataTable9.AcceptChanges();
  2849. // this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  2850. // // ClsControlPack.RefreshAndAutoSize(ultraGrid7);
  2851. // ultraGrid7.EndUpdate();
  2852. // }
  2853. // }
  2854. // }
  2855. // catch (Exception ex)
  2856. // {
  2857. // System.Diagnostics.Debug.WriteLine(ex.ToString());
  2858. // MessageBox.Show("系统出错,请联系管理人员", "警告");
  2859. // }
  2860. //}
  2861. #region 表中的列 值改变触发
  2862. //private void ultraGrid1_AfterCellUpdate(object sender, CellEventArgs e)
  2863. //{
  2864. // Boolean bl = true;
  2865. // if (this.CustomInfo == "GX" || this.CustomInfo == "BC2" || this.CustomInfo == "GB")
  2866. // {
  2867. // UltraGridRow row = this.ultraGrid1.ActiveRow;
  2868. // if (row == null || "".Equals(row))
  2869. // {
  2870. // return;
  2871. // }
  2872. // String sendMemoValeu = row.Cells["SEND_MEMO"].Value.ToString();
  2873. // if (sendMemoValeu.Equals("A") || sendMemoValeu.Equals("B") || sendMemoValeu.Equals("C"))
  2874. // {
  2875. // String BATCH_NO = row.Cells["BATCH_NO"].Value.ToString();
  2876. // String SPECIMEN_NO = row.Cells["SPECIMEN_NO"].Value.ToString();
  2877. // String phyname = row.Cells["PHY_NAME_L_bj"].Value.ToString();
  2878. // String sendMemo = row.Cells["SEND_MEMO"].Text.ToString();
  2879. // //金相
  2880. // if (sendMemoValeu.Equals("A"))
  2881. // {
  2882. // if (phyname.Contains(sendMemo))
  2883. // {
  2884. // bl = false;
  2885. // }
  2886. // if (bl)
  2887. // {
  2888. // this.alert("轧批号【" + BATCH_NO + "】取样编号【" + SPECIMEN_NO + "】不包含:【" + sendMemo + "】");
  2889. // }
  2890. // }
  2891. // //重量偏差
  2892. // if (sendMemoValeu.Equals("B"))
  2893. // {
  2894. // if (phyname.Contains("其他"))
  2895. // {
  2896. // bl = false;
  2897. // }
  2898. // if (bl)
  2899. // {
  2900. // this.alert("轧批号【" + BATCH_NO + "】取样编号【" + SPECIMEN_NO + "】不包含:【" + sendMemo + "】");
  2901. // }
  2902. // }
  2903. // //金相&重量偏差
  2904. // if (sendMemoValeu.Equals("C"))
  2905. // {
  2906. // if (phyname.Contains("其他") && phyname.Contains("金相"))
  2907. // {
  2908. // bl = false;
  2909. // }
  2910. // if (bl)
  2911. // {
  2912. // this.alert("轧批号【" + BATCH_NO + "】取样编号【" + SPECIMEN_NO + "】需包含:【" + sendMemo + "】两个项目,请检查是否包含!!!");
  2913. // }
  2914. // }
  2915. // }
  2916. // }
  2917. //}
  2918. #endregion
  2919. #region 轧批号
  2920. //textbox获得焦点
  2921. //private void textBox1_Enter(object sender, EventArgs e)
  2922. //{
  2923. // if (textboxHasText == false) {
  2924. // this.textBox1.Text = "";
  2925. // this.BATCH_NO2.Text = "";
  2926. // }
  2927. // this.textBox1.ForeColor = Color.Black;
  2928. // this.BATCH_NO2.ForeColor = Color.Black;
  2929. //}
  2930. //textbox获得焦点
  2931. //private void textBox1_Leave(object sender, EventArgs e)
  2932. //{
  2933. // if (textBox1.Text == "")
  2934. // {
  2935. // textBox1.Text = "输入轧批号后四位";
  2936. // textBox1.ForeColor = Color.LightGray;
  2937. // this.BATCH_NO2.Text = "输入轧批号后四位";
  2938. // this.BATCH_NO2.ForeColor = Color.LightGray;
  2939. // textboxHasText = false;
  2940. // }
  2941. // else
  2942. // textboxHasText = true;
  2943. //}
  2944. #endregion
  2945. }
  2946. }