| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632 |
- 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 Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Control;
- using com.steering.mes.zgmil.entity;
- using Infragistics.Win.UltraWinGrid;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.ZGMil.NodeResultQuery;
- using Core.StlMes.Client.ZGMil.ResultConrtrol;
- using Core.StlMes.Client.ZGMil.Entity;
- using System.Net;
- using Core.StlMes.Client.ZGMil.Common;
- using Core.StlMes.Client.ZGMil.Popup;
- using CoreFS.SA06;
- namespace Core.StlMes.Client.ZGMil.Result
- {
- public partial class FrmStraighteningResult : FrmBase
- {
- #region 初始化
- private Infragistics.Win.UltraWinGrid.UltraGrid _grid = null;
- public Infragistics.Win.UltraWinGrid.UltraGrid Grid
- {
- get { return _grid; }
- }
- public FrmStraighteningResult()
- {
- InitializeComponent();
- }
- int PanelSizeFlag = 0;
- RollingInfomation rf = new RollingInfomation();
- FeedRowPlan QuertFeedplan = new FeedRowPlan();
- MilPlan QueryMainPlan = new MilPlan();
- FeedRowPlan Feedplan = new FeedRowPlan();
- MilPlan MainPlan = new MilPlan();
- SawResult FeedSawResult = new SawResult();
- string PlanStatusQuery = "79";
- string PlanStartStatusQuery = "00"; //查询结炉实绩起始状态
- MilStraighteningResultEntity StraighteningResult = new MilStraighteningResultEntity();
- private string ActiveJUDGE_STOVE_NO = null;//主计划活动行的判定炉号
- private string ActiveStatus = null;////主计划活动行的状态
- private string proPlanId = null;//轧管订单编号
- private string gxPlanNo = null;//工序排产序号
- private string lotNo = null;//生产批号
- private string ActiveOFFLINE_FLAG = null;
- private string ActiveResultNo = null;
- private string WorkStand = "";//工作台
- private string Departm = "";//部门
- private string PlineCode = "";//产线
- private string stoveno = "";
- private string lotno = "";
- private string Flage = "";//
- MilStraighteningResultEntity temprstraght = new MilStraighteningResultEntity();//保存当前实绩类
- private string offlinenode = "";
- private string Shift = "";
- private string Group = "";
- private string _User = "";
- private string _UserName = ""; //签名 姓名
- private string _Url = ""; //签名 Url
- private string _UserID = ""; //签名 签名ID
- private string ChangeUserID = "";
- private string beforeQualifiedNum = "";//上道工序合格支数
- private string qualifiedNum = "";//该工序合格支数
- private string scrapNum = "";//该工序废品支数
- private string offineHas = "";//已下线支数
- private string offineHead = "";//返线支数
- protected override void OnLoad(EventArgs e)
- {
- base.OnLoad(e);
- //取消卡片筛选
- rollingInfomation1.UltraGrid4.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- rollingCard1.UltraGrid4.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- straighteningResult1.UltraGrid2.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- frmStraighteningResult11.UltraGrid4.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- frmStraighteningResult21.UltraGrid2.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- ultraGridPlan.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- ultraGrid_GHDL1.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- ultraGrid_GHDL2.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- ultraGrid_GHDL3.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- //ChangeGridColor();
- InitControl();
- //PanelSizeFlag = 0;
- //splitContainer2.SplitterDistance = 180;
- foreach (UltraGridColumn ugc in ultraGridPlan.DisplayLayout.Bands[0].Columns)
- {
- ugc.SortIndicator = SortIndicator.Disabled;
- }
- }
- protected override void OnShown(EventArgs e)
- {
- base.OnShown(e);
- string hostname = Dns.GetHostName();
- IPAddress ip = Dns.GetHostByName(hostname).AddressList[0];
- NativeMethodNew na = new NativeMethodNew(this.ob);
- WorkStand = na.GetOperateResult(ip.ToString(), "1");
- if (!WorkStand.Contains("矫直"))
- {
- //MessageBox.Show("提示:该电脑不是矫直操作台电脑,不允许操作改界面", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- //this.Dispose();
- //this.Close();
- //return;
- }
- if (WorkStand.Contains("矫直") && WorkStand.Contains("1"))
- {
- offlinenode = "01";
- }
- if (WorkStand.Contains("矫直") && WorkStand.Contains("2"))
- {
- offlinenode = "02";
- }
- if (WorkStand.Contains("矫直") && WorkStand.Contains("3"))
- {
- offlinenode = "03";
- }
- Departm = UserInfo.GetDepartment();
- PlineCode = na.GetPCode(Departm);//获取 用户 对应的产线
- if (PlineCode.Equals("C009") || PlineCode.Equals("C012") || PlineCode.Equals("C017") || PlineCode.Equals("C072"))
- {
- this.rollingCard1.ChangCard();
- }
- PlanQuery();
- //foreach (UltraGridRow ugr in ultraGridPlan.Rows)
- //{
- // ugr.Cells["JUDGE_NO"].Value = BaseMethod.getJudgeStoveNo(ugr.Cells["JUDGE_STOVE_NO"].Value.ToString());
- //}
- Shift = UserInfo.GetUserOrder();
- Group = UserInfo.GetUserGroup();
- Sign();
- ShowShift();
- }
- private void ShowShift()
- {
- colShowShiftGroup1.Ob = this.ob;
- colShowShiftGroup1.Group = this.UserInfo.GetUserGroup();
- colShowShiftGroup1.Shift = this.UserInfo.GetUserOrder();
- colShowShiftGroup1.ShowShift();
- colShowShiftGroup1.Timer1.Enabled = true;
- }
- /// <summary>
- /// 初始化控件
- /// </summary>
- public void InitControl()
- {
- if (chkLotNo.Checked)
- {
- txtLOT_NO.Enabled = true;
- }
- else
- {
- txtLOT_NO.Enabled = false;
- }
- if (chkHeatNo.Checked)
- {
- txtJudgeStoveNo.Enabled = true;
- }
- else
- {
- txtJudgeStoveNo.Enabled = false;
- }
- }
- #endregion
- /// <summary>
- /// 签名
- /// </summary>
- private void Sign()
- {
- ColUserName col = new ColUserName();
- col.StationId = "7";
- col.PlineCode = PlineCode;
- col.ColGroup = Group;
- col.Ob = this.ob;
- col.ShowDialog();
- _UserID = col.getUserId();
- _UserName = col.getUserName();
- }
- /// <summary>
- /// 按钮事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="ToolbarKey"></param>
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- PlanQuery();
- break;
- case "Save":
- StraighteningSave();
- break;
- case "Node":
- StraighteningNode();
- break;
- case "DoNodeBack":
- NodeBack();
- break;
- case "NodeQuery":
- NodeQuery();
- break;
- case "colchang":
- colchang();
- break;
- case "DoChangeCancel":
- ChangeShiftBack();
- break;
- case "DoPrint":
- PrintResult();
- break;
- case "Dooffline":
- Offline();
- break;
- case "Doofflinre2":
- Offline2();
- break;
- case "Doofflinre3":
- Offline3();
- break;
- case "ReLine1":
- BackLine1();
- break;
- case "ReLine2":
- BackLine2();
- break;
- case "ReLine3":
- BackLine3();
- break;
- case "DoStart":
- DoStart();
- break;
- case "DoStartBack":
- StartBack();
- break;
- case "DoSign":
- Sign();
- break;
- case "Close":
- this.Dispose();
- this.Close();
- break;
- }
- }
- #region 辅助事件方法及赋值
- /// <summary>
- /// 修改IS_START名称
- /// </summary>
- public void ChangeCellName()
- {
- if (ultraGridPlan.Rows.Count > 0)
- {
- NativeMethodNew na = new NativeMethodNew(this.ob);
- foreach (UltraGridRow ugr in ultraGridPlan.Rows)
- {
- //String Judge_Stove_No = ugr.Cells["JUDGE_DTOVE_NO"].Value.ToString();
- //if (na.isBegineNode(Judge_Stove_No, 0))
- //{
- // ugr.Appearance.BackColor = Color.YellowGreen;
- //}
- if (ugr.Cells["IS_START"].Value.ToString() != "未开始矫直" && ugr.Cells["IS_START"].Value.ToString() != "已开始矫直" && ugr.Cells["IS_START"].Value.ToString() != "已完成矫直")
- {
- switch (Convert.ToInt32(ugr.Cells["IS_START"].Value))
- {
- case 3:
- ugr.Cells["IS_START"].Value = "未开始矫直";
- break;
- case 0:
- ugr.Cells["IS_START"].Value = "已开始矫直";
- break;
- case 1:
- ugr.Cells["IS_START"].Value = "已完成矫直";
- break;
- }
- }
- }
- }
- }
- public void ChangeGridColor()
- {
- foreach (UltraGridRow ugr in ultraGridPlan.Rows)
- {
- if (ugr.Cells["IS_START"].Value.ToString() == "已完成矫直")
- {
- ugr.Appearance.BackColor = Color.YellowGreen;
- }
- }
- if (ultraGrid_GHDL1.Rows.Count > 0)
- {
- foreach (UltraGridRow ugr in ultraGrid_GHDL1.Rows)
- {
- if (ugr != null)
- {
- switch (ugr.Cells["STATUS"].Value.ToString())
- {
- case "剔除":
- ugr.Appearance.BackColor = Color.Yellow;
- break;
- }
- switch (ugr.Cells["CHANGE_FLAG"].Value.ToString())
- {
- case "待接班确认":
- ugr.Appearance.BackColor = Color.LightGreen;
- break;
- }
- }
- }
- }
- if (ultraGrid_GHDL2.Rows.Count > 0)
- {
- foreach (UltraGridRow ugr in ultraGrid_GHDL2.Rows)
- {
- if (ugr != null)
- {
- switch (ugr.Cells["STATUS"].Value.ToString())
- {
- case "剔除":
- ugr.Appearance.BackColor = Color.Yellow;
- break;
- }
- switch (ugr.Cells["CHANGE_FLAG"].Value.ToString())
- {
- case "待接班确认":
- ugr.Appearance.BackColor = Color.LightGreen;
- break;
- }
- }
- }
- }
- if (ultraGrid_GHDL3.Rows.Count > 0)
- {
- foreach (UltraGridRow ugr in ultraGrid_GHDL3.Rows)
- {
- if (ugr != null)
- {
- switch (ugr.Cells["STATUS"].Value.ToString())
- {
- case "剔除":
- ugr.Appearance.BackColor = Color.Yellow;
- break;
- }
- switch (ugr.Cells["CHANGE_FLAG"].Value.ToString())
- {
- case "待接班确认":
- ugr.Appearance.BackColor = Color.LightGreen;
- break;
- }
- }
- }
- }
- }
- private void chkLotNo_CheckedChanged(object sender, EventArgs e)
- {
- this.txtLOT_NO.Enabled = this.chkLotNo.Checked;
- }
- private void chkHeatNo_CheckedChanged(object sender, EventArgs e)
- {
- if (this.chkHeatNo.Checked)
- {
- this.txtJudgeStoveNo.Enabled = true;
- }
- else
- {
- this.txtJudgeStoveNo.Enabled = false;
- }
- if (chkStatusQuery.Checked)
- {
- PlanStatusQuery = "99";
- PlanStartStatusQuery = "80";
- }
- else
- {
- PlanStatusQuery = "79";
- PlanStartStatusQuery = "00";
- }
- }
- /// <summary>
- /// 流通卡赋值
- /// </summary>
- /// <param name="dt"></param>
- public void RollingCardEditGrid(DataTable dt, string heatno)
- {
- if (dt.Rows.Count > 0)
- {
- //上料切前剔除支数
- this.rollingCard1.Value.FeedScrapNum = dt.Rows[0]["SCRAP_FEED"].ToString();
- //上料切前合格支数
- this.rollingCard1.Value.FeedQualifiedNum = dt.Rows[0]["QUALIFIED_FEED"].ToString();
- //上料剔除支数
- this.rollingCard1.Value.FeedScrapDBNum = dt.Rows[0]["SCRAP_DBFEED"].ToString();
- //上料合格支数
- this.rollingCard1.Value.FeedQualifiedDBNum = dt.Rows[0]["QUALIFIED_DBFEED"].ToString();
- //加热炉剔除支数
- this.rollingCard1.Value.FurScrapNum = dt.Rows[0]["SCRAP_FUR"].ToString();
- //加热炉合格支数
- this.rollingCard1.Value.FurQualifiedNum = dt.Rows[0]["QUALIFIED_FUR"].ToString();
- //穿孔剔除支数
- this.rollingCard1.Value.PerScrapNum = dt.Rows[0]["SCRAP_PER"].ToString();
- //穿孔合格支数
- this.rollingCard1.Value.PerQualifiedNum = dt.Rows[0]["QUALIFIED_PER"].ToString();
- //连轧剔除支数
- this.rollingCard1.Value.RollingScrapNum = dt.Rows[0]["SCRAP_ROLLING"].ToString();
- //连轧合格支数
- this.rollingCard1.Value.RollingQualifiedNum = dt.Rows[0]["QUALIFIED_ROLLING"].ToString();
- //再加热炉剔除支数
- this.rollingCard1.Value.RefurScrapNum = dt.Rows[0]["SCRAP_REFUR"].ToString();
- //再加热炉合格支数
- this.rollingCard1.Value.RefurQualifiedNum = dt.Rows[0]["QUALIFIED_REFUR"].ToString();
- //定径剔除支数
- this.rollingCard1.Value.SizingScrapNum = dt.Rows[0]["SCRAP_SIZING"].ToString();
- //定径合格支数
- this.rollingCard1.Value.SizingQualifiedNum = dt.Rows[0]["QUALIFIED_SIZING"].ToString();
- //分切前剔除支数
- this.rollingCard1.Value.SawScrapNumBE = dt.Rows[0]["SCRAP_SAW_BE"].ToString();
- //分切前合格支数
- this.rollingCard1.Value.SawQualifiedNumBE = dt.Rows[0]["QUALIFIED_SAW_BE"].ToString();
- //分切剔除支数
- this.rollingCard1.Value.SawScrapNum = dt.Rows[0]["SCRAP_SAW"].ToString();
- //分切合格支数
- this.rollingCard1.Value.SawQualifiedNum = dt.Rows[0]["QUALIFIED_SAW"].ToString();
- //矫直剔除支数
- this.rollingCard1.Value.StraightScrapNum = dt.Rows[0]["SCRAP_STRAIGHT"].ToString();
- //矫直合格支数
- this.rollingCard1.Value.StraightQualifiedNum = dt.Rows[0]["QUALIFIED_STRAIGHT"].ToString();
- //矫直下线支数
- this.rollingCard1.Value.OfflineStraight = dt.Rows[0]["OFFLINE_STRAIGHT"].ToString();
- //矫直返线支数
- this.rollingCard1.Value.BacklineStraight = dt.Rows[0]["BACKLINE_STRAIGHT"].ToString();
- //探伤剔除支数
- this.rollingCard1.Value.TestingScrapNum = dt.Rows[0]["SCRAP_TESTING"].ToString();
- //探伤合格支数
- this.rollingCard1.Value.TestingQualifiedNum = dt.Rows[0]["QUALIFIED_TESTING"].ToString();
- NativeMethodNew na = new NativeMethodNew(this.ob);
- if (na.isBegineNode(heatno, 8) || na.isBegineNode(heatno, 9) || na.isBegineNode(heatno, 10))
- {
- //探伤下线支数
- this.rollingCard1.Value.OfflineTesting = dt.Rows[0]["OFFLINE_TESTING"].ToString();
- this.rollingCard1.Value.BacklineTesting = dt.Rows[0]["BACKLINE_TESTING"].ToString();
- }
- else
- {
- if (dt.Rows[0]["OFFLINE_TESTING"].ToString() == "0")
- {
- this.rollingCard1.Value.OfflineTesting = "";
- this.rollingCard1.Value.BacklineTesting = "";
- }
- else
- {
- //探伤下线支数
- this.rollingCard1.Value.OfflineTesting = dt.Rows[0]["OFFLINE_TESTING"].ToString();
- this.rollingCard1.Value.BacklineTesting = dt.Rows[0]["BACKLINE_TESTING"].ToString();
- }
- }
- this.rollingCard1.UpdateData();
- }
- else
- {
- this.rollingCard1.ClearData();
- }
- }
- /// <summary>
- /// 流通卡赋值
- /// </summary>
- /// <param name="dt"></param>
- public void RollingCardEditGrid1(DataTable dt, string heatno)
- {
- if (dt.Rows.Count > 0)
- {
- //矫直剔除支数
- this.rollingCard1.Value.StraightScrapNum = dt.Rows[0]["SCRAP_STRAIGHT"].ToString();
- //矫直合格支数
- this.rollingCard1.Value.StraightQualifiedNum = dt.Rows[0]["QUALIFIED_STRAIGHT"].ToString();
- //矫直下线支数
- this.rollingCard1.Value.OfflineStraight = dt.Rows[0]["OFFLINE_STRAIGHT"].ToString();
- //矫直返线支数
- this.rollingCard1.Value.BacklineStraight = dt.Rows[0]["BACKLINE_STRAIGHT"].ToString();
- //探伤剔除支数
- this.rollingCard1.Value.TestingScrapNum = dt.Rows[0]["SCRAP_TESTING"].ToString();
- //探伤合格支数
- this.rollingCard1.Value.TestingQualifiedNum = dt.Rows[0]["QUALIFIED_TESTING"].ToString();
- NativeMethodNew na = new NativeMethodNew(this.ob);
- if (na.isBegineNode(heatno, 8) || na.isBegineNode(heatno, 9) || na.isBegineNode(heatno, 10))
- {
- //探伤下线支数
- this.rollingCard1.Value.OfflineTesting = dt.Rows[0]["OFFLINE_TESTING"].ToString();
- this.rollingCard1.Value.BacklineTesting = dt.Rows[0]["BACKLINE_TESTING"].ToString();
- }
- else
- {
- if (dt.Rows[0]["OFFLINE_TESTING"].ToString() == "0")
- {
- this.rollingCard1.Value.OfflineTesting = "";
- this.rollingCard1.Value.BacklineTesting = "";
- }
- else
- {
- //探伤下线支数
- this.rollingCard1.Value.OfflineTesting = dt.Rows[0]["OFFLINE_TESTING"].ToString();
- this.rollingCard1.Value.BacklineTesting = dt.Rows[0]["BACKLINE_TESTING"].ToString();
- }
- }
- this.rollingCard1.UpdateData();
- }
- else
- {
- this.rollingCard1.ClearData();
- }
- }
- public void RollingCardClear()
- {
- //上料切前剔除支数
- this.rollingCard1.Value.FeedScrapNum = "";
- //上料切前合格支数
- this.rollingCard1.Value.FeedQualifiedNum = "";
- //上料剔除支数
- this.rollingCard1.Value.FeedScrapDBNum = "";
- //上料合格支数
- this.rollingCard1.Value.FeedQualifiedDBNum = "";
- //加热炉剔除支数
- this.rollingCard1.Value.FurScrapNum = "";
- //加热炉合格支数
- this.rollingCard1.Value.FurQualifiedNum = "";
- //穿孔剔除支数
- this.rollingCard1.Value.PerScrapNum = "";
- //穿孔合格支数
- this.rollingCard1.Value.PerQualifiedNum = "";
- //连轧剔除支数
- this.rollingCard1.Value.RollingScrapNum = "";
- //连轧合格支数
- this.rollingCard1.Value.RollingQualifiedNum = "";
- //再加热炉剔除支数
- this.rollingCard1.Value.RefurScrapNum = "";
- //再加热炉合格支数
- this.rollingCard1.Value.RefurQualifiedNum = "";
- //定径剔除支数
- this.rollingCard1.Value.SizingScrapNum = "";
- //定径合格支数
- this.rollingCard1.Value.SizingQualifiedNum = "";
- //分切前剔除支数
- this.rollingCard1.Value.SawScrapNumBE = "";
- //分切前合格支数
- this.rollingCard1.Value.SawQualifiedNumBE = "";
- //分切剔除支数
- this.rollingCard1.Value.SawScrapNum = "";
- //分切合格支数
- this.rollingCard1.Value.SawQualifiedNum = "";
- //矫直剔除支数
- this.rollingCard1.Value.StraightScrapNum = "";
- //矫直合格支数
- this.rollingCard1.Value.StraightQualifiedNum = "";
- //矫直下线支数
- this.rollingCard1.Value.OfflineStraight = "";
- //矫直返线支数
- this.rollingCard1.Value.BacklineStraight = "";
- //探伤剔除支数
- this.rollingCard1.Value.TestingScrapNum = "";
- //探伤合格支数
- this.rollingCard1.Value.TestingQualifiedNum = "";
- //探伤下线支数
- this.rollingCard1.Value.OfflineTesting = "";
- this.rollingCard1.Value.BacklineTesting = "";
- this.rollingCard1.UpdateData();
- }
-
-
- /// <summary>
- /// 轧制信息Grid赋值
- /// </summary>
- /// <param name="dt">轧制计划信息datatable</param>
- public void GridEdit(DataTable dt)
- {
- if (dt.Rows.Count > 0)
- {
- DataRow row1 = dt.Rows[0];
- //熔炼炉号
- this.rollingInfomation1.Value.StoveNo = row1["stove_no"].ToString();
- //炉号
- this.rollingInfomation1.Value.JudgeStoveNo = BaseMethod.getJudgeStoveNo(row1["judge_stove_no"].ToString());
- //生产批号
- this.rollingInfomation1.Value.LotNo = row1["lot_no"].ToString();
- //工序合同号
- this.rollingInfomation1.Value.ContractNo = row1["contract_no"].ToString();
- //执行工艺号
- this.rollingInfomation1.Value.ImpProcess = row1["imp_process"].ToString();
- //执行工艺号路径
- this.rollingInfomation1.Value.ImpProcessPath = row1["imp_process_path"].ToString();
- //产线代码
- this.rollingInfomation1.Value.PlineCode = row1["pline_code"].ToString();
- //状态
- this.rollingInfomation1.Value.Status = row1["STATUS"].ToString();
- //监制
- this.rollingInfomation1.Value.Producer = row1["producer"].ToString();
- //工艺状态
- this.rollingInfomation1.Value.ProcessStatus = row1["process_status"].ToString();
- //单倍长
- this.rollingInfomation1.Value.DbLength = row1["db_length"].ToString();
- //单倍重
- this.rollingInfomation1.Value.DbHeight = row1["db_height"].ToString();
- //轧制长度
- this.rollingInfomation1.Value.RollLength = row1["roll_length"].ToString();
- //分切数
- this.rollingInfomation1.Value.SawNum = row1["saw_num"].ToString();
- //目标长度
- this.rollingInfomation1.Value.TargetLength = row1["target_length"].ToString();
- //最终用户
- this.rollingInfomation1.Value.FinishUser = row1["finish_user"].ToString();
- //目标库
- this.rollingInfomation1.Value.TargetLiabrary = row1["target_liabrary"].ToString();
- //品种
- this.rollingInfomation1.Value.Varieties = row1["varieties"].ToString();
- //成品规格
- this.rollingInfomation1.Value.PipeSize = row1["pipe_size"].ToString();
- //扣型
- this.rollingInfomation1.Value.BuckleType = row1["buckle_type"].ToString();
- //长度范围
- this.rollingInfomation1.Value.LengthRange = row1["length_range"].ToString();
- //轧管判定标准
- this.rollingInfomation1.Value.RollStandrad = row1["roll_standrad"].ToString();
- //断面
- this.rollingInfomation1.Value.PipeSection = row1["pipe_section"].ToString();
- //钢种代码
- this.rollingInfomation1.Value.SteelCode = row1["steelcode"].ToString();
- //钢种名称
- this.rollingInfomation1.Value.SteelName = row1["steelname"].ToString();
- //钢级代码
- this.rollingInfomation1.Value.GradeCode = row1["gradecode"].ToString();
- //钢级名称
- this.rollingInfomation1.Value.GradeName = row1["gradename"].ToString();
- //炼钢判定标准
- this.rollingInfomation1.Value.SteelStandrad = row1["steel_standrad"].ToString();
- //去向
- this.rollingInfomation1.Value.Target = row1["target"].ToString();
- //支
- this.rollingInfomation1.Value.PlanNum = row1["BRANCH"].ToString();
- //吨
- this.rollingInfomation1.Value.PlanTon = row1["TON"].ToString();
- //切损去向
- this.rollingInfomation1.Value.CutTarget = row1["cut_target"].ToString();
- //切损长度
- this.rollingInfomation1.Value.CutLength = row1["cut_length"].ToString();
- //切损重量
- this.rollingInfomation1.Value.CutHeight = row1["CUT_WEIGHT"].ToString();
- //倍尺数
- this.rollingInfomation1.Value.DbNum = row1["DB_NUM"].ToString();
- //标准类别代码
- this.rollingInfomation1.Value.StdStyle = row1["STD_STYLE"].ToString();
- //标准类别描述
- this.rollingInfomation1.Value.StdStyleDesc = row1["STD_STYLE_DESC"].ToString();
- //成品备注
- this.rollingInfomation1.Value.ReMark = row1["ReMark"].ToString();
- this.rollingInfomation1.UpdateData();
- }
- }
- /// <summary>
- /// 流通卡赋值
- /// </summary>
- public void GetRollingCard()
- {
- UltraGridRow ugr = ultraGridPlan.ActiveRow;
- if (ugr != null)
- {
- string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
- DataTable dt = new DataTable();
- if (PlineCode.Equals("C009") || PlineCode.Equals("C012") || PlineCode.Equals("C017"))
- {
- dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getRollingCard1", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob);
- }
- else
- {
- dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getRollingCard", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob);
- }
- RollingCardEditGrid(dt, JudgeStoveNo);
- }
- }
- /// <summary>
- /// 流通卡赋值
- /// </summary>
- public void GetRollingCard1()
- {
- UltraGridRow ugr = ultraGridPlan.ActiveRow;
- if (ugr != null)
- {
- string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
- DataTable dt = new DataTable();
- if (PlineCode.Equals("C009") || PlineCode.Equals("C012") || PlineCode.Equals("C017"))
- {
- dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getRollingCard1BackLine", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob);
- }
- else
- {
- dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getRollingStaCard1", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob);
- }
- RollingCardClear();
- RollingCardEditGrid1(dt, JudgeStoveNo);
- }
- }
- /// <summary>
- /// 查询跟踪记录信息
- /// </summary>
- public void ultraGridTC()
- {
- if (this.dtPlan.Rows.Count > 0)
- {
- this.dtTC1.Rows.Clear();
- this.dtTC2.Rows.Clear();
- this.dtTC3.Rows.Clear();
- UltraGridRow ugr = ultraGridPlan.ActiveRow;
- string flagstatus = "0";
- if (this.ActiveStatus.Equals("已完成矫直"))
- {
- flagstatus = "1";
- }
- //UltraGridRow ugr = e.Row;
- if (ugr != null)
- {
- string HeatNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
- MainPlan.JudgeStoveNo = HeatNo;
- DataTable dtMP1 = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.getSingleMainPlanTC1", new object[] { MainPlan, flagstatus }, this.ob);
- DataTable dtMP2 = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.getSingleMainPlanTC2", new object[] { MainPlan, flagstatus }, this.ob);
- DataTable dtMP3 = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.getSingleMainPlanTC3", new object[] { MainPlan, flagstatus }, this.ob);
- if (dtMP1.Rows.Count > 0)
- {
- //this.ultraTabControl2
- this.ultraTabControl2.Tabs[0].Visible = true;
- if (this.ultraTabControl1.Tabs[1].Visible == true)
- {
- this.frmStraighteningResult11.Using1();
- }
- GridHelper.CopyDataToDatatable(ref dtMP1, ref this.dtTC1, true);
- //ultraGrid_GHDL1.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.AllRowsInBand);
- if (ultraGrid_GHDL1.Rows.Count > 0)
- {
- foreach (UltraGridRow ugr1 in ultraGrid_GHDL1.Rows)
- {
- ugr1.Cells["SCRAP_SLAB"].Value = "剔除钢管";
- ugr1.Cells["DELBACK"].Value = "剔料回退";
- ugr1.Cells["ChangShift"].Value = "交班操作";
- ugr1.Cells["BTNCHANGECOM"].Value = "接班操作";
- }
- }
- }
- else
- {
- this.ultraTabControl2.Tabs[0].Visible = false;
- if (this.ultraTabControl1.Tabs[1].Visible == true)
- {
- this.frmStraighteningResult11.NoUsing1();
- }
- }
- if (dtMP2.Rows.Count > 0)
- {
- this.ultraTabControl2.Tabs[1].Visible = true;
- if (this.ultraTabControl1.Tabs[1].Visible == true)
- {
- this.frmStraighteningResult11.Using2();
- }
- GridHelper.CopyDataToDatatable(ref dtMP2, ref this.dtTC2, true);
- //ultraGrid_GHDL2.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.AllRowsInBand);
- if (ultraGrid_GHDL2.Rows.Count > 0)
- {
- foreach (UltraGridRow ugr1 in ultraGrid_GHDL2.Rows)
- {
- ugr1.Cells["SCRAP_SLAB"].Value = "剔除钢管";
- ugr1.Cells["DELBACK"].Value = "剔料回退";
- ugr1.Cells["ChangShift"].Value = "交班操作";
- ugr1.Cells["BTNCHANGECOM"].Value = "接班操作";
- }
- }
- }
- else
- {
- this.ultraTabControl2.Tabs[1].Visible = false;
- if (this.ultraTabControl1.Tabs[1].Visible == true)
- {
- this.frmStraighteningResult11.NoUsing2();
- }
- }
- if (dtMP3.Rows.Count > 0)
- {
- this.ultraTabControl2.Tabs[2].Visible = true;
- GridHelper.CopyDataToDatatable(ref dtMP3, ref this.dtTC3, true);
- //ultraGrid_GHDL3.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.AllRowsInBand);
- if (ultraGrid_GHDL3.Rows.Count > 0)
- {
- foreach (UltraGridRow ugr1 in ultraGrid_GHDL3.Rows)
- {
- ugr1.Cells["SCRAP_SLAB"].Value = "剔除钢管";
- ugr1.Cells["DELBACK"].Value = "剔料回退";
- ugr1.Cells["ChangShift"].Value = "交班操作";
- ugr1.Cells["BTNCHANGECOM"].Value = "接班操作";
- }
- }
- }
- else
- {
- this.ultraTabControl2.Tabs[2].Visible = false;
- }
- ChangeGridColor();
- }
- }
- }
- /// <summary>
- /// 更新矫直实绩
- /// </summary>
- /// <param name="heatNo"></param>
- /// <param name="PliceCode"></param>
- public void GetStraightResult(string heatNo, string PliceCode)
- {
- StraighteningResult.Clear();
- string strheatno = heatNo;
- string factoryId = PliceCode;
- DataTable dtResult = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.getPerResult", new object[] { strheatno, proPlanId, gxPlanNo }, this.ob);
- if (dtResult.Rows.Count > 0)
- {
- //获取表里相应的字段值到类中
- StraighteningResult = NativeMethod.GetTableToEntity(dtResult, StraighteningResult);
- if (factoryId == "C010")//168三个矫直台
- {
- ultraTabControl1.Tabs[0].Visible = true;
- ultraTabControl1.Tabs[1].Visible = false;
- ultraTabControl1.Tabs[2].Visible = false;
- //ultraTabControl2.Tabs[0].Visible = true;
- //ultraTabControl2.Tabs[1].Visible = true;
- //ultraTabControl2.Tabs[2].Visible = true;
- //设置168机组控件(straighteningResult1)值
- this.straighteningResult1.Value = StraighteningResult;
- if (WorkStand.Contains("矫直") && WorkStand.Contains("1"))
- {
- //this.straighteningResult1.NoUsing2();
- //this.straighteningResult1.NoUsing3();
- Flage = "1";
- }
- if (WorkStand.Contains("矫直") && WorkStand.Contains("2"))
- {
- //this.straighteningResult1.NoUsing1();
- //this.straighteningResult1.NoUsing3();
- Flage = "2";
- }
- if (WorkStand.Contains("矫直") && WorkStand.Contains("3"))
- {
- //this.straighteningResult1.NoUsing1();
- //this.straighteningResult1.NoUsing2();
- Flage = "3";
- }
- }
- else
- {
- if (factoryId == "C017")//460两个矫直台
- {
- ultraTabControl1.Tabs[0].Visible = false;
- ultraTabControl1.Tabs[1].Visible = false;
- ultraTabControl1.Tabs[2].Visible = true;
- //ultraTabControl1.Tabs[0].Visible = false;
- //ultraTabControl1.Tabs[1].Visible = true;
- //ultraTabControl1.Tabs[2].Visible = false;
- //ultraTabControl2.Tabs[0].Visible = true;
- //ultraTabControl2.Tabs[1].Visible = true;
- //ultraTabControl2.Tabs[2].Visible = false;
- // 设置460机组控件(frmStraighteningResult21)值
- this.frmStraighteningResult21.Value = StraighteningResult;
- //this.frmStraighteningResult11.Value = StraighteningResult;
- if (WorkStand.Contains("矫直") && WorkStand.Contains("1"))
- {
- //this.frmStraighteningResult21.NoUsing2();
- Flage = "1";
- }
- if (WorkStand.Contains("矫直") && WorkStand.Contains("2"))
- {
- //this.frmStraighteningResult21.NoUsing1();
- Flage = "2";
- }
- }
- else//2 个矫直台
- {
- ultraTabControl1.Tabs[0].Visible = false;
- ultraTabControl1.Tabs[1].Visible = true;
- ultraTabControl1.Tabs[2].Visible = false;
- //ultraTabControl2.Tabs[0].Visible = true;
- //ultraTabControl2.Tabs[1].Visible = true;
- //ultraTabControl2.Tabs[2].Visible = false;
- // 设置其他机组控件值
- this.frmStraighteningResult11.Value = StraighteningResult;
- if (WorkStand.Contains("矫直") && WorkStand.Contains("1"))
- {
- //this.frmStraighteningResult11.NoUsing2();
- Flage = "1";
- }
- if (WorkStand.Contains("矫直") && WorkStand.Contains("2"))
- {
- //this.frmStraighteningResult11.NoUsing1();
- Flage = "2";
- }
- }
- }
- }
- else
- {
- this.straighteningResult1.Value = StraighteningResult;
- this.frmStraighteningResult21.Value = StraighteningResult;
- this.frmStraighteningResult11.Value = StraighteningResult;
- }
- }
-
- #endregion
- #region 事件方法
- /// <summary>
- /// 主计划查询
- /// </summary>
- public void PlanQuery()
- {
- string PrimaKey = "";
- UltraGridRow ugr = this.ultraGridPlan.ActiveRow;
- if (ugr != null)
- {
- PrimaKey = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
- }
- if (chkHeatNo.Checked == true)
- {
- if (this.txtJudgeStoveNo.Text == "")
- {
- MessageBox.Show("请输入炉号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- else
- {
- QueryMainPlan.JudgeStoveNo = this.txtJudgeStoveNo.Text;
- }
- }
- else
- {
- QueryMainPlan.JudgeStoveNo = "";
- }
- if (chkLotNo.Checked == true)
- {
- if (this.txtLOT_NO.Text == "")
- {
- MessageBox.Show("请输入生产批号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- else
- {
- QueryMainPlan.LotNo = this.txtLOT_NO.Text;
- }
- }
- else
- {
- QueryMainPlan.LotNo = "";
- }
- dtPlan.Rows.Clear();
- //ChangeGridColor();
- //查询主表记录
- QueryMainPlan.PlineCode = PlineCode;
- QueryMainPlan.Status = PlanStatusQuery;
- QueryMainPlan.StartStatus = PlanStartStatusQuery;
- DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlan", new object[] { QueryMainPlan, 8 }, this.ob);
- if (dt.Rows.Count == 0)
- {
- MessageBox.Show("未查询到匹配的数据,请重新查询!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- else
- {
- GridHelper.CopyDataToDatatable(ref dt, ref dtPlan, true);
- //ultraGridPlan.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.AllRowsInBand);
- ChangeCellName();
- ChangeGridColor();
- //this.ultraGridPlan.ActiveRow = null;
- if (ugr != null)
- {
- foreach (UltraGridRow ugr1 in ultraGridPlan.Rows)
- {
- ugr1.Cells["JUDGE_NO"].Value = BaseMethod.getJudgeStoveNo(ugr1.Cells["JUDGE_STOVE_NO"].Value.ToString());
- if (ugr1.Cells["JUDGE_STOVE_NO"].Value.ToString() == PrimaKey)
- {
- this.ultraGridPlan.ActiveRow = ugr1;
- }
- }
- }
- }
- }
- private String doQueryJugeNoStaus(string resultNo, string jugeNo, string plineCode)
- {
- string staus = "3";
- DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.doQueryResultStaus", new object[] { resultNo, jugeNo, plineCode, "6", proPlanId, gxPlanNo }, ob);
- if (ds.Rows.Count > 0)
- {
- staus = ds.Rows[0]["NODE_FUR_FLAG"].ToString();
- }
- return staus;
- }
- /// <summary>
- /// 主表单击事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraGridPlan_AfterRowActivate(object sender, EventArgs e)
- {
- if (this.dtPlan.Rows.Count > 0)
- {
- UltraGridRow ugr = ultraGridPlan.ActiveRow;
- //UltraGridRow ugr = e.Row;
- if (ugr != null)
- {
- //查询主计划信息
- string HeatNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
- string resultNo = ugr.Cells["ID"].Value.ToString();
- proPlanId = ugr.Cells["PRO_PLAN_ID"].Value.ToString();
- gxPlanNo = ugr.Cells["GX_PLAN_NO"].Value.ToString();
- lotNo = ugr.Cells["LOT_NO"].Value.ToString();
- MainPlan.JudgeStoveNo = HeatNo;
- MainPlan.ProPlanId = proPlanId;
- MainPlan.GxPlanNo = gxPlanNo;
- ActiveJUDGE_STOVE_NO = HeatNo;
- //string Status = ugr.Cells["IS_START"].Value.ToString();
- string Status = doQueryJugeNoStaus(resultNo, HeatNo,PlineCode);
- ActiveStatus = Status;
- string PCode = ugr.Cells["Pline_Code"].Value.ToString();
- PlineCode = PCode;
- DataTable dtMP = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlanForHeatNo", new object[] { MainPlan }, this.ob);
- if (dtMP.Rows.Count > 0)
- {
- ActiveResultNo = dtMP.Rows[0]["ID"].ToString();
- ActiveOFFLINE_FLAG = dtMP.Rows[0]["OFFLINE_FLAG"].ToString();
- if (dtMP.Rows[0]["PLINE_CODE"].ToString() == "C010")
- {
- ultraTabControl1.Tabs[0].Visible = true;
- ultraTabControl1.Tabs[1].Visible = false;
- ultraTabControl1.Tabs[2].Visible = false;
- }
- else
- {
- if (dtMP.Rows[0]["PLINE_CODE"].ToString() == "C017")
- {
- ultraTabControl1.Tabs[0].Visible = false;
- ultraTabControl1.Tabs[1].Visible = false;
- ultraTabControl1.Tabs[2].Visible = true;
- }
- else
- {
- ultraTabControl1.Tabs[0].Visible = false;
- ultraTabControl1.Tabs[1].Visible = true;
- ultraTabControl1.Tabs[2].Visible = false;
- }
- }
- PlineCode = dtMP.Rows[0]["PLINE_CODE"].ToString();
- GridEdit(dtMP); //轧制计划信息
- this.stoveno = dtMP.Rows[0]["STOVE_NO"].ToString();
- this.lotno = dtMP.Rows[0]["LOT_NO"].ToString();
- }
- if (Status != "3")//查询跟踪记录表
- {
- ultraGridTC();
- }
- else
- {
- dtTC1.Rows.Clear();
- dtTC2.Rows.Clear();
- dtTC3.Rows.Clear();
- }
- DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.getSingePlanFlag", new object[] { ActiveJUDGE_STOVE_NO, proPlanId, gxPlanNo }, ob);
- GetStraightResult(HeatNo, PlineCode);//更新实绩
- if (ds.Rows[0]["BACK_PLAN_FLAG"].ToString().Equals("7"))
- {
- GetRollingCard1();//更新流通卡
- }
- else
- {
- GetRollingCard();//更新流通卡
- }
- ChangeGridColor();
- if (Status == "3" || Status == "1")//查询跟踪记录表
- {
- return;
- }
- UltraGridRow ugr_plan = this.ultraGridPlan.ActiveRow;
- UltraGridRow ugr_roll = this.rollingCard1.UltraGrid4.Rows[0];
- string JudgeStoveNo = ugr_plan.Cells["JUDGE_STOVE_NO"].Value.ToString();
- Status = ugr_plan.Cells["IS_START"].Value.ToString();
- //查看结炉标识
- DataTable dtFlag = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetSingleJRLResult", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob);
- if (dtFlag.Rows.Count > 0)
- {
- if (string.IsNullOrEmpty(dtFlag.Rows[0]["NODE_FUR_FLAG"].ToString()))
- {
- //MessageBox.Show("炉号【" + JudgeStoveNo + "】未开始分切,不允许结炉", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (dtFlag.Rows[0]["NODE_FUR_FLAG"].ToString() != "1")
- {
- //MessageBox.Show("炉号【" + JudgeStoveNo + "】不能结炉,分切未完成。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- }
- else
- {
- return;
- }
- StraighteningResult.Clear();
- if (PlineCode == "C010")
- {
- this.straighteningResult1.UltraGrid2.UpdateData();
- StraighteningResult = NativeMethod.GetUltraGridToEntityNEW(this.straighteningResult1.UltraGrid2, StraighteningResult);
- int i = 0; int j = 0; int k = 0;
- if (ultraGrid_GHDL1.Rows.Count > 0)
- {
- foreach (UltraGridRow ugr1 in ultraGrid_GHDL1.Rows)
- {
- if (!string.IsNullOrEmpty(ugr1.Cells["MAT_NO"].Value.ToString()))
- {
- i = i + 1;
- }
- }
- }
- if (ultraGrid_GHDL2.Rows.Count > 0)
- {
- foreach (UltraGridRow ugr1 in ultraGrid_GHDL2.Rows)
- {
- if (!string.IsNullOrEmpty(ugr1.Cells["MAT_NO"].Value.ToString()))
- {
- j = j + 1;
- }
- }
- }
- if (ultraGrid_GHDL3.Rows.Count > 0)
- {
- foreach (UltraGridRow ugr1 in ultraGrid_GHDL3.Rows)
- {
- if (!string.IsNullOrEmpty(ugr1.Cells["MAT_NO"].Value.ToString()))
- {
- k = k + 1;
- }
- }
- }
- StraighteningResult.QualifiedNum1 = i - int.Parse(StraighteningResult.ScrapNum1.ToString());
- StraighteningResult.QualifiedNum2 = j - int.Parse(StraighteningResult.ScrapNum2.ToString());
- StraighteningResult.QualifiedNum3 = k - int.Parse(StraighteningResult.ScrapNum3.ToString());
- }
- else
- {
- if (PlineCode == "C017")
- {
- this.frmStraighteningResult21.UltraGrid2.UpdateData();
- StraighteningResult = NativeMethod.GetUltraGridToEntityNEW(this.frmStraighteningResult21.UltraGrid2, StraighteningResult);
- int i = 0; int j = 0; int k = 0;
- if (ultraGrid_GHDL1.Rows.Count > 0)
- {
- foreach (UltraGridRow ugr1 in ultraGrid_GHDL1.Rows)
- {
- if (!string.IsNullOrEmpty(ugr1.Cells["MAT_NO"].Value.ToString()))
- {
- i = i + 1;
- }
- }
- }
- if (ultraGrid_GHDL2.Rows.Count > 0)
- {
- foreach (UltraGridRow ugr1 in ultraGrid_GHDL2.Rows)
- {
- if (!string.IsNullOrEmpty(ugr1.Cells["MAT_NO"].Value.ToString()))
- {
- j = j + 1;
- }
- }
- }
- StraighteningResult.QualifiedNum1 = i - int.Parse(StraighteningResult.ScrapNum1.ToString());
- StraighteningResult.QualifiedNum2 = j - int.Parse(StraighteningResult.ScrapNum2.ToString());
- }
- else
- {
- this.frmStraighteningResult11.UltraGrid4.UpdateData();
- StraighteningResult = NativeMethod.GetUltraGridToEntityNEW(this.frmStraighteningResult11.UltraGrid4, StraighteningResult);
- int i = 0; int j = 0; int k = 0;
- if (ultraGrid_GHDL1.Rows.Count > 0)
- {
- foreach (UltraGridRow ugr1 in ultraGrid_GHDL1.Rows)
- {
- if (!string.IsNullOrEmpty(ugr1.Cells["MAT_NO"].Value.ToString()))
- {
- i = i + 1;
- }
- }
- }
- if (ultraGrid_GHDL2.Rows.Count > 0)
- {
- foreach (UltraGridRow ugr1 in ultraGrid_GHDL2.Rows)
- {
- if (!string.IsNullOrEmpty(ugr1.Cells["MAT_NO"].Value.ToString()))
- {
- j = j + 1;
- }
- }
- }
- StraighteningResult.QualifiedNum1 = i - int.Parse(StraighteningResult.ScrapNum1.ToString());
- StraighteningResult.QualifiedNum2 = j - int.Parse(StraighteningResult.ScrapNum2.ToString());
- }
- }
- if (ds.Rows[0]["BACK_PLAN_FLAG"].ToString().Equals("7"))
- {
- StraighteningResult.InMatNum = ds.Rows[0]["BRANCH"].ToString();
- if (int.Parse(StraighteningResult.InMatNum.ToString()) >= int.Parse(ugr_roll.Cells["ScrapNum11"].Value.ToString()))
- {
- StraighteningResult.QualifiedNum = int.Parse(StraighteningResult.InMatNum.ToString()) - int.Parse(this.rollingCard1.Value.OfflineStraight.ToString2()) - int.Parse(this.rollingCard1.Value.StraightScrapNum.ToString2());
- }
- }
- else
- {
- if (!string.IsNullOrEmpty(ugr_roll.Cells["QualifiedNum10"].Value.ToString()))
- {
- //来料支数
- StraighteningResult.InMatNum = ugr_roll.Cells["QualifiedNum10"].Value.ToString();
- }
- if (int.Parse(StraighteningResult.InMatNum.ToString()) > int.Parse(ugr_roll.Cells["ScrapNum11"].Value.ToString()))
- {
- StraighteningResult.QualifiedNum = int.Parse(StraighteningResult.InMatNum.ToString()) - int.Parse(this.rollingCard1.Value.OfflineStraight.ToString2()) - int.Parse(this.rollingCard1.Value.StraightScrapNum.ToString2());
- }
- }
- //else
- //{
- // MessageBox.Show("存在上一道工序已经剔除的管坯在本道工序也剔除了,请回退后再进行结炉操作", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- // return;
- //}
- //合格吨
- double DBHeight = 0;
- double BurnningRate = 0;
- double BurnningRate1 = 0;
- double DBNum = 1;
- NativeMethodNew na = new NativeMethodNew(this.ob);
- string JudgeStoveNotemp = BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "-01";
- double percent = na.GetLengthPercent(JudgeStoveNotemp, this.ob, 0);
- if (percent == 100.0)
- {
- MessageBox.Show("炉号:【" + JudgeStoveNo + "】尚未开始分切,不允许结炉", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- DataTable dtDBH = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getDbHeight", new object[] { JudgeStoveNo, ActiveResultNo, proPlanId, gxPlanNo }, this.ob);
- if (dtDBH.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(dtDBH.Rows[0]["DB_HEIGHT"].ToString()))
- {
- DBHeight = double.Parse(dtDBH.Rows[0]["DB_HEIGHT"].ToString());
- }
- if (!string.IsNullOrEmpty(dtDBH.Rows[0]["BURNNING_RATE"].ToString()))
- {
- BurnningRate = double.Parse(dtDBH.Rows[0]["BURNNING_RATE"].ToString());
- }
- if (!string.IsNullOrEmpty(dtDBH.Rows[0]["BURNINGRATE"].ToString()))
- {
- BurnningRate1 = double.Parse(dtDBH.Rows[0]["BURNINGRATE"].ToString());
- }
- if (!string.IsNullOrEmpty(dtDBH.Rows[0]["DB_NUM"].ToString()))
- {
- DBNum = double.Parse(dtDBH.Rows[0]["DB_NUM"].ToString());
- }
- }
- //分产线 是否经过再加热炉
- if (this.PlineCode == "C009" || PlineCode == "C012" || PlineCode == "C017")
- {
- double temp = DBHeight * (1 - (BurnningRate / 100));
- double tempnum = double.Parse(StraighteningResult.QualifiedNum.ToString());
- StraighteningResult.QaTon = temp * percent / 100 * tempnum;
- }
- else
- {
- double temp = DBHeight * (1 - (BurnningRate / 100)) * (1 - (BurnningRate1 / 100));
- double tempnum = double.Parse(StraighteningResult.QualifiedNum.ToString());
- StraighteningResult.QaTon = temp * percent / 100 * tempnum;
- }
- StraighteningResult.JudgeStoveNo = JudgeStoveNo;
- StraighteningResult.NodeFurFlag = "1";
- StraighteningResult.ColGroup = UserInfo.GetUserGroup();
- StraighteningResult.ColShift = UserInfo.GetUserOrder();
- StraighteningResult.ColUser = UserInfo.GetUserName();
- StraighteningResult.GxPlanNo = gxPlanNo;
- StraighteningResult.ProPlanId = proPlanId;
- int countafter = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.Qunum", new object[] { StraighteningResult }, this.ob);
- }
- }
- }
- /// <summary>
- /// 判断是否能开始当前炉次
- /// </summary>
- /// <returns></returns>
- private bool IsStart()
- {
- bool Start = true;
- foreach (UltraGridRow ugr in ultraGridPlan.Rows)
- {
- if (ugr.Cells["IS_START"].Value.ToString() == "已开始矫直")
- {
- MessageBox.Show("炉号【" + ugr.Cells["JUDGE_STOVE_NO"].Value.ToString() + "】正在矫直,不能两炉同时开始矫直", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- Start = false;
- }
- }
- return Start;
- }
- /// <summary>
- /// 双击上料事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- // private void ultraGridPlan_DoubleClickRow(object sender, DoubleClickRowEventArgs e)
- private void DoStart()
- {
- if (ultraGridPlan.Rows.Count > 0)
- {
- //if (!IsStart())
- //{
- // return;
- //}
- UltraGridRow ugr = ultraGridPlan.ActiveRow;
- if (ugr != null)
- {
- string HeatNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
- ActiveJUDGE_STOVE_NO = HeatNo;
- MainPlan.JudgeStoveNo = HeatNo;
- //string Status = ugr.Cells["IS_START"].Value.ToString();
-
- string ResultNo = ugr.Cells["ID"].Value.ToString();
- string Status = doQueryJugeNoStaus(ResultNo, HeatNo,PlineCode);
- ActiveStatus = Status;
- if (Status == "1")
- {
- MessageBox.Show("炉号:【" + HeatNo + "】已完成定径,不允许再次开始定径操作!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- PlineCode = ugr.Cells["Pline_Code"].Value.ToString();
- StraighteningResult.Clear();
- if (Status == "0")
- {
- MessageBox.Show("矫直工序正在进行,无法进行再次矫直!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (temprstraght != null)
- {
- StraighteningResult = NativeMethod.GetEntityToEntity(StraighteningResult, temprstraght);
- StraighteningResult.ChangeNum = "";
- StraighteningResult.InMatNum = "";
- StraighteningResult.QualifiedNum = "";
- StraighteningResult.QualifiedNum1 = "";
- StraighteningResult.QualifiedNum2 = "";
- StraighteningResult.QualifiedNum3 = "";
- StraighteningResult.Remark = "";
- StraighteningResult.ScrapNum = "";
- StraighteningResult.ScrapNum1 = "";
- StraighteningResult.ScrapNum2 = "";
- StraighteningResult.ScrapNum3 = "";
- StraighteningResult.SootBlowingTime = "";
- StraighteningResult.StartTime = "";
- StraighteningResult.EndTime = "";
- }
- DataTable dtMP = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlanForHeatNo", new object[] { MainPlan }, this.ob);
- ActiveOFFLINE_FLAG = dtMP.Rows[0]["OFFLINE_FLAG"].ToString();
- GridEdit(dtMP); //轧制计划信息
- ActiveResultNo = dtMP.Rows[0]["ID"].ToString();
- this.stoveno = dtMP.Rows[0]["STOVE_NO"].ToString();
- this.lotno = dtMP.Rows[0]["LOT_NO"].ToString();
- string PLineCode = dtMP.Rows[0]["PLINE_CODE"].ToString();
- string LotNo = dtMP.Rows[0]["LOT_NO"].ToString();
- string StoveNo = dtMP.Rows[0]["STOVE_NO"].ToString();
- string Judge_stove_no = dtMP.Rows[0]["judge_stove_no"].ToString();
- StraighteningResult.LotNo = LotNo;
- StraighteningResult.ResultNo = ResultNo;
- StraighteningResult.StoveNo = StoveNo;
- StraighteningResult.PlineCode = PLineCode;
- StraighteningResult.JudgeStoveNo = Judge_stove_no;
- StraighteningResult.ColMode = "0";
- StraighteningResult.ColGroup = UserInfo.GetUserGroup();
- StraighteningResult.ColShift = UserInfo.GetUserOrder();
- StraighteningResult.ColUser = UserInfo.GetUserName();
- StraighteningResult.ProPlanId = proPlanId;
- StraighteningResult.GxPlanNo = gxPlanNo;
- //修改主表状态,插入矫直实绩
- int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.UpdateStraighteningStatue", new object[] { StraighteningResult }, this.ob);
- if (count > 0)
- {
- NativeMethodNew na = new NativeMethodNew(this.ob);
- na.InsertSTAferDoubleClick(HeatNo, 7, "0", proPlanId, gxPlanNo);
- DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlan", new object[] { QueryMainPlan, 8 }, this.ob);
- GridHelper.CopyDataToDatatable(ref dt, ref dtPlan, true);
- //ultraGridPlan.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.AllRowsInBand);
- ChangeCellName();
- foreach (UltraGridRow ugr1 in this.ultraGridPlan.Rows)
- {
- ugr1.Cells["JUDGE_NO"].Value = BaseMethod.getJudgeStoveNo(ugr1.Cells["JUDGE_STOVE_NO"].Value.ToString());
- if (ugr1.Cells["JUDGE_STOVE_NO"].Value.ToString() == HeatNo)
- {
- ultraGridPlan.ActiveRow = ugr1;
- }
- }
- }
- }
- }
- }
- /// <summary>
- /// 开始回退
- /// </summary>
- private void StartBack()
- {
- if (ultraGridPlan.Rows.Count > 0)
- {
- if (this.ultraGridPlan.ActiveRow == null)
- {
- MessageBox.Show("请选择需要回退的炉号!!!");
- return;
- }
- UltraGridRow ugr = ultraGridPlan.ActiveRow;
- string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
- string ResultNo = ugr.Cells["ID"].Value.ToString();
- //string StartStatus = ugr.Cells["IS_START"].Value.ToString();
- string StartStatus = doQueryJugeNoStaus(ResultNo, JudgeStoveNo,PlineCode);
- if (StartStatus == "1")
- {
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】已结炉,不能入炉回退!!!!");
- return;
- }
- if (StartStatus == "3")
- {
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】未开始入炉,不能入炉回退!!!!");
- return;
- }
- int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FeedSawResult.startBack", new object[] { JudgeStoveNo, ResultNo, 7, PlineCode, proPlanId, gxPlanNo }, this.ob);
- ultraGridTC();
- ChangeGridColor();
- ChangeCellName();
- PlanQuery();
- }
- }
- /// <summary>
- /// 保存跟踪记录表备注
- /// </summary>
- private void ultraGridMatSeq_AfterCellUpdate(object sender, CellEventArgs e)
- {
- UltraGridRow ugr = null;
- string heatno = "";
- int seq = 0;
- string remark = "";
- if (ultraTabControl2.Tabs[0].Visible == true)
- {
- ugr = ultraGrid_GHDL1.ActiveRow;
- }
- if (ultraTabControl2.Tabs[1].Visible == true)
- {
- ugr = ultraGrid_GHDL2.ActiveRow;
- }
- if (ultraTabControl2.Tabs[2].Visible == true)
- {
- ugr = ultraGrid_GHDL3.ActiveRow;
- }
- if (e.Cell.Column.Key == "REMARK")
- {
- if (ugr == null)
- {
- //MessageBox.Show("您未选择任何管号队列数据,请重新选择后再进行保存操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- heatno = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
- seq = Convert.ToInt16(ugr.Cells["SEQ"].Value.ToString());
- if (!string.IsNullOrEmpty(ugr.Cells["REMARK"].Value.ToString()))
- {
- remark = ugr.Cells["REMARK"].Value.ToString();
- }
- else
- {
- remark = "";
- }
- NativeMethodNew na = new NativeMethodNew(this.ob);
- na.SaveRackRemark(1, seq, heatno, remark);
- }
- }
- /// <summary>
- /// 保存
- /// </summary>
- public void StraighteningSave()
- {
- StraighteningResult.Clear();
- UltraGridRow ugr = ultraGridPlan.ActiveRow;
- UltraGridRow ugr1 = straighteningResult1.UltraGrid2.Rows[0];
- UltraGridRow ugr11 = frmStraighteningResult11.UltraGrid4.Rows[0];
- UltraGridRow ugr21 = frmStraighteningResult21.UltraGrid2.Rows[0];
- UltraGridRow ugr2 = this.rollingCard1.UltraGrid4.Rows[0];
- string JudgeStoveNo = "";
- string saveflag = "0";
- if (this.ultraGridPlan.ActiveRow == null && ActiveJUDGE_STOVE_NO == null)
- {
- MessageBox.Show("未选择任何炉号,请选择炉号后进行保存操作。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (this.ultraGridPlan.ActiveRow == null)
- {
- JudgeStoveNo = ActiveJUDGE_STOVE_NO;
- }
- else
- {
- JudgeStoveNo = this.ultraGridPlan.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString();
- }
- DataTable dtFlag = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetSingleJRLResult", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob);
- if (PlineCode == "C010")
- {
- this.straighteningResult1.UltraGrid2.UpdateData();
- StraighteningResult = NativeMethod.GetUltraGridToEntityNEW(this.straighteningResult1.UltraGrid2, StraighteningResult);
- //StraighteningResult.QualifiedNum1 = "0";
- //StraighteningResult.QualifiedNum1 = "0";
- //StraighteningResult.QualifiedNum1 = "0";
- //StraighteningResult.QualifiedNum1 = this.ultraGrid_GHDL1.Rows.Count - int.Parse(StraighteningResult.ScrapNum1.ToString());
- //StraighteningResult.QualifiedNum2 = this.ultraGrid_GHDL2.Rows.Count - int.Parse(StraighteningResult.ScrapNum2.ToString());
- //StraighteningResult.QualifiedNum3 = this.ultraGrid_GHDL3.Rows.Count - int.Parse(StraighteningResult.ScrapNum3.ToString());
- }
- else
- {
- if (PlineCode == "C017")
- {
- this.frmStraighteningResult21.UltraGrid2.UpdateData();
- StraighteningResult = NativeMethod.GetUltraGridToEntityNEW(this.frmStraighteningResult21.UltraGrid2, StraighteningResult);
- //StraighteningResult.QualifiedNum1 = "0";
- //StraighteningResult.QualifiedNum1 = "0";
- StraighteningResult.QualifiedNum3 = "0";
- //StraighteningResult.QualifiedNum1 = this.ultraGrid_GHDL1.Rows.Count - int.Parse(StraighteningResult.ScrapNum1.ToString());
- //StraighteningResult.QualifiedNum2 = this.ultraGrid_GHDL2.Rows.Count - int.Parse(StraighteningResult.ScrapNum2.ToString());
- }
- else
- {
- this.frmStraighteningResult11.UltraGrid4.UpdateData();
- StraighteningResult = NativeMethod.GetUltraGridToEntityNEW(this.frmStraighteningResult11.UltraGrid4, StraighteningResult);
- //StraighteningResult.QualifiedNum1 = "0";
- //StraighteningResult.QualifiedNum1 = "0";
- StraighteningResult.QualifiedNum3 = "0";
- //StraighteningResult.QualifiedNum1 = this.ultraGrid_GHDL1.Rows.Count - int.Parse(StraighteningResult.ScrapNum1.ToString());
- //StraighteningResult.QualifiedNum2 = this.ultraGrid_GHDL2.Rows.Count - int.Parse(StraighteningResult.ScrapNum2.ToString());
- }
- }
- DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.getSingePlanFlag", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, ob);//查询计划是否为返线计划
- if (dtFlag.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(dtFlag.Rows[0]["NODE_FUR_FLAG"].ToString()))
- {
- if (dtFlag.Rows[0]["NODE_FUR_FLAG"].ToString() == "1")
- {
- if (ds.Rows[0]["BACK_PLAN_FLAG"].ToString().Equals("7"))
- {
- //来料支数
- StraighteningResult.InMatNum = ds.Rows[0]["BRANCH"].ToString();
- StraighteningResult.QualifiedNum = "0";
- }
- else
- {
- if (!string.IsNullOrEmpty(ugr2.Cells["QualifiedNum10"].Value.ToString()))
- {
- //来料支数
- StraighteningResult.InMatNum = ugr2.Cells["QualifiedNum10"].Value.ToString();
- StraighteningResult.QualifiedNum = "0";
- }
- }
- //if (int.Parse(StraighteningResult.InMatNum.ToString()) > int.Parse(ugr2.Cells["ScrapNum11"].Value.ToString()))
- //{
- // //合格支数
- // StraighteningResult.QualifiedNum = int.Parse(StraighteningResult.InMatNum.ToString()) - int.Parse(ugr2.Cells["ScrapNum11"].Value.ToString());
- //}
- }
- }
- }
- if (this.ultraGridPlan.ActiveRow == null && ActiveJUDGE_STOVE_NO == null)
- {
- MessageBox.Show("未选择任何炉号,请选择炉号后进行保存操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (this.ultraGridPlan.ActiveRow == null)
- {
- StraighteningResult.JudgeStoveNo = ActiveJUDGE_STOVE_NO;
- }
- else
- {
- StraighteningResult.JudgeStoveNo = this.ultraGridPlan.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString();
- }
- if (ActiveStatus.Equals("3"))
- {
- MessageBox.Show("炉号:【" + StraighteningResult.JudgeStoveNo + "】未开始进行矫直,不允许进行保存操作!!!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (ActiveStatus.Equals("1"))
- {
- saveflag = "1";
- //MessageBox.Show("炉号:【" + StraighteningResult.JudgeStoveNo + "】已完成矫直,不允许进行保存操作!!!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- //return;
- }
- //if (MessageUtil.ShowYesNoAndQuestion("确认炉号【" + StraighteningResult.JudgeStoveNo + "】保存实绩?") == DialogResult.No)
- //{
- // return;
- //}
- ////剔除支数
- //if (!string.IsNullOrEmpty(ugr1.Cells["ScrapNum"].Value.ToString()))
- //{
- // StraighteningResult.ScrapNum = ugr1.Cells["ScrapNum"].Value.ToString();
- //}
- //else
- //{
- // StraighteningResult.ScrapNum = "0";
- //}
- //入炉支数
- //string lailiao = ugr2.Cells["QualifiedNum10"].Value.ToString();
- //int ck = 0;
- //if (string.IsNullOrEmpty(lailiao))
- //{
- // ck = 0;
- //}
- //else
- //{
- // ck = int.Parse(lailiao) - int.Parse(StraighteningResult.ScrapNum.ToString());
- //}
- StraighteningResult.ProPlanId = proPlanId;
- StraighteningResult.GxPlanNo = gxPlanNo;
- int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.saveStraightening", new object[] { StraighteningResult, saveflag }, this.ob);
- if (count > 0)
- {
- MessageBox.Show("炉号【" + StraighteningResult.JudgeStoveNo + "】保存成功!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- this.straighteningResult1.IsCellSelect = false;
- this.frmStraighteningResult11.IsCellSelect = false;
- this.frmStraighteningResult21.IsCellSelect = false;
- temprstraght = NativeMethod.GetEntityToEntity(temprstraght, StraighteningResult);
- GetRollingCard();
- }
- /// <summary>
- /// 结炉操作
- /// 1、判断上一道工序结炉状态,2、更新实绩表(包括结炉时间,结炉状态),3.更新主表NODE_STATUS
- /// </summary>
- public void StraighteningNode()
- {
- StraighteningSave();
- StraighteningResult.Clear();
- if (this.ultraGridPlan.ActiveRow == null)
- {
- MessageBox.Show("未选择任何炉号,不允许结炉", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- UltraGridRow ugr_plan = this.ultraGridPlan.ActiveRow;
- UltraGridRow ugr_roll = this.rollingCard1.UltraGrid4.Rows[0];
- string JudgeStoveNo = ugr_plan.Cells["JUDGE_STOVE_NO"].Value.ToString();
- string resultNo = ugr_plan.Cells["ID"].Value.ToString();
- //string Status = ugr_plan.Cells["IS_START"].Value.ToString();
- string Status = doQueryJugeNoStaus(resultNo, JudgeStoveNo,PlineCode);
- NativeMethodNew na = new NativeMethodNew(this.ob);
- int WaitChangeSeq1 = na.GetWaitChangeSeq(ActiveJUDGE_STOVE_NO, ActiveResultNo, 0, "1", proPlanId, gxPlanNo);
- int WaitChangeSeq2 = na.GetWaitChangeSeq(ActiveJUDGE_STOVE_NO, ActiveResultNo, 0, "2", proPlanId, gxPlanNo);
- if (WaitChangeSeq1 > 0)
- {
- MessageBox.Show("序号:【" + WaitChangeSeq1 + "】子管未接班确认,不能结炉", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (WaitChangeSeq2 > 0)
- {
- MessageBox.Show("序号:【" + WaitChangeSeq2 + "】子管未接班确认,不能结炉", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (this.PlineCode.Equals("C010"))
- {
- int WaitChangeSeq3 = na.GetWaitChangeSeq(ActiveJUDGE_STOVE_NO, ActiveResultNo, 0, "3", proPlanId, gxPlanNo);
- if (WaitChangeSeq3 > 0)
- {
- MessageBox.Show("序号:【" + WaitChangeSeq3 + "】子管未接班确认,不能结炉", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- }
- if (Status == "1")
- {
- MessageBox.Show("炉号:【" + JudgeStoveNo + "】已完成矫直,不允许进行结炉操作!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (Status != "0")
- {
- MessageBox.Show("炉号【" + JudgeStoveNo + "】未开始矫直,不允许结炉!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- //查看结炉标识
- DataTable dtFlag = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetSingleJRLResult", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob);
- if (dtFlag.Rows.Count > 0)
- {
- if (string.IsNullOrEmpty(dtFlag.Rows[0]["NODE_FUR_FLAG"].ToString()))
- {
- MessageBox.Show("炉号【" + JudgeStoveNo + "】未开始分切,不允许结炉", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (dtFlag.Rows[0]["NODE_FUR_FLAG"].ToString() != "1")
- {
- MessageBox.Show("炉号【" + JudgeStoveNo + "】不能结炉,分切未完成。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- }
- if (MessageUtil.ShowYesNoAndQuestion("确认炉号【" + JudgeStoveNo + "】结炉?") == DialogResult.No)
- {
- return;
- }
- if (PlineCode == "C010")
- {
- this.straighteningResult1.UltraGrid2.UpdateData();
- StraighteningResult = NativeMethod.GetUltraGridToEntityNEW(this.straighteningResult1.UltraGrid2, StraighteningResult);
- int i = 0; int j = 0; int k = 0;
- if (ultraGrid_GHDL1.Rows.Count > 0)
- {
- foreach (UltraGridRow ugr1 in ultraGrid_GHDL1.Rows)
- {
- if (!string.IsNullOrEmpty(ugr1.Cells["MAT_NO"].Value.ToString()))
- {
- i = i + 1;
- }
- }
- }
- if (ultraGrid_GHDL2.Rows.Count > 0)
- {
- foreach (UltraGridRow ugr1 in ultraGrid_GHDL2.Rows)
- {
- if (!string.IsNullOrEmpty(ugr1.Cells["MAT_NO"].Value.ToString()))
- {
- j = j + 1;
- }
- }
- }
- if (ultraGrid_GHDL3.Rows.Count > 0)
- {
- foreach (UltraGridRow ugr1 in ultraGrid_GHDL3.Rows)
- {
- if (!string.IsNullOrEmpty(ugr1.Cells["MAT_NO"].Value.ToString()))
- {
- k = k + 1;
- }
- }
- }
- StraighteningResult.QualifiedNum1 = i - int.Parse(StraighteningResult.ScrapNum1.ToString());
- StraighteningResult.QualifiedNum2 = j - int.Parse(StraighteningResult.ScrapNum2.ToString());
- StraighteningResult.QualifiedNum3 = k - int.Parse(StraighteningResult.ScrapNum3.ToString());
- }
- else
- {
- if (PlineCode == "C017")
- {
- this.frmStraighteningResult21.UltraGrid2.UpdateData();
- StraighteningResult = NativeMethod.GetUltraGridToEntityNEW(this.frmStraighteningResult21.UltraGrid2, StraighteningResult);
- int i = 0; int j = 0; int k = 0;
- if (ultraGrid_GHDL1.Rows.Count > 0)
- {
- foreach (UltraGridRow ugr1 in ultraGrid_GHDL1.Rows)
- {
- if (!string.IsNullOrEmpty(ugr1.Cells["MAT_NO"].Value.ToString()))
- {
- i = i + 1;
- }
- }
- }
- if (ultraGrid_GHDL2.Rows.Count > 0)
- {
- foreach (UltraGridRow ugr1 in ultraGrid_GHDL2.Rows)
- {
- if (!string.IsNullOrEmpty(ugr1.Cells["MAT_NO"].Value.ToString()))
- {
- j = j + 1;
- }
- }
- }
- StraighteningResult.QualifiedNum1 = i - int.Parse(StraighteningResult.ScrapNum1.ToString());
- StraighteningResult.QualifiedNum2 = j - int.Parse(StraighteningResult.ScrapNum2.ToString());
- StraighteningResult.QualifiedNum3 = "0";
- }
- else
- {
- this.frmStraighteningResult11.UltraGrid4.UpdateData();
- StraighteningResult = NativeMethod.GetUltraGridToEntityNEW(this.frmStraighteningResult11.UltraGrid4, StraighteningResult);
- int i = 0; int j = 0; int k = 0;
- if (ultraGrid_GHDL1.Rows.Count > 0)
- {
- foreach (UltraGridRow ugr1 in ultraGrid_GHDL1.Rows)
- {
- if (!string.IsNullOrEmpty(ugr1.Cells["MAT_NO"].Value.ToString()))
- {
- i = i + 1;
- }
- }
- }
- if (ultraGrid_GHDL2.Rows.Count > 0)
- {
- foreach (UltraGridRow ugr1 in ultraGrid_GHDL2.Rows)
- {
- if (!string.IsNullOrEmpty(ugr1.Cells["MAT_NO"].Value.ToString()))
- {
- j = j + 1;
- }
- }
- }
- StraighteningResult.QualifiedNum1 = i - int.Parse(StraighteningResult.ScrapNum1.ToString());
- StraighteningResult.QualifiedNum2 = j - int.Parse(StraighteningResult.ScrapNum2.ToString());
- StraighteningResult.QualifiedNum3 = "0";
- }
- }
- DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.getSingePlanFlag", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, ob);
- if (ds.Rows[0]["BACK_PLAN_FLAG"].ToString().Equals("7"))
- {
- //来料支数
- StraighteningResult.InMatNum = ds.Rows[0]["BRANCH"].ToString();
- if (int.Parse(StraighteningResult.InMatNum.ToString3()) >= int.Parse(ugr_roll.Cells["ScrapNum11"].Value.ToString3()))
- {
- //合格支数
- StraighteningResult.QualifiedNum = int.Parse(StraighteningResult.InMatNum.ToString()) - int.Parse(ugr_roll.Cells["ScrapNum11"].Value.ToString3()) - int.Parse(ugr_roll.Cells["Offline11"].Value.ToString3());
- }
- else
- {
- MessageBox.Show("存在上一道工序已经剔除的管坯在本道工序也剔除了,请回退后再进行结炉操作", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- }
- else
- {
- if (!string.IsNullOrEmpty(ugr_roll.Cells["QualifiedNum10"].Value.ToString()))
- {
- //来料支数
- StraighteningResult.InMatNum = ugr_roll.Cells["QualifiedNum10"].Value.ToString();
- }
- if (int.Parse(StraighteningResult.InMatNum.ToString3()) >= int.Parse(ugr_roll.Cells["ScrapNum11"].Value.ToString3()))
- {
- //合格支数
- StraighteningResult.QualifiedNum = int.Parse(StraighteningResult.InMatNum.ToString()) - int.Parse(ugr_roll.Cells["ScrapNum11"].Value.ToString3()) - int.Parse(ugr_roll.Cells["Offline11"].Value.ToString3());
- }
- else
- {
- MessageBox.Show("存在上一道工序已经剔除的管坯在本道工序也剔除了,请回退后再进行结炉操作", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- }
-
- //合格吨
- double DBHeight = 0;
- double BurnningRate = 0;
- double BurnningRate1 = 0;
- double DBNum = 1;
- NativeMethodNew natemp = new NativeMethodNew(this.ob);
- string JudgeStoveNotemp = BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "-01";
- double percent = natemp.GetLengthPercent(JudgeStoveNotemp, this.ob, 0);
- if (percent == 100.0)
- {
- MessageBox.Show("炉号:【" + JudgeStoveNo + "】尚未开始分切,不允许结炉", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- DataTable dtDBH = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getDbHeight", new object[] { JudgeStoveNo, ActiveResultNo, proPlanId, gxPlanNo }, this.ob);
- if (dtDBH.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(dtDBH.Rows[0]["DB_HEIGHT"].ToString()))
- {
- DBHeight = double.Parse(dtDBH.Rows[0]["DB_HEIGHT"].ToString());
- }
- if (!string.IsNullOrEmpty(dtDBH.Rows[0]["BURNNING_RATE"].ToString()))
- {
- BurnningRate = double.Parse(dtDBH.Rows[0]["BURNNING_RATE"].ToString());
- }
- if (!string.IsNullOrEmpty(dtDBH.Rows[0]["BURNINGRATE"].ToString()))
- {
- BurnningRate1 = double.Parse(dtDBH.Rows[0]["BURNINGRATE"].ToString());
- }
- if (!string.IsNullOrEmpty(dtDBH.Rows[0]["DB_NUM"].ToString()))
- {
- DBNum = double.Parse(dtDBH.Rows[0]["DB_NUM"].ToString());
- }
- }
- //分产线 是否经过再加热炉
- if (this.PlineCode == "C009" || PlineCode == "C012" || PlineCode == "C017")
- {
- double temp = DBHeight * (1 - (BurnningRate / 100));
- double tempnum = double.Parse(StraighteningResult.QualifiedNum.ToString());
- StraighteningResult.QaTon = temp * percent / 100 * tempnum;
- }
- else
- {
- double temp = DBHeight * (1 - (BurnningRate / 100)) * (1 - (BurnningRate1 / 100));
- double tempnum = double.Parse(StraighteningResult.QualifiedNum.ToString());
- StraighteningResult.QaTon = temp * percent / 100 * tempnum;
- }
- StraighteningResult.JudgeStoveNo = JudgeStoveNo;
- StraighteningResult.NodeFurFlag = "1";
- StraighteningResult.ColGroup = UserInfo.GetUserGroup();
- StraighteningResult.ColShift = UserInfo.GetUserOrder();
- StraighteningResult.ColUser = UserInfo.GetUserName();
- StraighteningResult.UserId = _UserID;
- StraighteningResult.ProPlanId = proPlanId;
- StraighteningResult.GxPlanNo = gxPlanNo;
- StraighteningResult.LotNo = lotNo;
- StraighteningResult.PlineCode = PlineCode;
-
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.zgmil.coup.FrmStraighteningResult";
- ccp.MethodName = "updateMilSlab";
- ccp.ServerParams = new object[] { JudgeStoveNo, "9", proPlanId, gxPlanNo };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("修改成功!"))
- {
- //更新进程表,废品入库存
- ccp.ServerName = "com.steering.mes.zgmil.coup.FrmStraighteningResult";
- ccp.MethodName = "updateProcessL";
- ccp.ServerParams = new object[] { JudgeStoveNo, "9", "9", proPlanId, gxPlanNo, lotNo, PlineCode };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("修改成功!"))
- {
- //结炉操作:保存实绩,修改结炉状态
- int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.saveStraighteningNODE", new object[] { StraighteningResult }, this.ob);
- //MessageBox.Show("结炉操作完成", "提示 :", MessageBoxButtons.OK, MessageBoxIcon.Information);
- if (count > 0)
- {
- //int count2 = ServerHelper.SetData("com.steering.mes.zgmil.coup.FeedSawResult.scrapNodeMat", new object[] { JudgeStoveNo, 8, 0 }, this.ob);
- ccp.ServerName = "com.steering.mes.zgmil.coup.FrmStraighteningResult";
- ccp.MethodName = "assignmentMatNo";
- ccp.ServerParams = new object[] { JudgeStoveNo, "8", PlineCode, proPlanId, gxPlanNo };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("修改成功!"))
- {
- //往跟踪记录表插入探伤开始时间
- NativeMethodNew nas = new NativeMethodNew(this.ob);
- nas.InsertSTAferDoubleClick(JudgeStoveNo, 7, "1", proPlanId, gxPlanNo);
- NativeMethod.CheckNodeMatStatus(JudgeStoveNo, proPlanId, gxPlanNo, 7, this.ob);
- this.straighteningResult1.IsCellSelect = false;
- this.frmStraighteningResult11.IsCellSelect = false;
- this.frmStraighteningResult21.IsCellSelect = false;
- temprstraght = NativeMethod.GetEntityToEntity(temprstraght, StraighteningResult);
- DataTable dt1 = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlan", new object[] { QueryMainPlan, 8 }, this.ob);
- GridHelper.CopyDataToDatatable(ref dt1, ref dtPlan, true);
- //ultraGridPlan.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.AllRowsInBand);
- ChangeCellName();
- foreach (UltraGridRow ugr1 in this.ultraGridPlan.Rows)
- {
- ugr1.Cells["JUDGE_NO"].Value = BaseMethod.getJudgeStoveNo(ugr1.Cells["JUDGE_STOVE_NO"].Value.ToString());
- if (ugr1.Cells["JUDGE_STOVE_NO"].Value.ToString() == JudgeStoveNo)
- {
- ultraGridPlan.ActiveRow = ugr1;
- }
- }
- this.dataSet2.Clear();
- MessageUtil.ShowTips("炉号:【" + JudgeStoveNo + "】结炉成功!");
- }
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- }
-
-
- }
- /// <summary>
- ///
- /// </summary>
- private void NodeBack()
- {
- if (this.ultraGridPlan.ActiveRow == null)
- {
- MessageBox.Show("请选择需要回退的炉号!!!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- UltraGridRow ugr = ultraGridPlan.ActiveRow;
- string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
- string ResultNo = ugr.Cells["ID"].Value.ToString();
- //string NodeFlag = ugr.Cells["IS_START"].Value.ToString();
- string NodeFlag = doQueryJugeNoStaus(ResultNo, JudgeStoveNo, PlineCode);
- DataTable dtMat = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmOffLine.doQueryMatScrap", new object[] { JudgeStoveNo, PlineCode, proPlanId, gxPlanNo }, this.ob);
- if (dtMat.Rows.Count > 0)
- {
- if (int.Parse(dtMat.Rows[0][0].ToString()) > 0)
- {
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】的废品已发运,不能结炉回退!!!!");
- return;
- }
- }
- DataTable dtKG_FLAG = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetStraightKG_Flag", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob);
- if (dtKG_FLAG.Rows.Count > 0)
- {
- string kgflag = dtKG_FLAG.Rows[0]["KG_FLAG"].ToString();
- //if (kgflag.Equals("1"))
- //{
- // MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】 为探伤返线生成,不允许结炉回退。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- // return;
- //}
- }
- if (NodeFlag != "1")
- {
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】未结炉,不能结炉回退!!!!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.doQueryOffline", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, ob);
- if (ds.Rows.Count > 0)
- {
- MessageUtil.ShowTips("探伤工序存在下线实绩,不允许结炉回退!");
- return;
- }
- DataTable ds1 = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.doQueryStraighteningOfflineBack", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, ob);
- if (ds1.Rows.Count > 0)
- {
- string BACKLINE_NUM = ds1.Rows[0]["BACKLINE_NUM"].ToString();
- MessageUtil.ShowTips("矫直工序存在离线数据已 返线或者组炉 " + BACKLINE_NUM + "支,不允许结炉回退!");
- return;
- }
- DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.doNodeBackCheck", new object[] { JudgeStoveNo, ResultNo, proPlanId, gxPlanNo }, this.ob);
- if (dt.Rows.Count > 0)
- {
- string NodeProcess = ""; //当前炉次结炉工序
- string NodeStatus = dt.Rows[0][0].ToString();
- switch (NodeStatus)
- {
- case "30":
- NodeProcess = "穿孔";
- break;
- case "40":
- NodeProcess = "连轧";
- break;
- case "50":
- NodeProcess = "再加热炉";
- break;
- case "60":
- NodeProcess = "定径";
- break;
- case "70":
- NodeProcess = "分切";
- break;
- case "80":
- NodeProcess = "矫直";
- break;
- case "90":
- NodeProcess = "探伤";
- break;
- case "96":
- NodeProcess = "质检";
- break;
- }
- if (NodeStatus != "80")
- {
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】 " + NodeProcess + "工序已结炉,当前工序不能结炉回退", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- }
- ////判断当前炉次下道工序是否结炉 下道工序结炉 - 不允许回退
- //int Seq = 0;
- //DataTable dt2 = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.changeFlagQuery", new object[] { JudgeStoveNo, ResultNo, 7 , proPlanId, gxPlanNo}, this.ob);
- //if (dt2.Rows.Count > 0)
- //{
- // Seq = int.Parse(dt2.Rows[0][0].ToString());
- //}
- //int count2 = ServerHelper.SetData("com.steering.mes.zgmil.coup.FeedSawResult.nodeBack", new object[] { JudgeStoveNo, ResultNo, 7, PlineCode, Seq, 0 }, this.ob);
- string Group = UserInfo.GetUserGroup();
- string Shift = UserInfo.GetUserOrder();
- //查询结炉班次班组
- DataTable dtNodeGroup = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.doNodeBackCheck", new object[] { JudgeStoveNo, ResultNo, 7, proPlanId, gxPlanNo }, this.ob);
- if (dtNodeGroup.Rows.Count > 0)
- {
- string NodeShift = dtNodeGroup.Rows[0][0].ToString();
- string NodeGroup = dtNodeGroup.Rows[0][1].ToString();
- if (Shift == NodeShift && Group == NodeGroup)
- {
- NativeMethodNew nas = new NativeMethodNew(this.ob);
- if (this.ultraTabControl2.Tabs[0].Visible == true)
- {
- nas.NodeBack(JudgeStoveNo, ResultNo, this.PlineCode, 0, "1", proPlanId, gxPlanNo, lotNo);
- }
- if (this.ultraTabControl2.Tabs[1].Visible == true)
- {
- nas.NodeBack(JudgeStoveNo, ResultNo, this.PlineCode, 0, "2", proPlanId, gxPlanNo, lotNo);
- }
- if (this.ultraTabControl2.Tabs[2].Visible == true)
- {
- nas.NodeBack(JudgeStoveNo, ResultNo, this.PlineCode, 0, "3", proPlanId, gxPlanNo, lotNo);
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.zgmil.coup.FrmOffLine";
- ccp.MethodName = "insertMatScrapBack";
- ccp.ServerParams = new object[] { JudgeStoveNo, proPlanId, gxPlanNo, PlineCode, "9" };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- { MessageUtil.ShowTips(ccp.ReturnInfo); }
- ChangeGridColor();
- PlanQuery();
- }
- else
- {
- switch (NodeShift)
- {
- case "0":
- NodeShift = "白班";
- break;
- case "1":
- NodeShift = "早班";
- break;
- case "2":
- NodeShift = "中班";
- break;
- case "3":
- NodeShift = "夜班";
- break;
- }
- switch (NodeGroup)
- {
- case "1":
- NodeGroup = "甲班";
- break;
- case "2":
- NodeGroup = "乙班";
- break;
- case "3":
- NodeGroup = "丙班";
- break;
- case "4":
- NodeGroup = "丁班";
- break;
- }
- switch (this.UserInfo.GetUserOrder())
- {
- case "0":
- Shift = "白班";
- break;
- case "1":
- Shift = "早班";
- break;
- case "2":
- Shift = "中班";
- break;
- case "3":
- Shift = "夜班";
- break;
- }
- switch (this.UserInfo.GetUserGroup())
- {
- case "1":
- Group = "甲班";
- break;
- case "2":
- Group = "乙班";
- break;
- case "3":
- Group = "丙班";
- break;
- case "4":
- Group = "丁班";
- break;
- }
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】已由" + NodeGroup + "," + NodeShift + "结炉,当班不能结炉回退");
- return;
- }
- }
- }
- /// <summary>
- /// 1#剔除
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraGrid_GHDL1_ClickCellButton(object sender, CellEventArgs e)
- {
- int countss = 0;
- MilSlabScrapSeqEntity ScrapSlab = new MilSlabScrapSeqEntity();
- UltraGridRow ugr = ultraGrid_GHDL1.ActiveRow;
- UltraGridRow ugr1 = ultraGridPlan.ActiveRow;
- string PlanStatuss = ultraGridPlan.ActiveRow.Cells["IS_START"].Value.ToString();
- if (PlanStatuss != "已开始矫直")
- {
- MessageBox.Show("炉号【" + ultraGridPlan.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString() + "】不是已开始矫直状态,不允许操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
- String MAT_NO = ugr.Cells["MAT_NO"].Value.ToString();
- String Seq = ugr.Cells["seq"].Value.ToString();
- int Seq1 = int.Parse(Seq);
- string Status = ugr1.Cells["IS_START"].Value.ToString();
- string DlSTATUS = ugr.Cells["Status"].Value.ToString();
- string plcode = ugr1.Cells["Pline_Code"].Value.ToString();
- string offline = ugr.Cells["OFFLINE_FLAG"].Value.ToString();
- //if (ActiveOFFLINE_FLAG.Equals("2"))
- //{
- // if (!offline.Equals("返线"))
- // {
- // MessageBox.Show("当前为矫直返线,只允许对下线状态为返线的子管进行操作,", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- // return;
- // }
- //}
- string shif = ugr.Cells["COL_SHIFT"].Value.ToString();
- string group = ugr.Cells["COL_GROUP"].Value.ToString();
- Shift = UserInfo.GetUserOrder();
- Group = UserInfo.GetUserGroup();
- NativeMethodNew nasssss = new NativeMethodNew(this.ob);
- if (nasssss.IsRackOperate(shif, group))
- {
- MessageBox.Show("序号:【" + Seq + "】子管已由" + shif + "," + group + "操作,不允许再进行操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- DataTable ds = new DataTable();
- DataTable dd = new DataTable();
- if (e.Cell.Column.Key == "SCRAP_SLAB")
- {
- if (Status != "已开始矫直")
- {
- MessageBox.Show("炉号【" + JudgeStoveNo + "】未开始矫直,不能剔除", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (DlSTATUS == "剔除")
- {
- MessageBox.Show("序号【" + Seq + "】该条已经剔除,不能重复剔除", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- int ScrapNumBefore = 0;
- DataTable dtcountaftersaw = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.scrapMatCheckAfterSaw", new object[] { JudgeStoveNo, 8, "1", proPlanId, gxPlanNo }, this.ob);
- ScrapNumBefore = int.Parse(dtcountaftersaw.Rows[0]["Countss"].ToString());
- DataTable dtcount = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetRackCounts", new object[] { JudgeStoveNo, Seq1, "1", proPlanId, gxPlanNo }, this.ob);
- if (dtcount.Rows.Count > 0)
- {
- countss = int.Parse(dtcount.Rows[0]["COUNTSS"].ToString());
- }
-
- if (this.ultraGrid_GHDL1.Rows.Count - (countss + 1) < ScrapNumBefore)
- {
- if (e.Cell.Column.Key == "SCRAP_SLAB")
- {
- MessageBox.Show("不存在序号为【" + Seq + "】的管号,可能是被前道工序剔除,不能再次剔除!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- else if (e.Cell.Column.Key == "ChangShift")
- {
- MessageBox.Show("不存在序号为【" + Seq + "】的管号,可能是被前道工序剔除,不能进行交班操作!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- }
- //if (MessageUtil.ShowYesNoAndQuestion("是否剔除该子管") == DialogResult.No)
- //{
- // return;
- //}
- ScrapSlab.JudgeStoveNo = JudgeStoveNo;
- ScrapSlab.Seq = Seq;
- ScrapSlab.ProcessNo = "9";
- ScrapSlab.Flag = "0";
- ScrapSlab.ColMode = "1";
- ScrapSlab.ColUser = UserInfo.GetUserName();
- ScrapSlab.ColGroup = UserInfo.GetUserGroup();
- ScrapSlab.ColShift = UserInfo.GetUserOrder();
- ScrapSlab.ColNo = "1";
- ScrapSlab.ProPlanId = proPlanId;
- ScrapSlab.GxPlanNo = gxPlanNo;
- //剔管操作,:1、插入MIL_SLAB_SCRAP_SEQ表,2、探伤跟踪记录表状态,3、修改加探伤实绩表剔除支数
- int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.scrapFurMat", new object[] { ScrapSlab, "1" }, this.ob);
- //MessageBox.Show("管序号【" + Seq + "】剔除成功!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- //CoreClientParam ccp = new CoreClientParam();
- //ccp.ServerName = "com.steering.mes.zgmil.coup.FrmStraighteningResult";
- //ccp.MethodName = "updatePorcessOcupStaus";
- //ccp.ServerParams = new object[] { ScrapSlab, "9" };
- //if (ccp.ReturnCode != -1)
- //{
- // if (ccp.ReturnInfo.Equals("修改成功!"))
- // {
- ultraGridTC();//查询跟踪记录表
- GetStraightResult(JudgeStoveNo, plcode);//更新实绩
- ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.getSingePlanFlag", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, ob);
- if (ds.Rows[0]["BACK_PLAN_FLAG"].ToString().Equals("7"))
- {
- GetRollingCard1();
- }
- else
- {
- GetRollingCard();//更新流通卡
- }
- ChangeGridColor();
- // }
- //}
- }
- if (e.Cell.Column.Key == "DELBACK")
- {
- //if (MessageUtil.ShowYesNoAndQuestion("是否回退该剔除的坯料") == DialogResult.No)
- //{
- // return;
- //}
- if (!DlSTATUS.Equals("剔除"))
- {
- MessageBox.Show("该坯料未被剔除,请确认后重新选择!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- NativeMethodNew na = new NativeMethodNew(this.ob);
- int counts = 0;
- //if(Flage.Equals("1"))
- //{
- counts = na.DeleteSlabSeq(JudgeStoveNo, Seq.ToString(), 9, 1, 0, proPlanId, gxPlanNo);
- //}
- //if (Flage.Equals("2"))
- //{
- // counts = na.DeleteSlabSeq(JudgeStoveNo, Seq.ToString(), 10,1, 0);
- //}
- //if (Flage.Equals("3s"))
- //{
- // counts = na.DeleteSlabSeq(JudgeStoveNo, Seq.ToString(), 11, 1, 0);
- //}
- if (counts > 0)
- {
- ultraGridTC();//查询跟踪记录表
- GetStraightResult(JudgeStoveNo, plcode);//更新实绩
- ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.getSingePlanFlag", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, ob);
- if (ds.Rows[0]["BACK_PLAN_FLAG"].ToString().Equals("7"))
- {
- GetRollingCard1();
- }
- else
- {
- GetRollingCard();//更新流通卡
- }
- ChangeGridColor();
- //MessageBox.Show("剔料回退成功", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- else
- {
- MessageBox.Show("剔料回退失败", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- }
-
- if (e.Cell.Column.Key == "ChangShift")
- {
- string seqlast = "";
- int ScrapNumBefore = 0;
- DataTable dtcountaftersaw = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.scrapMatCheckAfterSaw", new object[] { JudgeStoveNo, 9, "1", proPlanId, gxPlanNo }, this.ob);
- ScrapNumBefore = int.Parse(dtcountaftersaw.Rows[0]["Countss"].ToString());
- DataTable dtcount = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetRackCounts", new object[] { JudgeStoveNo, Seq1, "1", proPlanId, gxPlanNo }, this.ob);
- if (dtcount.Rows.Count > 0)
- {
- countss = int.Parse(dtcount.Rows[0]["COUNTSS"].ToString());
- }
- if (this.ultraGrid_GHDL1.Rows.Count - (countss + 1) < ScrapNumBefore)
- {
- MessageBox.Show("不存在序号为【" + Seq + "】的管号,可能是被前道工序剔除,不能再次剔除!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (ugr.Cells["CHANGE_FLAG"].Value.ToString().Equals("确认交班") || ugr.Cells["CHANGE_FLAG"].Value.ToString().Equals("待接班确认"))
- {
- MessageBox.Show("序号:【" + Seq + "】已进行了交接班操作,不允许再次进行", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- //找到本台交接班的第一只
- DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetRackChangeFlag", new object[] { JudgeStoveNo, ActiveResultNo, Seq.ToString(), 1, "1", Shift, Group, proPlanId, gxPlanNo }, this.ob);
- if (dt.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(dt.Rows[0]["SEQ"].ToString()))
- {
- seqlast = dt.Rows[0]["SEQ"].ToString();
- }
- else
- {
- //seqlast = "1";
- }
- }
- else
- {
- //seqlast = "1";
- }
- if (int.Parse(seqlast) > int.Parse(Seq))
- {
- MessageBox.Show("您所选的管号队列交接班支已被上一班操作,不允许进行交接班", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- else
- {
- //针对矫直探伤需重写
- //HOTMethod hm = new HOTMethod(this.ob);
- //hm.UpdateChangeFlag(ActiveJUDGE_STOVE_NO, ActiveResultNo, "", 6, int.Parse(Seq), 0);
- NativeMethodNew na = new NativeMethodNew(this.ob);
- na.UpdateChangeFlag(ActiveJUDGE_STOVE_NO, ActiveResultNo, 0, int.Parse(Seq), "1");
- }
- }
- if (e.Cell.Column.Key == "BTNCHANGECOM")
- {
- NativeMethodNew na = new NativeMethodNew(this.ob);
- int WaitChangeSeq = na.GetWaitChangeSeq(ActiveJUDGE_STOVE_NO, ActiveResultNo, 0, "1", proPlanId, gxPlanNo);
- if (WaitChangeSeq == 0)
- {
- MessageBox.Show("没有待交班确认的管号。");
- return;
- }
- if (WaitChangeSeq != int.Parse(Seq))
- {
- MessageBox.Show("交班管序号与接班管序号不符,请确认后接班。");
- return;
- }
- if (MessageUtil.ShowYesNoAndQuestion("确认炉号:【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】序号:【" + Seq + "】交班?") == DialogResult.No)
- {
- return;
- }
- int count =0;
- //if (ChangeUserID == "")
- //{
- // FrmChangeGroup frmCg = new FrmChangeGroup(this.ob);
- // frmCg.ShowDialog();
- // if (frmCg.DialogResult == DialogResult.OK)
- // {
- // ChangeUserID = frmCg._UserID;
- // //ChangePassWord = frmCg._PassWord;
- // }
- if (this.DoRelogin(DoCheck))
- {
- count = na.ChangeShift(JudgeStoveNo, this.ActiveResultNo, Seq.ToString(), this.PlineCode, Shift, Group, 1, 1, "1", proPlanId, gxPlanNo);
- }
- //}
- //else
- //{
- // count = na.ChangeShift(JudgeStoveNo, this.ActiveResultNo, Seq.ToString(), this.PlineCode, Shift, Group, 1, 1, "1");
- //}
-
- if (count < 1)
- {
- MessageBox.Show("交接班失败,请查找原因后重新操作。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- }
- //过渡方法,接班后重登陆初始化导致Grid.Row为null
- if (ultraGridPlan.Rows == null)
- {
- return;
- }
- ultraGridTC();
- GetStraightResult(JudgeStoveNo, PlineCode);//更新实绩
- ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.getSingePlanFlag", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, ob);
- if (ds.Rows[0]["BACK_PLAN_FLAG"].ToString().Equals("7"))
- {
- GetRollingCard1();
- }
- else
- {
- GetRollingCard();//更新流通卡
- }
- ChangeGridColor();
- }
- /// <summary>
- /// 2#台剔除
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraGrid_GHDL2_ClickCellButton(object sender, CellEventArgs e)
- {
- int countss = 0;
- MilSlabScrapSeqEntity ScrapSlab = new MilSlabScrapSeqEntity();
- UltraGridRow ugr = ultraGrid_GHDL2.ActiveRow;
- UltraGridRow ugr1 = ultraGridPlan.ActiveRow;
- string PlanStatuss = ultraGridPlan.ActiveRow.Cells["IS_START"].Value.ToString();
- if (PlanStatuss != "已开始矫直")
- {
- MessageBox.Show("炉号【" + ultraGridPlan.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString() + "】不是已开始矫直状态,不能剔除", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
- String MAT_NO = ugr.Cells["MAT_NO"].Value.ToString();
- String Seq = ugr.Cells["seq"].Value.ToString();
- int Seq1 = int.Parse(Seq);
- string Status = ugr1.Cells["IS_START"].Value.ToString();
- string DlSTATUS = ugr.Cells["Status"].Value.ToString();
- string plcode = ugr1.Cells["Pline_Code"].Value.ToString();
- string offline = ugr.Cells["OFFLINE_FLAG"].Value.ToString();
- if (ActiveOFFLINE_FLAG.Equals("2"))
- {
- if (!offline.Equals("返线"))
- {
- MessageBox.Show("当前为矫直返线,只允许对下线状态为返线的子管进行操作,", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- }
- string shif = ugr.Cells["COL_SHIFT"].Value.ToString();
- string group = ugr.Cells["COL_GROUP"].Value.ToString();
- Shift = UserInfo.GetUserOrder();
- Group = UserInfo.GetUserGroup();
- NativeMethodNew nasssss = new NativeMethodNew(this.ob);
- DataTable ds = new DataTable();
- if (nasssss.IsRackOperate(shif, group))
- {
- MessageBox.Show("序号:【" + Seq + "】子管已由" + shif + "," + group + "操作,不允许再进行操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (e.Cell.Column.Key == "SCRAP_SLAB")
- {
- if (Status != "已开始矫直")
- {
- MessageBox.Show("炉号【" + JudgeStoveNo + "】未开始矫直,不能剔除", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (DlSTATUS == "剔除")
- {
- MessageBox.Show("序号【" + Seq + "】该条已经剔除,不能重复剔除", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- int ScrapNumBefore = 0;
- DataTable dtcountaftersaw = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.scrapMatCheckAfterSaw", new object[] { JudgeStoveNo, 9, "2", proPlanId, gxPlanNo }, this.ob);
- ScrapNumBefore = int.Parse(dtcountaftersaw.Rows[0]["Countss"].ToString());
- DataTable dtcount = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetRackCounts", new object[] { JudgeStoveNo, Seq1, "2", proPlanId, gxPlanNo }, this.ob);
- if (dtcount.Rows.Count > 0)
- {
- countss = int.Parse(dtcount.Rows[0]["COUNTSS"].ToString());
- }
- if (this.ultraGrid_GHDL2.Rows.Count - (countss + 1) < ScrapNumBefore)
- {
- MessageBox.Show("不存在序号为【" + Seq + "】的管号,可能是被前道工序剔除,不能再次剔除!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- //if (MessageUtil.ShowYesNoAndQuestion("是否剔除该子管") == DialogResult.No)
- //{
- // return;
- //}
- ScrapSlab.JudgeStoveNo = JudgeStoveNo;
- ScrapSlab.Seq = Seq;
- ScrapSlab.ProcessNo = "9";
- ScrapSlab.Flag = "0";
- ScrapSlab.ColMode = "1";
- ScrapSlab.ColUser = UserInfo.GetUserName();
- ScrapSlab.ColGroup = UserInfo.GetUserGroup();
- ScrapSlab.ColShift = UserInfo.GetUserOrder();
- ScrapSlab.ColNo = "2";
- ScrapSlab.ProPlanId = proPlanId;
- ScrapSlab.GxPlanNo = gxPlanNo;
- //剔管操作,:1、插入MIL_SLAB_SCRAP_SEQ表,2、探伤跟踪记录表状态,3、修改加探伤实绩表剔除支数
- int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.scrapFurMat", new object[] { ScrapSlab, "2" }, this.ob);
- //MessageBox.Show("管序号【" + Seq + "】剔除成功!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- ultraGridTC();//查询跟踪记录表
- GetStraightResult(JudgeStoveNo, plcode);//更新实绩
- ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.getSingePlanFlag", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, ob);
- if (ds.Rows[0]["BACK_PLAN_FLAG"].ToString().Equals("7"))
- {
- GetRollingCard1();
- }
- else
- {
- GetRollingCard();//更新流通卡
- }
- ChangeGridColor();
- }
- if (e.Cell.Column.Key == "DELBACK")
- {
- //if (MessageUtil.ShowYesNoAndQuestion("是否回退该剔除的坯料") == DialogResult.No)
- //{
- // return;
- //}
- if (!DlSTATUS.Equals("剔除"))
- {
- MessageBox.Show("该坯料未被剔除,请确认后重新选择!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- NativeMethodNew na = new NativeMethodNew(this.ob);
- int counts = 0;
- //if (Flage.Equals("1"))
- //{
- // counts = na.DeleteSlabSeq(JudgeStoveNo, Seq.ToString(), 9, 1, 0);
- //}
- //if (Flage.Equals("2"))
- //{
- counts = na.DeleteSlabSeq(JudgeStoveNo, Seq.ToString(), 10, 1, 0, proPlanId, gxPlanNo);
- //}
- //if (Flage.Equals("3s"))
- //{
- // counts = na.DeleteSlabSeq(JudgeStoveNo, Seq.ToString(), 11, 1, 0);
- //}
- if (counts > 0)
- {
- ultraGridTC();//查询跟踪记录表
- GetStraightResult(JudgeStoveNo, plcode);//更新实绩
- ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.getSingePlanFlag", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, ob);
- if (ds.Rows[0]["BACK_PLAN_FLAG"].ToString().Equals("7"))
- {
- GetRollingCard1();
- }
- else
- {
- GetRollingCard();//更新流通卡
- }
- ChangeGridColor();
- //MessageBox.Show("剔料回退成功", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- else
- {
- MessageBox.Show("剔料回退失败", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- }
-
- if (e.Cell.Column.Key == "ChangShift")
- {
- string seqlast = "";
- int ScrapNumBefore = 0;
- DataTable dtcountaftersaw = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.scrapMatCheckAfterSaw", new object[] { JudgeStoveNo, 9, "2", proPlanId, gxPlanNo }, this.ob);
- ScrapNumBefore = int.Parse(dtcountaftersaw.Rows[0]["Countss"].ToString());
- DataTable dtcount = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetRackCounts", new object[] { JudgeStoveNo, Seq1, "2", proPlanId, gxPlanNo }, this.ob);
- if (dtcount.Rows.Count > 0)
- {
- countss = int.Parse(dtcount.Rows[0]["COUNTSS"].ToString());
- }
- if (this.ultraGrid_GHDL2.Rows.Count - (countss + 1) < ScrapNumBefore)
- {
- MessageBox.Show("不存在序号为【" + Seq + "】的管号,可能是被前道工序剔除,不能再次剔除!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (ugr.Cells["CHANGE_FLAG"].Value.ToString().Equals("确认交班") || ugr.Cells["CHANGE_FLAG"].Value.ToString().Equals("待接班确认"))
- {
- MessageBox.Show("序号:【" + Seq + "】已进行了交接班操作,不允许再次进行", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- //找到本台交接班的第一只
- DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetRackChangeFlag", new object[] { JudgeStoveNo, ActiveResultNo, Seq.ToString(), 1, "2", Shift, Group, proPlanId, gxPlanNo }, this.ob);
- if (dt.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(dt.Rows[0]["SEQ"].ToString()))
- {
- seqlast = dt.Rows[0]["SEQ"].ToString();
- }
- else
- {
- //seqlast = "1";
- }
- }
- else
- {
- //seqlast = "1";
- }
- if (int.Parse(seqlast) > int.Parse(Seq))
- {
- MessageBox.Show("您所选的管号队列交接班支已被上一班操作,不允许进行交接班", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- else
- {
- //针对矫直探伤需重写
- //HOTMethod hm = new HOTMethod(this.ob);
- //hm.UpdateChangeFlag(ActiveJUDGE_STOVE_NO, ActiveResultNo, "", 6, int.Parse(Seq), 0);
- NativeMethodNew na = new NativeMethodNew(this.ob);
- na.UpdateChangeFlag(ActiveJUDGE_STOVE_NO, ActiveResultNo, 0, int.Parse(Seq), "2");
- }
- }
- if (e.Cell.Column.Key == "BTNCHANGECOM")
- {
- NativeMethodNew na = new NativeMethodNew(this.ob);
- int WaitChangeSeq = na.GetWaitChangeSeq(ActiveJUDGE_STOVE_NO, ActiveResultNo, 0, "2", proPlanId, gxPlanNo);
- if (WaitChangeSeq == 0)
- {
- MessageBox.Show("没有待交班确认的管号。");
- return;
- }
- if (WaitChangeSeq != int.Parse(Seq))
- {
- MessageBox.Show("交班管序号与接班管序号不符,请确认后接班。");
- return;
- }
- if (MessageUtil.ShowYesNoAndQuestion("确认炉号:【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】序号:【" + Seq + "】交班?") == DialogResult.No)
- {
- return;
- }
- int count = 0;
- if (this.DoRelogin(DoCheck))
- {
- count = na.ChangeShift(JudgeStoveNo, this.ActiveResultNo, Seq.ToString(), this.PlineCode, Shift, Group, 1, 1, "2", proPlanId, gxPlanNo);
- }
- //else
- //{
- // count = na.ChangeShift(JudgeStoveNo, this.ActiveResultNo, Seq.ToString(), this.PlineCode, Shift, Group, 1, 1, "2");
- //}
-
- if (count < 1)
- {
- MessageBox.Show("交接班失败,请查找原因后重新操作。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- }
- if (this.ultraGridPlan.Rows == null)
- {
- return;
- }
- ultraGridTC();
- GetStraightResult(JudgeStoveNo, PlineCode);//更新实绩
- ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.getSingePlanFlag", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, ob);
- if (ds.Rows[0]["BACK_PLAN_FLAG"].ToString().Equals("7"))
- {
- GetRollingCard1();
- }
- else
- {
- GetRollingCard();//更新流通卡
- }
-
- ChangeGridColor();
- }
- /// <summary>
- /// 3#台剔除
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraGrid_GHDL3_ClickCellButton(object sender, CellEventArgs e)
- {
- int countss = 0;
- MilSlabScrapSeqEntity ScrapSlab = new MilSlabScrapSeqEntity();
- UltraGridRow ugr = ultraGrid_GHDL3.ActiveRow;
- UltraGridRow ugr1 = ultraGridPlan.ActiveRow;
- string PlanStatuss = ultraGridPlan.ActiveRow.Cells["IS_START"].Value.ToString();
- if (PlanStatuss != "已开始矫直")
- {
- MessageBox.Show("炉号【" + ultraGridPlan.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString() + "】不是已开始矫直状态,不能剔除", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
- String MAT_NO = ugr.Cells["MAT_NO"].Value.ToString();
- String Seq = ugr.Cells["seq"].Value.ToString();
- int Seq1 = int.Parse(Seq);
- string Status = ugr1.Cells["IS_START"].Value.ToString();
- string DlSTATUS = ugr.Cells["Status"].Value.ToString();
- string plcode = ugr1.Cells["Pline_Code"].Value.ToString();
- string offline = ugr.Cells["OFFLINE_FLAG"].Value.ToString();
- if (ActiveOFFLINE_FLAG.Equals("2"))
- {
- if (!offline.Equals("返线"))
- {
- MessageBox.Show("当前为矫直返线,只允许对下线状态为返线的子管进行操作,", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- }
- string shif = ugr.Cells["COL_SHIFT"].Value.ToString();
- string group = ugr.Cells["COL_GROUP"].Value.ToString();
- Shift = UserInfo.GetUserOrder();
- Group = UserInfo.GetUserGroup();
- NativeMethodNew nasssss = new NativeMethodNew(this.ob);
- DataTable ds = new DataTable();
- if (nasssss.IsRackOperate(shif, group))
- {
- MessageBox.Show("序号:【" + Seq + "】子管已由" + shif + "," + group + "操作,不允许再进行操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (e.Cell.Column.Key == "SCRAP_SLAB")
- {
- if (Status != "已开始矫直")
- {
- MessageBox.Show("炉号【" + JudgeStoveNo + "】未开始矫直,不能剔除", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (DlSTATUS == "剔除")
- {
- MessageBox.Show("序号【" + Seq + "】该条已经剔除,不能重复剔除", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- int ScrapNumBefore = 0;
- DataTable dtcountaftersaw = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.scrapMatCheckAfterSaw", new object[] { JudgeStoveNo, 9, "3", proPlanId, gxPlanNo }, this.ob);
- ScrapNumBefore = int.Parse(dtcountaftersaw.Rows[0]["Countss"].ToString());
- DataTable dtcount = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetRackCounts", new object[] { JudgeStoveNo, Seq1, "3", proPlanId, gxPlanNo }, this.ob);
- if (dtcount.Rows.Count > 0)
- {
- countss = int.Parse(dtcount.Rows[0]["COUNTSS"].ToString());
- }
- if (this.ultraGrid_GHDL3.Rows.Count - (countss + 1) < ScrapNumBefore)
- {
- MessageBox.Show("不存在序号为【" + Seq + "】的管号,可能是被前道工序剔除,不能再次剔除!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- //if (MessageUtil.ShowYesNoAndQuestion("是否剔除该子管") == DialogResult.No)
- //{
- // return;
- //}
- ScrapSlab.JudgeStoveNo = JudgeStoveNo;
- ScrapSlab.Seq = Seq;
- ScrapSlab.ProcessNo = "9";
- ScrapSlab.Flag = "0";
- ScrapSlab.ColMode = "1";
- ScrapSlab.ColUser = UserInfo.GetUserName();
- ScrapSlab.ColGroup = UserInfo.GetUserGroup();
- ScrapSlab.ColShift = UserInfo.GetUserOrder();
- ScrapSlab.ColNo = "3";
- ScrapSlab.ProPlanId = proPlanId;
- ScrapSlab.GxPlanNo = gxPlanNo;
- //剔管操作,:1、插入MIL_SLAB_SCRAP_SEQ表,2、探伤跟踪记录表状态,3、修改加探伤实绩表剔除支数
- int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.scrapFurMat", new object[] { ScrapSlab, "3" }, this.ob);
- //MessageBox.Show("管序号【" + Seq + "】剔除成功!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- ultraGridTC();//查询跟踪记录表
- GetStraightResult(JudgeStoveNo, plcode);//更新实绩
- ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.getSingePlanFlag", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, ob);
- if (ds.Rows[0]["BACK_PLAN_FLAG"].ToString().Equals("7"))
- {
- GetRollingCard1();
- }
- else
- {
- GetRollingCard();//更新流通卡
- }
- ChangeGridColor();
- }
- if (e.Cell.Column.Key == "DELBACK")
- {
- //if (MessageUtil.ShowYesNoAndQuestion("是否回退该剔除的坯料") == DialogResult.No)
- //{
- // return;
- //}
- if (!DlSTATUS.Equals("剔除"))
- {
- MessageBox.Show("该坯料未被剔除,请确认后重新选择!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- NativeMethodNew na = new NativeMethodNew(this.ob);
- int counts = 0;
- //if (Flage.Equals("1"))
- //{
- // counts = na.DeleteSlabSeq(JudgeStoveNo, Seq.ToString(), 9, 1, 0);
- //}
- //if (Flage.Equals("2"))
- //{
- //counts = na.DeleteSlabSeq(JudgeStoveNo, Seq.ToString(), 10, 1, 0);
- //}
- //if (Flage.Equals("3s"))
- //{
- counts = na.DeleteSlabSeq(JudgeStoveNo, Seq.ToString(), 11, 1, 0, proPlanId, gxPlanNo);
- //}
- if (counts > 0)
- {
- ultraGridTC();//查询跟踪记录表
- GetStraightResult(JudgeStoveNo, plcode);//更新实绩
- ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.getSingePlanFlag", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, ob);
- if (ds.Rows[0]["BACK_PLAN_FLAG"].ToString().Equals("7"))
- {
- GetRollingCard1();
- }
- else
- {
- GetRollingCard();//更新流通卡
- }
- ChangeGridColor();
- //MessageBox.Show("剔料回退成功", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- else
- {
- MessageBox.Show("剔料回退失败", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- }
- #region 原来的交接班方法
- //if (e.Cell.Column.Key == "ChangShift")
- //{
- // int ScrapNumBefore = 0;
- // DataTable dtcountaftersaw = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.scrapMatCheckAfterSaw", new object[] { JudgeStoveNo, 9, "3" }, this.ob);
- // ScrapNumBefore = int.Parse(dtcountaftersaw.Rows[0]["Countss"].ToString());
- // DataTable dtcount = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetRackCounts", new object[] { JudgeStoveNo, Seq1, "3" }, this.ob);
- // if (dtcount.Rows.Count > 0)
- // {
- // countss = int.Parse(dtcount.Rows[0]["COUNTSS"].ToString());
- // }
- // if (this.ultraGrid_GHDL3.Rows.Count - (countss + 1) < ScrapNumBefore)
- // {
- // MessageBox.Show("不存在序号为【" + Seq + "】的管号,可能是被前道工序剔除,不能再次剔除!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- // return;
- // }
- // NativeMethodNew nas = new NativeMethodNew(this.ob);
- // Shift = UserInfo.GetUserOrder();
- // Group = UserInfo.GetUserGroup();
- // if (ugr.Cells["CHANGE_FLAG"].Value.ToString().Equals("正常"))
- // {
- // int count = nas.ChangeShift(JudgeStoveNo, this.ActiveResultNo, Seq.ToString(), this.PlineCode, Shift, Group, 1, 1, "3");
- // if (count < 1)
- // {
- // MessageBox.Show("交接班失败,请查找原因后重新操作。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- // return;
- // }
- // }
- // if (ugr.Cells["CHANGE_FLAG"].Value.ToString().Equals("交班点"))//回退
- // {
- // }
- //}
- #endregion
- if (e.Cell.Column.Key == "ChangShift")
- {
- string seqlast = "";
- int ScrapNumBefore = 0;
- DataTable dtcountaftersaw = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.scrapMatCheckAfterSaw", new object[] { JudgeStoveNo, 9, "3", proPlanId, gxPlanNo }, this.ob);
- ScrapNumBefore = int.Parse(dtcountaftersaw.Rows[0]["Countss"].ToString());
- DataTable dtcount = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetRackCounts", new object[] { JudgeStoveNo, Seq1, "3", proPlanId, gxPlanNo }, this.ob);
- if (dtcount.Rows.Count > 0)
- {
- countss = int.Parse(dtcount.Rows[0]["COUNTSS"].ToString());
- }
- if (this.ultraGrid_GHDL3.Rows.Count - (countss + 1) < ScrapNumBefore)
- {
- MessageBox.Show("不存在序号为【" + Seq + "】的管号,可能是被前道工序剔除,不能再次剔除!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (ugr.Cells["CHANGE_FLAG"].Value.ToString().Equals("确认交班") || ugr.Cells["CHANGE_FLAG"].Value.ToString().Equals("待接班确认"))
- {
- MessageBox.Show("序号:【" + Seq + "】已进行了交接班操作,不允许再次进行", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- //找到本台交接班的第一只
- DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetRackChangeFlag", new object[] { JudgeStoveNo, ActiveResultNo, Seq.ToString(), 1, "3", Shift, Group, proPlanId, gxPlanNo }, this.ob);
- if (dt.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(dt.Rows[0]["SEQ"].ToString()))
- {
- seqlast = dt.Rows[0]["SEQ"].ToString();
- }
- else
- {
- //seqlast = "1";
- }
- }
- else
- {
- //seqlast = "1";
- }
- if (int.Parse(seqlast) > int.Parse(Seq))
- {
- MessageBox.Show("您所选的管号队列交接班支已被上一班操作,不允许进行交接班", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- else
- {
- //针对矫直探伤需重写
- //HOTMethod hm = new HOTMethod(this.ob);
- //hm.UpdateChangeFlag(ActiveJUDGE_STOVE_NO, ActiveResultNo, "", 6, int.Parse(Seq), 0);
- NativeMethodNew na = new NativeMethodNew(this.ob);
- na.UpdateChangeFlag(ActiveJUDGE_STOVE_NO, ActiveResultNo, 0, int.Parse(Seq), "3");
- }
- }
- if (e.Cell.Column.Key == "BTNCHANGECOM")
- {
- NativeMethodNew na = new NativeMethodNew(this.ob);
- int WaitChangeSeq = na.GetWaitChangeSeq(ActiveJUDGE_STOVE_NO, ActiveResultNo, 0, "3", proPlanId, gxPlanNo);
- if (WaitChangeSeq == 0)
- {
- MessageBox.Show("没有待交班确认的管号。");
- return;
- }
- if (WaitChangeSeq != int.Parse(Seq))
- {
- MessageBox.Show("交班管序号与接班管序号不符,请确认后接班。");
- return;
- }
- if (MessageUtil.ShowYesNoAndQuestion("确认炉号:【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】序号:【" + Seq + "】交班?") == DialogResult.No)
- {
- return;
- }
- int count = 0;
- if (this.DoRelogin(DoCheck))
- {
- count = na.ChangeShift(JudgeStoveNo, this.ActiveResultNo, Seq.ToString(), this.PlineCode, Shift, Group, 1, 1, "3", proPlanId, gxPlanNo);
- }
- //else
- //{
- // count = na.ChangeShift(JudgeStoveNo, this.ActiveResultNo, Seq.ToString(), this.PlineCode, Shift, Group, 1, 1, "3");
- //}
- if (count < 1)
- {
- MessageBox.Show("交接班失败,请查找原因后重新操作。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- }
- if (this.ultraGridPlan.Rows == null)
- {
- return;
- }
- ultraGridTC();
- GetStraightResult(JudgeStoveNo, PlineCode);//更新实绩
- ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.getSingePlanFlag", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, ob);
- if (ds.Rows[0]["BACK_PLAN_FLAG"].ToString().Equals("7"))
- {
- GetRollingCard1();
- }
- else
- {
- GetRollingCard();//更新流通卡
- }
- ChangeGridColor();
- }
- public string DoCheck(CoreUserInfo User)
- {
- return "";
- }
- /// <summary>
- /// ///计划表ROW点击变换判断
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraGridPlan_BeforeRowActivate(object sender, RowEventArgs e)
- {
- if (this.straighteningResult1.IsCellSelect == true)
- {
- NativeMethodNew na = new NativeMethodNew(this.ob);
- if (!na.isBegineNode(ActiveJUDGE_STOVE_NO, 7))
- {
- this.straighteningResult1.IsCellSelect = false;
- return;
- }
- //if (MessageBox.Show("提示:穿孔实绩可能已修改,是否保存", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
- //{
- this.straighteningResult1.IsCellSelect = false;
- //保存探伤实绩
- //StraighteningSave();
- //}
- //else
- //{
- this.straighteningResult1.IsCellSelect = false;
- foreach (UltraGridRow ugr in this.ultraGridPlan.Rows)
- {
- if (ugr.Cells["JUDGE_STOVE_NO"].Value.ToString() == ActiveJUDGE_STOVE_NO)
- {
- this.ultraGridPlan.ActiveRow = ugr;
- }
- }
- return;
- //}
- }
- if (this.frmStraighteningResult11.IsCellSelect == true)
- {
- NativeMethodNew na = new NativeMethodNew(this.ob);
- if (!na.isBegineNode(ActiveJUDGE_STOVE_NO, 7))
- {
- this.frmStraighteningResult11.IsCellSelect = false;
- return;
- }
- //if (MessageBox.Show("提示:穿孔实绩可能已修改,是否保存", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
- //{
- this.frmStraighteningResult11.IsCellSelect = false;
- //保存探伤实绩
- //StraighteningSave();
- //}
- //else
- //{
- this.frmStraighteningResult11.IsCellSelect = false;
- foreach (UltraGridRow ugr in this.ultraGridPlan.Rows)
- {
- if (ugr.Cells["JUDGE_STOVE_NO"].Value.ToString() == ActiveJUDGE_STOVE_NO)
- {
- this.ultraGridPlan.ActiveRow = ugr;
- }
- }
- return;
- //}
- }
- if (this.frmStraighteningResult21.IsCellSelect == true)
- {
- NativeMethodNew na = new NativeMethodNew(this.ob);
- if (!na.isBegineNode(ActiveJUDGE_STOVE_NO, 7))
- {
- this.frmStraighteningResult21.IsCellSelect = false;
- return;
- }
- //if (MessageBox.Show("提示:穿孔实绩可能已修改,是否保存", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
- //{
- this.frmStraighteningResult21.IsCellSelect = false;
- //保存探伤实绩
- //StraighteningSave();
- //}
- //else
- //{
- this.frmStraighteningResult21.IsCellSelect = false;
- foreach (UltraGridRow ugr in this.ultraGridPlan.Rows)
- {
- if (ugr.Cells["JUDGE_STOVE_NO"].Value.ToString() == ActiveJUDGE_STOVE_NO)
- {
- this.ultraGridPlan.ActiveRow = ugr;
- }
- }
- return;
- //}
- }
- }
- /// <summary>
- /// 查询结炉实绩
- /// </summary>
- public void NodeQuery()
- {
- string Shift = UserInfo.GetUserOrder();
- string Group = UserInfo.GetUserGroup();
- string PliceCode = PlineCode;
- string StartTime = DateTime.Now.ToString("yyyy-MM-dd");
- string EndTime = DateTime.Now.AddDays(1).ToString("yyyy-MM-dd");
- string Date = StartTime;
- StartTime = StartTime + " 00:00:00";
- EndTime = EndTime + " 00:00:00";
- DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetStraightResultNodeQuery", new object[] { PliceCode, Shift, Group, StartTime, EndTime }, this.ob);
- FrmNodeResultQuery frm = new FrmNodeResultQuery(dt, 10, Date, Shift, Group, this.ob);
- frm.ShowDialog();
- }
- /// <summary>
- /// 矫直离线
- /// </summary>
- public void Offline()
- {
- DataTable dtFlag = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetSingleJRLResult", new object[] { ActiveJUDGE_STOVE_NO, proPlanId, gxPlanNo }, this.ob);
- if (dtFlag.Rows.Count > 0)
- {
- if (string.IsNullOrEmpty(dtFlag.Rows[0]["NODE_FUR_FLAG"].ToString()))
- {
- MessageBox.Show("炉号【" + ActiveJUDGE_STOVE_NO + "】未开始分切,不允许下线", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (dtFlag.Rows[0]["NODE_FUR_FLAG"].ToString() != "1")
- {
- MessageBox.Show("炉号【" + ActiveJUDGE_STOVE_NO + "】未完成分切,不允许下线 ", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- }
- //工序状态:01-矫直1#,02-矫直2#,03-矫直3#,11-ET探伤,12-MT探伤,13-UT探伤
- string Node = "JZ";
- beforeQualifiedNum = this.rollingCard1.Value.SawQualifiedNum;
- qualifiedNum = string.IsNullOrEmpty(this.rollingCard1.Value.StraightQualifiedNum) ? "0" : this.rollingCard1.Value.StraightQualifiedNum;
- scrapNum = string.IsNullOrEmpty(this.rollingCard1.Value.StraightScrapNum) ? "0" : this.rollingCard1.Value.StraightScrapNum;
- offineHas = string.IsNullOrEmpty(this.rollingCard1.Value.OfflineStraight) ? "0" : this.rollingCard1.Value.OfflineStraight;
- offineHead = string.IsNullOrEmpty(this.rollingCard1.Value.BacklineStraight) ? "0" : this.rollingCard1.Value.BacklineStraight;
- string numb = (int.Parse(beforeQualifiedNum.ToString3()) - int.Parse(qualifiedNum.ToString3()) - int.Parse(scrapNum.ToString3()) - int.Parse(offineHas.ToString3()) + int.Parse(offineHead.ToString3())).ToString();
- FrmStraighteningOffLine frm = new FrmStraighteningOffLine(Node, this.ob, PlineCode, stoveno, lotno, numb, proPlanId, gxPlanNo);
- frm.ShowDialog();
- PlanQuery();
- }
- public void Offline2()
- {
- DataTable dtFlag = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetSingleJRLResult", new object[] { ActiveJUDGE_STOVE_NO, proPlanId, gxPlanNo }, this.ob);
- if (dtFlag.Rows.Count > 0)
- {
- if (string.IsNullOrEmpty(dtFlag.Rows[0]["NODE_FUR_FLAG"].ToString()))
- {
- MessageBox.Show("炉号【" + ActiveJUDGE_STOVE_NO + "】未开始分切,不允许下线", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (dtFlag.Rows[0]["NODE_FUR_FLAG"].ToString() != "1")
- {
- MessageBox.Show("炉号【" + ActiveJUDGE_STOVE_NO + "】未完成分切,不允许下线 ", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- }
- //工序状态:01-矫直1#,02-矫直2#,03-矫直3#,11-ET探伤,12-MT探伤,13-UT探伤
- string Node = "02";
- //FrmOffLineOperation frm = new FrmOffLineOperation(Node, this.ob, PlineCode, stoveno, lotno);
- //if (frm.ShowDialog() == DialogResult.OK)
- //{
- // ultraGridTC();
- //}
- }
- public void Offline3()
- {
- if (!PlineCode.Equals("C010"))
- {
- MessageBox.Show("本产线不是168产线,没有3#矫直台,不允许执行3#台下线操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- DataTable dtFlag = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetSingleJRLResult", new object[] { ActiveJUDGE_STOVE_NO, proPlanId, gxPlanNo }, this.ob);
- if (dtFlag.Rows.Count > 0)
- {
- if (string.IsNullOrEmpty(dtFlag.Rows[0]["NODE_FUR_FLAG"].ToString()))
- {
- MessageBox.Show("炉号【" + ActiveJUDGE_STOVE_NO + "】未开始分切,不允许下线", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (dtFlag.Rows[0]["NODE_FUR_FLAG"].ToString() != "1")
- {
- MessageBox.Show("炉号【" + ActiveJUDGE_STOVE_NO + "】未完成分切,不允许下线 ", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- }
- //工序状态:01-矫直1#,02-矫直2#,03-矫直3#,11-ET探伤,12-MT探伤,13-UT探伤
- string Node = "03";
- //FrmOffLineOperation frm = new FrmOffLineOperation(Node, this.ob, PlineCode, stoveno, lotno);
- //if (frm.ShowDialog() == DialogResult.OK)
- //{
- // ultraGridTC();
- //}
- }
- public void BackLine1()
- {
- //工序状态:01-矫直1#,02-矫直2#,03-矫直3#,11-ET探伤,12-MT探伤,13-UT探伤
- string Node = "01";
- BackLineOperate frm = new BackLineOperate(Node, this.ob, PlineCode, stoveno, lotno);
- if (frm.ShowDialog() == DialogResult.OK)
- {
- ultraGridTC();
- }
- }
- public void BackLine2()
- {
- //工序状态:01-矫直1#,02-矫直2#,03-矫直3#,11-ET探伤,12-MT探伤,13-UT探伤
- string Node = "02";
- BackLineOperate frm = new BackLineOperate(Node, this.ob, PlineCode, stoveno, lotno);
- if (frm.ShowDialog() == DialogResult.OK)
- {
- ultraGridTC();
- }
- }
- public void BackLine3()
- {
- if (!PlineCode.Equals("C010"))
- {
- MessageBox.Show("本产线不是168产线,没有3#矫直台,不允许执行3#台下线操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- //工序状态:01-矫直1#,02-矫直2#,03-矫直3#,11-ET探伤,12-MT探伤,13-UT探伤
- string Node = "03";
- BackLineOperate frm = new BackLineOperate(Node, this.ob, PlineCode, stoveno, lotno);
- if (frm.ShowDialog() == DialogResult.OK)
- {
- ultraGridTC();
- }
- }
- private void ChangeShiftBack()
- {
- if (string.IsNullOrEmpty(this.ActiveJUDGE_STOVE_NO))
- {
- MessageBox.Show("您未选择任何计划,不允许进行交班回退操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- UltraGridRow ugr_plan = this.ultraGridPlan.ActiveRow;
- string Status = ugr_plan.Cells["IS_START"].Value.ToString();
- if (Status == "已完成矫直")
- {
- MessageBox.Show("炉号:【" + ActiveJUDGE_STOVE_NO + "】已完成矫直操作,不允许进行交班取消!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (Status == "未开始矫直")
- {
- MessageBox.Show("炉号:【" + ActiveJUDGE_STOVE_NO + "】未开始矫直操作,不允许进行交班取消!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- string Shift = UserInfo.GetUserOrder();
- string Group = UserInfo.GetUserGroup();
- NativeMethodNew na = new NativeMethodNew(this.ob);
- if (na.ChangeShiftBackCheck(this.ActiveJUDGE_STOVE_NO, this.ActiveResultNo, this.PlineCode, Shift, Group, 7, "1") || na.ChangeShiftBackCheck(this.ActiveJUDGE_STOVE_NO, this.ActiveResultNo, this.PlineCode, Shift, Group, 7, "2") || na.ChangeShiftBackCheck(this.ActiveJUDGE_STOVE_NO, this.ActiveResultNo, this.PlineCode, Shift, Group, 7, "3") || na.ChangeShiftBackCheckelse(this.ActiveJUDGE_STOVE_NO, this.ActiveResultNo, this.PlineCode, Shift, Group, 7, "1", proPlanId, gxPlanNo) || na.ChangeShiftBackCheckelse(this.ActiveJUDGE_STOVE_NO, this.ActiveResultNo, this.PlineCode, Shift, Group, 7, "2", proPlanId, gxPlanNo) || na.ChangeShiftBackCheckelse(this.ActiveJUDGE_STOVE_NO, this.ActiveResultNo, this.PlineCode, Shift, Group, 7, "3", proPlanId, gxPlanNo))
- {
- int count = na.ChangeShiftBack(this.ActiveJUDGE_STOVE_NO, this.ActiveResultNo, this.PlineCode, Shift, Group, 7, "1", proPlanId, gxPlanNo);
- na.ChangeShiftBack(this.ActiveJUDGE_STOVE_NO, this.ActiveResultNo, this.PlineCode, Shift, Group, 7, "2", proPlanId, gxPlanNo);
- if (this.PlineCode.Equals("C010"))
- {
- na.ChangeShiftBack(this.ActiveJUDGE_STOVE_NO, this.ActiveResultNo, this.PlineCode, Shift, Group, 7, "3", proPlanId, gxPlanNo);
- }
- if (count < 1)
- {
- //MessageBox.Show("交班回退失败, 请确认后重新操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- }
- else
- {
- switch (Shift)
- {
- case "1":
- Shift = "早班";
- break;
- case "2":
- Shift = "中班";
- break;
- case "3":
- Shift = "夜班";
- break;
- }
- switch (Group)
- {
- case "1":
- Group = "甲班";
- break;
- case "2":
- Group = "乙班";
- break;
- case "3":
- Group = "丙班";
- break;
- case "4":
- Group = "丁班";
- break;
- }
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】未在" + Group + "," + Shift + "进行交班操作,不允许进行交班取消操作");
- return;
- }
- GetStraightResult(ActiveJUDGE_STOVE_NO, PlineCode);//更新实绩
- ultraGridTC();
- ChangeGridColor();
- }
- private void PrintResult()
- {
- DateTime SeverTime = NativeMethod.GetSeverTime(this.ob);
- string Time = SeverTime.ToLongTimeString();
- string StartTime = "";
- string EndTime = "";
- string strurl = "";
- switch (PlineCode)
- {
- case "C008": //250
- //晚班
- Time = Time.Replace(":", "");
- if (int.Parse(Time) < 070000)
- {
- StartTime = SeverTime.AddDays(-1).ToShortDateString() + " 07:00:00";
- EndTime = SeverTime.ToShortDateString() + " 07:00:00";
- string Date2 = SeverTime.ToString("yyyy-MM-dd");
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilStraighteningResult250.cpt&format=pdf&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
- }
- else
- {
- StartTime = SeverTime.ToShortDateString() + " 07:00:00";
- EndTime = SeverTime.AddDays(1).ToShortDateString() + " 07:00:00";
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilStraighteningResult250.cpt&format=pdf&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
- }
- break;
- case "C009": //258
- //晚班
- Time = Time.Replace(":", "");
- if (int.Parse(Time) < 070000)
- {
- StartTime = SeverTime.AddDays(-1).ToShortDateString() + " 07:00:00";
- EndTime = SeverTime.ToShortDateString() + " 07:00:00";
- string Date2 = SeverTime.ToString("yyyy-MM-dd");
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilStraighteningResult258.cpt&format=pdf&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
- }
- else
- {
- StartTime = SeverTime.ToShortDateString() + " 07:00:00";
- EndTime = SeverTime.AddDays(1).ToShortDateString() + " 07:00:00";
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilStraighteningResult258.cpt&format=pdf&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
- }
- break;
- case "C010": //168
- //晚班
- Time = Time.Replace(":", "");
- if (int.Parse(Time) < 070000)
- {
- StartTime = SeverTime.AddDays(-1).ToShortDateString() + " 07:00:00";
- EndTime = SeverTime.ToShortDateString() + " 07:00:00";
- string Date2 = SeverTime.ToString("yyyy-MM-dd");
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilStraighteningResult168.cpt&format=pdf&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
- }
- else
- {
- StartTime = SeverTime.ToShortDateString() + " 07:00:00";
- EndTime = SeverTime.AddDays(1).ToShortDateString() + " 07:00:00";
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilStraighteningResult168.cpt&format=pdf&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
- }
- break;
- case "C012": //Arssel
- break;
- case "C017": //460
- //晚班
- Time = Time.Replace(":", "");
- if (int.Parse(Time) < 070000)
- {
- StartTime = SeverTime.AddDays(-1).ToShortDateString() + " 07:00:00";
- EndTime = SeverTime.ToShortDateString() + " 07:00:00";
- string Date2 = SeverTime.ToString("yyyy-MM-dd");
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilStraighteningResult460.cpt&format=pdf&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
- }
- else
- {
- StartTime = SeverTime.ToShortDateString() + " 07:00:00";
- EndTime = SeverTime.AddDays(1).ToShortDateString() + " 07:00:00";
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilStraighteningResult460.cpt&format=pdf&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
- }
- break;
- case "C072": //508
- //晚班
- Time = Time.Replace(":", "");
- if (int.Parse(Time) < 070000)
- {
- StartTime = SeverTime.AddDays(-1).ToShortDateString() + " 07:00:00";
- EndTime = SeverTime.ToShortDateString() + " 07:00:00";
- string Date2 = SeverTime.ToString("yyyy-MM-dd");
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilStraighteningResult508.cpt&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
- }
- else
- {
- StartTime = SeverTime.ToShortDateString() + " 07:00:00";
- EndTime = SeverTime.AddDays(1).ToShortDateString() + " 07:00:00";
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilStraighteningResult508.cpt&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
- }
- break;
- }
- FrmExcel fre = new FrmExcel(this.ob, strurl);
- //FrmRepExcel fre = new FrmRepExcel(ob, strurl);
- fre.AutoSize = true;
- fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- fre.WindowState = FormWindowState.Maximized;
- fre.Show();
- }
- public void colchang()
- {
- if (string.IsNullOrEmpty(ActiveJUDGE_STOVE_NO))
- {
- MessageBox.Show("您未选择任何住计划,不允许执行子管换台操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.getSingePlanFlag", new object[] { ActiveJUDGE_STOVE_NO, proPlanId, gxPlanNo }, this.ob);
- if (!ds.Rows[0]["BACK_PLAN_FLAG"].ToString().Equals("7"))
- {
- DataTable dtResult = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.getPerResult", new object[] { ActiveJUDGE_STOVE_NO, proPlanId, gxPlanNo }, this.ob);
- DataTable dtFlag = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetSingleJRLResult", new object[] { ActiveJUDGE_STOVE_NO, proPlanId, gxPlanNo }, this.ob);
- if (dtFlag.Rows.Count == 0)
- {
- MessageBox.Show("炉号:【" + ActiveJUDGE_STOVE_NO + "】尚开始分切,不允许进行子管换台操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (string.IsNullOrEmpty(dtFlag.Rows[0]["NODE_FUR_FLAG"].ToString()))
- {
- MessageBox.Show("炉号:【" + ActiveJUDGE_STOVE_NO + "】尚开始分切,不允许进行子管换台操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (!dtFlag.Rows[0]["NODE_FUR_FLAG"].ToString().Equals("1"))
- {
- MessageBox.Show("炉号:【" + ActiveJUDGE_STOVE_NO + "】分切工序尚未结炉,不允许进行子管换台操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (dtResult.Rows.Count == 0)
- {
- MessageBox.Show("炉号:【" + ActiveJUDGE_STOVE_NO + "】尚开始矫直,不允许进行子管换台操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (string.IsNullOrEmpty(dtResult.Rows[0]["NODE_FUR_FLAG"].ToString()))
- {
- MessageBox.Show("炉号:【" + ActiveJUDGE_STOVE_NO + "】尚开始矫直,不允许进行子管换台操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (dtResult.Rows[0]["NODE_FUR_FLAG"].ToString().Equals("1"))
- {
- MessageBox.Show("炉号:【" + ActiveJUDGE_STOVE_NO + "】已完成矫直,不允许进行子管换台操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- }
- ColNoChanges col = new ColNoChanges(this.ob, "00", ActiveJUDGE_STOVE_NO, PlineCode, proPlanId, gxPlanNo);
- col.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
- if (col.ShowDialog() == DialogResult.OK)
- {
- PlanQuery();
- GetStraightResult(ActiveJUDGE_STOVE_NO, PlineCode);//更新实绩
- GetRollingCard();//更新流通卡
- ChangeGridColor();
- //this.ultraGridTC();
- //ChangeGridColor();
- }
- }
- #endregion
- }
- }
|