| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821 |
- using com.steering.mes.zgmil.entity;
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.ZGMil.Result;
- using CoreFS.CA06;
- using Infragistics.Win;
- using Infragistics.Win.UltraWinGrid;
- 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;
- namespace Core.StlMes.Client.ZGMil.NodeResultQuery
- {
- public partial class PipSawFast : FrmBase
- {
- private OpeBase _ob;
- public OpeBase Ob
- {
- get { return _ob; }
- set { _ob = value; }
- }
- private Infragistics.Win.UltraWinGrid.UltraGrid _grid = null;
- public Infragistics.Win.UltraWinGrid.UltraGrid Grid
- {
- get { return _grid; }
- }
- private MilSawResultDeatilEntity milsawdeatail = new MilSawResultDeatilEntity();
- private string PlinCode = "";
- private string HeatNo = "";
- private string proPlanId = "";//轧管订单编号
- private string gxPlanNo = "";//工序排产序号
- private string OrderLength = "";
- private string HeadLength = "";
- private string TailLengeh = "";
- private string lotno = "";
- private string stoveno = "";
- private int SAW_NUM = 0;
- private int checktotalnum = 0;
- private int checktotalnumhas = 0;
- public bool isRefresh = false;
- private string saw11 = "";//锯的选择
- private string saw12 = "";
- private string saw21 = "";
- private string saw22 = "";
- private string saw211 = "";
- private string saw212 = "";
- private string saw221 = "";
- private string saw222 = "";
- private string colno1 = "";//台号选择
- private string colno2 = "";
- private string colno3 = "";
- private int lastnum = 0;//最后一排支数
- private int rowcounts = 0;//拍支数
- //public PipSawFast()
- //{
- // InitializeComponent();
- // GridHelper.InitCardGrid(PipeSawDataSource, ultraGrid2);
- //}
- public PipSawFast(OpeBase ob, string PlinCode, string HeatNo, String ProPlanId, String GxPlanNo, string OrderLength, string HeadLength, string TailLengeh, string lotno, string stoveno, int SAW_NUM, string CUT_HEAD_LENGTHA, string CUT_TRAIL_LENGTHA, string ORDER_LENGTHA)
- {
- InitializeComponent();
- this.ultraGrid2.UpdateData();
- GridHelper.InitCardGrid(PipeSawDataSource, ultraGrid2);
- _grid = this.ultraGrid2;
- this.Ob = ob;
- this.PlinCode = PlinCode;
- this.HeatNo = HeatNo;
- this.proPlanId = ProPlanId;
- this.gxPlanNo = GxPlanNo;
- this.OrderLength = OrderLength;
- this.HeadLength = HeadLength;
- this.TailLengeh = TailLengeh;
- this.lotno = lotno;
- this.stoveno = stoveno;
- this.SAW_NUM = SAW_NUM;
-
- // GridHelper.InitCardGrid(PipeSawDataSource, ultraGrid2);
- this.ultraGrid2.Rows[0].Cells["btnCUT"].Value = "快速分切";
- this.ultraGrid2.Rows[0].Cells["btnCUTHEAD"].Value = "快速切头";
- this.ultraGrid2.Rows[0].Cells["btnCUTORDER"].Value = "快速切定尺";
- this.ultraGrid2.Rows[0].Cells["btnCUTTAIL"].Value = "快速切尾";
- this.ultraGrid2.Rows[0].Cells["btnCUTEND"].Value = "分切结束";
- //Infragistics.Win.ValueList valueList1 = new Infragistics.Win.ValueList();
- //valueList1.ValueListItems.Add("1");
- //valueList1.ValueListItems.Add("2");
- //this.ultraGrid2.Rows[0].Cells["SAW_NO"].ValueList = valueList1;
- //this.ultraGrid2.Rows[0].Cells["SAW_NO"].Value = "1";
- //Infragistics.Win.ValueList valueList2 = new Infragistics.Win.ValueList();
- //valueList2.ValueListItems.Add("0");
- //valueList2.ValueListItems.Add("3");
- //valueList2.ValueListItems.Add("4");
- //this.ultraGrid2.Rows[0].Cells["SAW_NO_N"].ValueList = valueList2;
- //this.ultraGrid2.Rows[0].Cells["SAW_NO_N"].Value = "3";
- //Infragistics.Win.ValueList valueList3 = new Infragistics.Win.ValueList();
- //valueList3.ValueListItems.Add("1#台");
- //valueList3.ValueListItems.Add("2#台");
- //if (PlinCode.Equals("C010"))//168产线三个矫直切台
- //{
- // valueList3.ValueListItems.Add("3#台");
- //}
- //this.ultraGrid2.Rows[0].Cells["COL_NO1"].ValueList = valueList3;
- //this.ultraGrid2.Rows[0].Cells["COL_NO1"].Value = "1";
- if (!PlinCode.Equals("C010"))//168产线三个矫直切台
- {
- this.ultraGrid2.DisplayLayout.Bands[0].Columns["COL_NO31"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
- this.ultraGrid2.DisplayLayout.Bands[0].Columns["COL_NO32"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
- }
- //else
- //{
- // if (SAW_NUM > 5)
- // {
- // this.ultraGrid2.DisplayLayout.Bands[0].Columns["COL_NO31"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
- // }
- // else
- // {
- // this.ultraGrid2.DisplayLayout.Bands[0].Columns["COL_NO31"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
- // }
- //}
- if (PlinCode.Equals("C010") || PlinCode.Equals("C009") || PlinCode.Equals("C012")||PlinCode.Equals("C008"))//168,258,Assel机组
- {
- this.ultraGrid2.Rows[0].Cells["SAW2"].Column.Header.Caption = "2#锯";
- this.ultraGrid2.Rows[0].Cells["SAW41"].Column.Header.Caption = "4#锯";
- }
- else
- {
- this.ultraGrid2.Rows[0].Cells["SAW2"].Column.Header.Caption = "4#锯";
- this.ultraGrid2.Rows[0].Cells["SAW41"].Column.Header.Caption = "2#锯";
- }
- this.ultraGrid2.Rows[0].Cells["COL_NO11"].Value = "True";
- this.ultraGrid2.Rows[0].Cells["COL_NO21"].Value = "True";
- this.ultraGrid2.Rows[0].Cells["COL_NO31"].Value = "False";
- this.ultraGrid2.Rows[0].Cells["SAW1"].Value = "True";
- this.saw11 = "1";
- this.ultraGrid2.Rows[0].Cells["SAW2"].Value = "False";
- this.ultraGrid2.Rows[0].Cells["SAW31"].Value = "True";
- this.saw21 = "3";
- this.ultraGrid2.Rows[0].Cells["SAW41"].Value = "False";
- //this.ultraGrid2.Rows[0].Cells["SAW32"].Value = "False";
- //this.ultraGrid2.Rows[0].Cells["SAW42"].Value = "False";
- //this.ultraGrid2.DisplayLayout.Bands[0].Columns["SAW32"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
- //this.ultraGrid2.DisplayLayout.Bands[0].Columns["SAW42"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
- this.ultraGrid2.Rows[0].Cells["JUDGE_STOVE_NO"].Value = this.HeatNo;
- this.ultraGrid2.Rows[0].Cells["ORDER_LENGTH"].Value = this.OrderLength;
- this.ultraGrid2.Rows[0].Cells["CUT_HEAD_LENGTH"].Value = this.HeadLength;
- this.ultraGrid2.Rows[0].Cells["CUT_TRAIL_LENGTH"].Value = this.TailLengeh;
- this.ultraGrid2.Rows[0].Cells["JUDGE_STOVE_NO"].Value = this.HeatNo;
- this.ultraGrid2.Rows[0].Cells["CUT_HEAD_LENGTHA"].Value = CUT_HEAD_LENGTHA;
- this.ultraGrid2.Rows[0].Cells["CUT_TRAIL_LENGTHA"].Value = CUT_TRAIL_LENGTHA;
- this.ultraGrid2.Rows[0].Cells["ORDER_LENGTHA"].Value = ORDER_LENGTHA;
- }
- /// <summary>
- /// 加载界面初始化
- /// </summary>
- /// <param name="e"></param>
- protected override void OnShown(EventArgs e)
- {
- base.OnShown(e);
- ultraGrid2.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.PipSawFast.GetCountWithoutDel", new object[] { HeatNo, proPlanId, gxPlanNo }, this._ob);
- if (dt.Rows.Count > 0)
- {
- checktotalnum = int.Parse(dt.Rows[0]["counts"].ToString());
- }
- else
- {
- MessageBox.Show("炉号:【" + HeatNo + "】未开始上料锯切,或未开始分切,请确认后重新进行快速分切操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- //return;
- }
- DataTable dt2 = ServerHelper.GetData("com.steering.mes.zgmil.coup.PipSawFast.GetCountHasSaw", new object[] { HeatNo, proPlanId, gxPlanNo }, this._ob);
- if (dt2.Rows.Count > 0)
- {
- checktotalnumhas = int.Parse(dt2.Rows[0]["counts"].ToString());
- }
- this.ultraGrid2.Rows[0].Cells["TotalNumHas"].Value = checktotalnumhas;
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.zgmil.coup.EddyCurrentTestingResult";
- ccp.MethodName = "scrapMatCheck";
- ccp.ServerParams = new Object[] { HeatNo, 7, proPlanId, gxPlanNo };
- ccp = this._ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- DataTable dd = ServerHelper.GetData("com.steering.mes.zgmil.coup.PipSawFast.doQuerySlabCount", new object[] { HeatNo, proPlanId, gxPlanNo }, this._ob);
- //int ScrapNumBefore = Convert.ToInt32(ccp.ReturnInfo);//前几道工序剔除支数
- int ScrapNumBefore = Convert.ToInt32(dd.Rows[0][0].ToString());//前几道工序剔除支数
- checktotalnum = checktotalnum - ScrapNumBefore;//当前可切支数
- this.ultraGrid2.Rows[0].Cells["TotalNum"].Value = checktotalnum;
- if (this.checktotalnumhas > 0)
- {
- DataTable dtDeatail = ServerHelper.GetData("com.steering.mes.zgmil.coup.PipeSawResult.GetResultDetail", new object[] { HeatNo, proPlanId, gxPlanNo }, this._ob);
- if (dtDeatail.Rows.Count > 0)
- {
- DataRow dr1 = null;
- DataRow dr2 = null;
- DataRow dr3 = null;
- string sawno1 = "";
- string sawno2 = "";
- string sawnon1 = "";
- string sawnon2 = "";
- string colno01 = "";
- string colno02 = "";
- string colno03 = "";
- if (dtDeatail.Rows.Count == 1)//小炉号
- {
- dr1 = dtDeatail.Rows[0];
- sawno1 = dr1["SAW_NO"].ToString();
- sawnon1 = dr1["SAW_NO_N"].ToString();
- colno01 = dr1["COL_NO"].ToString();
- this.ultraGrid2.Rows[0].Cells["ROW_COUNT"].Value = dr1["ROW_COUNT"].ToString();
- if (!string.IsNullOrEmpty(dr1["CUT_HEAD_LENGTH"].ToString()))
- {
- this.ultraGrid2.Rows[0].Cells["CUT_HEAD_LENGTHA"].Value = dr1["CUT_HEAD_LENGTH"].ToString();
- this.ultraGrid2.Rows[0].Cells["btnCUTHEAD"].Column.ButtonDisplayStyle = Infragistics.Win.UltraWinGrid.ButtonDisplayStyle.Always;
- this.ultraGrid2.Rows[0].Cells["btnCUTHEAD"].Column.CellButtonAppearance.BackColor = Color.Yellow;
- }
- if (!string.IsNullOrEmpty(dr1["ORDER_LENGTH"].ToString()))
- {
- this.ultraGrid2.Rows[0].Cells["ORDER_LENGTHA"].Value = dr1["ORDER_LENGTH"].ToString();
- this.ultraGrid2.Rows[0].Cells["btnCUTORDER"].Column.ButtonDisplayStyle = Infragistics.Win.UltraWinGrid.ButtonDisplayStyle.Always;
- this.ultraGrid2.Rows[0].Cells["btnCUTORDER"].Column.CellButtonAppearance.BackColor = Color.Yellow;
- }
- if (!string.IsNullOrEmpty(dr1["CUT_TRAIL_LENGTH"].ToString()))
- {
- this.ultraGrid2.Rows[0].Cells["CUT_TRAIL_LENGTHA"].Value = dr1["CUT_TRAIL_LENGTH"].ToString();
- this.ultraGrid2.Rows[0].Cells["btnCUTTAIL"].Column.ButtonDisplayStyle = Infragistics.Win.UltraWinGrid.ButtonDisplayStyle.Always;
- this.ultraGrid2.Rows[0].Cells["btnCUTTAIL"].Column.CellButtonAppearance.BackColor = Color.Yellow;
- }
- if (!string.IsNullOrEmpty(dr1["CUT_SPEED"].ToString())) this.ultraGrid2.Rows[0].Cells["CUT_SPEED"].Value = dr1["CUT_SPEED"].ToString();
- if (!string.IsNullOrEmpty(dr1["CUT_THICKNESS"].ToString())) this.ultraGrid2.Rows[0].Cells["CUT_THICKNESS"].Value = dr1["CUT_THICKNESS"].ToString();
- if (!string.IsNullOrEmpty(colno01))
- {
- this.ultraGrid2.Rows[0].Cells["btnCUTEND"].Column.ButtonDisplayStyle = Infragistics.Win.UltraWinGrid.ButtonDisplayStyle.Always;
- this.ultraGrid2.Rows[0].Cells["btnCUTEND"].Column.CellButtonAppearance.BackColor = Color.Yellow;
- switch (colno01)
- {
- case "1":
- this.ultraGrid2.Rows[0].Cells["COL_NO11"].Value = "True";
- break;
- case "2":
- this.ultraGrid2.Rows[0].Cells["COL_NO21"].Value = "True";
- break;
- case "3":
- this.ultraGrid2.Rows[0].Cells["COL_NO31"].Value = "True";
- break;
- }
- }
- if (!string.IsNullOrEmpty(sawno1))
- {
- if (sawno1.Equals("1"))
- {
- this.ultraGrid2.Rows[0].Cells["SAW1"].Value = "True";
- this.ultraGrid2.Rows[0].Cells["SAW2"].Value = "False";
- }
- else
- {
- this.ultraGrid2.Rows[0].Cells["SAW1"].Value = "False";
- this.ultraGrid2.Rows[0].Cells["SAW2"].Value = "True";
- }
- }
- if (!string.IsNullOrEmpty(sawnon1))
- {
- if (sawnon1.Equals("3"))
- {
- this.ultraGrid2.Rows[0].Cells["SAW31"].Value = "True";
- this.ultraGrid2.Rows[0].Cells["SAW41"].Value = "False";
- }
- else
- {
- this.ultraGrid2.Rows[0].Cells["SAW31"].Value = "False";
- this.ultraGrid2.Rows[0].Cells["SAW41"].Value = "True";
- }
- }
- }
- else
- {
- dr1 = dtDeatail.Rows[0];
- dr2 = dtDeatail.Rows[1];
- if (dtDeatail.Rows.Count>2)
- {
- dr3 = dtDeatail.Rows[2];
- colno03 = dr3["COL_NO"].ToString();
- }
-
- sawno1 = dr1["SAW_NO"].ToString();
- sawno2 = dr2["SAW_NO"].ToString();
- sawnon1 = dr1["SAW_NO_N"].ToString();
- sawnon2 = dr2["SAW_NO_N"].ToString();
- colno01 = dr1["COL_NO"].ToString();
- colno02 = dr2["COL_NO"].ToString();
-
- this.ultraGrid2.Rows[0].Cells["ROW_COUNT"].Value = dr1["ROW_COUNT"].ToString();
- if (!string.IsNullOrEmpty(dr1["CUT_HEAD_LENGTH"].ToString()))
- {
- this.ultraGrid2.Rows[0].Cells["CUT_HEAD_LENGTHA"].Value = dr1["CUT_HEAD_LENGTH"].ToString();
- this.ultraGrid2.Rows[0].Cells["btnCUTHEAD"].Column.ButtonDisplayStyle = Infragistics.Win.UltraWinGrid.ButtonDisplayStyle.Always;
- this.ultraGrid2.Rows[0].Cells["btnCUTHEAD"].Column.CellButtonAppearance.BackColor = Color.Yellow;
- }
- if (!string.IsNullOrEmpty(dr1["ORDER_LENGTH"].ToString()))
- {
- this.ultraGrid2.Rows[0].Cells["ORDER_LENGTHA"].Value = dr1["ORDER_LENGTH"].ToString();
- this.ultraGrid2.Rows[0].Cells["btnCUTORDER"].Column.ButtonDisplayStyle = Infragistics.Win.UltraWinGrid.ButtonDisplayStyle.Always;
- this.ultraGrid2.Rows[0].Cells["btnCUTORDER"].Column.CellButtonAppearance.BackColor = Color.Yellow;
- }
- if (!string.IsNullOrEmpty(dr1["CUT_TRAIL_LENGTH"].ToString()))
- {
- this.ultraGrid2.Rows[0].Cells["CUT_TRAIL_LENGTHA"].Value = dr1["CUT_TRAIL_LENGTH"].ToString();
- this.ultraGrid2.Rows[0].Cells["btnCUTTAIL"].Column.ButtonDisplayStyle = Infragistics.Win.UltraWinGrid.ButtonDisplayStyle.Always;
- this.ultraGrid2.Rows[0].Cells["btnCUTTAIL"].Column.CellButtonAppearance.BackColor = Color.Yellow;
- }
- if (!string.IsNullOrEmpty(dr1["CUT_SPEED"].ToString())) this.ultraGrid2.Rows[0].Cells["CUT_SPEED"].Value = dr1["CUT_SPEED"].ToString();
- if (!string.IsNullOrEmpty(dr1["CUT_THICKNESS"].ToString())) this.ultraGrid2.Rows[0].Cells["CUT_THICKNESS"].Value = dr1["CUT_THICKNESS"].ToString();
- #region
- //if (!this.PlinCode.Equals("C010"))
- //{
- if (!(colno01.Equals("") && colno02.Equals("") && colno03.Equals("")))
- {
- this.ultraGrid2.Rows[0].Cells["btnCUTEND"].Column.ButtonDisplayStyle = Infragistics.Win.UltraWinGrid.ButtonDisplayStyle.Always;
- this.ultraGrid2.Rows[0].Cells["btnCUTEND"].Column.CellButtonAppearance.BackColor = Color.Yellow;
- switch (colno01)
- {
- case "1":
- this.ultraGrid2.Rows[0].Cells["COL_NO11"].Value = "True";
- break;
- case "2":
- this.ultraGrid2.Rows[0].Cells["COL_NO21"].Value = "True";
- break;
- case "3":
- this.ultraGrid2.Rows[0].Cells["COL_NO31"].Value = "True";
- break;
- }
- switch (colno02)
- {
- case "1":
- this.ultraGrid2.Rows[0].Cells["COL_NO11"].Value = "True";
- break;
- case "2":
- this.ultraGrid2.Rows[0].Cells["COL_NO21"].Value = "True";
- break;
- case "3":
- this.ultraGrid2.Rows[0].Cells["COL_NO31"].Value = "True";
- break;
- }
- switch (colno03)
- {
- case "1":
- this.ultraGrid2.Rows[0].Cells["COL_NO11"].Value = "True";
- break;
- case "2":
- this.ultraGrid2.Rows[0].Cells["COL_NO21"].Value = "True";
- break;
- case "3":
- this.ultraGrid2.Rows[0].Cells["COL_NO31"].Value = "True";
- break;
- }
- }
- if (sawno1.Equals(sawno2))
- {
- if (sawno1.Equals("1"))
- {
- this.ultraGrid2.Rows[0].Cells["SAW1"].Value = "True";
- this.ultraGrid2.Rows[0].Cells["SAW2"].Value = "False";
- //this.ultraGrid2.DisplayLayout.Bands[0].Columns["SAW31"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
- //this.ultraGrid2.DisplayLayout.Bands[0].Columns["SAW41"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
- //this.ultraGrid2.DisplayLayout.Bands[0].Columns["SAW32"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
- //this.ultraGrid2.DisplayLayout.Bands[0].Columns["SAW42"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
- if (sawnon1.Equals(sawnon2))
- {
- if (sawnon1.Equals("3"))
- {
- this.ultraGrid2.Rows[0].Cells["SAW31"].Value = "True";
- this.ultraGrid2.Rows[0].Cells["SAW41"].Value = "False";
- }
- else
- {
- this.ultraGrid2.Rows[0].Cells["SAW31"].Value = "False";
- this.ultraGrid2.Rows[0].Cells["SAW41"].Value = "True";
- }
- }
- else
- {
- this.ultraGrid2.Rows[0].Cells["SAW31"].Value = "True";
- this.ultraGrid2.Rows[0].Cells["SAW41"].Value = "True";
- }
- }
- else
- {
- this.ultraGrid2.Rows[0].Cells["SAW1"].Value = "False";
- this.ultraGrid2.Rows[0].Cells["SAW2"].Value = "True";
- //this.ultraGrid2.DisplayLayout.Bands[0].Columns["SAW31"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
- //this.ultraGrid2.DisplayLayout.Bands[0].Columns["SAW41"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
- //this.ultraGrid2.DisplayLayout.Bands[0].Columns["SAW32"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
- //this.ultraGrid2.DisplayLayout.Bands[0].Columns["SAW42"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
- if (sawnon1.Equals(sawnon2))
- {
- if (sawnon1.Equals("3"))
- {
- //this.ultraGrid2.Rows[0].Cells["SAW32"].Value = "True";
- //this.ultraGrid2.Rows[0].Cells["SAW42"].Value = "False";
- this.ultraGrid2.Rows[0].Cells["SAW31"].Value = "True";
- this.ultraGrid2.Rows[0].Cells["SAW41"].Value = "False";
- }
- else
- {
- //this.ultraGrid2.Rows[0].Cells["SAW32"].Value = "False";
- //this.ultraGrid2.Rows[0].Cells["SAW42"].Value = "True";
- this.ultraGrid2.Rows[0].Cells["SAW31"].Value = "False";
- this.ultraGrid2.Rows[0].Cells["SAW41"].Value = "True";
- }
- }
- else
- {
- //this.ultraGrid2.Rows[0].Cells["SAW32"].Value = "True";
- //this.ultraGrid2.Rows[0].Cells["SAW42"].Value = "True";
- this.ultraGrid2.Rows[0].Cells["SAW31"].Value = "True";
- this.ultraGrid2.Rows[0].Cells["SAW41"].Value = "True";
- }
- }
- }
- else
- {
- this.ultraGrid2.Rows[0].Cells["SAW1"].Value = "True";
- this.ultraGrid2.Rows[0].Cells["SAW2"].Value = "True";
- #region 原来适应258的代码
- //if (sawnon1.Equals("3"))
- //{
- // this.ultraGrid2.Rows[0].Cells["SAW31"].Value = "True";
- // this.ultraGrid2.Rows[0].Cells["SAW41"].Value = "False";
- //}
- //else
- //{
- // this.ultraGrid2.Rows[0].Cells["SAW31"].Value = "False";
- // this.ultraGrid2.Rows[0].Cells["SAW41"].Value = "True";
- //}
- //if (sawnon2.Equals("4"))
- //{
- // this.ultraGrid2.DisplayLayout.Bands[0].Columns["SAW32"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
- // this.ultraGrid2.DisplayLayout.Bands[0].Columns["SAW42"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
- // this.ultraGrid2.Rows[0].Cells["SAW32"].Value = "False";
- // this.ultraGrid2.Rows[0].Cells["SAW42"].Value = "True";
- //}
- //else
- //{
- // this.ultraGrid2.DisplayLayout.Bands[0].Columns["SAW32"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
- // this.ultraGrid2.DisplayLayout.Bands[0].Columns["SAW42"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
- // this.ultraGrid2.Rows[0].Cells["SAW32"].Value = "True";
- // this.ultraGrid2.Rows[0].Cells["SAW42"].Value = "False";
- //}
- #endregion
- if (sawnon1.Equals(sawnon2))
- {
- if (sawnon1.Equals("3"))
- {
- this.ultraGrid2.Rows[0].Cells["SAW31"].Value = "True";
- }
- else
- {
- this.ultraGrid2.Rows[0].Cells["SAW41"].Value = "True";
- }
- }
- else
- {
- this.ultraGrid2.Rows[0].Cells["SAW31"].Value = "True";
- this.ultraGrid2.Rows[0].Cells["SAW41"].Value = "True";
- }
- }
- //}
- #endregion
-
- //if (PlinCode.Equals("C010"))
- //{ }
- }
- }
- }
- }
- /// <summary>
- /// 判断是否有值切不为空
- /// </summary>
- /// <returns></returns>
- private bool MaskInputCheck()
- {
- bool result = true;
- if (string.IsNullOrEmpty(ultraGrid2.Rows[0].Cells["ROW_COUNT"].Value.ToString()))
- {
- result = false;
- return result;
- }
- else
- {
- if (int.Parse(ultraGrid2.Rows[0].Cells["ROW_COUNT"].Value.ToString()) == 0)
- {
- result = false;
- return result;
- }
- }
- if (string.IsNullOrEmpty(ultraGrid2.Rows[0].Cells["ORDER_LENGTH"].Value.ToString()))
- {
- result = false;
- return result;
- }
- if (string.IsNullOrEmpty(ultraGrid2.Rows[0].Cells["CUT_HEAD_LENGTH"].Value.ToString()))
- {
- result = false;
- return result;
- }
- if (string.IsNullOrEmpty(ultraGrid2.Rows[0].Cells["CUT_TRAIL_LENGTH"].Value.ToString()))
- {
- result = false;
- return result;
- }
- if (string.IsNullOrEmpty(ultraGrid2.Rows[0].Cells["TotalNum"].Value.ToString()))
- {
- result = false;
- return result;
- }
- return result;
- }
- /// <summary>
- /// 向矫直探伤表跟踪表插入台号
- /// </summary>
- /// <param name="i">排号</param>
- /// <param name="rowcount">拍支数</param>
- private void InsertCol(int i, int rowcount)
- {
- string cl1 = this.ultraGrid2.Rows[0].Cells["COL_NO1"].Value.ToString();
- string cl2 = this.ultraGrid2.Rows[0].Cells["COL_NO2"].Value.ToString();
- string cl3 = "";
- if (PlinCode == "C010")
- {
- cl3 = this.ultraGrid2.Rows[0].Cells["COL_NO3"].Value.ToString();
- }
- //逻辑判断,1,2,3号台是否被勾选并赋给管号队列表
- if (cl1.Equals("True") && (!cl2.Equals("True")) && (!cl3.Equals("True")))//只勾选1#台
- {
- int count2 = ServerHelper.SetData("com.steering.mes.zgmil.coup.PipeSawResult.UpdteRackCOL_NO", new object[] { HeatNo, "1", rowcount, SAW_NUM, proPlanId, gxPlanNo }, this._ob);
- }
- if ((!cl1.Equals("True")) && (cl2.Equals("True")) && (!cl3.Equals("True")))//只勾选2#台
- {
- int count2 = ServerHelper.SetData("com.steering.mes.zgmil.coup.PipeSawResult.UpdteRackCOL_NO", new object[] { HeatNo, "2", rowcount, SAW_NUM, proPlanId, gxPlanNo }, this._ob);
- }
- if ((!cl1.Equals("True")) && (!cl2.Equals("True")) && (cl3.Equals("True")))//只勾选2#台
- {
- int count2 = ServerHelper.SetData("com.steering.mes.zgmil.coup.PipeSawResult.UpdteRackCOL_NO", new object[] { HeatNo, "3", rowcount, SAW_NUM, proPlanId, gxPlanNo }, this._ob);
- }
- if ((cl1.Equals("True")) && (cl2.Equals("True")) && (!cl3.Equals("True")))//1#台,2#台
- {
- switch (i % 2)
- {
- case 1:
- int count2 = ServerHelper.SetData("com.steering.mes.zgmil.coup.PipeSawResult.UpdteRackCOL_NO", new object[] { HeatNo, "1", rowcount, SAW_NUM, proPlanId, gxPlanNo }, this._ob);
- break;
- case 0:
- int count3 = ServerHelper.SetData("com.steering.mes.zgmil.coup.PipeSawResult.UpdteRackCOL_NO", new object[] { HeatNo, "2", rowcount, SAW_NUM, proPlanId, gxPlanNo }, this._ob);
- break;
- }
- }
- if ((cl1.Equals("True")) && (!cl2.Equals("True")) && (cl3.Equals("True")))//1#台,3#台
- {
- switch (i % 2)
- {
- case 1:
- int count2 = ServerHelper.SetData("com.steering.mes.zgmil.coup.PipeSawResult.UpdteRackCOL_NO", new object[] { HeatNo, "1", rowcount, SAW_NUM, proPlanId, gxPlanNo }, this._ob);
- break;
- case 0:
- int count3 = ServerHelper.SetData("com.steering.mes.zgmil.coup.PipeSawResult.UpdteRackCOL_NO", new object[] { HeatNo, "3", rowcount, SAW_NUM, proPlanId, gxPlanNo }, this._ob);
- break;
- }
- }
- if ((!cl1.Equals("True")) && (cl2.Equals("True")) && (cl3.Equals("True")))//2#台,3#台
- {
- switch (i % 2)
- {
- case 1:
- int count2 = ServerHelper.SetData("com.steering.mes.zgmil.coup.PipeSawResult.UpdteRackCOL_NO", new object[] { HeatNo, "2", rowcount, SAW_NUM, proPlanId, gxPlanNo }, this._ob);
- break;
- case 0:
- int count3 = ServerHelper.SetData("com.steering.mes.zgmil.coup.PipeSawResult.UpdteRackCOL_NO", new object[] { HeatNo, "3", rowcount, SAW_NUM, proPlanId, gxPlanNo }, this._ob);
- break;
- }
- }
- if ((cl1.Equals("True")) && (cl2.Equals("True")) && (cl3.Equals("True")))//1#台,2#台,3#台
- {
- switch (i % 3)
- {
- case 1:
- int count2 = ServerHelper.SetData("com.steering.mes.zgmil.coup.PipeSawResult.UpdteRackCOL_NO", new object[] { HeatNo, "1", rowcount, SAW_NUM, proPlanId, gxPlanNo }, this._ob);
- break;
- case 2:
- int count3 = ServerHelper.SetData("com.steering.mes.zgmil.coup.PipeSawResult.UpdteRackCOL_NO", new object[] { HeatNo, "2", rowcount, SAW_NUM, proPlanId, gxPlanNo }, this._ob);
- break;
- case 0:
- int count4 = ServerHelper.SetData("com.steering.mes.zgmil.coup.PipeSawResult.UpdteRackCOL_NO", new object[] { HeatNo, "3", rowcount, SAW_NUM, proPlanId, gxPlanNo }, this._ob);
- break;
- }
- }
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="nobefore"></param>
- /// <param name="rowno"></param>
- private void InsertColNEW(int nobefore, int rowno)
- {
- if (this.ultraGrid2.Rows[0].Cells["COL_NO11"].Value != null)
- {
- if (this.ultraGrid2.Rows[0].Cells["COL_NO11"].Value.ToString() == "True")
- {
- this.colno1 = "1";
- }
- else
- {
- this.colno1 = "";
- }
- }
- if (this.ultraGrid2.Rows[0].Cells["COL_NO21"].Value != null)
- {
- if (this.ultraGrid2.Rows[0].Cells["COL_NO21"].Value.ToString() == "True")
- {
- this.colno2 = "2";
- }
- else
- {
- this.colno2 = "";
- }
- }
- if (this.ultraGrid2.Rows[0].Cells["COL_NO31"].Value != null)
- {
- if (this.ultraGrid2.Rows[0].Cells["COL_NO31"].Value.ToString() == "True")
- {
- this.colno3 = "3";
- }
- else
- {
- this.colno3 = "";
- }
- }
- //int i = nobefore + 1;
- int i = 1;
- for (; i <= rowno; i++)
- {
- string colno = "";
- //if ((!this.PlinCode.Equals("C010")) || (this.PlinCode.Equals("C010") && this.SAW_NUM < 6))
- //{
- //逻辑判断,1,2,3号台是否被勾选并赋给管号队列表
- //switch (i % 2)
- if (this.colno1.Equals("") && this.colno2.Equals("") && this.colno3.Equals(""))
- {
- MessageUtil.ShowTips("请选择矫直线!");
- return;
- }
- else if ((!this.colno1.Equals("")) && this.colno2.Equals("") && this.colno3.Equals(""))
- {
- colno = this.colno1;
- }
- else if (this.colno1.Equals("") && !this.colno2.Equals("") && this.colno3.Equals(""))
- {
- colno = this.colno2;
- }
- else if (this.colno1.Equals("") && this.colno2.Equals("") && !this.colno3.Equals(""))
- {
- colno = this.colno3;
- }
- else if (!this.colno1.Equals("") && !this.colno2.Equals("") && this.colno3.Equals(""))
- {
- switch (i % 2)
- {
- case 1:
- colno = this.colno1;
- break;
- case 0:
- colno = this.colno2;
- break;
- }
- }
- else if (!this.colno1.Equals("") && this.colno2.Equals("") && !this.colno3.Equals(""))
- {
- switch (i % 2)
- {
- case 1:
- colno = this.colno1;
- break;
- case 0:
- colno = this.colno3;
- break;
- }
- }
- else if (this.colno1.Equals("") && !this.colno2.Equals("") && !this.colno3.Equals(""))
- {
- switch (i % 2)
- {
- case 1:
- colno = this.colno2;
- break;
- case 0:
- colno = this.colno3;
- break;
- }
- }
- else if (!this.colno1.Equals("") && !this.colno2.Equals("") && !this.colno3.Equals(""))
- {
- switch (i % 3)
- {
- case 1:
- //if ((!this.colno1.Equals("")) && (!this.colno2.Equals("")) && (!this.colno3.Equals("")))
- //{
- // colno = this.colno1;
- //}
- //else if ((!this.colno2.Equals("")))
- //{
- // colno = this.colno2;
- //}
- //else
- //{
- // colno = this.colno3;
- //}
- colno = this.colno1;
- break;
- case 0:
- //if ((!this.colno1.Equals("")) && (!this.colno2.Equals("")) && (!this.colno3.Equals("")))
- //{
- // colno = this.colno3;
- //}
- //else if ((!this.colno1.Equals("")))
- //{
- // colno = this.colno1;
- //}
- //else
- //{
- // colno = this.colno2;
- //}
- colno = this.colno2;
- break;
- case 2:
- //if ((!this.colno1.Equals("")) && (!this.colno2.Equals("")) && (!this.colno3.Equals("")))
- //{
- // colno = this.colno2;
- //}
- //else if ((!this.colno1.Equals("")))
- //{
- // colno = this.colno1;
- //}
- //else
- //{
- // colno = this.colno3;
- //}
- colno = this.colno3;
- break;
- }
- }
-
- // }
- //else
- //{
- // //if (!(this.colno1.Equals("1") && this.colno2.Equals("2") && this.colno3.Equals("3")))
- // //{
- // // MessageBox.Show("炉号:【" + this.HeatNo + "】的分切数为【" + this.SAW_NUM + "】请全选三条矫直线后重新进行矫直分切结束操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- // // return;
- // //}
- // switch (i % 6)
- // {
- // case 0:
- // colno = "3";
- // break;
- // case 1:
- // colno = "1";
- // break;
- // case 2:
- // colno = "2";
- // break;
- // case 3:
- // colno = "3";
- // break;
- // case 4:
- // colno = "1";
- // break;
- // case 5:
- // colno = "2";
- // break;
- // }
- //}
- if (i == rowno)
- {
- if (this.lastnum > 0)
- {
- //int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.PipSawFast.UpdteRackCOL_NONEW", new object[] { HeatNo, colno, this.lastnum, SAW_NUM, i }, this._ob);
- int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.PipSawFast.UpdateColno", new object[] { HeatNo, colno, this.lastnum, SAW_NUM, i, proPlanId, gxPlanNo }, this._ob);
- }
- else
- {
- //int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.PipSawFast.UpdteRackCOL_NONEW", new object[] { HeatNo, colno, this.rowcounts, SAW_NUM, i }, this._ob);
- int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.PipSawFast.UpdateColno", new object[] { HeatNo, colno, this.rowcounts, SAW_NUM, i, proPlanId, gxPlanNo }, this._ob);
- }
- }
- else
- {
- //int count2 = ServerHelper.SetData("com.steering.mes.zgmil.coup.PipSawFast.UpdteRackCOL_NONEW", new object[] { HeatNo, colno, this.rowcounts, SAW_NUM, i }, this._ob);
- int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.PipSawFast.UpdateColno", new object[] { HeatNo, colno, this.rowcounts, SAW_NUM, i, proPlanId, gxPlanNo }, this._ob);
- }
- }
- }
- /// <summary>
- /// 快速分切
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraGrid2_ClickCellButton(object sender, CellEventArgs e)
- {
- int rownoBefore = 0; //快速分切之前已切的总排数
- bool iscontinue = false;//是否可以进行快速分切
- if(!lotno.Equals("试轧料"))
- {
- if (!MaskInputCheck())
- {
- MessageBox.Show("您未输入分切的参数,请确认后重新输入", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- }
-
- DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.PipSawFast.GetCountWithoutDel", new object[] { HeatNo, proPlanId, gxPlanNo }, this._ob);
- if (dt.Rows.Count > 0)
- {
- checktotalnum = int.Parse(dt.Rows[0]["counts"].ToString());
- }
- else
- {
- MessageBox.Show("炉号:【" + HeatNo + "】未开始上料锯切,或未开始分切,请确认后重新进行快速分切操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- DataTable dt2 = ServerHelper.GetData("com.steering.mes.zgmil.coup.PipSawFast.GetCountHasSaw", new object[] { HeatNo, proPlanId, gxPlanNo }, this._ob);
- if (dt2.Rows.Count > 0)
- {
- checktotalnumhas = int.Parse(dt2.Rows[0]["counts"].ToString());
- }
- this.ultraGrid2.Rows[0].Cells["TotalNumHas"].Value = checktotalnumhas;
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.zgmil.coup.EddyCurrentTestingResult";
- ccp.MethodName = "scrapMatCheck";
- ccp.ServerParams = new Object[] { HeatNo, 7, proPlanId, gxPlanNo };
- ccp = this._ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- int ScrapNumBefore = Convert.ToInt32(ccp.ReturnInfo);//前几道工序剔除支数
- checktotalnum = checktotalnum - ScrapNumBefore;//当前可切支数
- int totalnum = 0;
- int rowcount = 0;
- totalnum = checktotalnum;
- this.ultraGrid2.Rows[0].Cells["TotalNum"].Value = totalnum;
- //totalnum = int.Parse(this.ultraGrid2.Rows[0].Cells["TotalNum"].Value.ToString());
- rowcount = int.Parse(this.ultraGrid2.Rows[0].Cells["ROW_COUNT"].Value.ToString());
- //2016-07-12
- totalnum = int.Parse(this.ultraGrid2.Rows[0].Cells["TotalNum"].Value.ToString3()) + int.Parse(this.ultraGrid2.Rows[0].Cells["TotalNumHas"].Value.ToString3());
- //2016-07-12注释
- //DataTable dtDeatail = ServerHelper.GetData("com.steering.mes.zgmil.coup.PipeSawResult.GetResultDetail", new object[] { HeatNo }, this._ob);
- //if (dtDeatail.Rows.Count > 0)
- //{
- // foreach (DataRow dr in dtDeatail.Rows)
- // {
- // int s = Int16.Parse(dr["ROW_NO"].ToString());
- // rownoBefore = (rownoBefore > s) ? rownoBefore : s;
- // if (!dr["SAW_FLAG"].ToString().Equals("3"))
- // {
- // //MessageBox.Show("排号:" + rownoBefore + "还未分切完成,请确认并分切完后再执行快速分切操作。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- // //return;
- // }
- // else
- // {
- // iscontinue = true;
- // }
- // }
- //}
- if (this.ultraGrid2.Rows[0].Cells["SAW1"].Value.ToString() == "True")
- {
- saw11 = "1";
- }
- else
- {
- saw11 = "";
- }
- if (this.ultraGrid2.Rows[0].Cells["SAW2"].Value.ToString() == "True")
- {
- saw12 = this.ultraGrid2.Rows[0].Cells["SAW2"].Column.Header.Caption.ToString2().Substring(0, 1);
- }
- else
- {
- saw12 = "";
- }
- if (this.ultraGrid2.Rows[0].Cells["SAW31"].Value != null)
- {
- //2#台选择的锯进行联动
- if (this.ultraGrid2.Rows[0].Cells["SAW31"].Value.ToString() == "True")
- {
- //this.saw211 = "3";
- this.saw21 = this.ultraGrid2.Rows[0].Cells["SAW31"].Column.Header.Caption.ToString2().Substring(0, 1);
- }
- else
- {
- //this.saw211 = "";
- this.saw21 = "";
- }
- }
- //if (this.ultraGrid2.Rows[0].Cells["SAW32"].Value != null)
- //{
- // if (this.ultraGrid2.Rows[0].Cells["SAW32"].Value.ToString() == "True")
- // {
- // this.saw221 = "3";
- // }
- // else
- // {
- // this.saw221 = "";
- // }
- //}
- if (this.ultraGrid2.Rows[0].Cells["SAW41"].Value != null)
- {
- if (this.ultraGrid2.Rows[0].Cells["SAW41"].Value.ToString() == "True")
- {
- //this.saw212 = "4";
- this.saw22 = this.ultraGrid2.Rows[0].Cells["SAW41"].Column.Header.Caption.ToString2().Substring(0, 1);
- }
- else
- {
- //this.saw212 = "";
- this.saw22 = "";
- }
- }
- //if (this.ultraGrid2.Rows[0].Cells["SAW42"].Value != null)
- //{
- // if (this.ultraGrid2.Rows[0].Cells["SAW42"].Value.ToString() == "True")
- // {
- // this.saw222 = "4";
- // }
- // else
- // {
- // this.saw222 = "";
- // }
- //}
- //if (!string.IsNullOrEmpty(saw11))
- //{
- // if (saw211.Equals("") && saw212.Equals(""))
- // {
- // MessageBox.Show("您勾选了1#锯但并未选择1#锯锯切完成后的下一锯号", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- // return;
- // }
- //}
- //if (!string.IsNullOrEmpty(saw12))
- //{
- // if (saw221.Equals("") && saw222.Equals(""))
- // {
- // MessageBox.Show("您勾选了2#锯但并未选择2#锯锯切完成后的下一锯号", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- // return;
- // }
- //}
- //if (string.IsNullOrEmpty(saw12) && string.IsNullOrEmpty(saw11))
- //{
- // MessageBox.Show("您未在第一个分切台子选择任何锯,请选择后重新开始", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- // return;
- //}
- if (string.IsNullOrEmpty(saw11) && string.IsNullOrEmpty(saw12) && string.IsNullOrEmpty(saw21) && string.IsNullOrEmpty(saw22))
- {
- MessageBox.Show("您未选择任何锯,请选择后重新开始", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- milsawdeatail.Clear();
- milsawdeatail.LotNo = this.lotno;
- milsawdeatail.StoveNo = this.stoveno;
- milsawdeatail.JudgeStoveNo = HeatNo;
- milsawdeatail.PlineCode = PlinCode;
- milsawdeatail.ColGroup = this.UserInfo.GetUserGroup();
- milsawdeatail.ColUser = this.UserInfo.GetUserName();
- milsawdeatail.ColShift = this.UserInfo.GetUserOrder();
- milsawdeatail.ColMode = "1";
- milsawdeatail.SawFlag = "1";
- milsawdeatail.ProPlanId = proPlanId;
- milsawdeatail.GxPlanNo = gxPlanNo;
- int checkresult = rownoBefore;
- if (e.Cell.Column.Key == "btnCUTHEAD")//快速分切切头
- {
- #region 来料及切头 默认 偶数排给4#锯奇数排给3(快速切头需重写)
- //if (totalnum == 0)
- //{
- // MessageBox.Show("快速切头已完成。不允许再次进行。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- // return;
- //}
- int last = totalnum % rowcount;//最后一排的支数
- this.lastnum = last;
- this.rowcounts = rowcount;
- int rowno = totalnum / rowcount;//总排数-1
- int i = 1;
- //if (iscontinue)
- //{
- rowno = rowno + rownoBefore;
- i = rownoBefore + 1;
- //}
- if (last > 0)
- {
- rowno = rowno + 1;
- }
- DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.PipSawFast.doQueryMilSawDeatil", new object[] { milsawdeatail }, this._ob);
- if (int.Parse(ds.Rows[0][0].ToString()) > 0)
- {
- for (; i <= rowno; i++)
- {
- milsawdeatail.RowNo = i.ToString();
- if (last > 0)
- {
- if (i == rowno)
- {
- milsawdeatail.RowCount = last.ToString();
- }
- else
- {
- milsawdeatail.RowCount = rowcount.ToString();
- }
- }
- else
- {
- milsawdeatail.RowCount = rowcount.ToString();
- }
- if (this.ultraGrid2.Rows[0].Cells["CUT_HEAD_LENGTHA"].Text == "")
- {
- MessageBox.Show("切头长度不能为空,请输入!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- milsawdeatail.CutHeadLength = this.ultraGrid2.Rows[0].Cells["CUT_HEAD_LENGTHA"].Value.ToString();
- milsawdeatail.CutHeadLengthTotal = float.Parse(milsawdeatail.RowCount.ToString()) * float.Parse(milsawdeatail.CutHeadLength.ToString()) / 1000;
- milsawdeatail.CutSpeed = this.ultraGrid2.Rows[0].Cells["CUT_SPEED"].Value.ToString();
- milsawdeatail.CutThickness = this.ultraGrid2.Rows[0].Cells["CUT_THICKNESS"].Value.ToString();
- //if ((!this.PlinCode.Equals("C010")) || (this.PlinCode.Equals("C010") && this.SAW_NUM < 6))
- //{
- switch (i % 2)
- {
- case 0:
-
- if (saw11.Equals("") && saw12.Equals(""))
- {
- milsawdeatail.SawNo = "";
- }
- else if ((!saw11.Equals("")) && saw12.Equals(""))
- {
- milsawdeatail.SawNo = saw11;
- }
- else if (saw11.Equals("") && (!saw12.Equals("")))
- {
- milsawdeatail.SawNo = saw12;
- }
- else
- {
- milsawdeatail.SawNo = saw12;
- }
- if (PlinCode.Equals("C017"))
- {
- if (milsawdeatail.SawNo.Equals("1"))
- {
- if (this.saw21.Equals("") && this.saw22.Equals(""))
- {
- milsawdeatail.SawNoN = "";
- }
- else if ((!this.saw21.Equals("")) && this.saw22.Equals(""))
- {
- milsawdeatail.SawNoN = saw21;
- }
- else if (this.saw21.Equals("") && (!this.saw22.Equals("")))
- {
- milsawdeatail.SawNoN = saw22;
- }
- else
- {
- milsawdeatail.SawNoN = saw22;
- }
- }
- else if (milsawdeatail.SawNo.Equals("4"))
- {
- if (this.saw21.Equals("") && this.saw22.Equals(""))
- {
- milsawdeatail.SawNoN = "";
- }
- else if ((!this.saw21.Equals("")) && this.saw22.Equals(""))
- {
- milsawdeatail.SawNoN = saw21;
- }
- else if (this.saw21.Equals("") && (!this.saw22.Equals("")))
- {
- milsawdeatail.SawNoN = saw22;
- }
- else
- {
- milsawdeatail.SawNoN = saw21;
- }
- }
- else
- {
- milsawdeatail.SawNoN = "";
- }
- }
- else
- {
- if (this.saw21.Equals("") && this.saw22.Equals(""))
- {
- milsawdeatail.SawNoN = "";
- }
- else if ((!this.saw21.Equals("")) && this.saw22.Equals(""))
- {
- milsawdeatail.SawNoN = saw21;
- }
- else if (this.saw21.Equals("") && (!this.saw22.Equals("")))
- {
- milsawdeatail.SawNoN = saw22;
- }
- else
- {
- milsawdeatail.SawNoN = saw22;
- }
- }
-
-
- break;
- case 1:
-
- if (saw11.Equals("") && saw12.Equals(""))
- {
- milsawdeatail.SawNo = "";
- }
- else if ((!saw11.Equals("")) && saw12.Equals(""))
- {
- milsawdeatail.SawNo = saw11;
- }
- else if (saw11.Equals("") && (!saw12.Equals("")))
- {
- milsawdeatail.SawNo = saw12;
- }
- else
- {
- milsawdeatail.SawNo = saw11;
- }
- if (PlinCode.Equals("C017"))
- {
- if (milsawdeatail.SawNo.Equals("1"))
- {
- if (this.saw21.Equals("") && this.saw22.Equals(""))
- {
- milsawdeatail.SawNoN = "";
- }
- else if ((!this.saw21.Equals("")) && this.saw22.Equals(""))
- {
- milsawdeatail.SawNoN = saw21;
- }
- else if (this.saw21.Equals("") && (!this.saw22.Equals("")))
- {
- milsawdeatail.SawNoN = saw22;
- }
- else
- {
- milsawdeatail.SawNoN = saw22;
- }
- }
- else if (milsawdeatail.SawNo.Equals("4"))
- {
- if (this.saw21.Equals("") && this.saw22.Equals(""))
- {
- milsawdeatail.SawNoN = "";
- }
- else if ((!this.saw21.Equals("")) && this.saw22.Equals(""))
- {
- milsawdeatail.SawNoN = saw21;
- }
- else if (this.saw21.Equals("") && (!this.saw22.Equals("")))
- {
- milsawdeatail.SawNoN = saw22;
- }
- else
- {
- milsawdeatail.SawNoN = saw21;
- }
- }
- else
- {
- milsawdeatail.SawNoN = "";
- }
- }
- else
- {
- if (this.saw21.Equals("") && this.saw22.Equals(""))
- {
- milsawdeatail.SawNoN = "";
- }
- else if ((!this.saw21.Equals("")) && this.saw22.Equals(""))
- {
- milsawdeatail.SawNoN = saw21;
- }
- else if (this.saw21.Equals("") && (!this.saw22.Equals("")))
- {
- milsawdeatail.SawNoN = saw22;
- }
- else
- {
- milsawdeatail.SawNoN = saw21;
- }
- }
- break;
- }
- //}
- //else
- //{
- // switch (i % 3)//168 待添加(168第三条线启动的话,所有的锯都会用到)
- // {
- // case 0://(分给3)
- // break;
- // case 1: //(分给1)
- // break;
- // case 2://(分给2)
- // break;
- // }
- //}
- //1修改实绩表,2.更新管号队列
- int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.PipSawFast.updateSawDetailNEW", new object[] { milsawdeatail }, this._ob);
- checkresult = checkresult + count;
- }
- }
- else
- {
- for (; i <= rowno; i++)
- {
- milsawdeatail.RowNo = i.ToString();
- if (last > 0)
- {
- if (i == rowno)
- {
- milsawdeatail.RowCount = last.ToString();
- }
- else
- {
- milsawdeatail.RowCount = rowcount.ToString();
- }
- }
- else
- {
- milsawdeatail.RowCount = rowcount.ToString();
- }
- if (this.ultraGrid2.Rows[0].Cells["CUT_HEAD_LENGTHA"].Text == "")
- {
- MessageBox.Show("切头长度不能为空,请输入!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- milsawdeatail.CutHeadLength = this.ultraGrid2.Rows[0].Cells["CUT_HEAD_LENGTHA"].Value.ToString();
- milsawdeatail.CutHeadLengthTotal = float.Parse(milsawdeatail.RowCount.ToString()) * float.Parse(milsawdeatail.CutHeadLength.ToString()) / 1000;
- milsawdeatail.CutSpeed = this.ultraGrid2.Rows[0].Cells["CUT_SPEED"].Value.ToString();
- milsawdeatail.CutThickness = this.ultraGrid2.Rows[0].Cells["CUT_THICKNESS"].Value.ToString();
- //if ((!this.PlinCode.Equals("C010")) || (this.PlinCode.Equals("C010") && this.SAW_NUM < 6))
- //{
- switch (i % 2)
- {
- case 0:
-
- if (saw11.Equals("") && saw12.Equals(""))
- {
- milsawdeatail.SawNo = "";
- }
- else if ((!saw11.Equals("")) && saw12.Equals(""))
- {
- milsawdeatail.SawNo = saw11;
- }
- else if (saw11.Equals("") && (!saw12.Equals("")))
- {
- milsawdeatail.SawNo = saw12;
- }
- else
- {
- milsawdeatail.SawNo = saw12;
- }
- if (PlinCode.Equals("C017"))
- {
- if (milsawdeatail.SawNo.Equals("1"))
- {
- if (this.saw21.Equals("") && this.saw22.Equals(""))
- {
- milsawdeatail.SawNoN = "";
- }
- else if ((!this.saw21.Equals("")) && this.saw22.Equals(""))
- {
- milsawdeatail.SawNoN = saw21;
- }
- else if (this.saw21.Equals("") && (!this.saw22.Equals("")))
- {
- milsawdeatail.SawNoN = saw22;
- }
- else
- {
- milsawdeatail.SawNoN = saw22;
- }
- }
- else if (milsawdeatail.SawNo.Equals("4"))
- {
- if (this.saw21.Equals("") && this.saw22.Equals(""))
- {
- milsawdeatail.SawNoN = "";
- }
- else if ((!this.saw21.Equals("")) && this.saw22.Equals(""))
- {
- milsawdeatail.SawNoN = saw21;
- }
- else if (this.saw21.Equals("") && (!this.saw22.Equals("")))
- {
- milsawdeatail.SawNoN = saw22;
- }
- else
- {
- milsawdeatail.SawNoN = saw21;
- }
- }
- else
- {
- milsawdeatail.SawNoN = "";
- }
- }
- else
- {
- if (this.saw21.Equals("") && this.saw22.Equals(""))
- {
- milsawdeatail.SawNoN = "";
- }
- else if ((!this.saw21.Equals("")) && this.saw22.Equals(""))
- {
- milsawdeatail.SawNoN = saw21;
- }
- else if (this.saw21.Equals("") && (!this.saw22.Equals("")))
- {
- milsawdeatail.SawNoN = saw22;
- }
- else
- {
- milsawdeatail.SawNoN = saw22;
- }
- }
-
- break;
- case 1:
-
- if (saw11.Equals("") && saw12.Equals(""))
- {
- milsawdeatail.SawNo = "";
- }
- else if ((!saw11.Equals("")) && saw12.Equals(""))
- {
- milsawdeatail.SawNo = saw11;
- }
- else if (saw11.Equals("") && (!saw12.Equals("")))
- {
- milsawdeatail.SawNo = saw12;
- }
- else
- {
- milsawdeatail.SawNo = saw11;
- }
- if (PlinCode.Equals("C017"))
- {
- if (milsawdeatail.SawNo.Equals("1"))
- {
- if (this.saw21.Equals("") && this.saw22.Equals(""))
- {
- milsawdeatail.SawNoN = "";
- }
- else if ((!this.saw21.Equals("")) && this.saw22.Equals(""))
- {
- milsawdeatail.SawNoN = saw21;
- }
- else if (this.saw21.Equals("") && (!this.saw22.Equals("")))
- {
- milsawdeatail.SawNoN = saw22;
- }
- else
- {
- milsawdeatail.SawNoN = saw22;
- }
- }
- else if (milsawdeatail.SawNo.Equals("4"))
- {
- if (this.saw21.Equals("") && this.saw22.Equals(""))
- {
- milsawdeatail.SawNoN = "";
- }
- else if ((!this.saw21.Equals("")) && this.saw22.Equals(""))
- {
- milsawdeatail.SawNoN = saw21;
- }
- else if (this.saw21.Equals("") && (!this.saw22.Equals("")))
- {
- milsawdeatail.SawNoN = saw22;
- }
- else
- {
- milsawdeatail.SawNoN = saw21;
- }
- }
- else
- {
- milsawdeatail.SawNoN = "";
- }
- }
- else
- {
- if (this.saw21.Equals("") && this.saw22.Equals(""))
- {
- milsawdeatail.SawNoN = "";
- }
- else if ((!this.saw21.Equals("")) && this.saw22.Equals(""))
- {
- milsawdeatail.SawNoN = saw21;
- }
- else if (this.saw21.Equals("") && (!this.saw22.Equals("")))
- {
- milsawdeatail.SawNoN = saw22;
- }
- else
- {
- milsawdeatail.SawNoN = saw22;
- }
- }
-
- break;
- }
- //}
- //else
- //{
- // switch (i % 3)//168 待添加(168第三条线启动的话,所有的锯都会用到)
- // {
- // case 0://(分给3)
- // break;
- // case 1: //(分给1)
- // break;
- // case 2://(分给2)
- // break;
- // }
- //}
- //1插入实绩表,2.更新管号队列
- int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.PipSawFast.InsertSawDetailNEW", new object[] { milsawdeatail }, this._ob);
- checkresult = checkresult + count;
- }
- }
- if (checkresult != rowno)
- {
- ServerHelper.SetData("com.steering.mes.zgmil.coup.PipSawFast.InsertSawDetailNEWBACK", new object[] { milsawdeatail }, this._ob);
- MessageBox.Show("快速切头未完成。请查找原因后重新执行。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- else
- {
- DataTable dthas = ServerHelper.GetData("com.steering.mes.zgmil.coup.PipSawFast.GetCountHasSaw", new object[] { HeatNo, proPlanId, gxPlanNo }, this._ob);
- if (dthas.Rows.Count > 0)
- {
- checktotalnumhas = int.Parse(dthas.Rows[0]["counts"].ToString());
- }
- this.ultraGrid2.Rows[0].Cells["TotalNumHas"].Value = checktotalnumhas;
- this.ultraGrid2.Rows[0].Cells["TotalNum"].Value = "0";
- this.ultraGrid2.Rows[0].Cells["btnCUTHEAD"].Column.ButtonDisplayStyle = Infragistics.Win.UltraWinGrid.ButtonDisplayStyle.Always;
- this.ultraGrid2.Rows[0].Cells["btnCUTHEAD"].Column.CellButtonAppearance.BackColor = Color.Yellow;
- }
- #endregion
- }
- if (e.Cell.Column.Key == "btnCUTORDER")//快速分切切定尺
- {
- if (checktotalnumhas == 0)
- {
- MessageBox.Show("炉号:【" + HeatNo + "】还未开始切头,不允许进行切定尺操作。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (this.ultraGrid2.Rows[0].Cells["ORDER_LENGTHA"].Text == "")
- {
- MessageBox.Show("切定尺长度不能为空,请输入!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (double.Parse(this.ultraGrid2.Rows[0].Cells["ORDER_LENGTHA"].Text.ToString2()) > 20 && !PlinCode.Equals("C072"))
- {
- //if (MessageUtil.ShowYesNoAndQuestion("您输入的定尺长度已大于25米,是否继续?") == DialogResult.No) return;
- MessageUtil.ShowTips("输入的定尺长度已大于20米,与实际不符!");
- return;
- }
- milsawdeatail.OrderLength = this.ultraGrid2.Rows[0].Cells["ORDER_LENGTHA"].Value.ToString();
- int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.PipSawFast.UPDATEORDER_LENGTH", new object[] { milsawdeatail }, this._ob);
- if (count < 0)
- {
- MessageBox.Show("快速切定尺失败,请查找原因后重新操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- else
- {
- //切定尺就把长度、重量写入进程表
- milsawdeatail.OrderLength = this.ultraGrid2.Rows[0].Cells["ORDER_LENGTHA"].Text;
- ccp.ServerName = "com.steering.mes.zgmil.coup.PipSawFast";
- ccp.MethodName = "updatePortOrderLength";
- ccp.ServerParams = new object[] { milsawdeatail };
- ccp = _ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("修改成功!"))
- {
-
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- DataTable dthas = ServerHelper.GetData("com.steering.mes.zgmil.coup.PipSawFast.GetCountHasSaw", new object[] { HeatNo, proPlanId, gxPlanNo }, this._ob);
- if (dthas.Rows.Count > 0)
- {
- checktotalnumhas = int.Parse(dthas.Rows[0]["counts"].ToString());
- }
- this.ultraGrid2.Rows[0].Cells["TotalNumHas"].Value = checktotalnumhas;
- this.ultraGrid2.Rows[0].Cells["btnCUTORDER"].Column.ButtonDisplayStyle = Infragistics.Win.UltraWinGrid.ButtonDisplayStyle.Always;
- this.ultraGrid2.Rows[0].Cells["btnCUTORDER"].Column.CellButtonAppearance.BackColor = Color.Yellow;
- }
- }
- if (e.Cell.Column.Key == "btnCUTTAIL")//快速分切切尾
- {
- if (checktotalnumhas == 0)
- {
- MessageBox.Show("炉号:【" + HeatNo + "】还未开始切头,不允许进行切尾操作。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (this.ultraGrid2.Rows[0].Cells["CUT_TRAIL_LENGTHA"].Text == "")
- {
- MessageBox.Show("切尾长度不能为空,请输入!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- milsawdeatail.CutTrailLength = this.ultraGrid2.Rows[0].Cells["CUT_TRAIL_LENGTHA"].Value;
- //milsawdeatail.CutTrailLengthTotal = float.Parse(milsawdeatail.RowCount.ToString()) * float.Parse(milsawdeatail.CutTrailLength.ToString());
- int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.PipSawFast.UPDATETAIL", new object[] { milsawdeatail }, this._ob);
- if (count < 0)
- {
- MessageBox.Show("快速切尾失败,请查找原因后重新操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- else
- {
- DataTable dthas = ServerHelper.GetData("com.steering.mes.zgmil.coup.PipSawFast.GetCountHasSaw", new object[] { HeatNo, proPlanId, gxPlanNo }, this._ob);
- if (dthas.Rows.Count > 0)
- {
- checktotalnumhas = int.Parse(dthas.Rows[0]["counts"].ToString());
- }
- this.ultraGrid2.Rows[0].Cells["TotalNumHas"].Value = checktotalnumhas;
- this.ultraGrid2.Rows[0].Cells["btnCUTTAIL"].Column.ButtonDisplayStyle = Infragistics.Win.UltraWinGrid.ButtonDisplayStyle.Always;
- this.ultraGrid2.Rows[0].Cells["btnCUTTAIL"].Column.CellButtonAppearance.BackColor = Color.Yellow;
- }
- }
- if (e.Cell.Column.Key == "btnCUTEND")//快速分切结束
- {
- DataTable dtDeatails = ServerHelper.GetData("com.steering.mes.zgmil.coup.PipeSawResult.GetResultDetail", new object[] { HeatNo, proPlanId, gxPlanNo }, this._ob);
- if (dtDeatails.Rows.Count == 0)
- {
- MessageBox.Show("炉号:【" + HeatNo + "】还未开始切头,快速分切还未开始。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- int result = 0;
- foreach (DataRow dr in dtDeatails.Rows)
- {
- if (string.IsNullOrEmpty(dr["CUT_TRAIL_LENGTH"].ToString()))
- {
- result = 1;
- }
- if (string.IsNullOrEmpty(dr["ORDER_LENGTH"].ToString()))
- {
- result = 1;
- }
- }
- if (result == 1)
- {
- MessageBox.Show("炉号:【" + HeatNo + "】还未完成分切,不允许进行分切结束操作。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- int last = checktotalnumhas % rowcount;//最后一排的支数
- this.lastnum = last;
- this.rowcounts = rowcount;
- int rowno = checktotalnumhas / rowcount;//总排数-1
- if (last > 0)
- {
- rowno = rowno + 1;
- }
- milsawdeatail.SawFlag = "1";
- milsawdeatail.OrderLength = this.ultraGrid2.Rows[0].Cells["ORDER_LENGTHA"].Text;
- ccp.ServerName = "com.steering.mes.zgmil.coup.PipSawFast";
- ccp.MethodName = "updatePortOrderLength";
- ccp.ServerParams = new object[] { milsawdeatail };
- ccp = _ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("修改成功!"))
- {
- int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.PipSawFast.UPDATESawFlag", new object[] { milsawdeatail }, this._ob);
- if (count < 0)
- {
- MessageBox.Show("快速切尾失败,请查找原因后重新操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- else
- {
- this.InsertColNEW(rownoBefore, rowno);
- this.Dispose();
- this.Close();
- }
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
-
- }
- // dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.PipSawFast.GetCountWithoutDel", new object[] { HeatNo }, this._ob);
- //if (dt.Rows.Count > 0)
- //{
- // checktotalnum = int.Parse(dt.Rows[0]["counts"].ToString());
- //}
- //else
- //{
- // MessageBox.Show("炉号:【" + HeatNo + "】未开始上料锯切,或未开始分切,请确认后重新进行快速分切操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- // return;
- //}
- // dt2 = ServerHelper.GetData("com.steering.mes.zgmil.coup.PipSawFast.GetCountHasSaw", new object[] { HeatNo }, this._ob);
- //if (dt2.Rows.Count > 0)
- //{
- // checktotalnumhas = int.Parse(dt2.Rows[0]["counts"].ToString());
- //}
- //this.ultraGrid2.Rows[0].Cells["TotalNumHas"].Value = checktotalnumhas;
- //CoreClientParam ccp1 = new CoreClientParam();
- //ccp1.ServerName = "com.steering.mes.zgmil.coup.EddyCurrentTestingResult";
- //ccp1.MethodName = "scrapMatCheck";
- //ccp1.ServerParams = new Object[] { HeatNo, 7 };
- //ccp1 = this._ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- //ScrapNumBefore = Convert.ToInt32(ccp1.ReturnInfo);//前几道工序剔除支数
- //checktotalnum = checktotalnum - ScrapNumBefore;//当前可切支数
- //totalnum = checktotalnum;
- //this.ultraGrid2.Rows[0].Cells["TotalNum"].Value = totalnum;
- }
- /// <summary>
- /// 关闭当前页面,刷新分切页面管号队列
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void PipSawFast_FormClosed(object sender, FormClosedEventArgs e)
- {
- this.isRefresh = true;
- this.DialogResult = DialogResult.OK;
- //GridHelper.CopyDataToDatatable(ref dt, ref f1.dtMat, true);
- }
- private void ultraGrid2_CellChange(object sender, CellEventArgs e)
- {
- this.ultraGrid2.UpdateData();
- if (this.ultraGrid2.Rows[0].Cells["SAW31"].Value != null)
- {
- //2#台选择的锯进行联动
- if (this.ultraGrid2.Rows[0].Cells["SAW31"].Value.ToString() == "True")
- {
- //this.ultraGrid2.Rows[0].Cells["SAW32"].Value = "False";
- //this.saw211 = "3";
- //this.saw211 = this.ultraGrid2.Rows[0].Cells["SAW31"].Column.Header.Caption.ToString2().Substring(0, 1);
- this.saw21 = this.ultraGrid2.Rows[0].Cells["SAW31"].Column.Header.Caption.ToString2().Substring(0, 1);
- }
- else
- {
- //this.saw211 = "";
- this.saw21 = "";
- }
- }
- //if (this.ultraGrid2.Rows[0].Cells["SAW32"].Value != null)
- //{
- // if (this.ultraGrid2.Rows[0].Cells["SAW32"].Value.ToString() == "True")
- // {
- // //this.ultraGrid2.Rows[0].Cells["SAW31"].Value = "False";
- // //this.saw221 = "3";
- // this.saw221 = this.ultraGrid2.Rows[0].Cells["SAW32"].Column.Header.Caption.ToString2().Substring(0, 1);
- // }
- // else
- // {
- // this.saw221 = "";
- // }
- //}
- if (this.ultraGrid2.Rows[0].Cells["SAW41"].Value != null)
- {
- if (this.ultraGrid2.Rows[0].Cells["SAW41"].Value.ToString() == "True")
- {
- //this.ultraGrid2.Rows[0].Cells["SAW42"].Value = "False";
- //this.saw212 = "4";
- //this.saw212 = this.ultraGrid2.Rows[0].Cells["SAW41"].Column.Header.Caption.ToString2().Substring(0, 1);
- this.saw22 = this.ultraGrid2.Rows[0].Cells["SAW41"].Column.Header.Caption.ToString2().Substring(0, 1);
- }
- else
- {
- //this.saw212 = "";
- this.saw22 = "";
- }
- }
- //if (this.ultraGrid2.Rows[0].Cells["SAW42"].Value != null)
- //{
- // if (this.ultraGrid2.Rows[0].Cells["SAW42"].Value.ToString() == "True")
- // {
- // this.ultraGrid2.Rows[0].Cells["SAW41"].Value = "False";
- // // this.saw222 = "4";
- // this.saw222 = this.ultraGrid2.Rows[0].Cells["SAW42"].Column.Header.Caption.ToString2().Substring(0, 1);
- // }
- // else
- // {
- // this.saw222 = "";
- // }
- //}
- if (this.ultraGrid2.Rows[0].Cells["COL_NO11"].Value != null)
- {
- if (this.ultraGrid2.Rows[0].Cells["COL_NO11"].Value.ToString() == "True")
- {
- this.colno1 = "1";
- }
- else
- {
- this.colno1 = "";
- }
- }
- if (this.ultraGrid2.Rows[0].Cells["COL_NO21"].Value != null)
- {
- if (this.ultraGrid2.Rows[0].Cells["COL_NO21"].Value.ToString() == "True")
- {
- this.colno2 = "2";
- }
- else
- {
- this.colno2 = "";
- }
- }
- if (this.ultraGrid2.Rows[0].Cells["COL_NO31"].Value != null)
- {
- if (this.ultraGrid2.Rows[0].Cells["COL_NO31"].Value.ToString() == "True")
- {
- //if (!(this.ultraGrid2.Rows[0].Cells["SAW31"].Value.ToString() == "True" && this.ultraGrid2.Rows[0].Cells["SAW41"].Value.ToString() == "True" && this.ultraGrid2.Rows[0].Cells["SAW1"].Value.ToString() == "True" && this.ultraGrid2.Rows[0].Cells["SAW2"].Value.ToString() == "True"))
- //{
- // MessageBox.Show("您未将所有的锯勾选,不允许选择第三号矫直线", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- // this.colno3 = "";
- // return;
- //}
- this.colno3 = "3";
- }
- else
- {
- this.colno3 = "";
- }
- }
- #region 上料台锯号限制 分料台锯号选择(取消)
- //if(this.ultraGrid2.Rows[0].Cells["SAW1"].Value != null)
- //{
- // if (this.ultraGrid2.Rows[0].Cells["SAW1"].Value.ToString() == "True")
- // {
- // this.ultraGrid2.DisplayLayout.Bands[0].Columns["SAW31"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
- // this.ultraGrid2.DisplayLayout.Bands[0].Columns["SAW41"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
- // }
- // else
- // {
- // this.ultraGrid2.DisplayLayout.Bands[0].Columns["SAW31"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
- // this.ultraGrid2.DisplayLayout.Bands[0].Columns["SAW41"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
- // this.ultraGrid2.Rows[0].Cells["SAW31"].Value = "False";
- // this.ultraGrid2.Rows[0].Cells["SAW41"].Value = "False";
- // }
- //}
- //if (this.ultraGrid2.Rows[0].Cells["SAW2"].Value != null)
- //{
- // if (this.ultraGrid2.Rows[0].Cells["SAW2"].Value.ToString() == "True")
- // {
- // this.ultraGrid2.DisplayLayout.Bands[0].Columns["SAW32"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
- // this.ultraGrid2.DisplayLayout.Bands[0].Columns["SAW42"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
- // }
- // else
- // {
- // this.ultraGrid2.DisplayLayout.Bands[0].Columns["SAW32"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
- // this.ultraGrid2.DisplayLayout.Bands[0].Columns["SAW42"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
- // this.ultraGrid2.Rows[0].Cells["SAW32"].Value = "False";
- // this.ultraGrid2.Rows[0].Cells["SAW42"].Value = "False";
- // }
- //}
- #endregion
- }
- }
- }
|