| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using CoreFS.CA06;
- using System.Collections;
- using Infragistics.Win.UltraWinGrid;
- using Infragistics.Win;
- using System.Drawing.Printing;
- using System.IO;
- using System.Drawing.Imaging;
- using System.Drawing.Drawing2D;
- using ThoughtWorks.QRCode.Codec;
- namespace Core.LZMes.Client.QCM
- {
- public partial class QCM0201ZHB : FrmBase
- {
- #region 初始化
- //Boolean textboxHasText = false;//判断输入框是否有文本
- private String v_line_no = "";//RZ1-热轧 ZB1-中板线 HB1-厚板线 LT1-连退
- Image image2;//二维码
- private String v_BATCH_NO = "";//轧批号
- private String PRINT_SEQV = "";//打印序号
- private int lennum = 0;//长度
- public QCM0201ZHB()
- {
- InitializeComponent();
- }
- private void QCM0201ZHB_Load(object sender, EventArgs e)
- {
- //获取自定义参数
- if (!this.CustomInfo.Equals(""))
- {
- v_line_no = this.CustomInfo;
- }
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["PHY_NAME_L_bj"].Header.Caption = "检验项目";
- this.ultraGrid4.DisplayLayout.Bands[0].Columns["PHY_NAME_L_bj"].Header.Caption = "检验项目";
- // dateTimePicker1.Value = DateTime.Now.Date.AddDays(-1);
- dateTimePicker2.Value = DateTime.Now.Date.AddDays(1);
- ValueList v = new ValueList();
- v.ValueListItems.Add("1", "是");
- v.ValueListItems.Add("0", "否");
- this.ultraGrid3.DisplayLayout.Bands[0].Columns["ISJUDGE"].ValueList = v.Clone();
- ValueList v1 = new ValueList();
- v1.ValueListItems.Add("0", "订单");
- v1.ValueListItems.Add("1", "人工");
- this.ultraGrid3.DisplayLayout.Bands[0].Columns["ITEM_FLAG"].ValueList = v1.Clone();
- this.ultraGrid6.DisplayLayout.Bands[0].Columns["ITEM_FLAG"].ValueList = v1.Clone();
- v1 = new ValueList();
- v1.ValueListItems.Add("0", "订单");
- v1.ValueListItems.Add("1", "人工复制");
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["ITEM_FLAG"].ValueList = v1.Clone();
- this.ultraGrid4.DisplayLayout.Bands[0].Columns["ITEM_FLAG"].ValueList = v1.Clone();
- ValueList v2 = new ValueList();
- v2.ValueListItems.Add("A", "成分");
- v2.ValueListItems.Add("B", "材质");
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["smp_catg"].ValueList = v2.Clone();
- this.ultraGrid4.DisplayLayout.Bands[0].Columns["smp_catg"].ValueList = v2.Clone();
- this.ultraGrid8.DisplayLayout.Bands[0].Columns["SMP_CATG"].ValueList = v2.Clone();
- ValueList v3 = new ValueList();
- v3.ValueListItems.Add("0", "未发送");
- v3.ValueListItems.Add("1", "已引用");
- v3.ValueListItems.Add("2", "已接收");
- v3.ValueListItems.Add("3", "已完成");
- v3.ValueListItems.Add("7", "确认接收样");
- this.ultraGrid8.DisplayLayout.Bands[0].Columns["STATUS"].ValueList = v3.Clone();
- ValueList v4 = new ValueList();
- v4.ValueListItems.Add("ZB1", "中板线");
- v4.ValueListItems.Add("HB1", "厚板线");
- this.ultraGrid4.DisplayLayout.Bands[0].Columns["PLINE_CODE_LIMS"].ValueList = v4.Clone();
- if ("ZB".Equals(v_line_no))
- {
- this.button3.Enabled = false;
- this.button4.Enabled = false;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["RZ_MIXROLL"].Hidden = true;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["RZ_OLD_SAMPL_NO"].Hidden = true;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["CHEM_INTERNALCONTROL"].Hidden = true;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["CRAFT_EXECUTE"].Hidden = true;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["FUNCTION_FUHE"].Hidden = true;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["SHOULD_SAMPLE"].Hidden = true;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["STOVE_TIME"].Hidden = true;
- this.ultraGrid4.DisplayLayout.Bands[0].Columns["RZ_MIXROLL"].Hidden = true;
- this.ultraGrid4.DisplayLayout.Bands[0].Columns["RZ_OLD_SAMPL_NO"].Hidden = true;
- this.ultraGrid4.DisplayLayout.Bands[0].Columns["CHEM_INTERNALCONTROL"].Hidden = true;
- this.ultraGrid4.DisplayLayout.Bands[0].Columns["CRAFT_EXECUTE"].Hidden = true;
- this.ultraGrid4.DisplayLayout.Bands[0].Columns["FUNCTION_FUHE"].Hidden = true;
- this.ultraGrid4.DisplayLayout.Bands[0].Columns["SHOULD_SAMPLE"].Hidden = true;
- this.ultraGrid4.DisplayLayout.Bands[0].Columns["STOVE_TIME"].Hidden = true;
- this.ultraGrid7.DisplayLayout.Bands[0].Columns["组批区间"].Hidden = true;
- this.ultraGrid7.DisplayLayout.Bands[0].Columns["成分是否符合"].Hidden = true;
- this.ultraGrid7.DisplayLayout.Bands[0].Columns["工艺是否符合"].Hidden = true;
- this.ultraGrid7.DisplayLayout.Bands[0].Columns["预测性能"].Hidden = true;
- this.ultraGrid7.DisplayLayout.Bands[0].Columns["是否预测抽样"].Hidden = true;
- this.ultraGrid7.DisplayLayout.Bands[0].Columns["加热炉出炉时间"].Hidden = true;
- }
- }
- #endregion
- #region 功能
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- this.DoQuery();
- break;
- case "Send":
- this.DoSend();
- break;
- case "Unsend":
- this.DoUnsend();//撤销委托
- break;
- case "Unsend19":
- this.DoUnsend19();//撤销19委托
- break;
- case "Add":
- this.AddBasePhy();//新增检验项
- break;
- case "AddArtificial":
- this.AddArtificial();//新增人工委托
- break;
- case "Update":
- this.DoUpdate();//修改取样材料号
- break;
- case "AddWt":
- this.DoAddWt();//新增复制单条委托
- break;
- case "DelWt":
- this.DoDelWt();//撤销复制单条委托
- break;
- case "DoDelete":
- this.DoDelete();//删除委托
- break;
- case "UpBatchNo":
- this.DoUpBatchNo();//复样 修改轧批号 (一炉5个轧批 1 2 3 4 5 取1号轧批委托 夹杂不合格 复 2 3轧批)
- break;
- case "UpRefBatchNo":
- this.DoUpRefBatchNo();//初样 修改指定的按炉引用 (一炉5个轧批 1 2 3 4 5 系统默认为 1 但是现场实际取的是3 所以要人工修改)
- break;
- case "DoQuote":
- //this.DoQuote();//引用实绩
- this.DoQuoteKY();
- break;
- case "AllUpdate":
- this.DoAllUpdate();//修改 全部修改的方法
- break;
- case "InExport": // 导出
- ClsControlPack.ExportDataWithSaveDialog2(ref ultraGrid7, this.Text);
- // ClsControlPack.ExportDataWithSaveDialog2(ref ultraGrid4, this.Text);
- // this.inExport();
- break;
- case "DoProcessNo":
- this.DoProcessNo();//调整热处理号
- break;
- case "doPrint":
- this.doPrint();//打印
- break;
- }
- }
- #region 打印
- private void doPrint()
- {
- RowsCollection rowsCollection = this.ultraGrid1.Rows;
- if (this.ultraTabControl1.Tabs[0].Selected) //检验委托
- {
- rowsCollection = this.ultraGrid1.Rows;
- }
- else if (this.ultraTabControl1.Tabs[1].Selected)
- {
- rowsCollection = this.ultraGrid4.Rows;
- }
- foreach (UltraGridRow ugr in rowsCollection)
- {
- if (ugr.Cells["CHK"].Value.ToString().ToLower() == "true")
- {
- String specimenNo = ugr.Cells["SPECIMEN_NO"].Value.ToString();//取样编号
- String materialNo = ugr.Cells["MATERIAL_NO"].Value.ToString();//子板号
- String batchNO = ugr.Cells["BATCH_NO"].Value.ToString();//轧批号
- String steelName = ugr.Cells["STEEL_NAME"].Value.ToString();//钢种
- String thck = ugr.Cells["THICK"].Value.ToString();//规格
- String phyNameLbj = ugr.Cells["PHY_NAME_L_bj"].Value.ToString();//项目
- String STATUS = ugr.Cells["STATUS"].Value.ToString();//发送状态
- String PRINT_SEQ = ugr.Cells["PRINT_SEQ"].Value.ToString();//打印序号
- if (STATUS.Equals("未发送"))
- {
- this.alert("当前委托还未发送!请先发送委托");
- return;
- }
- if (string.IsNullOrEmpty(specimenNo))
- {
- this.alert("未找到相应委托数据!请核实!!!");
- return;
- }
- if (string.IsNullOrEmpty(PRINT_SEQ))
- {
- PRINT_SEQ = "1";
- }
- v_BATCH_NO = materialNo;//轧批号 batchNO 换成子板号240126
- PRINT_SEQV = PRINT_SEQ;
- //二维码内容
- String qrCodeContent = specimenNo;
- QRCodeEncoder qrCodeEncoder = new QRCodeEncoder();
- qrCodeEncoder.QRCodeEncodeMode = QRCodeEncoder.ENCODE_MODE.BYTE;//二维码编码格式
- int num = qrCodeContent.Length;
- lennum = num;
- if (num <= 90)
- {
- qrCodeEncoder.QRCodeScale = 5;
- qrCodeEncoder.QRCodeVersion = 2;
- }
- else
- {
- qrCodeEncoder.QRCodeScale = 6;//二维码大小比例4
- qrCodeEncoder.QRCodeVersion = 14;//设置二维码的版本,默认7 该值影响二维码最高数据容量 7大致对应40个汉字长度,内容超出择需提升该数值
- }
- //设置错误校验级别,默认中等,二维码被遮挡住一部分实际上也是能扫出内容的,这个效验级别的意思就是
- //当遮挡部分最大占整体多少时仍然可以被扫出来,M大概在20%左右,H为30%,级别越高相应的数据容量会缩小
- qrCodeEncoder.QRCodeErrorCorrect = QRCodeEncoder.ERROR_CORRECTION.M;
- System.Drawing.Image image = qrCodeEncoder.Encode(qrCodeContent, Encoding.UTF8);//生成二维码图片 第一个参数打印内容
- image2 = image;
- string FilePath = @"C:\二维码";
- if (!Directory.Exists(FilePath))
- {
- Directory.CreateDirectory(FilePath);//判断是否有相应文件夹
- }
- PrintDocument printDocument = new PrintDocument();
- printDocument.PrinterSettings.PrinterName = "Deli DL-888T";//打印机名
- printDocument.PrintPage += new PrintPageEventHandler(pdt_PrintPage);//设置字体
- try
- {
- if (!printDocument.PrinterSettings.IsValid)
- {
- MessageBox.Show("打印设置无效!", "出错", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- return;
- }
- printDocument.Print();
- }
- catch (Exception ex)
- {
- MessageBox.Show("打印过程出现异常!\n" + ex.Message, "出错", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- }
- finally
- {
- printDocument.Dispose();
- }
- //增加打印标识
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.JHY01.JHY0102.UpdateInfo";
- ccp.MethodName = "doPrintLog";
- ccp.ServerParams = new object[] { specimenNo };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- //保存二维码
- //FilePath = @"C:\二维码\" + batchNO + "二维码.jpg";
- //System.IO.FileStream fs = new System.IO.FileStream(FilePath, System.IO.FileMode.Create, System.IO.FileAccess.Write, System.IO.FileShare.None);
- //image.Save(fs, System.Drawing.Imaging.ImageFormat.Jpeg);
- //fs.Close();
- image.Dispose();
- }
- }
- }
- void pdt_PrintPage(object sender, PrintPageEventArgs e)
- {
- Graphics grfx = e.Graphics;
- grfx.DrawString(PRINT_SEQV, new Font("宋体", 15), Brushes.Black, 22, 70);//打印内容、字体、颜色、X、Y
- grfx.DrawString(v_BATCH_NO, new Font("宋体", 14), Brushes.Black, 68, 130);//打印内容、字体、颜色、X、Y
- grfx.DrawImage(image2, 70, 15, 120, 110);//图片、X、Y、宽、高
- }
- #endregion
- #endregion
- #region 功能方法
- #region 调整热处理号
- private void DoProcessNo()
- {
- String tabstr = "1";
- RowsCollection rowsCollection = this.ultraGrid1.Rows;
- if (this.ultraTabControl1.Tabs[0].Selected) //检验委托
- {
- rowsCollection = this.ultraGrid1.Rows;
- tabstr = "1";
- }
- else if (this.ultraTabControl1.Tabs[1].Selected)
- {
- rowsCollection = this.ultraGrid4.Rows;
- tabstr = "2";
- }
- foreach (UltraGridRow ugr in rowsCollection)
- {
- if (ugr.Cells["CHK"].Value.ToString().ToLower() == "true")
- {
- String PROCESS_NOS = ugr.Cells["PROCESS_NOS"].Value.ToString();//热处理号
- String RCL_STATE = ugr.Cells["RCL_STATE"].Value.ToString();//库存热处理号
- String SPECIMEN_NO = ugr.Cells["SPECIMEN_NO"].Value.ToString();//取样编号
- String MATERIAL_NO = ugr.Cells["MATERIAL_NO"].Value.ToString();
- String BATCH_NO = ugr.Cells["BATCH_NO"].Value.ToString();
- String SMP_NO = ugr.Cells["SMP_NO"].Value.ToString();
- String PLINE_CODE = ugr.Cells["PLINE_CODE"].Value.ToString();
- String userName = this.UserInfo.GetUserName().ToString();
- if (RCL_STATE.Contains("G"))
- {
- if (!PROCESS_NOS.Equals(RCL_STATE))
- {
- this.alert(MATERIAL_NO + "实时库存热处理号为:[" + RCL_STATE + "]请调整为正确的送样热处理号!");
- return;
- }
- }
- Hashtable ht = new Hashtable();
- ht.Add("PROCESS_NOS", PROCESS_NOS);
- ht.Add("SPECIMEN_NO", SPECIMEN_NO);
- ht.Add("MATERIAL_NO", MATERIAL_NO);
- ht.Add("BATCH_NO", BATCH_NO);
- ht.Add("SMP_NO", SMP_NO);
- ht.Add("PLINE_CODE", PLINE_CODE);
- ht.Add("USER_NAME", userName);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.JHY01.JHY0102.UpdateInfo";
- ccp.MethodName = "doProcessNos";
- ccp.ServerParams = new object[] { ht };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1)
- {
- return;
- }
- }
- }
- MessageBox.Show("调整热处理号成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);
- this.DoQuery();
- }
- #endregion
- #region 导出
- private void inExport()
- {
- try
- {
- String checkboxVal = "";
- String STARTTIME = this.dateTimePicker1.Value.ToString("yyyy-MM-dd");
- String ENDTIME = this.dateTimePicker2.Value.ToString("yyyy-MM-dd");
- String BATCH_NO = this.textBox1.Text.Trim();
- String BATCH_NO2 = this.BATCH_NO2.Text.Trim();
- String VALIDFLAG = "1";
- String CERT_INST_NAME = this.textBox2.Text.Trim();//认证机构
- String PLINE_NAME = this.PLINE_NAME.Text.Trim();
- String PLINE_CODE = v_line_no;
- String STEEL_NAME = this.txt_steel_name.Text.Trim();
- String SMP_CATG = this.cbx_smp_catg.Text.Trim();
- String heatNo = this.selheatNo.Text.Trim();
- String DESIGNKEY = this.sel_design_key.Text.Trim();
- String SAMPLE_DELIVERY_TIME = this.SAMPLE_DELIVERY_TIME2.Text.Trim();//查询 送样时间点
- String sdtime = this.dateTimePicker4.Text.ToString();
- SAMPLE_DELIVERY_TIME = sdtime + " " + SAMPLE_DELIVERY_TIME;//送样时间点
- if (PLINE_NAME.Equals("全部"))
- {
- PLINE_NAME = "";
- }
- if (CERT_INST_NAME.Equals("全部"))
- {
- CERT_INST_NAME = "";
- }
- if (SMP_CATG.Equals("全部"))
- {
- SMP_CATG = "";
- }
- else if (SMP_CATG.Equals("成分"))
- {
- SMP_CATG = "A";
- }
- else
- {
- SMP_CATG = "B";
- }
- if (this.CustomInfo == "HB")
- {
- PLINE_NAME = "厚板线";
- }
- else if (this.CustomInfo == "ZB")
- {
- PLINE_NAME = "中板线";
- }
- //轧批号 小框框 是否勾选
- if (this.checkBox1.Checked)
- {
- checkboxVal = "1";
- STARTTIME = "";
- ENDTIME = "";
- }
- else
- {
- BATCH_NO = "";
- BATCH_NO2 = "";
- }
- if (this.checkBox2.Checked)
- {
- STARTTIME = "";
- ENDTIME = "";
- }
- else
- {
- heatNo = "";
- }
- if (this.checkBox3.Checked)
- {
- //STARTTIME = "";
- //ENDTIME = "";
- }
- else
- {
- DESIGNKEY = "";
- }
- if (!this.checkBox4.Checked)
- {
- SAMPLE_DELIVERY_TIME = "";
- }
- String checkbokTxtL = "F";//同轧批合并委托
- if (this.checkBox6.Checked)
- {
- checkbokTxtL = "T";
- }
- Hashtable ht = new Hashtable();
- ht.Add("BATCH_NO", BATCH_NO);
- ht.Add("BATCH_NO2", BATCH_NO2);
- ht.Add("STARTTIME", STARTTIME);
- ht.Add("ENDTIME", ENDTIME);
- ht.Add("VALIDFLAG", VALIDFLAG);
- ht.Add("CERT_INST_NAME", CERT_INST_NAME);
- ht.Add("PLINE_NAME", PLINE_NAME);
- ht.Add("PLINE_CODE", PLINE_CODE);
- ht.Add("checkboxVal", checkboxVal);
- if (this.ultraTabControl1.Tabs[0].Selected)
- {
- ht.Add("STATUS", "0");
- }
- if (this.ultraTabControl1.Tabs[1].Selected || this.ultraTabControl1.Tabs[2].Selected)
- {
- ht.Add("TAB_NAME", "1");
- }
- ht.Add("STEEL_NAME", STEEL_NAME);
- ht.Add("SMP_CATG", SMP_CATG);
- ht.Add("HEAT_NO", heatNo);
- ht.Add("DESIGN_KEY", DESIGNKEY);
- ht.Add("SAMPLE_DELIVERY_TIME", SAMPLE_DELIVERY_TIME);
- ht.Add("CHECKBOKTXTL", checkbokTxtL);
- String PLINE_NAME2 = "导出数据";
- if (this.CustomInfo == "HB")
- {
- PLINE_NAME2 = "厚板线导出";
- }
- else if (this.CustomInfo == "ZB")
- {
- PLINE_NAME2 = "中板线导出";
- }
-
- this.dataSet8.Clear();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.JHY01.JHY0101.QuerryQltySample";
- ccp.MethodName = "ZHBQueryExcel";
- ccp.ServerParams = new object[] {ht};
- ccp.SourceDataTable = this.dataSet8.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- // ClsControlPack.RefreshAndAutoSize(ultraGrid7);
- foreach (UltraGridRow ugr in this.ultraGrid7.Rows)
- {
- string specimen_no = ugr.Cells["取样编号"].Value.ToString();
- if (!string.IsNullOrEmpty(specimen_no))
- {
- CoreClientParam ccp2 = new CoreClientParam();
- ccp2.ServerName = "QCM.JHY01.JHY0101.QuerryQltySample";
- ccp2.MethodName = "getQltySampleItemNew2";
- ccp2.ServerParams = new object[] { specimen_no };
- ccp2.SourceDataTable = this.dataSet8.Tables[1];
- ultraGrid7.BeginUpdate();
- //重绘控件直到endupdate 不会每次就重绘控件 避免闪烁
- for (int idx = this.dataTable9.Rows.Count - 1; idx >= 0; idx--)
- {
- if (Convert.ToString(this.dataTable9.Rows[idx]["取样编号"]) == specimen_no)
- this.dataTable9.Rows[idx].Delete();
- }
- this.dataTable9.AcceptChanges();
- this.ExecuteQueryToDataTable(ccp2, CoreInvokeType.Internal);
- ultraGrid7.EndUpdate();
- }
- }
-
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- #endregion
- #region 全部修改
- private void DoAllUpdate()
- {
- if (this.ultraTabControl1.Tabs[0].Selected) //检验委托
- {
- UltraGridRow row = this.ultraGrid1.ActiveRow;
- String type = row.Cells["SMP_TYPE_CODE"].Value.ToString();
- if (type.Equals("0"))
- {
- //初样修改 夹杂按炉已不用这个按钮了
- // DoUpRefBatchNo();
- }
- else if (type.Equals("1"))
- {
- //复样修改
- DoUpBatchNo();
- }
- }
- else if (this.ultraTabControl1.Tabs[1].Selected)
- {
- //委托记录
- //修改热处理号 取样材料号
- doAllUpdate();
- }
- }
- #endregion
- #region 初样 修改取样轧批号按炉初样比如:夹杂
- private void DoUpRefBatchNo()
- {
- try
- {
- CoreClientParam ccp = new CoreClientParam();
- ArrayList smpNo = new ArrayList();//试样号
- ArrayList specimenNo = new ArrayList();//取样编号
- ArrayList batchNo = new ArrayList();//轧批号
- ArrayList heatnNo = new ArrayList();//炉号
- ArrayList materialNo = new ArrayList();//取样材料号
- ArrayList send_memo = new ArrayList();//发送备注
- ArrayList inspectionLot = new ArrayList();//检验号
- ArrayList plineCode = new ArrayList();
- foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
- {
- if (ugr.Cells["CHK"].Value.ToString().ToLower() == "true")
- {
- if (!ugr.Cells["SMP_TYPE_CODE"].Value.ToString().Equals("0") || !ugr.Cells["FREQ_CODE"].Value.ToString().Equals("D"))
- {
- this.alert("修改初样取样轧批号按钮是用来修改【初样】【按炉取样】的轧批,请谨慎操作!");
- return;
- }
- smpNo.Add(ugr.Cells["SMP_NO"].Value.ToString());
- specimenNo.Add(ugr.Cells["SPECIMEN_NO"].Value.ToString());
- batchNo.Add(ugr.Cells["BATCH_NO"].Value.ToString());
- heatnNo.Add(ugr.Cells["HEAT_NO"].Value.ToString());
- materialNo.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
- send_memo.Add(ugr.Cells["SEND_MEMO"].Value.ToString());
- inspectionLot.Add(ugr.Cells["INSPECTION_LOT"].Value.ToString());
- plineCode.Add(ugr.Cells["PLINE_CODE"].Value.ToString());
- }
- }
- ccp.ServerName = "QCM.JHY01.JHY0102.UpdateInfo";
- ccp.MethodName = "DoUpRefBatchNo";
- ccp.ServerParams = new object[] { smpNo, specimenNo, batchNo, heatnNo, materialNo, send_memo, inspectionLot, plineCode };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- MessageBox.Show("修改成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);
- this.DoQuery();
- }
-
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错【初样修改轧批号】,请联系管理人员", "警告");
- }
- }
- #endregion
- #region 复样 修改轧批号
- private void DoUpBatchNo()
- {
- try
- {
- CoreClientParam ccp = new CoreClientParam();
- ArrayList smpNo = new ArrayList();//试样号
- ArrayList specimenNo = new ArrayList();//取样编号
- ArrayList batchNo = new ArrayList();//轧批号
- ArrayList materialNo = new ArrayList();//取样材料号
- ArrayList send_memo = new ArrayList();//发送备注
- ArrayList inspectionLot = new ArrayList();//检验号
- ArrayList plineCode = new ArrayList();
- foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
- {
- if (ugr.Cells["CHK"].Value.ToString().ToLower() == "true")
- {
- 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"))
- {
- this.alert("修改复样轧批号按钮是用来修改【复样】【按炉取样】的轧批,请谨慎操作!");
- return;
- }
- smpNo.Add(ugr.Cells["SMP_NO"].Value.ToString());
- specimenNo.Add(ugr.Cells["SPECIMEN_NO"].Value.ToString());
- batchNo.Add(ugr.Cells["BATCH_NO"].Value.ToString());
- materialNo.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
- send_memo.Add(this.UserInfo.GetUserName().ToString());//ugr.Cells["SEND_MEMO"].Value.ToString()
- inspectionLot.Add(ugr.Cells["INSPECTION_LOT"].Value.ToString());
- plineCode.Add(ugr.Cells["PLINE_CODE"].Value.ToString());
- }
- }
- ccp.ServerName = "QCM.JHY01.JHY0102.UpdateInfo";
- ccp.MethodName = "updateBatchNo";
- ccp.ServerParams = new object[] { smpNo, specimenNo, batchNo, materialNo, send_memo, inspectionLot, plineCode };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- MessageBox.Show("修改成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);
- this.DoQuery();
- }
-
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错【复样修改轧批号】,请联系管理人员", "警告");
- }
- }
- #endregion
- #region 修改热处理号 取样材料号
- public void doAllUpdate()
- {
- UltraGridRow row = this.ultraGrid4.ActiveRow;
- String PROCESS_NOS = row.Cells["PROCESS_NOS"].Value.ToString().Trim();
- String MATERIAL_NO = row.Cells["MATERIAL_NO"].Value.ToString();
- String BATCH_NO = row.Cells["BATCH_NO"].Value.ToString();
- String SPECIMEN_NO = row.Cells["SPECIMEN_NO"].Value.ToString();
- String SMP_NO = row.Cells["SMP_NO"].Value.ToString();
- String PLINE_CODE = row.Cells["PLINE_CODE"].Value.ToString();
- Hashtable ht = new Hashtable();
- ht.Add("PROCESS_NOS", PROCESS_NOS);
- ht.Add("MATERIAL_NO", MATERIAL_NO);
- ht.Add("BATCH_NO", BATCH_NO);
- ht.Add("SPECIMEN_NO", SPECIMEN_NO);
- ht.Add("SMP_NO", SMP_NO);
- ht.Add("PLINE_CODE", PLINE_CODE);
- ht.Add("USER_NAME", this.UserInfo.GetUserName().ToString());
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.JHY01.JHY0102.UpdateInfo";
- ccp.MethodName = "doAllUpdate";
- ccp.ServerParams = new object[] { ht };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1)
- {
- return;
- }
- MessageBox.Show("修改成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);
- this.DoQuery();
- }
- #endregion
- #region 修改取样材料号
- private void DoUpdate()
- {
- try
- {
- // String plineCode = this.CustomInfo;
- CoreClientParam ccp = new CoreClientParam();
- ArrayList smpNo = new ArrayList();//试样号
- ArrayList specimenNo = new ArrayList();//取样编号
- ArrayList batchNo = new ArrayList();//轧批号
- ArrayList materialNo = new ArrayList();//取样材料号
- ArrayList send_memo = new ArrayList();//发送备注
- ArrayList inspectionLot = new ArrayList();//检验号
- ArrayList plineCode = new ArrayList();
- foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
- {
- if (ugr.Cells["CHK"].Value.ToString().ToLower() == "true")
- {
- smpNo.Add(ugr.Cells["SMP_NO"].Value.ToString());
- specimenNo.Add(ugr.Cells["SPECIMEN_NO"].Value.ToString());
- batchNo.Add(ugr.Cells["BATCH_NO"].Value.ToString());
- if (string.IsNullOrEmpty(ugr.Cells["MATERIAL_NO"].Value.ToString()))
- {
- this.alert("取样材料号不能为空!!!!");
- return;
- }
- materialNo.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
- send_memo.Add(ugr.Cells["SEND_MEMO"].Value.ToString());
- inspectionLot.Add(ugr.Cells["INSPECTION_LOT"].Value.ToString());
- plineCode.Add(ugr.Cells["PLINE_CODE"].Value.ToString());
- }
- }
- ccp.ServerName = "QCM.JHY01.JHY0102.UpdateInfo";
- ccp.MethodName = "updateMaterialNo";
- ccp.ServerParams = new object[] { smpNo, specimenNo, batchNo, materialNo, send_memo, inspectionLot, plineCode };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错【修改取样材料号】,请联系管理人员", "警告");
- }
- }
- #endregion
- #region 新增人工委托
- private void AddArtificial()
- {
- try
- {
- QCM0205ZHB frmRbp = new QCM0205ZHB();
- frmRbp.StartPosition = FormStartPosition.CenterScreen;
- frmRbp.ob = this.ob;
- if(v_line_no.Equals("ZB")){
- frmRbp.plineCode = "ZB1";
- }else if(v_line_no.Equals("HB")){
- frmRbp.plineCode = "HB1";
- }
- frmRbp.ShowDialog();
- this.DoQuery();
- }
- catch (Exception ex)
- {
- MessageBox.Show("操作过程出现异常!\n" + ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- }
- }
- #endregion
- #region 新增检验项
- private void AddBasePhy()
- {
- try
- {
- UltraGridRow row = this.ultraGrid1.ActiveRow;
- if (row == null)
- {
- this.alert("检验委托为空!请选择检验委托数据!!!");
- return;
- }
- if (!row.Cells["SMP_CATG"].Text.ToString().Equals("材质"))
- {
- this.alert("只有材质数据才可以新增检验项!!!");
- return;
- }
- QCM0204 frmRbp = new QCM0204();
- frmRbp.StartPosition = FormStartPosition.CenterScreen;
- frmRbp.ob = this.ob;
- frmRbp.specimenNo = row.Cells["SPECIMEN_NO"].Value.ToString();
- frmRbp.smpNo = row.Cells["SMP_NO"].Value.ToString();
- frmRbp.plineCode = "ZHB";
- frmRbp.ShowDialog();
- this.DoQueryPrg(row);//右下角
- }
- catch (Exception ex)
- {
- MessageBox.Show("操作过程出现异常!\n" + ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- }
- }
- #endregion
- #region 新增复制单条委托
- private void DoAddWt()
- {
- try
- {
- int num = 0;
- foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
- {
- if (ugr.Cells["CHK"].Value.ToString().ToLower() == "true")
- {
- num = num + 1;
- }
- }
- if (num > 1)
- {
- this.alert("只能单条复制!为防止数据差错谢谢配合【谨慎复制】");
- return;
- }
- UltraGridRow row = this.ultraGrid1.ActiveRow;
- if (row == null)
- {
- this.alert("检验委托为空!请选择检验委托数据!!!");
- return;
- }
- String batchNo = row.Cells["BATCH_NO"].Value.ToString();//轧批号
- String designKey = row.Cells["DESIGN_KEY"].Value.ToString();//订单号
- String smpNo = row.Cells["SMP_NO"].Value.ToString();//试样号
- String specimenNo = row.Cells["SPECIMEN_NO"].Value.ToString();//取样编号
- String smpTypeName = row.Cells["SMP_TYPE_NAME"].Value.ToString();//取样类型
- if (MessageBox.Show("轧批号【" + batchNo + "】,确认复制当前委托一条?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
- {
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.JHY01.JHY0102.UpdateInfo";
- if (smpTypeName.Equals("初样"))
- {
- ccp.MethodName = "DoAddWtZy";
- }
- else if (smpTypeName.Equals("复样"))
- {
- ccp.MethodName = "DoAddWtFy";
- }
- ccp.ServerParams = new object[] { batchNo, designKey, smpNo, specimenNo, this.UserInfo.GetUserName() };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- MessageBox.Show("复制委托成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);
- }
- this.DoQuery();
- }
- catch (Exception ex)
- {
- MessageBox.Show("操作过程出现异常!\n" + ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- }
- }
- #endregion
- #region 撤销复制单条委托
- private void DoDelWt()
- {
- try
- {
- int num = 0;
- foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
- {
- if (ugr.Cells["CHK"].Value.ToString().ToLower() == "true")
- {
- num = num + 1;
- }
- }
- if (num > 1)
- {
- this.alert("只能单条删除!为防止数据差错谢谢配合【谨慎删除】");
- return;
- }
- UltraGridRow row = this.ultraGrid1.ActiveRow;
- if (row == null)
- {
- this.alert("检验委托为空!请选择检验委托数据!!!");
- return;
- }
- String batchNo = row.Cells["BATCH_NO"].Value.ToString();//轧批号
- String designKey = row.Cells["DESIGN_KEY"].Value.ToString();//订单号
- String smpNo = row.Cells["SMP_NO"].Value.ToString();//试样号
- String specimenNo = row.Cells["SPECIMEN_NO"].Value.ToString();//取样编号
- String smpTypeName = row.Cells["SMP_TYPE_NAME"].Value.ToString();//取样类型
- String item_flag = row.Cells["ITEM_FLAG"].Value.ToString();//项目来源(0-订单,1-人工)
- if (MessageBox.Show("轧批号【" + batchNo + "】,确认撤销当前委托?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
- {
- return;
- }
- if (!item_flag.Equals("1"))
- {
- this.alert("只能撤销人工复制委托");
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.JHY01.JHY0102.UpdateInfo";
- if (smpTypeName.Equals("初样"))
- {
- ccp.MethodName = "DoDelWtZy";
- }
- else if (smpTypeName.Equals("复样"))
- {
- ccp.MethodName = "DoDelWtFy";
- }
- ccp.ServerParams = new object[] { batchNo, designKey, smpNo, specimenNo };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- MessageBox.Show("撤销复制委托成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);//ccp.ReturnInfo "发送成功" ccp.ReturnInfo
- }
- this.DoQuery();
- }
- catch (Exception ex)
- {
- MessageBox.Show("操作过程出现异常!\n" + ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- }
- }
- #endregion
- #region 删除委托
- private void DoDelete()
- {
- try
- {
- UltraGridRow row = this.ultraGrid1.ActiveRow;
- if (row == null)
- {
- this.alert("检验委托为空!请选择检验委托数据!!!");
- return;
- }
- String batchNoViw = row.Cells["BATCH_NO"].Value.ToString();//轧批号
- ArrayList batchNo = new ArrayList();//轧批号
- ArrayList designKey = new ArrayList();//订单号
- ArrayList smpNo = new ArrayList();//试样号
- ArrayList specimenNo = new ArrayList();//取样编号
- ArrayList smpTypeName = new ArrayList();//取样类型
- foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
- {
- if (ugr.Cells["CHK"].Value.ToString().ToLower() == "true")
- {
- batchNo.Add(ugr.Cells["BATCH_NO"].Value.ToString());//轧批号
- designKey.Add(ugr.Cells["DESIGN_KEY"].Value.ToString());//订单号
- smpNo.Add(ugr.Cells["SMP_NO"].Value.ToString());//试样号
- specimenNo.Add(ugr.Cells["SPECIMEN_NO"].Value.ToString());//取样编号
-
- if (ugr.Cells["SMP_TYPE_NAME"].Value.ToString().Contains("模拟焊后"))
- {
- smpTypeName.Add("初样");//取样类型
- }
- else
- {
- smpTypeName.Add(ugr.Cells["SMP_TYPE_NAME"].Value.ToString());//取样类型
- }
- if (ugr.Cells["SMP_TYPE_CODE"].Value.ToString().Equals("3"))
- {
- this.alert("件件取样暂时不支持删除!!!");
- return;
- }
- }
- }
- if (MessageBox.Show("确认删除轧批号【" + batchNoViw + "】委托?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
- {
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.JHY01.JHY0102.UpdateInfo";
- ccp.MethodName = "DoDelete";
- ccp.ServerParams = new object[] { batchNo, designKey, smpNo, specimenNo, smpTypeName, this.UserInfo.GetUserName() };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- MessageBox.Show("删除委托成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);
- }
- this.DoQuery();
- }
- catch (Exception ex)
- {
- MessageBox.Show("操作过程出现异常!\n" + ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- }
- }
- #endregion
- #region 人工引用界面
- private void DoQuoteKY()
- {
- try
- {
- UltraGridRow row = this.ultraGrid1.ActiveRow;
- if (row == null)
- {
- this.alert("检验委托为空!请选择检验委托数据!!!");
- return;
- }
- if (!row.Cells["SMP_CATG"].Text.ToString().Equals("材质"))
- {
- this.alert("只有材质数据才可以引用!!!");
- return;
- }
- if (row.Cells["FREQ_CODE"].Value.ToString().Equals("D"))
- {
- this.alert("夹杂不能使用当前按钮!");
- return;
- }
- String PLINE_CODE = row.Cells["PLINE_CODE"].Value.ToString();
- String txt_DESIGN_KEY = row.Cells["DESIGN_KEY"].Value.ToString();
- String txtDK = txt_DESIGN_KEY.Substring(0, 2);
- String SMP_TYPE_CODE = row.Cells["SMP_TYPE_CODE"].Value.ToString();
- // if ("ZB1".Equals(PLINE_CODE) && "1".Equals(SMP_TYPE_CODE))
- //{
- // //复样引用
- // foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
- // {
- // if (ugr.Cells["CHK"].Value.ToString().ToLower() == "true")
- // {
- // if (ugr.Cells["FREQ_CODE"].Value.ToString().Equals("D"))
- // {
- // this.alert("夹杂不能使用当前按钮!!!");
- // return;
- // }
- // if (ugr.Cells["PLINE_CODE"].Value.ToString().Equals("ZB1") && ugr.Cells["SMP_TYPE_CODE"].Value.ToString().Equals("1"))
- // {
- // Hashtable ht = new Hashtable();
- // ht.Add("HEAT_NO", ugr.Cells["HEAT_NO"].Value.ToString());
- // ht.Add("BATCH_NO", ugr.Cells["BATCH_NO"].Value.ToString());
- // ht.Add("SMP_NO", ugr.Cells["SMP_NO"].Value.ToString());
- // ht.Add("SPECIMEN_NO", ugr.Cells["SPECIMEN_NO"].Value.ToString());
- // ht.Add("FREQ_CODE", ugr.Cells["FREQ_CODE"].Value.ToString());
- // ht.Add("PLINE_CODE", ugr.Cells["PLINE_CODE"].Value.ToString());
- // ht.Add("SMP_TYPE_CODE", ugr.Cells["SMP_TYPE_CODE"].Value.ToString());
- // ht.Add("SEND_ID", this.UserInfo.GetUserID());
- // ht.Add("CREATE_NAME", this.UserInfo.GetUserName());
- // ht.Add("THICK", ugr.Cells["THICK"].Value.ToString());
- // ht.Add("DESIGN_KEY", ugr.Cells["DESIGN_KEY"].Value.ToString());
- // CoreClientParam ccp = new CoreClientParam();
- // ccp.ServerName = "QCM.JHY01.JHY0102.UpdateInfo";
- // ccp.MethodName = "DoQuoteBatchNo";
- // ccp.ServerParams = new object[] { ht };
- // ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- // }
- // }
- // }
- // this.DoQuery();
- // return;
- //}
- int num = 0;
- foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
- {
- if (ugr.Cells["CHK"].Value.ToString().ToLower() == "true")
- {
- if (ugr.Cells["FREQ_CODE"].Value.ToString().Equals("D"))
- {
- this.alert("夹杂不能使用当前按钮!!!");
- return;
- }
- String CERT_INST_CODE = ugr.Cells["CERT_INST_CODE"].Value.ToString();
- if (CERT_INST_CODE.Equals("IC005"))//美国船级社
- {
- String CERT_INST_NAME = ugr.Cells["CERT_INST_NAME"].Value.ToString();
- this.alert("【"+CERT_INST_NAME+"】认证机构不能引用!请核实数据");
- return;
- }
- num = num + 1;
- }
- }
- if (num!=1)
- {
- this.alert("要勾选委托并且只能勾选一条引用!");
- return;
- }
- String zbstr = "0";
- if ("ZB1".Equals(PLINE_CODE))
- {
- CoreClientParam ccp2 = new CoreClientParam();
- ccp2.ServerName = "QCM.JHY01.JHY0101.QuerryQltySample";//调用java地址
- ccp2.MethodName = "getDuplicateSample";//调用的方法
- ccp2.ServerParams = new object[] { row.Cells["BATCH_NO"].Value.ToString(), PLINE_CODE, row.Cells["INSPECTION_LOT"].Value.ToString() };
- ccp2.SourceDataTable = this.dataSet9.Tables[0];
- this.ExecuteQueryToDataTable(ccp2, CoreInvokeType.Internal);
- for (int i = 0; i < ccp2.SourceDataTable.Rows.Count; i++)
- {
- String count= ccp2.SourceDataTable.Rows[i]["COUNT"].ToString();
- if (!"".Equals(count) && count!=null && !count.Equals("0"))
- {
- zbstr = "1";
- }
- }
- }
- if ("19".Equals(txtDK))
- {
- this.DoQuote();
- }
- else if ("ZB1".Equals(PLINE_CODE) && zbstr.Equals("0"))
- {
- this.DoQuote();
- }
- else {
- QCM0206 frmRbp = new QCM0206();
- frmRbp.StartPosition = FormStartPosition.CenterScreen;
- frmRbp.ob = this.ob;
- frmRbp.specimenNo = row.Cells["SPECIMEN_NO"].Value.ToString();
- frmRbp.smpNo = row.Cells["SMP_NO"].Value.ToString();
- frmRbp.batchNo = row.Cells["BATCH_NO"].Value.ToString();
- frmRbp.designKey = row.Cells["DESIGN_KEY"].Value.ToString();
- frmRbp.steelCode = row.Cells["STEEL_NAME"].Value.ToString();
- frmRbp.thick = row.Cells["THICK"].Value.ToString();
- frmRbp.ShowDialog();
- this.DoQuery();
- }
-
- }
- catch (Exception ex)
- {
- MessageBox.Show("操作过程出现异常!\n" + ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- }
- }
- #endregion
- #region 查询
- private void DoQuery()
- {
- try
- {
- //导出
- if (this.ultraTabControl1.Tabs[2].Selected)
- {
- inExport();
- return;
- }
- //LIMS退回轧批
- if (this.ultraTabControl1.Tabs[3].Selected)
- {
- inLIMSQuery();
- return;
- }
- String RZ_MIXROLL = "";
- String checkboxVal = "";
- String STARTTIME = this.dateTimePicker1.Value.ToString("yyyy-MM-dd");
- String ENDTIME = this.dateTimePicker2.Value.ToString("yyyy-MM-dd");
- String BATCH_NO = this.textBox1.Text.Trim();
- String BATCH_NO2 = this.BATCH_NO2.Text.Trim();
- String VALIDFLAG = "1";
- String CERT_INST_NAME = this.textBox2.Text.Trim();//认证机构
- String PLINE_NAME = this.PLINE_NAME.Text.Trim();
- String PLINE_CODE = v_line_no;
- String STEEL_NAME = this.txt_steel_name.Text.Trim();
- String SMP_CATG = this.cbx_smp_catg.Text.Trim();
- String heatNo = this.selheatNo.Text.Trim();
- String DESIGNKEY = this.sel_design_key.Text.Trim();
- String SAMPLE_DELIVERY_TIME = this.SAMPLE_DELIVERY_TIME2.Text.Trim();//查询 送样时间点
- String sdtime = this.dateTimePicker4.Text.ToString();
- SAMPLE_DELIVERY_TIME = sdtime + " " + SAMPLE_DELIVERY_TIME;//送样时间点
- if (PLINE_NAME.Equals("全部"))
- {
- PLINE_NAME = "";
- }
- if (CERT_INST_NAME.Equals("全部"))
- {
- CERT_INST_NAME = "";
- }
- if (SMP_CATG.Equals("全部"))
- {
- SMP_CATG = "";
- }
- else if (SMP_CATG.Equals("成分"))
- {
- SMP_CATG = "A";
- }
- else
- {
- SMP_CATG = "B";
- }
- if (this.CustomInfo == "HB")
- {
- PLINE_NAME = "厚板线";
- }
- else if (this.CustomInfo == "ZB")
- {
- PLINE_NAME = "中板线";
- }
- //轧批号 小框框 是否勾选
- if (this.checkBox1.Checked)
- {
- checkboxVal = "1";
- STARTTIME = "";
- ENDTIME = "";
- if (string.IsNullOrEmpty(BATCH_NO))
- {
- this.alert("请输入轧批号!!!");
- this.textBox1.Focus();
- return;
- }
- }
- else
- {
- BATCH_NO = "";
- BATCH_NO2 = "";
- }
- if (this.checkBox2.Checked)
- {
- STARTTIME = "";
- ENDTIME = "";
- }
- else
- {
- heatNo = "";
- }
- if (this.checkBox3.Checked)
- {
- //STARTTIME = "";
- //ENDTIME = "";
- }
- else
- {
- DESIGNKEY = "";
- }
- if (this.checkBox5.Checked)
- {
- STARTTIME = "";
- ENDTIME = "";
- RZ_MIXROLL = this.textBox3.Text.Trim();
- }
- if (!string.IsNullOrEmpty(BATCH_NO2))
- {
- if (string.IsNullOrEmpty(BATCH_NO))
- {
- this.alert("请输入轧批号!!!");
- this.textBox1.Focus();
- return;
- }
- }
- if (!this.checkBox4.Checked)
- {
- SAMPLE_DELIVERY_TIME = "";
- }
-
- CoreClientParam ccp = new CoreClientParam();
- if (this.ultraTabControl1.Tabs[0].Selected) //检验委托
- {
- this.dataSet1.Clear();
- ccp.ServerName = "QCM.JHY01.JHY0101.QuerryQltySample";
- ccp.MethodName = "getQltySampleInfoZHB";
- ccp.SourceDataTable = this.dataSet1.Tables[0];
- }
- else if (this.ultraTabControl1.Tabs[1].Selected)
- {
- this.dataSet5.Clear();
- ccp.ServerName = "QCM.JHY01.JHY0101.QuerryQltySample";
- ccp.MethodName = "getQltySampleInfoZHB";
- ccp.SourceDataTable = this.dataSet5.Tables[0];
- }
- Hashtable ht = new Hashtable();
- ht.Add("BATCH_NO", BATCH_NO);
- ht.Add("BATCH_NO2", BATCH_NO2);
- ht.Add("STARTTIME", STARTTIME);
- ht.Add("ENDTIME", ENDTIME);
- ht.Add("VALIDFLAG", VALIDFLAG);
- ht.Add("CERT_INST_NAME", CERT_INST_NAME);
- ht.Add("PLINE_NAME", PLINE_NAME);
- ht.Add("PLINE_CODE", PLINE_CODE);
- ht.Add("checkboxVal", checkboxVal);
- if (this.ultraTabControl1.Tabs[0].Selected)
- {
- ht.Add("STATUS", "0");
- }
- if (this.ultraTabControl1.SelectedTab.Text.Equals("委托记录"))
- {
- ht.Add("TAB_NAME", "1");
- }
- ht.Add("STEEL_NAME", STEEL_NAME);
- ht.Add("SMP_CATG", SMP_CATG);
- ht.Add("HEAT_NO", heatNo);
- ht.Add("DESIGN_KEY", DESIGNKEY);
- ht.Add("SAMPLE_DELIVERY_TIME", SAMPLE_DELIVERY_TIME);
- ht.Add("RZ_MIXROLL", RZ_MIXROLL);
- String checkbokTxtL = "F";//同轧批合并委托
- if (this.checkBox6.Checked)
- {
- if (this.ultraTabControl1.Tabs[1].Selected) { checkbokTxtL = "T"; }
- }
- ht.Add("CHECKBOKTXTL", checkbokTxtL);
-
- ccp.ServerParams = new object[] { ht };
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- if (this.ultraTabControl1.Tabs[0].Selected) //检验委托
- {
- foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
- {
- switch (ugr.Cells["STATUS"].Text.ToString())
- {
- case "0":
- ugr.Cells["STATUS"].Value = "未发送";
- break;
- case "1":
- ugr.Cells["STATUS"].Value = "已引用";
- break;
- case "2":
- ugr.Cells["STATUS"].Value = "已接收";
- break;
- case "3":
- ugr.Cells["STATUS"].Value = "已完成";
- break;
- case "4":
- ugr.Cells["STATUS"].Value = "检化验系统退回";
- break;
- case "5":
- ugr.Cells["STATUS"].Value = "重判";
- break;
- case "7":
- ugr.Cells["STATUS"].Value = "确认接收样";
- break;
- }
- if (ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "复样")
- {
- ugr.Cells["SMP_TYPE_NAME"].Appearance.ForeColor = Color.Red;
- }
- if (ugr.Cells["SMP_LOCATION"].Value.ToString().Contains("一次模拟焊后"))
- {
- if (ugr.Cells["SMP_LOCATION"].Value.ToString().Contains("一次模拟焊后")
- && (ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "复样" || ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "卷卷取样"
- || ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "按母板取样"))
- {
- ugr.Cells["SMP_TYPE_NAME"].Value = "一次模拟焊后" + ugr.Cells["SMP_TYPE_NAME"].Value.ToString();
- }
- else
- {
- ugr.Cells["SMP_TYPE_NAME"].Value = "一次模拟焊后";
- }
- }
- else if (ugr.Cells["SMP_LOCATION"].Value.ToString().Contains("二次模拟焊后"))
- {
- if (ugr.Cells["SMP_LOCATION"].Value.ToString().Contains("二次模拟焊后")
- && (ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "复样" || ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "卷卷取样"
- || ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "按母板取样"))
- {
- ugr.Cells["SMP_TYPE_NAME"].Value = "二次模拟焊后" + ugr.Cells["SMP_TYPE_NAME"].Value.ToString();
- }
- else
- {
- ugr.Cells["SMP_TYPE_NAME"].Value = "二次模拟焊后";
- }
- }
- else if (ugr.Cells["SMP_LOCATION"].Value.ToString().Contains("三次模拟焊后"))
- {
- if (ugr.Cells["SMP_LOCATION"].Value.ToString().Contains("三次模拟焊后")
- && (ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "复样" || ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "卷卷取样"
- || ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "按母板取样"))
- {
- ugr.Cells["SMP_TYPE_NAME"].Value = "三次模拟焊后" + ugr.Cells["SMP_TYPE_NAME"].Value.ToString();
- }
- else
- {
- ugr.Cells["SMP_TYPE_NAME"].Value = "三次模拟焊后";
- }
- }
- else if (ugr.Cells["SMP_LOCATION"].Value.ToString().Contains("四次模拟焊后"))
- {
- if (ugr.Cells["SMP_LOCATION"].Value.ToString().Contains("四次模拟焊后")
- && (ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "复样" || ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "卷卷取样"
- || ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "按母板取样"))
- {
- ugr.Cells["SMP_TYPE_NAME"].Value = "四次模拟焊后" + ugr.Cells["SMP_TYPE_NAME"].Value.ToString();
- }
- else
- {
- ugr.Cells["SMP_TYPE_NAME"].Value = "四次模拟焊后";
- }
- }
- if (ugr.Cells["SMP_CATG"].Value.ToString().Equals("A"))
- {
- ugr.Appearance.BackColor = Color.Aqua;
- }
- }
- }
- else if (this.ultraTabControl1.Tabs[1].Selected)
- {
- foreach (UltraGridRow ugr in this.ultraGrid4.Rows)
- {
- switch (ugr.Cells["STATUS"].Text.ToString())
- {
- case "0":
- ugr.Cells["STATUS"].Value = "未发送";
- break;
- case "1":
- ugr.Cells["STATUS"].Value = "已引用";
- break;
- case "2":
- ugr.Cells["STATUS"].Value = "已接收";
- break;
- case "3":
- ugr.Cells["STATUS"].Value = "已完成";
- break;
- case "4":
- ugr.Cells["STATUS"].Value = "检化验系统退回";
- break;
- case "5":
- ugr.Cells["STATUS"].Value = "重判";
- break;
- case "7":
- ugr.Cells["STATUS"].Value = "确认接收样";
- break;
- }
- if (ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "复样")
- {
- ugr.Cells["SMP_TYPE_NAME"].Appearance.ForeColor = Color.Red;
- }
- if (ugr.Cells["SMP_LOCATION"].Value.ToString().Contains("一次模拟焊后"))
- {
- if (ugr.Cells["SMP_LOCATION"].Value.ToString().Contains("一次模拟焊后")
- && (ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "复样" || ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "卷卷取样"
- || ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "按母板取样"))
- {
- ugr.Cells["SMP_TYPE_NAME"].Value = "一次模拟焊后" + ugr.Cells["SMP_TYPE_NAME"].Value.ToString();
- }
- else
- {
- ugr.Cells["SMP_TYPE_NAME"].Value = "一次模拟焊后";
- }
- }
- else if (ugr.Cells["SMP_LOCATION"].Value.ToString().Contains("二次模拟焊后"))
- {
- if (ugr.Cells["SMP_LOCATION"].Value.ToString().Contains("二次模拟焊后")
- && (ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "复样" || ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "卷卷取样"
- || ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "按母板取样"))
- {
- ugr.Cells["SMP_TYPE_NAME"].Value = "二次模拟焊后" + ugr.Cells["SMP_TYPE_NAME"].Value.ToString();
- }
- else
- {
- ugr.Cells["SMP_TYPE_NAME"].Value = "二次模拟焊后";
- }
- }
- else if (ugr.Cells["SMP_LOCATION"].Value.ToString().Contains("三次模拟焊后"))
- {
- if (ugr.Cells["SMP_LOCATION"].Value.ToString().Contains("三次模拟焊后")
- && (ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "复样" || ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "卷卷取样"
- || ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "按母板取样"))
- {
- ugr.Cells["SMP_TYPE_NAME"].Value = "三次模拟焊后" + ugr.Cells["SMP_TYPE_NAME"].Value.ToString();
- }
- else
- {
- ugr.Cells["SMP_TYPE_NAME"].Value = "三次模拟焊后";
- }
- }
- else if (ugr.Cells["SMP_LOCATION"].Value.ToString().Contains("四次模拟焊后"))
- {
- if (ugr.Cells["SMP_LOCATION"].Value.ToString().Contains("四次模拟焊后")
- && (ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "复样" || ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "卷卷取样"
- || ugr.Cells["SMP_TYPE_NAME"].Value.ToString() == "按母板取样"))
- {
- ugr.Cells["SMP_TYPE_NAME"].Value = "四次模拟焊后" + ugr.Cells["SMP_TYPE_NAME"].Value.ToString();
- }
- else
- {
- ugr.Cells["SMP_TYPE_NAME"].Value = "四次模拟焊后";
- }
- }
- if (!String.IsNullOrEmpty(ugr.Cells["ZHB_SPECIMEN_NO"].Value.ToString()))
- {
- ugr.Appearance.BackColor = Color.LightGreen;
- }
- if (ugr.Cells["SMP_CATG"].Value.ToString().Equals("A"))
- {
- ugr.Appearance.BackColor = Color.Aqua;
- }
- if (ugr.Cells["FREQ_CODE"].Value.ToString().Equals("D") && String.IsNullOrEmpty(ugr.Cells["QUOTE_CONSIGN_NO"].Value.ToString())
- && ugr.Cells["SMP_TYPE_CODE"].Value.ToString().Equals("0"))
- {
- ugr.Appearance.BackColor = Color.Red;
- }
- }
- }
-
-
- int num = 0;
- if (this.ultraTabControl1.Tabs[0].Selected) //检验委托
- {
- num = this.ultraGrid1.Rows.Count();
- if (num <= 0)
- {
- this.dataSet2.Clear();
- this.dataSet3.Clear();
- }
- }
- else if (this.ultraTabControl1.Tabs[1].Selected)
- {
- num = this.ultraGrid4.Rows.Count();
- if (num <= 0)
- {
- this.dataSet6.Clear();
- this.dataSet7.Clear();
- }
- }
-
-
- // ClsControlPack.RefreshAndAutoSize(ultraGrid1);
- // ClsControlPack.RefreshAndAutoSize(ultraGrid4);
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- private void inLIMSQuery()
- {
- try
- {
- String checkboxVal = "";
- String STARTTIME = this.dateTimePicker1.Value.ToString("yyyy-MM-dd");
- String ENDTIME = this.dateTimePicker2.Value.ToString("yyyy-MM-dd");
- String BATCH_NO = this.textBox1.Text.Trim();
- String BATCH_NO2 = this.BATCH_NO2.Text.Trim();
- String VALIDFLAG = "1";
- String CERT_INST_NAME = this.textBox2.Text.Trim();//认证机构
- String PLINE_NAME = this.PLINE_NAME.Text.Trim();
- String PLINE_CODE = v_line_no;
- String STEEL_NAME = this.txt_steel_name.Text.Trim();
- String SMP_CATG = this.cbx_smp_catg.Text.Trim();
- String heatNo = this.selheatNo.Text.Trim();
- String DESIGNKEY = this.sel_design_key.Text.Trim();
- String SAMPLE_DELIVERY_TIME = this.SAMPLE_DELIVERY_TIME2.Text.Trim();//查询 送样时间点
- String sdtime = this.dateTimePicker4.Text.ToString();
- SAMPLE_DELIVERY_TIME = sdtime + " " + SAMPLE_DELIVERY_TIME;//送样时间点
- if (PLINE_NAME.Equals("全部"))
- {
- PLINE_NAME = "";
- }
- if (CERT_INST_NAME.Equals("全部"))
- {
- CERT_INST_NAME = "";
- }
- if (SMP_CATG.Equals("全部"))
- {
- SMP_CATG = "";
- }
- else if (SMP_CATG.Equals("成分"))
- {
- SMP_CATG = "A";
- }
- else
- {
- SMP_CATG = "B";
- }
- if (this.CustomInfo == "HB")
- {
- PLINE_NAME = "厚板线";
- }
- else if (this.CustomInfo == "ZB")
- {
- PLINE_NAME = "中板线";
- }
- //轧批号 小框框 是否勾选
- if (this.checkBox1.Checked)
- {
- checkboxVal = "1";
- STARTTIME = "";
- ENDTIME = "";
- }
- else
- {
- BATCH_NO = "";
- BATCH_NO2 = "";
- }
- if (this.checkBox2.Checked)
- {
- STARTTIME = "";
- ENDTIME = "";
- }
- else
- {
- heatNo = "";
- }
- if (this.checkBox3.Checked)
- {
- //STARTTIME = "";
- //ENDTIME = "";
- }
- else
- {
- DESIGNKEY = "";
- }
- if (!this.checkBox4.Checked)
- {
- SAMPLE_DELIVERY_TIME = "";
- }
- Hashtable ht = new Hashtable();
- ht.Add("BATCH_NO", BATCH_NO);
- ht.Add("BATCH_NO2", BATCH_NO2);
- ht.Add("STARTTIME", STARTTIME);
- ht.Add("ENDTIME", ENDTIME);
- ht.Add("VALIDFLAG", VALIDFLAG);
- ht.Add("CERT_INST_NAME", CERT_INST_NAME);
- ht.Add("PLINE_NAME", PLINE_NAME);
- ht.Add("PLINE_CODE", PLINE_CODE);
- ht.Add("checkboxVal", checkboxVal);
- ht.Add("STATUS", "0");
- ht.Add("STEEL_NAME", STEEL_NAME);
- ht.Add("SMP_CATG", SMP_CATG);
- ht.Add("HEAT_NO", heatNo);
- ht.Add("DESIGN_KEY", DESIGNKEY);
- ht.Add("SAMPLE_DELIVERY_TIME", SAMPLE_DELIVERY_TIME);
- CoreClientParam ccp = new CoreClientParam();
- this.dataSet10.Clear();
- ccp.ServerName = "QCM.JHY01.JHY0102.QuerryJhyQtly";
- ccp.MethodName = "ZHBQueryLims";
- ccp.SourceDataTable = this.dataSet10.Tables[0];
- ccp.ServerParams = new object[] { ht };
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- #endregion
- #region 查找检验项目
- private void DoQueryPrg(UltraGridRow ugr)
- {
- try
- {
- this.dataSet3.Clear();
- String specimen_no = ugr.Cells["SPECIMEN_NO"].Value.ToString();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.JHY01.JHY0101.QuerryQltySample";
- ccp.MethodName = "getQltySampleItem";
- ccp.ServerParams = new object[] { specimen_no };
- ccp.SourceDataTable = this.dataSet3.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- #endregion
- #region 查询订单信息
- private void DoQueryOrder(UltraGridRow ugr)
- {
- try
- {
- this.dataSet2.Clear();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.JHY01.JHY0101.QuerryQltySample";
- ccp.MethodName = "getQltySampleOrd";
- ccp.ServerParams = new object[] { ugr.Cells["SMP_NO"].Text.ToString() };
- ccp.SourceDataTable = this.dataSet2.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- foreach (UltraGridRow ugr2 in this.ultraGrid2.Rows)
- {
- ugr2.Cells["Column1"].Value = ugr2.Cells["THICK"].Value + "*" + ugr2.Cells["WIDTH"].Value + "*" + ugr2.Cells["LENGTH"].Value;
- }
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- #endregion
- #region 发送检验委托
- private void DoSend()
- {
- try
- {
- String sdeltime = this.SAMPLE_DELIVERY_TIME.Text.Trim().ToString();
- if (!sdeltime.Equals("24:00:00"))
- {
- String strDocond = DoCondition();//委托人员限制
- if ("0".Equals(strDocond))
- {
- return;
- }
-
- //当前时间小于送样时间15分钟,不能选择当前送样时间发送委托
- //送样时间小于当前时间,不能选择肖妆送样时间发送委托
- String sdtime0 = this.dateTimePicker3.Text.ToString();
- String sampleDeliveryTime0 = this.SAMPLE_DELIVERY_TIME.Text.ToString();
- String dbtime = sdtime0 + " " + sampleDeliveryTime0;//送样时间点
- DateTime historyTime = Convert.ToDateTime(dbtime);//转换日期格式
- System.DateTime currentTime = new System.DateTime();
- currentTime = System.DateTime.Now;//系统时间
- TimeSpan ts = historyTime - currentTime;
- double getHours = ts.TotalMinutes;
- //产品名称
- String PROD_NAME = "";
- UltraGridRow rowp = this.ultraGrid1.ActiveRow;
- if (rowp != null)
- {
- PROD_NAME = rowp.Cells["PROD_NAME"].Text.ToString();
- }
- if (!PROD_NAME.Contains("模具"))
- {
- if (getHours <= -1)
- {
- this.alert("送样时间截点不能小于当前系统时间截点,请选择一个大于当前系统时间截点并且不能小于15分钟的送样时间截点,谢谢!");
- return;
- }
- else if (getHours <= 15)
- {
- this.alert("当前系统时间截点小于送样时间截点15分钟,不能在当前送样时间点进行委托,请选择另一个送样时间点,谢谢!");
- return;
- }
- }
- }
- //判断是否有合并的委托
- String spNoSel = "";
- string fh1 = "";
- int num1 = 0;
- foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
- {
- if (ugr.Cells["CHK"].Value.ToString().ToLower() == "true")
- {
- String specimeNoSel = ugr.Cells["SPECIMEN_NO"].Value.ToString();
- num1 = num1 + 1;
- if (num1 <= 1)
- {
- spNoSel = specimeNoSel;
- fh1 = ",";
- }
- else
- {
- spNoSel = spNoSel + fh1 + specimeNoSel;
- }
- }
- }
-
- CoreClientParam ccpSel = new CoreClientParam();
- ccpSel.ServerName = "QCM.JHY01.JHY0102.QuerryJhyQtly";
- ccpSel.MethodName = "Sel_ZHB_HB";
- ccpSel.ServerParams = new object[] { spNoSel };
- ccpSel = this.ExecuteNonQuery(ccpSel, CoreInvokeType.Internal);
- if (ccpSel.ReturnCode == -1)
- {
- if (MessageBox.Show("是否继续发送委托?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
- {
- return;
- }
- }
-
- DoUpdate();//先修改取样材料号
- String sampleDeliveryTime = this.SAMPLE_DELIVERY_TIME.Text.ToString();
- if (!sampleDeliveryTime.Equals("03:00:00") && !sampleDeliveryTime.Equals("06:30:00") && !sampleDeliveryTime.Equals("10:30:00") &&
- !sampleDeliveryTime.Equals("11:00:00") && !sampleDeliveryTime.Equals("15:00:00") && !sampleDeliveryTime.Equals("17:30:00") &&
- !sampleDeliveryTime.Equals("18:00:00") && !sampleDeliveryTime.Equals("20:30:00") && !sampleDeliveryTime.Equals("21:00:00") &&
- !sampleDeliveryTime.Equals("06:00:00") && !sampleDeliveryTime.Equals("24:00:00"))
- {
- this.alert("请在下拉框中选择正确的时间点不要手动更改时间点格式,当前时间点格式【"+ sampleDeliveryTime+"】不在规定时间格式中!");
- return;
- }
- String sdtime = this.dateTimePicker3.Text.ToString();
- if (String.IsNullOrEmpty(sampleDeliveryTime) || String.IsNullOrEmpty(sdtime))
- {
- this.alert("请选择送样时间点!");
- return;
- }
- //DateTime dt = DateTime.Now;
- //String sdtime = string.Format("{0:yyyy-MM-dd}", dt);
- sampleDeliveryTime = sdtime + " " + sampleDeliveryTime;//送样时间点
-
- List<UltraGridRow> lists = new List<UltraGridRow>();
- CoreClientParam ccp = new CoreClientParam();
- string SPECIMEN_NO = "";
- string fh = "";
- int num = 0;
- string dnum = "0";
- foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
- {
- string specimeNo = "";
- if (ugr.Cells["CHK"].Value.ToString().ToLower() == "true")
- {
- if (string.IsNullOrEmpty(ugr.Cells["MATERIAL_NO"].Value.ToString()))
- {
- return;
- }
- specimeNo = ugr.Cells["SPECIMEN_NO"].Value.ToString();
- num = num + 1;
- if (num <= 1)
- {
- SPECIMEN_NO = specimeNo;
- fh = ",";
- }
- else
- {
- SPECIMEN_NO = SPECIMEN_NO + fh + specimeNo;
- }
- lists.Add(ugr);
- if (ugr.Cells["FREQ_CODE"].Value.ToString().Equals("D"))
- {
- dnum = "1";
- }
- }
- }
- ccp.ServerName = "QCM.JHY01.JHY0102.Send2";
- ccp.MethodName = "SendLIMES";
- ccp.ServerParams = new object[] { SPECIMEN_NO, this.UserInfo.GetUserID(), this.UserInfo.GetUserName(), sampleDeliveryTime };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- for (int i = 0; i < lists.Count; i++)
- {
- lists[i].Delete(false);
- }
- MessageBox.Show("发送成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);//ccp.ReturnInfo "发送成功" ccp.ReturnInfo
- }
- //夹杂按炉
- if ("1".Equals(dnum))
- {
- this.DoQuery();
- }
- int conut = this.ultraGrid1.Rows.Count();
- if (conut <= 0)
- {
- this.dataSet2.Clear();
- this.dataSet3.Clear();
- }
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- #endregion
- #region 撤销检验委托
- private void DoUnsend()
- {
- try
- {
- if (MessageBox.Show("确认撤销发送?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
- {
- return;
- }
- List<UltraGridRow> lists = new List<UltraGridRow>();
- String zhyy = "MES撤回";
- CoreClientParam ccp = new CoreClientParam();
- string SPECIMEN_NO = "";
- string fh = "";
- int num = 0;
- int numy = 0;
- int numzhb = 0;
- string dnum = "0";
- foreach (UltraGridRow ugr in this.ultraGrid4.Rows)
- {
- string specimeNo = "";
- if (ugr.Cells["CHK"].Value.ToString().ToLower() == "true")
- {
- specimeNo = ugr.Cells["SPECIMEN_NO"].Value.ToString();
- String status = ugr.Cells["STATUS"].Value.ToString();
- if ("7".Equals(status) || "确认接收样".Equals(status))
- {
- this.alert("该委托样品已接收, 不允许撤回, 请联系LIMS实验室退回");
- return;
- }
- String zhbsno = ugr.Cells["ZHB_SPECIMEN_NO"].Value.ToString();
- if ("1".Equals(status) || "已引用".Equals(status))
- {
- numy = 1;
- }
- if (!String.IsNullOrEmpty(zhbsno))
- {
- numzhb = 1;
- }
- num = num + 1;
- if (num <= 1)
- {
- SPECIMEN_NO = specimeNo;
- fh = ",";
- }
- else
- {
- SPECIMEN_NO = SPECIMEN_NO + fh + specimeNo;
- }
- lists.Add(ugr);
- if (ugr.Cells["FREQ_CODE"].Value.ToString().Equals("D"))
- {
- dnum = "1";
- }
- }
- }
- if (numy == 1)
- {
- this.alert("不能撤销引用的轧批号!!!");
- return;
- }
- if (numzhb == 1)
- {
- this.alert("合并委托撤销请点击【撤销同批合并发送】按钮!");
- return;
- }
- ccp.ServerName = "QCM.JHY01.JHY0102.Send2";
- ccp.MethodName = "CancelLIMES";
- ccp.ServerParams = new object[] { SPECIMEN_NO, this.UserInfo.GetUserName(), zhyy };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- for (int i = 0; i < lists.Count; i++)
- {
- lists[i].Delete(false);
- }
- MessageBox.Show("撤销发送成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);//ccp.ReturnInfo "发送成功" ccp.ReturnInfo
- }
- //夹杂按炉
- if ("1".Equals(dnum))
- {
- this.DoQuery();
- }
- int conut = this.ultraGrid4.Rows.Count();
- if (conut <= 0)
- {
- this.dataSet6.Clear();
- this.dataSet7.Clear();
- }
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- #endregion
- #region 撤销检验委托19
- private void DoUnsend19()
- {
- try
- {
- if (MessageBox.Show("确认撤销19订单?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
- {
- return;
- }
- List<UltraGridRow> lists = new List<UltraGridRow>();
- String zhyy = "MES撤回";
- CoreClientParam ccp = new CoreClientParam();
- string SPECIMEN_NO = "";
- string fh = "";
- int num = 0;
- int num19 = 0;
- foreach (UltraGridRow ugr in this.ultraGrid4.Rows)
- {
- string specimeNo = "";
- if (ugr.Cells["CHK"].Value.ToString().ToLower() == "true")
- {
- specimeNo = ugr.Cells["SPECIMEN_NO"].Value.ToString();
- String designKey = ugr.Cells["DESIGN_KEY"].Value.ToString();
- designKey=designKey.Substring(0, 2);
- if (!"19".Equals(designKey))
- {
- num19 = 1;
- }
- num = num + 1;
- if (num <= 1)
- {
- SPECIMEN_NO = specimeNo;
- fh = ",";
- }
- else
- {
- SPECIMEN_NO = SPECIMEN_NO + fh + specimeNo;
- }
- lists.Add(ugr);
- }
- }
- if (num19==1)
- {
- this.alert("撤销19订单按钮只能撤销19订单!!!");
- return;
- }
- ccp.ServerName = "QCM.JHY01.JHY0102.Send2";
- ccp.MethodName = "CancelLIMES19";
- ccp.ServerParams = new object[] { SPECIMEN_NO, this.UserInfo.GetUserName(), zhyy };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- for (int i = 0; i < lists.Count; i++)
- {
- lists[i].Delete(false);
- }
- MessageBox.Show("撤销19订单成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);//ccp.ReturnInfo "发送成功" ccp.ReturnInfo
- }
- //this.DoQuery();
- int conut = this.ultraGrid4.Rows.Count();
- if (conut <= 0)
- {
- this.dataSet6.Clear();
- this.dataSet7.Clear();
- }
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- #endregion
- #region 同轧批牌号合并发送按钮
- private void button1_Click(object sender, EventArgs e)
- {
- try
- {
- String sdeltime = this.SAMPLE_DELIVERY_TIME.Text.Trim().ToString();
- if (!sdeltime.Equals("24:00:00"))
- {
- String strDocond = DoCondition();//委托人员限制
- if ("0".Equals(strDocond))
- {
- return;
- }
- //当前时间小于送样时间15分钟,不能选择当前送样时间发送委托
- //送样时间小于当前时间,不能选择肖妆送样时间发送委托
- String sdtime0 = this.dateTimePicker3.Text.ToString();
- String sampleDeliveryTime0 = this.SAMPLE_DELIVERY_TIME.Text.ToString();
- String dbtime = sdtime0 + " " + sampleDeliveryTime0;//送样时间点
- DateTime historyTime = Convert.ToDateTime(dbtime);//转换日期格式
- System.DateTime currentTime = new System.DateTime();
- currentTime = System.DateTime.Now;//系统时间
- TimeSpan ts = historyTime - currentTime;
- double getHours = ts.TotalMinutes;
- if (getHours <= -1)
- {
- this.alert("送样时间截点不能小于当前系统时间截点,请选择一个大于当前系统时间截点并且不能小于15分钟的送样时间截点,谢谢!");
- return;
- }
- else if (getHours <= 15)
- {
- this.alert("当前系统时间截点小于送样时间截点15分钟,不能在当前送样时间点进行委托,请选择另一个送样时间点,谢谢!");
- return;
- }
- }
- // DoUpdate();//先修改取样材料号
- String sampleDeliveryTime = this.SAMPLE_DELIVERY_TIME.Text.ToString();
- if (!sampleDeliveryTime.Equals("03:00:00") && !sampleDeliveryTime.Equals("06:00:00") && !sampleDeliveryTime.Equals("10:30:00") &&
- !sampleDeliveryTime.Equals("11:00:00") && !sampleDeliveryTime.Equals("15:00:00") && !sampleDeliveryTime.Equals("17:30:00") &&
- !sampleDeliveryTime.Equals("18:00:00") && !sampleDeliveryTime.Equals("20:30:00") && !sampleDeliveryTime.Equals("21:00:00") &&
- !sampleDeliveryTime.Equals("06:30:00") && !sampleDeliveryTime.Equals("24:00:00") )
- {
- this.alert("请在下拉框中选择正确的时间点不要手动更改时间点格式,当前时间点格式【" + sampleDeliveryTime + "】不在规定时间格式中!");
- return;
- }
- String sdtime = this.dateTimePicker3.Text.ToString();
- if (String.IsNullOrEmpty(sampleDeliveryTime) || String.IsNullOrEmpty(sdtime))
- {
- this.alert("请选择送样时间点!");
- return;
- }
- //DateTime dt = DateTime.Now;
- //String sdtime = string.Format("{0:yyyy-MM-dd}", dt);
- sampleDeliveryTime = sdtime + " " + sampleDeliveryTime;//送样时间点
- CoreClientParam ccp = new CoreClientParam();
- string SPECIMEN_NO = "";
- string BATCH_NO = "";
- string fh = "";
- int num = 0;
- foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
- {
- string specimeNo = "";
- if (ugr.Cells["CHK"].Value.ToString().ToLower() == "true")
- {
- specimeNo = ugr.Cells["SPECIMEN_NO"].Value.ToString();
- BATCH_NO = ugr.Cells["BATCH_NO"].Value.ToString();
- num = num + 1;
- if (num <= 1)
- {
- SPECIMEN_NO = specimeNo;
- fh = ",";
- }
- else
- {
- SPECIMEN_NO = SPECIMEN_NO + fh + specimeNo;
- }
- }
- }
- if (num>=2)
- {
- this.alert("只允许对一个牌号打勾[勾选一条委托即可,无需勾选多条委托]");
- return;
- }
- //主题:关于DNV性能引用 技术中心李娇丽提出 申报时间2024-10-28 11:06:27
- //2024年挪威船级社年审提出,低等级不能引用高等级性能,因为低等级的冲击未进行试验,没有试验原始记录,挪威船级社DNV需要在冲击温度相同的情况下才能引用性能。
- if ("".Equals(BATCH_NO))
- {
- this.alert("请勾选委托!");
- return;
- }
- Hashtable ht = new Hashtable();
- ht.Add("BATCH_NO", BATCH_NO);
- CoreClientParam ccpSel = new CoreClientParam();
- ccpSel.ServerName = "QCM.JHY01.JHY0102.QuerryJhyQtly";
- ccpSel.MethodName = "getZHBDNV";
- ccpSel.ServerParams = new object[] { ht };
- ccpSel = this.ExecuteNonQuery(ccpSel, CoreInvokeType.Internal);
- if (ccpSel.ReturnCode == -1)
- {
- return;
- }
- ccp.ServerName = "QCM.JHY01.JHY0102.Send2";
- ccp.MethodName = "ZHBmergeSendLIMES";
- ccp.ServerParams = new object[] { SPECIMEN_NO, this.UserInfo.GetUserID(), this.UserInfo.GetUserName(), sampleDeliveryTime };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- MessageBox.Show("合并发送成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);
- }
- this.DoQuery();
- int conut = this.ultraGrid1.Rows.Count();
- if (conut <= 0)
- {
- this.dataSet2.Clear();
- this.dataSet3.Clear();
- }
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- #endregion
- #region 撤销合并同批发送委托
- private void button2_Click(object sender, EventArgs e)
- {
- try
- {
- if (MessageBox.Show("确认撤销同批合并发送委托?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
- {
- return;
- }
- String zhyy = "MES撤回";
- CoreClientParam ccp = new CoreClientParam();
- string SPECIMEN_NO = "";
- string fh = "";
- int num = 0;
- int numy = 0;
- foreach (UltraGridRow ugr in this.ultraGrid4.Rows)
- {
- string specimeNo = "";
- if (ugr.Cells["CHK"].Value.ToString().ToLower() == "true")
- {
- specimeNo = ugr.Cells["ZHB_SPECIMEN_NO"].Value.ToString();//合并取样编号
- if (String.IsNullOrEmpty(specimeNo))
- {
- this.alert("【撤销同批合并发送】按钮只能撤销合并委托!");
- return;
- }
- String status = ugr.Cells["STATUS"].Value.ToString();
- if ("7".Equals(status) || "确认接收样".Equals(status))
- {
- this.alert("该委托样品已接收, 不允许撤回, 请联系系统管理员");
- return;
- }
- String quoteConsignNo = ugr.Cells["QUOTE_CONSIGN_NO"].Value.ToString();
- if ("1".Equals(status) || !String.IsNullOrEmpty(quoteConsignNo))
- {
- numy = 1;
- }
- num = num + 1;
- if (num <= 1)
- {
- SPECIMEN_NO = specimeNo;
- fh = ",";
- }
- else
- {
- SPECIMEN_NO = SPECIMEN_NO + fh + specimeNo;
- }
- }
- }
- if (numy == 1)
- {
- this.alert("不能撤销引用的轧批号!!!");
- return;
- }
- ccp.ServerName = "QCM.JHY01.JHY0102.Send2";
- ccp.MethodName = "ZHBCancelLIMES";
- ccp.ServerParams = new object[] { SPECIMEN_NO, this.UserInfo.GetUserName(), zhyy };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- MessageBox.Show("撤销同批合并发送成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);//ccp.ReturnInfo "发送成功" ccp.ReturnInfo
- }
- this.DoQuery();
- int conut = this.ultraGrid4.Rows.Count();
- if (conut <= 0)
- {
- this.dataSet6.Clear();
- this.dataSet7.Clear();
- }
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- #endregion
- #region 引用实绩
- private void DoQuote()
- {
- UltraGridRow row = this.ultraGrid1.ActiveRow;
- if (row == null)
- {
- this.alert("检验委托为空!请选择检验委托数据!!!");
- return;
- }
- if (MessageBox.Show("轧批号【" + row.Cells["BATCH_NO"].Value.ToString() + "】,确认引用?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
- {
- return;
- }
- if (!String.IsNullOrEmpty(row.Cells["QUOTE_MEMO"].Value.ToString()))
- {
- this.alert("已引用不可重复引用!!!");
- return;
- }
- String DESIGN_KEY = row.Cells["DESIGN_KEY"].Value.ToString();
- String HEAT_NO = row.Cells["HEAT_NO"].Value.ToString();
- String BATCH_NO = row.Cells["BATCH_NO"].Value.ToString();
- String SMP_NO = row.Cells["SMP_NO"].Value.ToString();
- String SPECIMEN_NO = row.Cells["SPECIMEN_NO"].Value.ToString();
- String FREQ_CODE = row.Cells["FREQ_CODE"].Value.ToString();
- String PLINE_CODE = row.Cells["PLINE_CODE"].Value.ToString();
- String SMP_TYPE_CODE = row.Cells["SMP_TYPE_CODE"].Value.ToString();
- String THICK = row.Cells["THICK"].Value.ToString();
- String STEEL_NAME = row.Cells["STEEL_NAME"].Value.ToString();
- Hashtable ht = new Hashtable();
- ht.Add("HEAT_NO", HEAT_NO);
- ht.Add("BATCH_NO", BATCH_NO);
- ht.Add("SMP_NO", SMP_NO);
- ht.Add("SPECIMEN_NO", SPECIMEN_NO);
- ht.Add("FREQ_CODE", FREQ_CODE);
- ht.Add("PLINE_CODE", PLINE_CODE);
- ht.Add("SMP_TYPE_CODE", SMP_TYPE_CODE);
- ht.Add("SEND_ID", this.UserInfo.GetUserID());
- ht.Add("CREATE_NAME", this.UserInfo.GetUserName());
- ht.Add("THICK", THICK);
- ht.Add("DESIGN_KEY", DESIGN_KEY);
- ht.Add("STEEL_NAME", STEEL_NAME);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.JHY01.JHY0102.UpdateInfo";
- ccp.MethodName = "DoQuoteBatchNo";
- ccp.ServerParams = new object[] { ht };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- MessageBox.Show("引用成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);
- }
- this.DoQuery();
- }
- #endregion
- #region 预测抽样
- private void button3_Click(object sender, EventArgs e)
- {
- try
- {
- String sdeltime = this.SAMPLE_DELIVERY_TIME.Text.Trim().ToString();
- if (!sdeltime.Equals("24:00:00"))
- {
- //当前时间小于送样时间15分钟,不能选择当前送样时间发送委托
- //送样时间小于当前时间,不能选择肖妆送样时间发送委托
- String sdtime0 = this.dateTimePicker3.Text.ToString();
- String sampleDeliveryTime0 = this.SAMPLE_DELIVERY_TIME.Text.ToString();
- String dbtime = sdtime0 + " " + sampleDeliveryTime0;//送样时间点
- DateTime historyTime = Convert.ToDateTime(dbtime);//转换日期格式
- System.DateTime currentTime = new System.DateTime();
- currentTime = System.DateTime.Now;//系统时间
- TimeSpan ts = historyTime - currentTime;
- double getHours = ts.TotalMinutes;
- if (getHours <= -1)
- {
- this.alert("送样时间截点不能小于当前系统时间截点,请选择一个大于当前系统时间截点并且不能小于15分钟的送样时间截点,谢谢!");
- return;
- }
- else if (getHours <= 15)
- {
- this.alert("当前系统时间截点小于送样时间截点15分钟,不能在当前送样时间点进行委托,请选择另一个送样时间点,谢谢!");
- return;
- }
- }
- // DoUpdate();//先修改取样材料号
- String sampleDeliveryTime = this.SAMPLE_DELIVERY_TIME.Text.ToString();
- if (!sampleDeliveryTime.Equals("03:00:00") && !sampleDeliveryTime.Equals("06:00:00") && !sampleDeliveryTime.Equals("10:30:00") &&
- !sampleDeliveryTime.Equals("11:00:00") && !sampleDeliveryTime.Equals("15:00:00") && !sampleDeliveryTime.Equals("17:30:00") &&
- !sampleDeliveryTime.Equals("18:00:00") && !sampleDeliveryTime.Equals("20:30:00") && !sampleDeliveryTime.Equals("21:00:00") &&
- !sampleDeliveryTime.Equals("06:30:00") && !sampleDeliveryTime.Equals("24:00:00") )
- {
- this.alert("请在下拉框中选择正确的时间点不要手动更改时间点格式,当前时间点格式【" + sampleDeliveryTime + "】不在规定时间格式中!");
- return;
- }
- String sdtime = this.dateTimePicker3.Text.ToString();
- if (String.IsNullOrEmpty(sampleDeliveryTime) || String.IsNullOrEmpty(sdtime))
- {
- this.alert("请选择送样时间点!");
- return;
- }
- sampleDeliveryTime = sdtime + " " + sampleDeliveryTime;//送样时间点
- CoreClientParam ccp = new CoreClientParam();
- string SPECIMEN_NO = "";
- string fh = "";
- int num = 0;
- foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
- {
- string specimeNo = "";
- if (ugr.Cells["CHK"].Value.ToString().ToLower() == "true")
- {
- specimeNo = ugr.Cells["SPECIMEN_NO"].Value.ToString();
- num = num + 1;
- if (num <= 1)
- {
- SPECIMEN_NO = specimeNo;
- fh = ",";
- }
- else
- {
- SPECIMEN_NO = SPECIMEN_NO + fh + specimeNo;
- }
- }
- }
- ccp.ServerName = "QCM.JHY01.JHY0102.Send2";
- ccp.MethodName = "ZHBYuCeSample";
- ccp.ServerParams = new object[] { SPECIMEN_NO, this.UserInfo.GetUserID(), this.UserInfo.GetUserName(), sampleDeliveryTime };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- MessageBox.Show("预测成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);
- }
- this.DoQuery();
- int conut = this.ultraGrid1.Rows.Count();
- if (conut <= 0)
- {
- this.dataSet2.Clear();
- this.dataSet3.Clear();
- }
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- #endregion
- #region 撤销预测抽样
- private void button4_Click(object sender, EventArgs e)
- {
- try
- {
- if (MessageBox.Show("确认撤销发送?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
- {
- return;
- }
-
- String zhyy = "MES撤回";
- CoreClientParam ccp = new CoreClientParam();
- string SPECIMEN_NO = "";
- string fh = "";
- int num = 0;
- foreach (UltraGridRow ugr in this.ultraGrid4.Rows)
- {
- string specimeNo = "";
- if (ugr.Cells["CHK"].Value.ToString().ToLower() == "true")
- {
- specimeNo = ugr.Cells["SPECIMEN_NO"].Value.ToString();//取样编号
- String status = ugr.Cells["STATUS"].Value.ToString();//状态
- if ("7".Equals(status) || "确认接收样".Equals(status))
- {
- this.alert("该委托样品已接收, 不允许撤回, 请联系系统管理员");
- return;
- }
- String zhbsno = ugr.Cells["RZ_OLD_SAMPL_NO"].Value.ToString();//抽样取样编号
- String RZ_MIXROLL = ugr.Cells["RZ_MIXROLL"].Value.ToString();//组批区间
- if (String.IsNullOrEmpty(RZ_MIXROLL) || !specimeNo.Equals(zhbsno) )
- {
- this.alert("【撤销抽样】按钮只能撤销预测抽样委托!");
- return;
- }
- num = num + 1;
- if (num <= 1)
- {
- SPECIMEN_NO = specimeNo;
- fh = ",";
- }
- else
- {
- SPECIMEN_NO = SPECIMEN_NO + fh + specimeNo;
- }
- }
- }
- ccp.ServerName = "QCM.JHY01.JHY0102.Send2";
- ccp.MethodName = "CancelZHBYuCeSample";
- ccp.ServerParams = new object[] { SPECIMEN_NO, this.UserInfo.GetUserName(), zhyy };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- MessageBox.Show("撤销预测抽样成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);//ccp.ReturnInfo "发送成功" ccp.ReturnInfo
- }
- this.DoQuery();
- int conut = this.ultraGrid4.Rows.Count();
- if (conut <= 0)
- {
- this.dataSet6.Clear();
- this.dataSet7.Clear();
- }
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- #endregion
- #region 条件
- private String DoCondition()
- {
- try
- {
- String userid=this.UserInfo.GetUserID();//员工ID
- String stime = this.SAMPLE_DELIVERY_TIME.Text.ToString();//送样时间点
- //厚板操作员 userid.Equals("X16962") || userid.Equals("X16961") ||
- if (userid.Equals("X16975") || userid.Equals("X16984") || userid.Equals("X16972") || userid.Equals("X16968") ||
- userid.Equals("X16965") || userid.Equals("X16978") || userid.Equals("X16964") || userid.Equals("X16981") || userid.Equals("X17002") ||
- userid.Equals("X16989") || userid.Equals("X16995") || userid.Equals("X16986") || userid.Equals("X16982") || userid.Equals("X16976") ||
- userid.Equals("X17022") || userid.Equals("X16999") || userid.Equals("X16979") || userid.Equals("X16966") || userid.Equals("X17008") ||
- userid.Equals("X16941") || userid.Equals("X16988") || userid.Equals("X16994") || userid.Equals("X16993") || userid.Equals("X16969") ||
- userid.Equals("X17003") || userid.Equals("X16997") || userid.Equals("X16987") || userid.Equals("X16998") || userid.Equals("X16973"))
- {
- if (!stime.Equals("06:30:00") && !stime.Equals("10:30:00") && !stime.Equals("17:30:00") && !stime.Equals("20:30:00"))
- {
- this.alert("选择的送样时间点错误!无法发送委托!您是厚板操作员请您选择厚板送样时间点!");
- return "0";
- }
- }
- else if (userid.Equals("X17020") || userid.Equals("X17019") || userid.Equals("X17038") || userid.Equals("X17028") ||
- userid.Equals("X17044") || userid.Equals("X17036") || userid.Equals("X17034") || userid.Equals("X17009") || userid.Equals("X17011") ||
- userid.Equals("X17047") || userid.Equals("X17039") || userid.Equals("X17030") || userid.Equals("X17026") || userid.Equals("X17010") ||
- userid.Equals("X17037") || userid.Equals("X17040") || userid.Equals("X17045") || userid.Equals("X17033") || userid.Equals("X17041") ||
- userid.Equals("X17014") || userid.Equals("X17021") || userid.Equals("X17027") || userid.Equals("X17052") || userid.Equals("X17012") ||
- userid.Equals("X17017") || userid.Equals("X17018") || userid.Equals("X17032") || userid.Equals("X17053"))
- {
- //中板操作员
- if (!stime.Equals("03:00:00") && !stime.Equals("06:00:00") && !stime.Equals("11:00:00") && !stime.Equals("15:00:00") &&
- !stime.Equals("18:00:00") && !stime.Equals("21:00:00"))
- {
- this.alert("选择的送样时间点错误!无法发送委托!您是中板操作员请您选择中板送样时间点!");
- return "0";
- }
- }
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- return "1";
- }
- #endregion
- #endregion
- #region 其它事件
- #region 查询下拉框 取样材料号 轧批号
- private void ultraGrid1_AfterCellActivate(object sender, EventArgs e)
- {
- //this.dataSet4.Clear();
- //String heatNo = this.ultraGrid1.ActiveRow.Cells["HEAT_NO"].Value.ToString();
- //CoreClientParam ccp2 = new CoreClientParam();
- //ccp2.ServerName = "QCM.JHY01.JHY0101.QuerryQltySample";//调用java地址
- //ccp2.MethodName = "getBatchNo";//调用的方法
- //ccp2.ServerParams = new object[] { heatNo };
- //ccp2.SourceDataTable = this.dataSet4.Tables[0];
- //this.ExecuteQueryToDataTable(ccp2, CoreInvokeType.Internal);
- //ValueList VDEFECT_DESC2 = new ValueList();
- //for (int i = 0; i < ccp2.SourceDataTable.Rows.Count; i++)
- //{
- // VDEFECT_DESC2.ValueListItems.Add(ccp2.SourceDataTable.Rows[i]["BATCH_NO"].ToString(), ccp2.SourceDataTable.Rows[i]["BATCH_NO"].ToString());
- //}
- //this.ultraGrid1.DisplayLayout.Bands[0].Columns["BATCH_NO"].ValueList = VDEFECT_DESC2;
- this.dataSet4.Clear();
- String batchNo = this.ultraGrid1.ActiveRow.Cells["BATCH_NO"].Value.ToString();
- String plineCode = this.ultraGrid1.ActiveRow.Cells["PLINE_CODE"].Value.ToString();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.JHY01.JHY0101.QuerryQltySample";//调用java地址
- ccp.MethodName = "getBilletId";//调用的方法
- ccp.ServerParams = new object[] { batchNo, plineCode };
- ccp.SourceDataTable = this.dataSet4.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- ValueList VDEFECT_DESC = new ValueList();
- for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
- {
- VDEFECT_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["MATERIAL_NO"].ToString(), ccp.SourceDataTable.Rows[i]["MATERIAL_NO"].ToString());
- }
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["MATERIAL_NO"].ValueList = VDEFECT_DESC;
- }
- #endregion
- private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
- {
- int num = this.ultraGrid1.Rows.Count();
- if (num >= 1)
- {
- // this.DoQueryPrg(this.ultraGrid1.ActiveRow);//右下角
- // this.DoQueryOrder(this.ultraGrid1.ActiveRow);//左下角
- this.dataSet4.Clear();
- String heatNo = this.ultraGrid1.ActiveRow.Cells["HEAT_NO"].Value.ToString();
- String plineCode = this.ultraGrid1.ActiveRow.Cells["PLINE_CODE"].Value.ToString();
- String batchNo = this.ultraGrid1.ActiveRow.Cells["BATCH_NO"].Value.ToString();
- String freqCode = this.ultraGrid1.ActiveRow.Cells["FREQ_CODE"].Value.ToString();
- if (freqCode.Equals("D"))
- {
- CoreClientParam ccp2 = new CoreClientParam();
- ccp2.ServerName = "QCM.JHY01.JHY0101.QuerryQltySample";//调用java地址
- ccp2.MethodName = "getBatchNo";//调用的方法
- ccp2.ServerParams = new object[] { heatNo, plineCode };
- ccp2.SourceDataTable = this.dataSet4.Tables[0];
- this.ExecuteQueryToDataTable(ccp2, CoreInvokeType.Internal);
- ValueList VDEFECT_DESC2 = new ValueList();
- for (int i = 0; i < ccp2.SourceDataTable.Rows.Count; i++)
- {
- VDEFECT_DESC2.ValueListItems.Add(ccp2.SourceDataTable.Rows[i]["BATCH_NO"].ToString(), ccp2.SourceDataTable.Rows[i]["BATCH_NO"].ToString());
- }
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["BATCH_NO"].ValueList = VDEFECT_DESC2;
- }
- Infragistics.Win.UltraWinGrid.UltraGrid uGrid = (Infragistics.Win.UltraWinGrid.UltraGrid)sender;
- string specimen_no = uGrid.ActiveRow.Cells["SPECIMEN_NO"].Text.Trim();
- string smp_no = uGrid.ActiveRow.Cells["SMP_NO"].Text.Trim();
- this.dataSet3.Tables[0].Clear();
- this.dataSet2.Tables[0].Clear();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.JHY01.JHY0101.QuerryQltySample";
- ccp.MethodName = "getQltySampleItemNew";
- ccp.ServerParams = new object[] { specimen_no };
- ccp.SourceDataTable = this.dataSet3.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- CoreClientParam ccp1 = new CoreClientParam();
- ccp1.ServerName = "QCM.JHY01.JHY0101.QuerryQltySample";
- ccp1.MethodName = "getQltySampleOrdNew";
- ccp1.ServerParams = new object[] { smp_no };
- ccp1.SourceDataTable = this.dataSet2.Tables[0];
- this.ExecuteQueryToDataTable(ccp1, CoreInvokeType.Internal);
- //foreach (UltraGridRow ugr2 in this.ultraGrid2.Rows)
- //{
- // ugr2.Cells["Column1"].Value = ugr2.Cells["THICK"].Value + "*" + ugr2.Cells["WIDTH"].Value + "*" + ugr2.Cells["LENGTH"].Value;
- //}
- this.dataSet4.Clear();
- CoreClientParam ccp3 = new CoreClientParam();
- ccp3.ServerName = "QCM.JHY01.JHY0101.QuerryQltySample";//调用java地址
- ccp3.MethodName = "getProcessNo";//调用的方法
- ccp3.ServerParams = new object[] { batchNo, plineCode };
- ccp3.SourceDataTable = this.dataSet4.Tables[0];
- this.ExecuteQueryToDataTable(ccp3, CoreInvokeType.Internal);
- ValueList VDEFECT_DESC3 = new ValueList();
- for (int i = 0; i < ccp3.SourceDataTable.Rows.Count; i++)
- {
- VDEFECT_DESC3.ValueListItems.Add(ccp3.SourceDataTable.Rows[i]["RCL_STATE"].ToString(), ccp3.SourceDataTable.Rows[i]["RCL_STATE"].ToString());
- }
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["PROCESS_NOS"].ValueList = VDEFECT_DESC3;
-
- }
- else
- {
- this.dataSet2.Clear();
- this.dataSet3.Clear();
- }
- }
- #region 选择tab 显示相应按钮
- private void ultraTabControl1_SelectedTabChanged(object sender, Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventArgs e)
- {
- if (this.ultraTabControl1.SelectedTab.Index == 0)
- {
- this.ToolBarItemEnable(this, "Send", true);
- this.ToolBarItemEnable(this, "Add", true);
- this.ToolBarItemEnable(this, "AddArtificial", true);
- this.ToolBarItemEnable(this, "Unsend", false);
- this.ToolBarItemEnable(this, "Unsend19", false);
- this.ToolBarItemEnable(this, "AddWt", true);
- this.ToolBarItemEnable(this, "DelWt", true);
- this.ToolBarItemEnable(this, "DoDelete", true);
- this.ToolBarItemEnable(this, "UpBatchNo", true);
- this.ToolBarItemEnable(this, "UpRefBatchNo", true);
- this.ToolBarItemEnable(this, "DoQuote", true);
- this.ToolBarItemEnable(this, "AllUpdate", true);
- this.ToolBarItemEnable(this, "InExport", false);
- this.ToolBarItemEnable(this, "DoProcessNo", true);
- this.ToolBarItemEnable(this, "doPrint", false);
- // this.DoQuery();
- }
- else if (this.ultraTabControl1.SelectedTab.Index == 1)
- {
- this.ToolBarItemEnable(this, "Send", false);
- this.ToolBarItemEnable(this, "Add", false);
- this.ToolBarItemEnable(this, "AddArtificial", false);
- this.ToolBarItemEnable(this, "Unsend", true);
- this.ToolBarItemEnable(this, "Unsend19", true);
- this.ToolBarItemEnable(this, "AddWt", false);
- this.ToolBarItemEnable(this, "DelWt", false);
- this.ToolBarItemEnable(this, "DoDelete", false);
- this.ToolBarItemEnable(this, "UpBatchNo", false);
- this.ToolBarItemEnable(this, "UpRefBatchNo", false);
- this.ToolBarItemEnable(this, "DoQuote", false);
- this.ToolBarItemEnable(this, "AllUpdate", false);
- this.ToolBarItemEnable(this, "InExport", false);
- this.ToolBarItemEnable(this, "DoProcessNo", true);
- this.ToolBarItemEnable(this, "doPrint", true);
- // this.DoQuery();
- }
- else if (this.ultraTabControl1.SelectedTab.Index == 2)
- {
- this.ToolBarItemEnable(this, "Send", false);
- this.ToolBarItemEnable(this, "Add", false);
- this.ToolBarItemEnable(this, "AddArtificial", false);
- this.ToolBarItemEnable(this, "Unsend", false);
- this.ToolBarItemEnable(this, "Unsend19", false);
- this.ToolBarItemEnable(this, "AddWt", false);
- this.ToolBarItemEnable(this, "DelWt", false);
- this.ToolBarItemEnable(this, "DoDelete", false);
- this.ToolBarItemEnable(this, "UpBatchNo", false);
- this.ToolBarItemEnable(this, "UpRefBatchNo", false);
- this.ToolBarItemEnable(this, "DoQuote", false);
- this.ToolBarItemEnable(this, "AllUpdate", false);
- this.ToolBarItemEnable(this, "InExport", true);
- this.ToolBarItemEnable(this, "DoProcessNo", false);
- this.ToolBarItemEnable(this, "doPrint", false);
- }
- else if (this.ultraTabControl1.SelectedTab.Index == 3)
- {
- this.ToolBarItemEnable(this, "Send", false);
- this.ToolBarItemEnable(this, "Add", false);
- this.ToolBarItemEnable(this, "AddArtificial", false);
- this.ToolBarItemEnable(this, "Unsend", false);
- this.ToolBarItemEnable(this, "Unsend19", false);
- this.ToolBarItemEnable(this, "AddWt", false);
- this.ToolBarItemEnable(this, "DelWt", false);
- this.ToolBarItemEnable(this, "DoDelete", false);
- this.ToolBarItemEnable(this, "UpBatchNo", false);
- this.ToolBarItemEnable(this, "UpRefBatchNo", false);
- this.ToolBarItemEnable(this, "DoQuote", false);
- this.ToolBarItemEnable(this, "AllUpdate", false);
- this.ToolBarItemEnable(this, "InExport", false);
- this.ToolBarItemEnable(this, "DoProcessNo", false);
- this.ToolBarItemEnable(this, "doPrint", false);
- }
- }
- #endregion
- private void ultraGrid4_AfterRowActivate(object sender, EventArgs e)
- {
- // this.DoQueryPrg(this.ultraGrid4.ActiveRow);
- // this.DoQueryOrder(this.ultraGrid4.ActiveRow);
- Infragistics.Win.UltraWinGrid.UltraGrid uGrid = (Infragistics.Win.UltraWinGrid.UltraGrid)sender;
- string specimen_no = uGrid.ActiveRow.Cells["SPECIMEN_NO"].Text.Trim();
- string smp_no = uGrid.ActiveRow.Cells["SMP_NO"].Text.Trim();
- this.dataSet6.Tables[0].Clear();
- this.dataSet7.Tables[0].Clear();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.JHY01.JHY0101.QuerryQltySample";
- ccp.MethodName = "getQltySampleItemNew";
- ccp.ServerParams = new object[] { specimen_no };
- ccp.SourceDataTable = this.dataSet7.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- CoreClientParam ccp1 = new CoreClientParam();
- ccp1.ServerName = "QCM.JHY01.JHY0101.QuerryQltySample";
- ccp1.MethodName = "getQltySampleOrdNew";
- ccp1.ServerParams = new object[] { smp_no };
- ccp1.SourceDataTable = this.dataSet6.Tables[0];
- this.ExecuteQueryToDataTable(ccp1, CoreInvokeType.Internal);
- //foreach (UltraGridRow ugr2 in this.ultraGrid2.Rows)
- //{
- // ugr2.Cells["Column1"].Value = ugr2.Cells["THICK"].Value + "*" + ugr2.Cells["WIDTH"].Value + "*" + ugr2.Cells["LENGTH"].Value;
- //}
- }
- private void ultraGrid1_CellChange(object sender, CellEventArgs e)
- {
- ultraGrid1.UpdateData();
- }
- private void ultraGrid1_AfterHeaderCheckStateChanged(object sender, AfterHeaderCheckStateChangedEventArgs e)
- {
- ultraGrid1.UpdateData();
- }
- private void ultraGrid4_AfterHeaderCheckStateChanged(object sender, AfterHeaderCheckStateChangedEventArgs e)
- {
- ultraGrid4.UpdateData();
- }
- private void ultraGrid4_CellChange(object sender, CellEventArgs e)
- {
- ultraGrid4.UpdateData();
- }
- #endregion
- #region 右下角 删除 名称
- private void ultraGrid3_InitializeRow(object sender, InitializeRowEventArgs e)
- {
- e.Row.Cells["deletebol"].Value = "删除";
- }
- #endregion
- #region 右下角 删除
- private void ultraGrid3_ClickCellButton(object sender, CellEventArgs e)
- {
- ultraGrid3.UpdateData();
- if (e.Cell.Column.Key == "deletebol")
- {
- if (MessageBox.Show("确定要删除这一项目?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk) == DialogResult.No)
- {
- return;
- }
- try
- {
- CoreClientParam ccp = new CoreClientParam();
- String seq = "";//检验项目流水号
- String specimenNo = "";//取样编号
- UltraGridRow row = ultraGrid3.ActiveRow;
- if (!row.Cells["ITEM_FLAG"].Value.ToString().Equals("1"))
- {
- MessageBox.Show("不能删除系统生成的项目,只能删除人工生成的项目!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- return;
- }
- seq = row.Cells["SEQ"].Value.ToString();
- specimenNo = row.Cells["SPECIMEN_NO"].Value.ToString();
- ccp.ServerName = "QCM.JHY01.JHY0102.UpdateInfo";
- ccp.MethodName = "deleteInfo";
- ccp.ServerParams = new object[] { seq, specimenNo };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- MessageBox.Show(ccp.ReturnInfo, "提示", MessageBoxButtons.OK, MessageBoxIcon.None);
- }
- this.DoQueryPrg(this.ultraGrid1.ActiveRow);
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- }
- #endregion
- #region 轧批号框勾选触发
- private void checkBox1_Click(object sender, EventArgs e)
- {
- if (this.checkBox1.Checked)
- {
- this.dateTimePicker1.Enabled = false;
- this.dateTimePicker2.Enabled = false;
- this.textBox1.Enabled = true;
- this.BATCH_NO2.Enabled = true;
- }
- else
- {//&& !this.checkBox3.Checked
- if (!this.checkBox1.Checked && !this.checkBox2.Checked && !this.checkBox5.Checked)
- {
- this.dateTimePicker1.Enabled = true;
- this.dateTimePicker2.Enabled = true;
- }
- this.textBox1.Enabled = false;
- this.BATCH_NO2.Enabled = false;
- }
- }
- private void checkBox2_Click(object sender, EventArgs e)
- {
- if (this.checkBox2.Checked)
- {
- this.dateTimePicker1.Enabled = false;
- this.dateTimePicker2.Enabled = false;
- this.selheatNo.Enabled = true;
- }
- else
- {//&& !this.checkBox3.Checked
- if (!this.checkBox1.Checked && !this.checkBox2.Checked && !this.checkBox5.Checked)
- {
- this.dateTimePicker1.Enabled = true;
- this.dateTimePicker2.Enabled = true;
- }
- this.selheatNo.Enabled = false;
- }
- }
- private void checkBox3_Click(object sender, EventArgs e)
- {
- if (this.checkBox3.Checked)
- {
- //this.dateTimePicker1.Enabled = false;
- //this.dateTimePicker2.Enabled = false;
- this.sel_design_key.Enabled = true;
- }
- else
- {
- //if (!this.checkBox1.Checked && !this.checkBox2.Checked && !this.checkBox3.Checked)
- //{
- // this.dateTimePicker1.Enabled = true;
- // this.dateTimePicker2.Enabled = true;
- //}
- this.sel_design_key.Enabled = false;
- }
- }
- private void checkBox4_Click(object sender, EventArgs e)
- {
- if (this.checkBox4.Checked)
- {
- this.SAMPLE_DELIVERY_TIME2.Enabled = true;
- this.dateTimePicker4.Enabled = true;
- }
- else
- {
- this.SAMPLE_DELIVERY_TIME2.Enabled = false;
- this.dateTimePicker4.Enabled = false;
- }
- }
- private void checkBox5_Click(object sender, EventArgs e)
- {
- if (this.checkBox5.Checked)
- {
- this.dateTimePicker1.Enabled = false;
- this.dateTimePicker2.Enabled = false;
- this.textBox3.Enabled = true;
- }
- else
- {//&& !this.checkBox3.Checked
- if (!this.checkBox1.Checked && !this.checkBox2.Checked && !this.checkBox5.Checked)
- {
- this.dateTimePicker1.Enabled = true;
- this.dateTimePicker2.Enabled = true;
- }
- this.textBox3.Enabled = false;
- }
- }
- #endregion
- #region 子板号 热处理号
- private void ultraGrid4_AfterCellActivate(object sender, EventArgs e)
- {
- this.dataSet4.Clear();
- String batchNo = this.ultraGrid4.ActiveRow.Cells["BATCH_NO"].Value.ToString();
- String plineCode = this.ultraGrid4.ActiveRow.Cells["PLINE_CODE"].Value.ToString();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.JHY01.JHY0101.QuerryQltySample";//调用java地址
- ccp.MethodName = "getBilletId";//调用的方法
- ccp.ServerParams = new object[] { batchNo, plineCode };
- ccp.SourceDataTable = this.dataSet4.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- ValueList VDEFECT_DESC = new ValueList();
- for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
- {
- VDEFECT_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["MATERIAL_NO"].ToString(), ccp.SourceDataTable.Rows[i]["MATERIAL_NO"].ToString());
- }
- this.ultraGrid4.DisplayLayout.Bands[0].Columns["MATERIAL_NO"].ValueList = VDEFECT_DESC;
-
- this.dataSet4.Clear();
- CoreClientParam ccp2 = new CoreClientParam();
- ccp2.ServerName = "QCM.JHY01.JHY0101.QuerryQltySample";//调用java地址
- ccp2.MethodName = "getProcessNo";//调用的方法
- ccp2.ServerParams = new object[] { batchNo, plineCode };
- ccp2.SourceDataTable = this.dataSet4.Tables[0];
- this.ExecuteQueryToDataTable(ccp2, CoreInvokeType.Internal);
- ValueList VDEFECT_DESC2 = new ValueList();
- for (int i = 0; i < ccp2.SourceDataTable.Rows.Count; i++)
- {
- VDEFECT_DESC2.ValueListItems.Add(ccp2.SourceDataTable.Rows[i]["RCL_STATE"].ToString(), ccp2.SourceDataTable.Rows[i]["RCL_STATE"].ToString());
- }
- this.ultraGrid4.DisplayLayout.Bands[0].Columns["PROCESS_NOS"].ValueList = VDEFECT_DESC2;
-
- }
- #endregion
- #region 颜色
- private void ultraGrid4_InitializeRow(object sender, InitializeRowEventArgs e)
- {
- //预测抽样
- //if (!String.IsNullOrEmpty(e.Row.Cells["RZ_OLD_SAMPL_NO"].Value.ToString()))
- //{
- // e.Row.Appearance.BackColor = Color.FromArgb(128, 255, 255);//浅蓝色
- //}
- if (e.Row.Cells["SHOULD_SAMPLE"].Value.ToString().Equals("Y") || e.Row.Cells["SHOULD_SAMPLE"].Value.ToString().Contains("Y(抽样)"))
- {
- e.Row.Appearance.BackColor = Color.FromArgb(128, 255, 255);//浅蓝色
- }
- if (e.Row.Cells["RZ_OLD_SAMPL_NO"].Value.ToString().Equals(e.Row.Cells["SPECIMEN_NO"].Value.ToString()))
- {
- e.Row.Appearance.ForeColor = Color.Red;
- }
- //LAR送样
- if (!String.IsNullOrEmpty(e.Row.Cells["SPECIAL_QUOTE_MEMO"].Value.ToString()) && e.Row.Cells["STEEL_NAME"].Value.ToString().Contains("LRA"))
- {
- e.Row.Appearance.BackColor = Color.LightGoldenrodYellow;//黄色
- }
- }
- private void ultraGrid1_InitializeRow(object sender, InitializeRowEventArgs e)
- {
- //LAR送样
- if (!String.IsNullOrEmpty(e.Row.Cells["SPECIAL_QUOTE_MEMO"].Value.ToString()) && e.Row.Cells["STEEL_NAME"].Value.ToString().Contains("LRA"))
- {
- e.Row.Appearance.BackColor = Color.LightGoldenrodYellow;//黄色
- }
- //性能预测
- if (e.Row.Cells["SHOULD_SAMPLE"].Value.ToString().Equals("Y") || e.Row.Cells["SHOULD_SAMPLE"].Value.ToString().Contains("Y(抽样)"))
- {
- e.Row.Appearance.BackColor = Color.FromArgb(128, 255, 255);//浅蓝色
- }
- if (e.Row.Cells["SHOULD_SAMPLE"].Value.ToString().Contains("Y(抽样)"))
- {
- e.Row.Appearance.ForeColor = Color.Red;
- }
- }
- private void ultraGrid8_InitializeRow(object sender, InitializeRowEventArgs e)
- {
- //LIMS退回轧批
- if (!e.Row.Cells["STATUS"].Text.ToString().Equals("未发送"))
- {
- e.Row.Appearance.BackColor = Color.LightGreen;//浅绿
- }
- }
- #endregion
-
- //private void ultraGrid7_AfterRowExpanded(object sender, RowEventArgs e)
- //{
- // try{
- // if (e.Row == null)
- // return;
- // if (e.Row.Band.Index == 0 && !e.Row.HasParent())
- // {
- // string specimen_no = Convert.ToString(e.Row.Cells["取样编号"].Value);
- // if (!string.IsNullOrEmpty(specimen_no))
- // {
- // CoreClientParam ccp = new CoreClientParam();
- // ccp.ServerName = "QCM.JHY01.JHY0101.QuerryQltySample";
- // ccp.MethodName = "getQltySampleItemNew2";
- // ccp.ServerParams = new object[] { specimen_no };
- // ccp.SourceDataTable = this.dataSet8.Tables[1];
- // ultraGrid7.BeginUpdate();
- // //重绘控件直到endupdate 不会每次就重绘控件 避免闪烁
- // for (int idx = this.dataTable9.Rows.Count - 1; idx >= 0; idx--)
- // {
- // if (Convert.ToString(this.dataTable9.Rows[idx]["取样编号"]) == specimen_no)
- // this.dataTable9.Rows[idx].Delete();
- // }
- // this.dataTable9.AcceptChanges();
- // this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- // // ClsControlPack.RefreshAndAutoSize(ultraGrid7);
- // ultraGrid7.EndUpdate();
- // }
- // }
- // }
- // catch (Exception ex)
- // {
- // System.Diagnostics.Debug.WriteLine(ex.ToString());
- // MessageBox.Show("系统出错,请联系管理人员", "警告");
- // }
- //}
- #region 表中的列 值改变触发
- //private void ultraGrid1_AfterCellUpdate(object sender, CellEventArgs e)
- //{
- // Boolean bl = true;
- // if (this.CustomInfo == "GX" || this.CustomInfo == "BC2" || this.CustomInfo == "GB")
- // {
- // UltraGridRow row = this.ultraGrid1.ActiveRow;
- // if (row == null || "".Equals(row))
- // {
- // return;
- // }
- // String sendMemoValeu = row.Cells["SEND_MEMO"].Value.ToString();
- // if (sendMemoValeu.Equals("A") || sendMemoValeu.Equals("B") || sendMemoValeu.Equals("C"))
- // {
- // String BATCH_NO = row.Cells["BATCH_NO"].Value.ToString();
- // String SPECIMEN_NO = row.Cells["SPECIMEN_NO"].Value.ToString();
- // String phyname = row.Cells["PHY_NAME_L_bj"].Value.ToString();
- // String sendMemo = row.Cells["SEND_MEMO"].Text.ToString();
- // //金相
- // if (sendMemoValeu.Equals("A"))
- // {
- // if (phyname.Contains(sendMemo))
- // {
- // bl = false;
- // }
- // if (bl)
- // {
- // this.alert("轧批号【" + BATCH_NO + "】取样编号【" + SPECIMEN_NO + "】不包含:【" + sendMemo + "】");
- // }
- // }
- // //重量偏差
- // if (sendMemoValeu.Equals("B"))
- // {
- // if (phyname.Contains("其他"))
- // {
- // bl = false;
- // }
- // if (bl)
- // {
- // this.alert("轧批号【" + BATCH_NO + "】取样编号【" + SPECIMEN_NO + "】不包含:【" + sendMemo + "】");
- // }
- // }
- // //金相&重量偏差
- // if (sendMemoValeu.Equals("C"))
- // {
- // if (phyname.Contains("其他") && phyname.Contains("金相"))
- // {
- // bl = false;
- // }
- // if (bl)
- // {
- // this.alert("轧批号【" + BATCH_NO + "】取样编号【" + SPECIMEN_NO + "】需包含:【" + sendMemo + "】两个项目,请检查是否包含!!!");
- // }
- // }
- // }
- // }
- //}
- #endregion
- #region 轧批号
- //textbox获得焦点
- //private void textBox1_Enter(object sender, EventArgs e)
- //{
- // if (textboxHasText == false) {
- // this.textBox1.Text = "";
- // this.BATCH_NO2.Text = "";
- // }
- // this.textBox1.ForeColor = Color.Black;
- // this.BATCH_NO2.ForeColor = Color.Black;
- //}
- //textbox获得焦点
- //private void textBox1_Leave(object sender, EventArgs e)
- //{
- // if (textBox1.Text == "")
- // {
- // textBox1.Text = "输入轧批号后四位";
- // textBox1.ForeColor = Color.LightGray;
- // this.BATCH_NO2.Text = "输入轧批号后四位";
- // this.BATCH_NO2.ForeColor = Color.LightGray;
- // textboxHasText = false;
- // }
- // else
- // textboxHasText = true;
- //}
- #endregion
- }
- }
|