| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536 |
- 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.StlMes.Client.ZGMil.Entity;
- using System.Collections;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Tool;
- using Core.Mes.Client.Comm.Control;
- using Infragistics.Win.UltraWinGrid;
- using Core.Mes.Client.Comm.Format;
- using Infragistics.Win.UltraWinEditors;
- using Infragistics.Win;
- using Core.StlMes.Client.ZGMil.NodeResultQuery;
- using Core.StlMes.Client.ZGMil.ResultConrtrol;
- using Core.StlMes.Client.ZGMil.Common;
- namespace Core.StlMes.Client.ZGMil.Signature
- {
- public partial class FrmInOnlineStore : FrmBase
- {
- private string[] plineCodes = { };
- public FrmInOnlineStore()
- {
- InitializeComponent();
- }
- string Group = "";
- private string Departm = "";//部门
- private string PlineCode = "";//产线
- private string _UserName = ""; //签名 姓名
- private string _UserID = ""; //签名 签名ID
- private string proPlanId = "";//轧管订单编号
- private string gxPlanNo = "";//工序排产序号
- /// <summary>
- /// 重写基类方法
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="ToolbarKey"></param>
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "DoQuery":
- QuerySinglePlan();
- break;
- case"DoQueryMat":
- QueryMat();
- break;
- case"DoQueryMatB":
- QueryMatButess();
- break;
- case"DoQueryInList":
- DoQueryInList();
- break;
- case"cancelInList":
- cancelInList();
- break;
- case "DoSave":
- DoSave();
- break;
- case "DoSaveShort":
- DoSaveShort();
- break;
- case "DoDecision":
- DoDecision();
- break;
- case "cancelDoDecision":
- cancelDoDecision();
- break;
- case "DoBeside":
- doBeside();
- break;
- case "cancelDoBeside":
- cancelDoBeside();
- break;
- case"Print":
- printPipe();
- break;
- case"OfflineXX":
- OfflineXX();
- break;
- case "insertProssWt":
- insertProssWt();
- break;
- case"adjustWgt":
- adjustWgt();
- break;
- case "QuXiang":
- QuXiang();
- break;
- case "Export":
- ExportData();
- break;
- case "Close":
- this.Close();
- break;
- }
- }
- /// <summary>
- /// 短尺交库
- /// </summary>
- private void DoSaveShort()
- {
- FrmShortRuler QADefect = new FrmShortRuler("", this.ob);
- QADefect.ShowDialog();
- if (QADefect.DialogResult == DialogResult.OK)
- {
- ArrayList shortList = QADefect.shortList;
- int acount = QADefect.acount;
- DoSave(shortList, acount);
- }
-
- }
- /// <summary>
- /// 短尺交库
- /// </summary>
- /// <param name="list"></param>
- private void DoSave(ArrayList shortList,int acountNum)
- {
- string strInbound = "800701";//入库类型
- string strInMemo = "";
- string surplusFlag = "";//是否余材标识
- string sampleFlag = "";//是否减取样长度标识
- int k = 0;
- int b = 0;
- this.ultraGrid3.UpdateData();
- this.ultraGrid2.UpdateData();
- DataTable dte = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryPortMilState", new object[] { this.ultraGrid1.ActiveRow.Cells["JUDGE_NO"].Text, proPlanId, gxPlanNo }, ob);
- int acount = int.Parse(dte.Rows[0]["acount"].ToString2());
- int acount2 = int.Parse(dte.Rows[0]["acount2"].ToString2());
- if (this.ultraGrid3.ActiveRow.Cells["Astatus"].Text == "合格" && acount > 0 && acount2 <= 0)
- {
- MessageUtil.ShowTips("有样管未交库,请先交样管!");
- return;
- }
- if (!textMemo.Text.Trim().ToString().Equals(""))
- {
- if (!StringUtil.IsNumber(textMemo.Text.Trim().ToString()))
- {
- MessageUtil.ShowTips("请输入正确的短尺长度!");
- return;
- }
- }
- DataTable dtMemo = PipeManageClass.getComTypeInfo(strInbound, ob);
- if (dtMemo.Rows.Count >= 1)
- {
- strInMemo = dtMemo.Rows[0]["MEMO"].ToString();
- }
- NativeMethodNew na = new NativeMethodNew(this.ob);
- string plinCode = this.ultraGrid8.ActiveRow.Cells["PLINE_CODE"].Text.ToString();
- ArrayList list = new ArrayList();
- DataTable ds = null;
- ds = getStoreNo(plinCode); //取对应产线产出库
- if (ds == null)
- {
- MessageUtil.ShowTips("无轧管在线库基础信息,请维护!");
- return;
- }
- string storageNo = ds.Rows[0]["STORAGE_NO"].ToString();
- //选择250中间库,168中间库则去中间库;
- if (this.cmbStorage.Value.ToString2().Equals("BZJ1") || this.cmbStorage.Value.ToString2().Equals("BZJ2"))
- {
- storageNo = this.cmbStorage.Value.ToString2();
- }
- DataTable dtDept = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryDept", new object[] { plinCode }, ob);
- string Deptid = dtDept.Rows[0]["DEPARTMENT_CODE"].ToString();
- string Department = dtDept.Rows[0]["DEPARTMENT_DESC"].ToString();
- list.Add(storageNo);
- list.Add(storageNo + "10101");
- list.Add(ds.Rows[0]["STORAGE_TYPE_NO"].ToString());
- list.Add(ds.Rows[0]["STORAGE_TYPE_NAME"].ToString());
- list.Add(this.UserInfo.GetUserName());
- list.Add(Deptid);
- list.Add(Department);
- list.Add(Deptid);
- list.Add(Department);
- list.Add(this.UserInfo.GetUserOrder());
- list.Add(this.UserInfo.GetUserGroup());
- ArrayList parm = new ArrayList();
- if (this.ultraGrid3.ActiveRow.Cells["Astatus"].Text.Trim() == "待处理")
- {
- MessageUtil.ShowTips("待处理品不允许进行入库!");
- return;
- }
- if (this.cmbStorage.Value.ToString2() == "")
- {
- MessageUtil.ShowTips("请选择去向,再进行交库!");
- return;
- }
- MilPlanEntity3 mi = (MilPlanEntity3)this.ultraGrid3.ActiveRow.ListObject;
- mi.PlineCode = plinCode;
- if (plinCode == "C009")
- {
- mi.PlineName = "258机组";
- }
- else if (plinCode == "C008")
- {
- mi.PlineName = "250机组";
- }
- else if (plinCode == "C010")
- {
- mi.PlineName = "168机组";
- }
- else if (plinCode == "C017")
- {
- mi.PlineName = "460机组";
- }
- else if (plinCode == "C072")
- {
- mi.PlineName = "天淮508机组";
- }
- if (mi.MaterialDesc.Equals(""))
- {
- mi.MaterialDesc = this.ultraGrid1.ActiveRow.Cells["OUTWL_DESC"].Text.ToString();
- }
- string milPlanTity = JSONFormat.Format(mi);
- int s = 0;
- int m = 0;
- int n = 0;
- int z = 0;
- int y = 0;
- int p = 0;
- int num = 0;
- int x = 0;
- int totalNum = 0;
- foreach (UltraGridRow uRow in ultraGrid2.Rows)
- {
- if (uRow.Cells["BATCH_NO"].Text == "")
- {
- s = s + 1;
- }
- }
- if (s > 0)
- {
- MessageUtil.ShowTips("未进行分批,不允许交库!");
- return;
- }
- foreach (UltraGridRow row1 in ultraGrid2.Rows)
- {
- if (Convert.ToBoolean(row1.Cells["CHK"].Value) == true)
- {
- if (row1.Cells["ACT_LEN"].Value.ToString2() != "")
- {
- if (double.Parse(row1.Cells["ACT_LEN"].Value.ToString2()) > 0)
- {
- }
- else
- {
- m = m + 1;
- }
- }
- else
- {
- m = m + 1;
- }
- if (row1.Cells["ACT_COUNT"].Value.ToString2() != "")
- {
- if (int.Parse(row1.Cells["ACT_COUNT"].Value.ToString2()) > 0)
- {
- }
- else
- {
- n = n + 1;
- }
- }
- else
- {
- n = n + 1;
- }
- if (row1.Cells["ACT_WEIGHT"].Value.ToString2() != "")
- {
- if (double.Parse(row1.Cells["ACT_WEIGHT"].Value.ToString2()) > 0)
- {
- }
- else
- {
- z = z + 1;
- }
- }
- else
- {
- z = z + 1;
- }
- if (row1.Cells["BATCH_NO"].Value.ToString2() == "")
- {
- y = y + 1;
- }
- if (row1.Cells["THACT_COUNT"].Text.ToString3() != "")
- {
- if (int.Parse(row1.Cells["ACT_COUNT"].Text.ToString3()) + int.Parse(row1.Cells["INSTORECOUNT"].Text.ToString3()) > int.Parse(row1.Cells["THACT_COUNT"].Text.ToString3()))
- {
- x = x + 1;
- }
- }
- ArrayList parm1 = new ArrayList();
- parm1.Add(row1.Cells["ACT_LEN"].Value.ToString2());
- parm1.Add(row1.Cells["ACT_COUNT"].Value.ToString2());
- parm1.Add(row1.Cells["ACT_WEIGHT"].Value.ToString2());
- parm1.Add(row1.Cells["BATCH_NO"].Value.ToString2());
- if (this.ultraGrid3.ActiveRow.Cells["Astatus"].Text == "合格" || this.ultraGrid3.ActiveRow.Cells["Astatus"].Text == "样管")
- {
- parm1.Add("40740401");//探伤结果
- parm1.Add("40740601");//表检结果
- }
- else if (this.ultraGrid3.ActiveRow.Cells["Astatus"].Text == "判废")
- {
- parm1.Add("");//探伤结果
- parm1.Add("");//表检结果
- }
- parm1.Add(row1.Cells["THACT_COUNT"].Value.ToString3());
- parm.Add(parm1);
- totalNum = totalNum + int.Parse(row1.Cells["ACT_COUNT"].Value.ToString2());
- num++;
- }
- }
- IQueryable<UltraGridRow> checkMagRows = this.ultraGrid2.Rows.AsQueryable().Where(" CHK = 'True'");
- int offlinePro = checkMagRows.GroupBy(a => a.GetValue("BATCH_NO")).Count();
- if (checkMagRows.Count() > 1)
- {
- if (offlinePro == 1)
- {
- MessageUtil.ShowTips("批号一样,长度不一样请分开交库!");
- return;
- }
- }
- if (num <= 0)
- {
- MessageUtil.ShowTips("请勾选产出信息!");
- return;
- }
- if (m > 0)
- {
- MessageUtil.ShowTips("长度不能为空,必须大于零!");
- return;
- }
- if (n > 0)
- {
- MessageUtil.ShowTips("支数不能为空,必须大于零!");
- return;
- }
- if (!acountNum.Equals(int.Parse(this.ultraGrid2.ActiveRow.Cells["ACT_COUNT"].Text.ToString3())))
- {
- MessageUtil.ShowTips("请确认短尺交库的支数!");
- return;
- }
- if (z > 0)
- {
- MessageUtil.ShowTips("重量不能为空,必须大于零!");
- return;
- }
- if (y > 0)
- {
- MessageUtil.ShowTips("批号不能为空,请选择!");
- return;
- }
- if (x > 0)
- {
- MessageUtil.ShowTips("输入的实际支数加已在线库支数不能大于理论支数!");
- return;
- }
- if (this.surplusChk.Checked)
- {
- surplusFlag = "1";
- }
- else
- {
- surplusFlag = "0";
- }
- if (this.sampleLen.Checked)
- {
- sampleFlag = "1";
- }
- else
- {
- sampleFlag = "0";
- }
- if (mi.Target.ToString().Equals("A") && surplusFlag == "1")
- {
- MessageUtil.ShowTips("A字头不允许进行无合同交库!");
- return;
- }
- string contractNo = this.ultraGrid1.ActiveRow.Cells["ORDER_NO"].Text.Trim();
- string target = "";
- string pckFlag = "";//打捆标志
- string matRturnFlag = "";//交货材料要求标志
- string testType = "";//双探类别
- string testGrade = "";//等级
- DataTable dd = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryMilPlan", new object[] { this.ultraGrid1.ActiveRow.Cells["JUDGE_NO"].Text, proPlanId, gxPlanNo }, ob);
- target = dd.Rows[0]["TARGET"].ToString();
- if (target.Equals("A"))
- {
- DataTable dt = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryOrderAsk", new object[] { contractNo }, ob);
- if (dt.Rows.Count > 0)
- {
- for (int i = 0; i < dt.Rows.Count; i++)
- {
- if (dt.Rows[i]["ASK_SUB_ITME_VAL_DESC"].ToString().Contains("打捆"))
- {
- k = k + 1;
- }
- else if (dt.Rows[i]["ASK_ITME"].ToString().Equals("121009"))
- {
- b = b + 1;
- }
- }
- }
- if (k > 0 && b > 0)
- {
- if (MessageUtil.ShowYesNoAndQuestion("该合同的附加要求打捆、交货材料是否满足要求?") == DialogResult.No)
- {
- return;
- }
- pckFlag = "1";
- matRturnFlag = "1";
- }
- else if (k > 0 && b < 1)
- {
- if (MessageUtil.ShowYesNoAndQuestion("该合同的附加要求打捆是否满足要求?") == DialogResult.No)
- {
- return;
- }
- pckFlag = "1";
- matRturnFlag = "0";
- }
- else if (b > 0 && k < 1)
- {
- if (MessageUtil.ShowYesNoAndQuestion("该合同的附加要求交货材料是否满足要求?") == DialogResult.No)
- {
- return;
- }
- pckFlag = "0";
- matRturnFlag = "1";
- }
- else
- {
- pckFlag = "0";
- matRturnFlag = "0";
- }
- if (doQueryPk(this.ultraGrid8.ActiveRow.Cells["ORD_LN_DLY_PK"].Value.ToString()))
- {
- DataTable dtest = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryEntrustT", new object[] { BaseMethod.getJudgeStoveNo(this.ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Text), proPlanId, gxPlanNo }, ob);
- if (dtest.Rows.Count > 0)
- {
- testType = "UT";
- testGrade = dtest.Rows[0][0].ToString();
- }
- else
- {
- MessageUtil.ShowTips("此炉是需要进行双探的管子,需走离线委外加工!");
- return;
- }
- }
- }
- DataTable portDt = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryPortCount", new object[] { ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Text, ultraGrid8.ActiveRow.Cells["LOT_NO"].Text, ultraGrid8.ActiveRow.Cells["ID"].Text }, ob);
- string portCount = portDt.Rows[0][0].ToString3();//理论支数
- DataTable matDt = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryPipeCount", new object[] { ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Text, ultraGrid8.ActiveRow.Cells["LOT_NO"].Text, ultraGrid8.ActiveRow.Cells["ID"].Text }, ob);
- string matCount = matDt.Rows[0][0].ToString3();//已交库支
- DataTable instoreDt = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryPipeLXCount", new object[] { ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Text, ultraGrid8.ActiveRow.Cells["LOT_NO"].Text, ultraGrid8.ActiveRow.Cells["ID"].Text }, ob);
- string pipeLXCount = instoreDt.Rows[0][0].ToString3(); //交库点离线支
- if (totalNum + int.Parse(matCount) + int.Parse(pipeLXCount) > int.Parse(portCount))
- {
- MessageUtil.ShowTips("总交库支数已大于产出支数,请核对支数再交库!");
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
- ccp.MethodName = "doPipeIn";
- ccp.ServerParams = new object[] { milPlanTity, list, parm, strInbound, strInMemo, this.cmbStorage.Value.ToString2(), this.cmbStorage.Text.Trim(), surplusFlag, sampleFlag, pckFlag, matRturnFlag, testType, testGrade, shortList };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("交库成功!"))
- {
- QuerySinglePlan();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 调整库去向
- /// </summary>
- private void QuXiang()
- {
- UltraGridRow uRow = this.ultraGrid8.ActiveRow;
- if (uRow == null) return;
- string jugeNo = BaseMethod.getJudgeStoveNo(uRow.Cells["JUDGE_STOVE_NO"].Text.ToString());
- string lotno = uRow.Cells["LOT_NO"].Text.Trim();
- if (this.cmbStorage.Value.ToString2() == "")
- {
- MessageUtil.ShowTips("请选择去向,再进行调整库去向!");
- return;
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否确认调整库去向?") == DialogResult.No)
- {
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
- ccp.MethodName = "updateQuXiang";
- ccp.ServerParams = new object[] { jugeNo, lotno, PlineCode, this.cmbStorage.Value.ToString2(), this.cmbStorage.Text.Trim() };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("调整成功!"))
- {
- QuerySinglePlan();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 下线点离线
- /// </summary>
- private void OfflineXX()
- {
- UltraGridRow uRow = this.ultraGrid8.ActiveRow;
- if (uRow == null) return;
- string jugeNo = uRow.Cells["JUDGE_STOVE_NO"].Text.Trim();
- string lotno = uRow.Cells["LOT_NO"].Text.Trim();
- string nodeStaus = uRow.Cells["NODE_STATUS"].Text.Trim();
- if(nodeStaus == "入库完成")
- {
- MessageUtil.ShowTips("入库完成了的炉信息不允许离线!");
- return;
- }
- DataTable dtFlag = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetSingleJRLResult", new object[] { jugeNo, proPlanId, gxPlanNo }, this.ob);
- if (dtFlag.Rows.Count > 0)
- {
- if (string.IsNullOrEmpty(dtFlag.Rows[0]["NODE_FUR_FLAG"].ToString()))
- {
- MessageBox.Show("未开始分切,不允许下线", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- }
-
- DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmOffLine.doQueryJugeCount", new object[] { jugeNo }, ob);
- DataTable dd = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmOffLine.doQueryOfflineEdCount", new object[] { jugeNo }, ob);
- //工序状态:01-矫直1#,02-矫直2#,03-矫直3#,11-ET探伤,12-MT探伤,13-UT探伤
- string Node = "XX";
- //beforeQualifiedNum = this.rollingCard1.Value.SawQualifiedNum;
- string qualifiedNum = ds.Rows[0][0].ToString();
- string offineHas = dd.Rows[0][0].ToString();
- //offineHead = string.IsNullOrEmpty(this.rollingCard1.Value.BacklineStraight) ? "0" : this.rollingCard1.Value.BacklineStraight;
- string numb = (int.Parse(qualifiedNum) - int.Parse(offineHas)).ToString();
- FrmXiaXianOffLine frm = new FrmXiaXianOffLine(Node, this.ob, PlineCode, jugeNo, lotno, numb, proPlanId, gxPlanNo);
- frm.ShowDialog();
- QuerySinglePlan();
- }
- /// <summary>
- /// 根据外径、壁厚调整重量
- /// </summary>
- private void adjustWgt()
- {
- string dimer = this.txt_dimer.Text.Trim();
- string height = this.txt_height.Text.Trim();
- if (!StringUtil.IsDouble(dimer))
- {
- MessageUtil.ShowTips("外径应该为数字");
- return;
- }
- if (!StringUtil.IsDouble(height))
- {
- MessageUtil.ShowTips("壁厚应该为数字");
- return;
- }
- UltraGridRow uRow = this.ultraGrid8.ActiveRow;
- if(uRow == null)
- {
- MessageUtil.ShowTips("炉计划为空,不能调整重量!");
- return;
- }
- string jugeNo = uRow.Cells["JUDGE_NO"].Text;
- string wgt = (0.02466 * Math.Abs((double.Parse(dimer) - double.Parse(height))) * double.Parse(height)/1000).ToString2();
- if (MessageUtil.ShowYesNoAndQuestion("是否确认调整理论重量?") == DialogResult.No)
- {
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
- ccp.MethodName = "adjustWgt";
- ccp.ServerParams = new object[] { jugeNo, wgt };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("调整成功!"))
- {
- QuerySinglePlan();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 回报过磅重量
- /// </summary>
- private void insertProssWt()
- {
- this.ultraGrid6.UpdateData();
- UltraGridRow uRow = this.ultraGrid6.ActiveRow;
- //string departMentid = PipeManageClass.GetDepartIdBySectionId(UserInfo.GetDeptid(), ob);
- string departMentid = UserInfo.GetDeptid();
- if (uRow == null)
- {
- MessageUtil.ShowTips("请选择需要回报过磅重量的炉信息!");
- return;
- }
- if(uRow.Cells["ProductFlag"].Value.ToString() != "801402")
- {
- MessageUtil.ShowTips("只允许成品类回报过磅重量!");
- return;
- }
- if (Double.Parse(uRow.Cells["PonderGrossWt"].Value.ToString3()) <= 0)
- {
- MessageUtil.ShowTips("请输入正确的过磅重量!");
- return;
- }
-
- ArrayList list = new ArrayList();
- list.Add(uRow.Cells["JudgeStoveNo"].Value.ToString());
- list.Add(uRow.Cells["PonderGrossWt"].Value.ToString3());
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
- ccp.MethodName = "insertProssWt";
- ccp.ServerParams = new object[] { list, departMentid };
- ccp = ob.ExecuteNonQuery(ccp,CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("回报成功!"))
- {
- QueryMat();
- MatZcMEntity2bindingSource.Clear();
- MatZcMEntity2bindingSource.Clear();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 打印入库单
- /// </summary>
- private void printPipe()
- {
- this.ultraGrid7.UpdateData();
- string jugeAppleCode = "";
- IQueryable<UltraGridRow> checkRows = this.ultraGrid7.Rows.AsQueryable().Where(a=>a.GetValue("CHK") == "True");
- if(checkRows.Count() == 0)
- {
- MessageUtil.ShowTips("请选择需要打印的判定数据信息!");
- return;
- }
- foreach (UltraGridRow uRow in checkRows)
- {
- jugeAppleCode = uRow.Cells["JugdeApplyCode"].Value.ToString();
- }
- if (jugeAppleCode == "")
- {
- MessageUtil.ShowTips("未申请判定,不允许打印缴库单!");
- return;
- }
- int jugeAppleM = checkRows.GroupBy(a => a.GetValue("JugdeApplyCode")).Count();
- if (jugeAppleM > 1)
- {
- MessageUtil.ShowTips("只有同一申请单号的信息才允许同时打印!");
- return;
- }
- string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilGodownEntryYM.cpt&format=pdf&JUGDE_APPLY_CODE=" + jugeAppleCode;
- FrmExcel fre = new FrmExcel(this.ob, strurl);
- fre.AutoSize = true;
- fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- fre.WindowState = FormWindowState.Maximized;
- fre.Show();
- }
- /// <summary>
- /// 结炉回退
- /// </summary>
- private void cancelDoBeside()
- {
- this.ultraGrid1.UpdateData();
- UltraGridRow uRow = this.ultraGrid1.ActiveRow;
- if (uRow.Index < 0 || uRow == null)
- {
- MessageUtil.ShowTips("请选择需要结炉回退的主信息!");
- return;
- }
- string jugeNo = uRow.Cells["JUDGE_NO"].Text.Trim();
- string lotNo = uRow.Cells["LOT_NO"].Text.Trim();
- //string planId = uRow.Cells["ID"].Text.Trim();
- DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryFApply", new object[] { jugeNo }, ob);//查询炉号是否有已申请判定的
- if (int.Parse(ds.Rows[0][0].ToString()) > 0)
- {
- MessageUtil.ShowTips("该炉已申请判定,不允许进行结炉回退!");
- return;
- }
- DataTable ds1 = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryFQY", new object[] { jugeNo }, ob);//查询炉号是否有已申请判定的
- if (int.Parse(ds1.Rows[0][0].ToString()) > 0)
- {
- MessageUtil.ShowTips("该炉有复取样废管,不允许进行结炉回退!");
- return;
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否确认结炉回退?") == DialogResult.No)
- {
- return;
- }
- //int count = ServerHelper.SetData("com.steering.mes.signature.FrmInOnlineStore.cancelDoBeside", new object[] { jugeNo,lotNo,PlineCode, proPlanId, gxPlanNo }, ob);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
- ccp.MethodName = "cancelDoBeside";
- ccp.ServerParams = new object[] { jugeNo, lotNo, PlineCode, proPlanId, gxPlanNo };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("结炉回退成功!"))
- {
- QuerySinglePlan();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- //if (count > 0)
- //{
- // QuerySinglePlan();
- // MessageUtil.ShowTips("回退成功!");
- //}
- }
-
- /// <summary>
- /// 交库结炉(验证进程表数据与入库数据一致性(合格))
- /// </summary>
- private void doBeside()
- {
- this.ultraGrid8.UpdateData();
- UltraGridRow uRow = this.ultraGrid8.ActiveRow;
- if (uRow.Index < 0 || uRow == null)
- {
- MessageUtil.ShowTips("请选择需要结炉的主信息!");
- return;
- }
- NativeMethodNew na = new NativeMethodNew(this.ob);
- string plinCode = this.ultraGrid8.ActiveRow.Cells["PLINE_CODE"].Text.ToString();
- string jugeNo = uRow.Cells["JUDGE_STOVE_NO"].Text.Trim();
- string lotNo = uRow.Cells["LOT_NO"].Text.Trim();
- if (MessageUtil.ShowYesNoAndQuestion("是否确认结炉?") == DialogResult.No)
- {
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
- ccp.MethodName = "doBeside";
- ccp.ServerParams = new object[] { jugeNo, lotNo, plinCode, _UserID, proPlanId, gxPlanNo };
- ccp = ob.ExecuteNonQuery(ccp,CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("结炉成功!"))
- {
- QuerySinglePlan();
- MilPlanEntity3bindingSource.Clear();
- this.dataTable2.Clear();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
-
- }
- /// <summary>
- /// 查询仓库信息
- /// </summary>
- /// <param name="plineCode"></param>
- /// <returns></returns>
- private DataTable getStoreNo(string plineCode)
- {
- DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryStoreNo", new object[] { plineCode }, ob);
- if (ds.Rows.Count > 0)
- {
- return ds;
- }
- else
- {
- return null;
- }
- }
-
- /// <summary>
- /// 交库
- /// </summary>
- private void DoSave()
- {
- string storeNo = "";
- string location = "";
- string storagetype = "";
- string storagetypedesc = "";
- string strInbound = "800701";//入库类型
- string strInMemo = "";
- string strGroupNo = "";//组号
- string surplusFlag = "";//是否余材标识
- string sampleFlag = "";//是否减取样长度标识
- int k = 0;
- int b = 0;
- this.ultraGrid3.UpdateData();
- DataTable dte = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryPortMilState", new object[] { this.ultraGrid1.ActiveRow.Cells["JUDGE_NO"].Text, proPlanId, gxPlanNo }, ob);
- int acount = int.Parse(dte.Rows[0]["acount"].ToString2());
- int acount2 = int.Parse(dte.Rows[0]["acount2"].ToString2());
- if (this.ultraGrid3.ActiveRow.Cells["Astatus"].Text == "合格" && acount > 0 && acount2 <= 0)
- {
- //if (MessageUtil.ShowYesNoAndQuestion("有样管未交库,是否确认继续非样管交库?") == DialogResult.No)
- //{
- // return;
- //}
- MessageUtil.ShowTips("有样管未交库,请先交样管!");
- return;
- }
- if (!textMemo.Text.Trim().ToString().Equals(""))
- {
- if (!StringUtil.IsNumber(textMemo.Text.Trim().ToString()))
- {
- MessageUtil.ShowTips("请输入正确的短尺长度!");
- return;
- }
- }
-
- DataTable dtMemo = PipeManageClass.getComTypeInfo(strInbound, ob);
- if (dtMemo.Rows.Count >= 1)
- {
- strInMemo = dtMemo.Rows[0]["MEMO"].ToString();
- }
- NativeMethodNew na = new NativeMethodNew(this.ob);
- //string plinCode = na.GetPCode(this.UserInfo.GetDepartment());
- string plinCode = this.ultraGrid8.ActiveRow.Cells["PLINE_CODE"].Text.ToString();
- ArrayList list = new ArrayList();
- DataTable ds = null;
- //选择250中间库,168中间库则去中间库;其它则是产出库
- //if (this.ultraGrid8.ActiveRow.Cells["BACK_PLAN_FLAG"].Text.Equals("10")) //交库返线,取位置备份表仓库信息
- //{
- // ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryStoreNo", new object[] { plinCode, this.ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Text }, ob);
- //}
- //else
- //{
- // ds = getStoreNo(plinCode); //取对应产线产出库
- //}
- ds = getStoreNo(plinCode); //取对应产线产出库
- if (ds == null)
- {
- MessageUtil.ShowTips("无轧管在线库基础信息,请维护!");
- return;
- }
- string storageNo = ds.Rows[0]["STORAGE_NO"].ToString();
-
- //选择250中间库,168中间库则去中间库;
- if (this.cmbStorage.Value.ToString2().Equals("BZJ1") || this.cmbStorage.Value.ToString2().Equals("BZJ2"))
- {
- storageNo = this.cmbStorage.Value.ToString2();
- }
- DataTable dtDept = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryDept", new object[] { plinCode }, ob);
- string Deptid = dtDept.Rows[0]["DEPARTMENT_CODE"].ToString();
- string Department = dtDept.Rows[0]["DEPARTMENT_DESC"].ToString();
- list.Add(storageNo);
- list.Add(storageNo + "10101");
- list.Add(ds.Rows[0]["STORAGE_TYPE_NO"].ToString());
- list.Add(ds.Rows[0]["STORAGE_TYPE_NAME"].ToString());
- list.Add(this.UserInfo.GetUserName());
- list.Add(Deptid);
- list.Add(Department);
- list.Add(Deptid);
- list.Add(Department);
- list.Add(this.UserInfo.GetUserOrder());
- list.Add(this.UserInfo.GetUserGroup());
- //list.Add(PipeManageClass.GetDepartIdBySectionId(this.UserInfo.GetDeptid(), this.ob));
- //list.Add(PipeManageClass.GetDepartBySectionId(this.UserInfo.GetDeptid(), this.ob));
- ArrayList parm = new ArrayList();
- //foreach(UltraGridRow uRow in checkMagRows)
- //{
- // MilPlanEntity3 milPlanEntity = (MilPlanEntity3)uRow.ListObject;
- // string milPlanTity = JSONFormat.Format(milPlanEntity);
- // parm.Add(milPlanTity);
- //}
- //if (this.ultraGrid8.ActiveRow.Cells["LOT_NO"].Text.Trim() != "试轧料")
- //{
- if (this.ultraGrid3.ActiveRow.Cells["Astatus"].Text.Trim() == "待处理")
- {
- MessageUtil.ShowTips("待处理品不允许进行入库!");
- return;
- }
- //}
- if (this.cmbStorage.Value.ToString2() == "")
- {
- MessageUtil.ShowTips("请选择去向,再进行交库!");
- return;
- }
- MilPlanEntity3 mi = (MilPlanEntity3)this.ultraGrid3.ActiveRow.ListObject;
- mi.PlineCode = plinCode;
- if (plinCode == "C009")
- {
- mi.PlineName = "258机组";
- }
- else if (plinCode == "C008")
- {
- mi.PlineName = "250机组";
- }
- else if (plinCode == "C010")
- {
- mi.PlineName = "168机组";
- }
- else if (plinCode == "C017")
- {
- mi.PlineName = "460机组";
- }
- else if (plinCode == "C072")
- {
- mi.PlineName = "天淮508机组";
- }
- if (mi.MaterialDesc.Equals(""))
- {
- mi.MaterialDesc = this.ultraGrid1.ActiveRow.Cells["OUTWL_DESC"].Text.ToString();
- }
- string milPlanTity = JSONFormat.Format(mi);
- int s = 0;
- int m = 0;
- int n = 0;
- int z = 0;
- int y = 0;
- int p = 0;
- int num = 0;
- int x = 0;
- int totalNum = 0;
- //if (this.ultraGrid3.ActiveRow.Cells["GoType"].Text.Equals("成品") || this.ultraGrid3.ActiveRow.Cells["GoType"].Text.Equals("半成品"))
- //{
- // DataTable df = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQuerySampleNum", new object[] { mi.JudgeStoveNo.ToString(), plinCode, proPlanId, gxPlanNo }, ob);
- // if (int.Parse(df.Rows[0][0].ToString()) <= 0)
- // {
- // MessageUtil.ShowTips("交库信息中无样管信息,不允许进行交库!");
- // return;
- // }
- //}
- foreach (UltraGridRow uRow in ultraGrid2.Rows)
- {
- if (uRow.Cells["BATCH_NO"].Text == "")
- {
- s = s + 1;
- }
- }
- if (s > 0)
- {
- MessageUtil.ShowTips("未进行分批,不允许交库!");
- return;
- }
-
- foreach (UltraGridRow row1 in ultraGrid2.Rows)
- {
- if (Convert.ToBoolean(row1.Cells["CHK"].Value) == true)
- {
- if (row1.Cells["ACT_LEN"].Value.ToString2() != "")
- {
- if (double.Parse(row1.Cells["ACT_LEN"].Value.ToString2()) > 0)
- {
- }
- else
- {
- m = m + 1;
- }
- }
- else
- {
- m = m + 1;
- }
- if (row1.Cells["ACT_COUNT"].Value.ToString2() != "")
- {
- if (int.Parse(row1.Cells["ACT_COUNT"].Value.ToString2()) > 0)
- {
- }
- else
- {
- n = n + 1;
- }
- }
- else
- {
- n = n + 1;
- }
- if (row1.Cells["ACT_WEIGHT"].Value.ToString2() != "")
- {
- if (double.Parse(row1.Cells["ACT_WEIGHT"].Value.ToString2()) > 0)
- {
- }
- else
- {
- z = z + 1;
- }
- }
- else
- {
- z = z + 1;
- }
- if (row1.Cells["BATCH_NO"].Value.ToString2() == "")
- {
- y = y + 1;
- }
- //if (this.ultraGrid3.ActiveRow.Cells["Astatus"].Text != "")
- //{
- // if (row1.Cells["FLAW_STAUS"].Value.ToString2() == "" || row1.Cells["TESTING_STAUS"].Value.ToString2() == "")
- // {
- // p = p + 1;
- // }
- //}
- //if (this.ultraGrid3.ActiveRow.Cells["Astatus"].Text == "合格")
- //{
- // if (!row1.Cells["FLAW_STAUS"].Text.ToString2().Contains("合格") || !row1.Cells["TESTING_STAUS"].Text.ToString2().Contains("合格"))
- // {
- // MessageUtil.ShowTips("合格品下,探伤、质检状态都应为合格!");
- // return;
- // }
- //}
- //else
- //{
- // if (row1.Cells["FLAW_STAUS"].Text.ToString2().Contains("合格") || row1.Cells["TESTING_STAUS"].Text.ToString2().Contains("合格"))
- // {
- // MessageUtil.ShowTips("不是合格品下,探伤、质检状态都不应为合格!");
- // return;
- // }
- //}
- if (row1.Cells["THACT_COUNT"].Text.ToString3() != "")
- {
- if (int.Parse(row1.Cells["ACT_COUNT"].Text.ToString3()) + int.Parse(row1.Cells["INSTORECOUNT"].Text.ToString3()) > int.Parse(row1.Cells["THACT_COUNT"].Text.ToString3()))
- {
- x = x + 1;
- }
- }
- ArrayList parm1 = new ArrayList();
- parm1.Add(row1.Cells["ACT_LEN"].Value.ToString2());
- parm1.Add(row1.Cells["ACT_COUNT"].Value.ToString2());
- parm1.Add(row1.Cells["ACT_WEIGHT"].Value.ToString2());
- parm1.Add(row1.Cells["BATCH_NO"].Value.ToString2());
- if (this.ultraGrid3.ActiveRow.Cells["Astatus"].Text == "合格" || this.ultraGrid3.ActiveRow.Cells["Astatus"].Text == "样管")
- {
- parm1.Add("40740401");//探伤结果
- parm1.Add("40740601");//表检结果
- }
- else if (this.ultraGrid3.ActiveRow.Cells["Astatus"].Text == "判废")
- {
- parm1.Add("");//探伤结果
- parm1.Add("");//表检结果
- }
- parm1.Add(row1.Cells["THACT_COUNT"].Value.ToString3());
- parm.Add(parm1);
- totalNum = totalNum + int.Parse(row1.Cells["ACT_COUNT"].Value.ToString2());
- num++;
- }
- }
- IQueryable<UltraGridRow> checkMagRows = this.ultraGrid2.Rows.AsQueryable().Where(" CHK = 'True'");
- int offlinePro = checkMagRows.GroupBy(a => a.GetValue("BATCH_NO")).Count();
- if (checkMagRows.Count() > 1)
- {
- if (offlinePro == 1)
- {
- MessageUtil.ShowTips("批号一样,长度不一样请分开交库!");
- return;
- }
- }
- if (num <= 0)
- {
- MessageUtil.ShowTips("请勾选产出信息!");
- return;
- }
- if (m > 0)
- {
- MessageUtil.ShowTips("长度不能为空,必须大于零!");
- return;
- }
- if (n > 0)
- {
- MessageUtil.ShowTips("支数不能为空,必须大于零!");
- return;
- }
- if (z > 0)
- {
- MessageUtil.ShowTips("重量不能为空,必须大于零!");
- return;
- }
- if (y > 0)
- {
- MessageUtil.ShowTips("批号不能为空,请选择!");
- return;
- }
- //if (p > 0)
- //{
- // MessageUtil.ShowTips("请选择探伤结果和表检结果!");
- // return;
- //}
- if (x > 0)
- {
- MessageUtil.ShowTips("输入的实际支数加已在线库支数不能大于理论支数!");
- return;
- }
- if (this.surplusChk.Checked)
- {
- surplusFlag = "1";
- }
- else
- {
- surplusFlag = "0";
- }
- if (this.sampleLen.Checked)
- {
- sampleFlag = "1";
- }
- else
- {
- sampleFlag = "0";
- }
- if(mi.Target.ToString().Equals("A") && surplusFlag == "1")
- {
- MessageUtil.ShowTips("A字头不允许进行无合同交库!");
- return;
- }
- //DataTable dtSlample = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryPortSlample", new object[] { this.ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Text }, ob);
- //if (dtSlample.Rows.Count > 0)
- //{
- // MessageUtil.ShowTips("请先将样管交库!");
- // return;
- //}
- string contractNo = this.ultraGrid1.ActiveRow.Cells["ORDER_NO"].Text.Trim();
- string target = "";
- string pckFlag = "";//打捆标志
- string matRturnFlag = "";//交货材料要求标志
- string testType = "";//双探类别
- string testGrade = "";//等级
- DataTable dd = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryMilPlan", new object[] { this.ultraGrid1.ActiveRow.Cells["JUDGE_NO"].Text, proPlanId, gxPlanNo }, ob);
- target = dd.Rows[0]["TARGET"].ToString();
- if (target.Equals("A"))
- {
- DataTable dt = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryOrderAsk", new object[] { contractNo }, ob);
- if (dt.Rows.Count > 0)
- {
- for (int i = 0; i < dt.Rows.Count; i++)
- {
- if (dt.Rows[i]["ASK_SUB_ITME_VAL_DESC"].ToString().Contains("打捆"))
- {
- k = k + 1;
- }
- else if (dt.Rows[i]["ASK_ITME"].ToString().Equals("121009"))
- {
- b = b + 1;
- }
- }
- }
- if (k > 0 && b > 0)
- {
- if (MessageUtil.ShowYesNoAndQuestion("该合同的附加要求打捆、交货材料是否满足要求?") == DialogResult.No)
- {
- return;
- }
- pckFlag = "1";
- matRturnFlag = "1";
- }
- else if (k > 0 && b < 1)
- {
- if (MessageUtil.ShowYesNoAndQuestion("该合同的附加要求打捆是否满足要求?") == DialogResult.No)
- {
- return;
- }
- pckFlag = "1";
- matRturnFlag = "0";
- }
- else if (b > 0 && k < 1)
- {
- if (MessageUtil.ShowYesNoAndQuestion("该合同的附加要求交货材料是否满足要求?") == DialogResult.No)
- {
- return;
- }
- pckFlag = "0";
- matRturnFlag = "1";
- }
- else
- {
- pckFlag = "0";
- matRturnFlag = "0";
- }
- if (doQueryPk(this.ultraGrid8.ActiveRow.Cells["ORD_LN_DLY_PK"].Value.ToString()))
- {
- DataTable dtest = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryEntrustT", new object[] { BaseMethod.getJudgeStoveNo(this.ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Text), proPlanId, gxPlanNo }, ob);
- if (dtest.Rows.Count > 0)
- {
- testType = "UT";
- testGrade = dtest.Rows[0][0].ToString();
- }
- else
- {
- MessageUtil.ShowTips("此炉是需要进行双探的管子,需走离线委外加工!");
- return;
- }
- }
- }
- DataTable portDt = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryPortCount", new object[] { ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Text, ultraGrid8.ActiveRow.Cells["LOT_NO"].Text, ultraGrid8.ActiveRow.Cells["ID"].Text }, ob);
- string portCount = portDt.Rows[0][0].ToString3();//理论支数
- DataTable matDt = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryPipeCount", new object[] { ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Text, ultraGrid8.ActiveRow.Cells["LOT_NO"].Text, ultraGrid8.ActiveRow.Cells["ID"].Text }, ob);
- string matCount = matDt.Rows[0][0].ToString3();//已交库支
- DataTable instoreDt = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryPipeLXCount", new object[] { ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Text, ultraGrid8.ActiveRow.Cells["LOT_NO"].Text, ultraGrid8.ActiveRow.Cells["ID"].Text }, ob);
- string pipeLXCount = instoreDt.Rows[0][0].ToString3(); //交库点离线支
- if (totalNum + int.Parse(matCount) + int.Parse(pipeLXCount) > int.Parse(portCount))
- {
- MessageUtil.ShowTips("总交库支数已大于产出支数,请核对支数再交库!");
- return;
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否确认交库?") == DialogResult.No)
- {
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
- ccp.MethodName = "doPipeIn";
- ccp.ServerParams = new object[] { milPlanTity, list, parm, strInbound, strInMemo, this.cmbStorage.Value.ToString2(), this.cmbStorage.Text.Trim(), surplusFlag, sampleFlag, pckFlag, matRturnFlag, testType, testGrade, this.textMemo.Text.Trim(), this.textMemo2.Text.Trim() };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("交库成功!"))
- {
- QuerySinglePlan();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 查询是否需双探
- /// </summary>
- /// <param name="orderPk"></param>
- private bool doQueryPk(string orderPk)
- {
- DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.doQueryProcessSeq", new object[] { orderPk }, ob);
- if (ds.Rows.Count > 0)
- {
- if (ds.Rows[0]["PROCESS_SEQ"].ToString().Equals("F"))
- {
- return true;
- }
- }
- return false;
- }
- /// <summary>
- /// 撤销交库
- /// </summary>
- private void cancelInList()
- {
- this.ultraGrid4.UpdateData();
- IQueryable<UltraGridRow> checkMagRows = this.ultraGrid4.Rows.AsQueryable().Where(" CHK = 'True'");
- if (checkMagRows.Count() == 0)
- {
- MessageUtil.ShowTips("请勾选需要撤销的入库记录!");
- return;
- }
- ArrayList parm = new ArrayList();
- foreach(UltraGridRow uRow in checkMagRows)
- {
- YdmZcInlistEntity inListEntity = (YdmZcInlistEntity)uRow.ListObject;
- string inListTity = JSONFormat.Format(inListEntity);
- parm.Add(inListTity);
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否确认撤销?") == DialogResult.No) return;
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
- ccp.MethodName = "cancelPipeIn";
- ccp.ServerParams = new object[] {parm };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("撤销成功!"))
- {
- DoQueryInList();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
-
- }
- /// <summary>
- /// 申请判定
- /// </summary>
- private void DoDecision()
- {
- this.ultraGrid7.UpdateData();
- int m =0 ;
- int n = 0;
- IQueryable<UltraGridRow> checkMagRows = this.ultraGrid7.Rows.AsQueryable().Where(" CHK = 'True'");
- if (checkMagRows.Count() == 0)
- {
- MessageUtil.ShowTips("请选择需要申请判定的主信息!");
- return;
- }
- ArrayList parm = new ArrayList();
- foreach(UltraGridRow uRow in checkMagRows)
- {
- if (uRow.Cells["QcmStaus"].Text.Trim() == "判废"||uRow.Cells["QcmStaus"].Text.Trim() == "待处理")
- {
- m= m+1;
- }
- if (uRow.Cells["JugdeApplyCode"].Text.Trim() != "")
- {
- n = n + 1;
- }
- MatZcMEntity matZcEntity = (MatZcMEntity)uRow.ListObject;
- string matZcTity = JSONFormat.Format(matZcEntity);
- parm.Add(matZcTity);
- }
- if (m > 0)
- {
- MessageUtil.ShowTips("废品/待处理的炉批组信息,不允许申请判定!");
- return;
- }
- if(n>0)
- {
- MessageUtil.ShowTips("正在进行判定的炉批组信息,不允许重复申请判定!");
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
- ccp.MethodName = "doDecision";
- ccp.ServerParams = new object[] { parm, this.ultraGrid6.ActiveRow.Cells["JudgeStoveNo"].Value.ToString(), this.ultraGrid6.ActiveRow.Cells["ProductFlag"].Value.ToString() };
- ccp = ob.ExecuteNonQuery(ccp,CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("申请判定成功!"))
- {
- QueryMat();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 撤销申请判定
- /// </summary>
- private void cancelDoDecision()
- {
- this.ultraGrid7.UpdateData();
- IQueryable<UltraGridRow> checkMagRows = this.ultraGrid7.Rows.AsQueryable().Where(" CHK = 'True'");
- if (checkMagRows.Count() == 0)
- {
- MessageUtil.ShowTips("请选择需要撤销申请判定的主信息!");
- return;
- }
- ArrayList parm = new ArrayList();
- foreach(UltraGridRow uRow in checkMagRows)
- {
- MatZcMEntity matZcTity = (MatZcMEntity)uRow.ListObject;
- string matTity = JSONFormat.Format(matZcTity);
- parm.Add(matTity);
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否确认撤销?") == DialogResult.No) return;
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
- ccp.MethodName = "cancelDoDecision";
- ccp.ServerParams = new object[] { parm };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("撤销成功!"))
- {
- QueryMat();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 查询入库实绩
- /// </summary>
- private void DoQueryInList()
- {
- string plinCode = "";
- string jugeNo = "";
- string startTim = "";
- string endTim = "";
- //string departMentId = PipeManageClass.GetDepartIdBySectionId(UserInfo.GetDeptid(),ob);
- string departMentId = UserInfo.GetDeptid();
- NativeMethodNew na = new NativeMethodNew(this.ob);
- plinCode = na.GetPCode(this.UserInfo.GetDepartment());
- if (this.chkHeatNo1.Checked && this.txtHeatNo1.Text.Trim() != "")
- {
- jugeNo = this.txtHeatNo1.Text.Trim();
- }
- if (chkTim1.Checked)
- {
- if (DateTime.Parse(StartTime1.Value.ToString()) > DateTime.Parse(EndTime1.Value.ToString()))
- {
- MessageUtil.ShowTips("选择的前面时间不能大于后面的时间!");
- return;
- }
- else
- {
- startTim = this.StartTime1.Value.ToString("yyyy-MM-dd");
- endTim = this.EndTime1.Value.ToString("yyyy-MM-dd");
- }
- }
- ArrayList list = new ArrayList();
- list.Add(jugeNo);
- list.Add(plinCode);
- List<YdmZcInlistEntity> listSource = EntityHelper.GetData<YdmZcInlistEntity>(
- "com.steering.mes.signature.FrmInOnlineStore.doQueryInList", new object[] { list, startTim, endTim, departMentId, plineCodes }, this.ob);
- YdmZcInlistEntitybindingSource.DataSource = listSource;
- }
- /// <summary>
- /// 查询库存实绩
- /// </summary>
- private void QueryMatButess()
- {
- string plinCode = "";
- string jugeNo = "";
- string startTim = "";
- string endTim = "";
- //string departMentId = PipeManageClass.GetDepartIdBySectionId(UserInfo.GetDeptid(),ob);
- string departMentId = UserInfo.GetDeptid();
- NativeMethodNew na = new NativeMethodNew(this.ob);
- plinCode = na.GetPCode(this.UserInfo.GetDepartment());
- if (this.chkHeatNo3.Checked && this.txtHeatNo3.Text.Trim() != "")
- {
- jugeNo = this.txtHeatNo3.Text.Trim();
- }
- if (chkTim3.Checked)
- {
- if (DateTime.Parse(StartTime3.Value.ToString()) > DateTime.Parse(EndTime3.Value.ToString()))
- {
- MessageUtil.ShowTips("选择的前面时间不能大于后面的时间!");
- return;
- }
- else
- {
- startTim = this.StartTime3.Value.ToString("yyyy-MM-dd HH:mm:ss");
- endTim = this.EndTime3.Value.ToString("yyyy-MM-dd HH:mm:ss");
- }
- }
- ArrayList list = new ArrayList();
- list.Add(jugeNo);
- list.Add(plinCode);
- List<MatZcMEntity> listSource = EntityHelper.GetData<MatZcMEntity>(
- "com.steering.mes.signature.FrmInOnlineStore.doQueryMatButess", new object[] { list, startTim, endTim, departMentId, plineCodes }, this.ob);
- MatZcMEntitybindingSource.DataSource = listSource;
- }
- /// <summary>
- /// 查询材料表
- /// </summary>
- private void QueryMat()
- {
- string plinCode = "";
- string jugeNo = "";
- string startTim = "";
- string endTim = "";
- string departMentid = PipeManageClass.GetDepartIdBySectionId(UserInfo.GetDeptid(), ob);
- NativeMethodNew na = new NativeMethodNew(this.ob);
- plinCode = na.GetPCode(this.UserInfo.GetDepartment());
- if (this.chkHeatNo2.Checked && this.txtHeatNo2.Text.Trim() != "")
- {
- jugeNo = this.txtHeatNo2.Text.Trim();
- }
- if (chkTim2.Checked)
- {
- if (DateTime.Parse(StartTime2.Value.ToString()) > DateTime.Parse(EndTime2.Value.ToString()))
- {
- MessageUtil.ShowTips("选择的前面时间不能大于后面的时间!");
- return;
- }
- else
- {
- startTim = this.StartTime2.Value.ToString("yyyy-MM-dd HH:mm:ss");
- endTim = this.EndTime2.Value.ToString("yyyy-MM-dd HH:mm:ss");
- }
- }
-
- ArrayList list = new ArrayList();
- list.Add(jugeNo);
- list.Add(plinCode);
- List<MatZcMEntity> listSource = EntityHelper.GetData<MatZcMEntity>(
- "com.steering.mes.signature.FrmInOnlineStore.doQueryMat", new object[] { list, startTim, endTim, departMentid, plinCode, this.ultraOptionSet1.CheckedItem.DataValue.ToString(), plineCodes }, this.ob);
- MatZcMEntity1bindingSource.DataSource = listSource;
- }
- /// <summary>
- /// 查询炉顺序
- /// </summary>
- private void QuerySinglePlan()
- {
- string plinCode = "";
- string startTim = "";
- string endTim = "";
- string jugeNo = "";
- string lotNo = "";
- if(this.chkJugeHeatNo.Checked && this.txtJugeNo.Text.Trim() != "")
- {
- jugeNo = this.txtJugeNo.Text.Trim();
- }
- if(chkTim.Checked)
- {
- if (DateTime.Parse(StartTime.Value.ToString()) > DateTime.Parse(EndTime.Value.ToString()))
- {
- MessageUtil.ShowTips("选择的前面时间不能大于后面的时间!");
- return;
- }
- else
- {
- startTim = this.StartTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
- endTim = this.EndTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
- }
- }
- if(this.chkLotNo.Checked&&this.txtLotNo.Text.Trim() !="")
- {
- lotNo = this.txtLotNo.Text.Trim();
- }
- NativeMethodNew na = new NativeMethodNew(this.ob);
- plinCode = na.GetPCode(this.UserInfo.GetDepartment());
- string nodeStaus = this.ultraOptionSet2.CheckedItem.DataValue.ToString();
- ArrayList list = new ArrayList();
- list.Add(jugeNo);
- list.Add(lotNo);
- list.Add(plinCode);
- this.dtPlan.Clear();
- this.dataTable1.Clear();
- this.dataTable2.Clear();
- this.MilPlanEntity3bindingSource.Clear();
- DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.querySinglePlan", new object[] { list, startTim, endTim, nodeStaus, plineCodes }, ob);
- GridHelper.CopyDataToDatatable(ref ds, ref dtPlan, true);
- }
- /// <summary>
- /// 查询炉投入产出
- /// </summary>
- private void QuerySingleJugStove(string jugeNo, string lotNo, string plinCode)
- {
- //string plinCode = "";
- string startTim = "";
- string endTim = "";
- NativeMethodNew na = new NativeMethodNew(this.ob);
- //plinCode = na.GetPCode(this.UserInfo.GetDepartment());
- string nodeStaus = this.ultraOptionSet2.CheckedItem.DataValue.ToString();
- //if(this.chkJugeHeatNo.Checked && this.txtJugeNo.Text.Trim() != "")
- //{
- // jugeNo = this.txtJugeNo.Text.Trim();
- //}
- //if(chkTim.Checked)
- //{
- // if (DateTime.Parse(StartTime.Value.ToString()) > DateTime.Parse(EndTime.Value.ToString()))
- // {
- // MessageUtil.ShowTips("选择的前面时间不能大于后面的时间!");
- // return;
- // }
- // else
- // {
- // startTim = this.StartTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
- // endTim = this.EndTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
- // }
- //}
- //if(this.chkLotNo.Checked&&this.txtLotNo.Text.Trim() !="")
- //{
- // lotNo = this.txtLotNo.Text.Trim();
- //}
- ArrayList list = new ArrayList();
- list.Add(plinCode);
- list.Add(jugeNo);
- list.Add(lotNo);
- list.Add(plinCode);
- list.Add(jugeNo);
- list.Add(lotNo);
- list.Add(plinCode);
- list.Add(jugeNo);
- list.Add(lotNo);
- list.Add(plinCode);
- list.Add(jugeNo);
- list.Add(lotNo);
- list.Add(plinCode);
- list.Add(jugeNo);
- list.Add(lotNo);
- list.Add(plinCode);
- list.Add(jugeNo);
- list.Add(lotNo);
- dataSet1.Clear();
- this.dataTable1.Clear();
- DataTable dt = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQuerySingleJugStove", new object[] { list, startTim, endTim, nodeStaus }, ob);
- GridHelper.CopyDataToDatatable(ref dt, ref dataTable1, true);
- }
- private void QueryMinMaxDS()
- {
- UltraGridRow uRow = this.ultraGrid8.ActiveRow;
- DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.doQueryMinMaxD", new object[] { uRow.Cells["JUDGE_NO"].Value.ToString() }, ob);
- DataTable dd = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.doQueryMinMaxS", new object[] { uRow.Cells["JUDGE_NO"].Value.ToString() }, ob);
- if (ds.Rows.Count > 0)
- {
- this.txt_dimer.Text = ds.Rows[0]["DIMATER"].ToString();
- }
- else
- {
- this.txt_dimer.Text = "0";
- }
- if (dd.Rows.Count > 0)
- {
- this.txt_height.Text = dd.Rows[0]["HEIGHT"].ToString();
- }
- else
- {
- this.txt_height.Text = "0";
- }
- }
- private void FrmInOnlineStore_Load(object sender, EventArgs e)
- {
- DateTime now = DateTime.Now;
- DateTime dt1 = new DateTime(now.Year, now.Month, 1);//当月第一天
- DateTime dt2 = dt1.AddMonths(1).AddDays(-1);//当月最后一天
- this.StartTime.Value = DateTime.Parse(dt1.ToString("yyyy-MM-dd") + " 00:00:00");
- this.EndTime.Value = DateTime.Parse(dt2.ToString("yyyy-MM-dd") + " 23:59:59");
- this.StartTime1.Value = DateTime.Parse(dt1.ToString("yyyy-MM-dd") + " 00:00:00");
- this.EndTime1.Value = DateTime.Parse(dt2.ToString("yyyy-MM-dd") + " 23:59:59");
- this.StartTime2.Value = DateTime.Parse(dt1.ToString("yyyy-MM-dd") + " 00:00:00");
- this.EndTime2.Value = DateTime.Parse(dt2.ToString("yyyy-MM-dd") + " 23:59:59");
- this.StartTime3.Value = DateTime.Parse(dt1.ToString("yyyy-MM-dd") + " 00:00:00");
- this.EndTime3.Value = DateTime.Parse(dt2.ToString("yyyy-MM-dd") + " 23:59:59");
- EntityHelper.ShowGridCaption<MilPlanEntity3>(ultraGrid3.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<YdmZcInlistEntity>(ultraGrid4.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<MatZcMEntity>(ultraGrid6.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<MatZcMEntity>(ultraGrid5.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<MatZcMEntity>(ultraGrid7.DisplayLayout.Bands[0]);
- //EntityHelper.ShowGridCaption<MatZcMEntity>(ultraGrid9.DisplayLayout.Bands[0]);
- PipeManageClass.InitComboEditor2(cmbStorage, "com.steering.mes.signature.FrmInOnlineStore.getStoreNo", "STORAGE_NO",this.UserInfo.GetDeptid(), this.ob, false);
- PipeManageClass.InitComboEditor(txt_UtGrade, "com.steering.mes.signature.FrmInOnlineStore.getTestGrade", "BASECODE", this.ob, false);
- InitBindColumn();
- NativeMethodNew na = new NativeMethodNew(this.ob);
- Departm = UserInfo.GetDepartment();
- PlineCode = na.GetPCode(Departm);//获取 用户 对应的产线
- plineCodes = BaseMethod.GetPlineCode(ValidDataPurviewIds, ob);
- //if (!PlineCode.Equals("C072"))
- //{
- // label7.Visible = false;
- // textMemo.Visible = false;
- //}
- Sign();
- }
- private void InitBindColumn()
- {
- //材料状态
- this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150101", "材料产出待判");
- this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150102", "材料管理封锁");
- this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150103", "材料质量封锁");
- this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150104", "材料可编计划");
- this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150105", "材料已编计划");
- this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150106", "材料为余材");
- this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150201", "材料产出等待(未综合判定)");
- this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150202", "材料产出(已综合判定");
- this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150203", "材料为余材(已综合判定)");
- this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150204", "材料脱单余材(销售组织脱单)");
- this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150205", "材料缴库余材(销售组织缴库)");
- this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150301", "材料可编提单");
- this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150302", "材料已编提单");
- this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150303", "销售出厂");
- //材料类别
- this.ultraGrid7.DisplayLayout.ValueLists[1].ValueListItems.Add("801401", "在制品");
- this.ultraGrid7.DisplayLayout.ValueLists[1].ValueListItems.Add("801402", "成品");
- this.ultraGrid7.DisplayLayout.ValueLists[1].ValueListItems.Add("801403", "商品");
- //材料状态
- this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150101", "材料产出待判");
- this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150102", "材料管理封锁");
- this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150103", "材料质量封锁");
- this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150104", "材料可编计划");
- this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150105", "材料已编计划");
- this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150106", "材料为余材");
- this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150201", "材料产出等待(未综合判定)");
- this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150202", "材料产出(已综合判定");
- this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150203", "材料为余材(已综合判定)");
- this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150204", "材料脱单余材(销售组织脱单)");
- this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150205", "材料缴库余材(销售组织缴库)");
- this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150301", "材料可编提单");
- this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150302", "材料已编提单");
- this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150303", "销售出厂");
- //材料类别
- this.ultraGrid6.DisplayLayout.ValueLists[1].ValueListItems.Add("801401", "在制品");
- this.ultraGrid6.DisplayLayout.ValueLists[1].ValueListItems.Add("801402", "成品");
- this.ultraGrid6.DisplayLayout.ValueLists[1].ValueListItems.Add("801403", "商品");
- //材料状态
- this.ultraGrid5.DisplayLayout.ValueLists[0].ValueListItems.Add("80150101", "材料产出待判");
- this.ultraGrid5.DisplayLayout.ValueLists[0].ValueListItems.Add("80150102", "材料管理封锁");
- this.ultraGrid5.DisplayLayout.ValueLists[0].ValueListItems.Add("80150103", "材料质量封锁");
- this.ultraGrid5.DisplayLayout.ValueLists[0].ValueListItems.Add("80150104", "材料可编计划");
- this.ultraGrid5.DisplayLayout.ValueLists[0].ValueListItems.Add("80150105", "材料已编计划");
- this.ultraGrid5.DisplayLayout.ValueLists[0].ValueListItems.Add("80150106", "材料为余材");
- this.ultraGrid5.DisplayLayout.ValueLists[0].ValueListItems.Add("80150201", "材料产出等待(未综合判定)");
- this.ultraGrid5.DisplayLayout.ValueLists[0].ValueListItems.Add("80150202", "材料产出(已综合判定");
- this.ultraGrid5.DisplayLayout.ValueLists[0].ValueListItems.Add("80150203", "材料为余材(已综合判定)");
- this.ultraGrid5.DisplayLayout.ValueLists[0].ValueListItems.Add("80150204", "材料脱单余材(销售组织脱单)");
- this.ultraGrid5.DisplayLayout.ValueLists[0].ValueListItems.Add("80150205", "材料缴库余材(销售组织缴库)");
- this.ultraGrid5.DisplayLayout.ValueLists[0].ValueListItems.Add("80150301", "材料可编提单");
- this.ultraGrid5.DisplayLayout.ValueLists[0].ValueListItems.Add("80150302", "材料已编提单");
- this.ultraGrid5.DisplayLayout.ValueLists[0].ValueListItems.Add("80150303", "销售出厂");
- //材料类别
- this.ultraGrid5.DisplayLayout.ValueLists[1].ValueListItems.Add("801401", "在制品");
- this.ultraGrid5.DisplayLayout.ValueLists[1].ValueListItems.Add("801402", "成品");
- this.ultraGrid5.DisplayLayout.ValueLists[1].ValueListItems.Add("801403", "商品");
- //材料状态
- this.ultraGrid4.DisplayLayout.ValueLists[0].ValueListItems.Add("80150101", "材料产出待判");
- this.ultraGrid4.DisplayLayout.ValueLists[0].ValueListItems.Add("80150102", "材料管理封锁");
- this.ultraGrid4.DisplayLayout.ValueLists[0].ValueListItems.Add("80150103", "材料质量封锁");
- this.ultraGrid4.DisplayLayout.ValueLists[0].ValueListItems.Add("80150104", "材料可编计划");
- this.ultraGrid4.DisplayLayout.ValueLists[0].ValueListItems.Add("80150105", "材料已编计划");
- this.ultraGrid4.DisplayLayout.ValueLists[0].ValueListItems.Add("80150106", "材料为余材");
- this.ultraGrid4.DisplayLayout.ValueLists[0].ValueListItems.Add("80150201", "材料产出等待(未综合判定)");
- this.ultraGrid4.DisplayLayout.ValueLists[0].ValueListItems.Add("80150202", "材料产出(已综合判定");
- this.ultraGrid4.DisplayLayout.ValueLists[0].ValueListItems.Add("80150203", "材料为余材(已综合判定)");
- this.ultraGrid4.DisplayLayout.ValueLists[0].ValueListItems.Add("80150204", "材料脱单余材(销售组织脱单)");
- this.ultraGrid4.DisplayLayout.ValueLists[0].ValueListItems.Add("80150205", "材料缴库余材(销售组织缴库)");
- this.ultraGrid4.DisplayLayout.ValueLists[0].ValueListItems.Add("80150301", "材料可编提单");
- this.ultraGrid4.DisplayLayout.ValueLists[0].ValueListItems.Add("80150302", "材料已编提单");
- this.ultraGrid4.DisplayLayout.ValueLists[0].ValueListItems.Add("80150303", "销售出厂");
- this.ultraGrid4.DisplayLayout.ValueLists[1].ValueListItems.Add("00", "合格");
- this.ultraGrid4.DisplayLayout.ValueLists[1].ValueListItems.Add("11", "待处理");
- this.ultraGrid4.DisplayLayout.ValueLists[1].ValueListItems.Add("22", "废品");
- this.ultraGrid4.DisplayLayout.ValueLists[2].ValueListItems.Add("0", "非样管");
- this.ultraGrid4.DisplayLayout.ValueLists[2].ValueListItems.Add("1", "样管");
- //string[] arr = new string[3] { "801501", "801502", "801503" };
- //DataTable dt = ClsLoad.GetValueListDataTable(arr, this.ob);
- //this.ultraGrid2.DisplayLayout.Bands[0].Columns["MAT_STATUS"].ValueList = ClsLoad.GeneralValuelist(ref dt, "BASECODE", "BASENAME");
- }
- private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
- {
- string goType = "";
- NativeMethodNew na = new NativeMethodNew(this.ob);
- string plinCode = this.ultraGrid8.ActiveRow.Cells["PLINE_CODE"].Text.ToString();
- //doQueryQaJugeStove(this.ultraGrid1.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString(), plinCode);
- DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryGoType", new object[] { this.ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString() }, this.ob);
- if (ds.Rows.Count > 0)
- {
- goType = ds.Rows[0][0].ToString();
- }
- doQueryQaInStore(this.ultraGrid1.ActiveRow.Cells["JUDGE_NO"].Value.ToString(), this.ultraGrid1.ActiveRow.Cells["LOT_NO"].Value.ToString(), plinCode, goType);
- }
- /// <summary>
- /// 签名
- /// </summary>
- private void Sign()
- {
- ColUserName col = new ColUserName();
- col.StationId = "12";
- col.PlineCode = PlineCode;
- col.ColGroup = UserInfo.GetUserGroup();
- col.Ob = this.ob;
- col.ShowDialog();
- _UserID = col.getUserId();
- _UserName = col.getUserName();
- }
- /// <summary>
- /// 查询表检炉批
- /// </summary>
- private void doQueryQaJugeStove(string jugeStove,string plineCode)
- {
- DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryQaStove", new object[] { jugeStove, plineCode }, ob);
- GridHelper.CopyDataToDatatable(ref ds, ref dataTable2, true);
- }
- //private void ultraGrid2_AfterRowActivate(object sender, EventArgs e)
- //{
- // NativeMethodNew na = new NativeMethodNew(this.ob);
- // string plinCode = na.GetPCode(this.UserInfo.GetDepartment());
- // doQueryQaInStore(this.ultraGrid2.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString(), this.ultraGrid2.ActiveRow.Cells["LOT_NO"].Value.ToString(), plinCode);
- //}
- /// <summary>
- /// 查询产出详细信息
- /// </summary>
- /// <param name="p"></param>
- /// <param name="p_2"></param>
- /// <param name="plinCode"></param>
- private void doQueryQaInStore(string p, string p_2, string plinCode,string goType)
- {
- ArrayList parm = new ArrayList();
- parm.Add(p);
- parm.Add(p_2);
- parm.Add(plinCode);
- parm.Add(p);
- parm.Add(p_2);
- parm.Add(plinCode);
- parm.Add(p);
- parm.Add(p_2);
- parm.Add(plinCode);
- //parm.Add(p);
- //parm.Add(p_2);
- //parm.Add(plinCode);
- //parm.Add(p);
- //parm.Add(p_2);
- //parm.Add(plinCode);
- MilPlanEntity3bindingSource.Clear();
- List<MilPlanEntity3> listSource = EntityHelper.GetData<MilPlanEntity3>(
- "com.steering.mes.signature.FrmInOnlineStore.doQuerySurface", new object[] { parm,goType }, this.ob);
- MilPlanEntity3bindingSource.DataSource = listSource;
- }
- private void ultraGrid3_AfterSelectChange(object sender, Infragistics.Win.UltraWinGrid.AfterSelectChangeEventArgs e)
- {
- foreach (UltraGridRow uRow in ultraGrid3.Selected.Rows)
- {
- if (uRow.GetType() != typeof(Infragistics.Win.UltraWinGrid.UltraGridGroupByRow))
- {
- uRow.Cells["CHK"].Value = true;
- }
- }
- }
- private void ultraGrid3_AfterRowActivate(object sender, EventArgs e)
- {
- string judgeStoveNo = this.ultraGrid1.ActiveRow.Cells["JUDGE_NO"].Value.ToString();
- string lotNo = this.ultraGrid1.ActiveRow.Cells["LOT_NO"].Value.ToString();
- string length = this.ultraGrid3.ActiveRow.Cells["ActLen"].Value.ToString2();
- string staus = this.ultraGrid3.ActiveRow.Cells["Astatus"].Value.ToString();
- string id = this.ultraGrid3.ActiveRow.Cells["id"].Value.ToString();
- string sampleFlag = "";
- ArrayList list = new ArrayList();
- list.Add(judgeStoveNo);
- list.Add(lotNo);
- if (this.sampleLen.Checked)
- {
- sampleFlag = "1";
- }
- else
- {
- sampleFlag = "0";
- }
- //doQueryNum(list, staus);
- //getBacthNo(judgeStoveNo, lotNo,id);
- getBacthNoInformation(judgeStoveNo, lotNo, id, this.ultraGrid3.ActiveRow.Cells["Astatus"].Value.ToString(), sampleFlag);
- }
- /// <summary>
- /// 查询炉次信息
- /// </summary>
- private void getBacthNoInformation(string judgeStoveNo, string lotNo, string id, string flag, string sampleFlag)
- {
- this.dataTable2.Clear();
- DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryBacthNoInformation", new object[] { judgeStoveNo, lotNo, id, flag, sampleFlag }, ob);
- GridHelper.CopyDataToDatatable(ref ds, ref dataTable2, true);
- DataTable portDt = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryPortCount", new object[] { judgeStoveNo, lotNo, id }, ob);
- string portCount = portDt.Rows[0][0].ToString3();
- DataTable matDt = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryPipeCount", new object[] { judgeStoveNo, lotNo, id }, ob);
- string matCount = matDt.Rows[0][0].ToString3();
- DataTable lxDt = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryPipeLXCount", new object[] { judgeStoveNo, lotNo, id }, ob);
- string lxCount = lxDt.Rows[0][0].ToString3();
- this.ultraLabel3.Text = "炉号:" + judgeStoveNo + " " + "理论支数:" + portCount + " " + "已交库支数:" + matCount + " " + "离线支数:" + lxCount;
- ultraLabel3.ForeColor = Color.Red;
- }
- /// <summary>
- /// 查询几大类的支数、长度、重量信息
- /// </summary>
- /// <param name="list"></param>
- /// <param name="staus"></param>
- private void doQueryNum(ArrayList list,string staus)
- {
- DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryNum", new object[] { list, staus }, ob);
- GridHelper.CopyDataToDatatable(ref ds, ref dataTable2, true);
- }
- UltraComboEditor bacthNo = new UltraComboEditor();
- UltraComboEditor flawStaus = new UltraComboEditor();
- UltraComboEditor testingStaus = new UltraComboEditor();
- private void getBacthNo(string jugeNo,string lotNo,string id)
- {
- DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryBacthNo", new object[] { jugeNo, lotNo, id }, ob);
- PipeManageClass.InitComboEditor(bacthNo, ds, "BATCHCODE", false);
- PipeManageClass.BindColumn(bacthNo, "BATCH_NO", this.Controls, this.ultraGrid2,0);
- PipeManageClass.InitComboEditor(flawStaus, "com.steering.mes.signature.FrmInOnlineStore.doQueryFlawStaus", "BASECODE",this.ob, false);
- PipeManageClass.BindColumn(flawStaus, "FLAW_STAUS", this.Controls, this.ultraGrid2, 0);
- PipeManageClass.InitComboEditor(testingStaus, "com.steering.mes.signature.FrmInOnlineStore.doQueryTestingStaus", "BASECODE", this.ob, false);
- PipeManageClass.BindColumn(testingStaus, "TESTING_STAUS", this.Controls, this.ultraGrid2, 0);
- }
-
- private void ultraGrid2_CellChange(object sender, CellEventArgs e)
- {
- this.ultraGrid2.UpdateData();
- string isSampleFlag = "";
- string stausFlag = "";
- if (e.Cell.Column.Key == "ACT_LEN" || e.Cell.Column.Key == "ACT_COUNT")
- {
- //if (e.Cell.DataChanged)
- //{
- if (e.Cell.Row.Cells["ACT_COUNT"].Value.ToString2() != "" && e.Cell.Row.Cells["ACT_COUNT"].Value.ToString2() != "0" && e.Cell.Row.Cells["ACT_LEN"].Value.ToString2() != "" && double.Parse(e.Cell.Row.Cells["ACT_LEN"].Value.ToString2()) > 0)
- {
- if (this.ultraGrid3.ActiveRow != null)
- {
- if (this.ultraGrid3.ActiveRow.Cells["Astatus"].Text.ToString() == "样管")
- {
- isSampleFlag = "1";
- stausFlag = "0";
- }
- else if (this.ultraGrid3.ActiveRow.Cells["Astatus"].Text.ToString() == "合格")
- {
- isSampleFlag = "0";
- stausFlag = "0";
- }
- else
- {
- isSampleFlag = "0";
- stausFlag = "2";
- }
- DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryWgt", new object[] { this.ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString(), int.Parse(e.Cell.Row.Cells["ACT_COUNT"].Value.ToString2()), stausFlag, isSampleFlag }, ob);
- e.Cell.Row.Cells["ACT_WEIGHT"].Value = ds.Rows[0]["ACT_WEIGHT"].ToString2();
- }
- else
- {
- MessageUtil.ShowTips("请选择炉批行信息!");
- return;
- }
- }
- //}
- }
- if (e.Cell.Column.Key == "CHK")
- {
- if (Convert.ToBoolean(e.Cell.Value))
- {
- for (int i = 0; i < e.Cell.Row.Cells.Count; i++)
- {
- e.Cell.Row.Cells[i].Activation = Activation.AllowEdit;
- }
- }
- //else
- //{
- // e.Cell.Row.Delete();
- //}
- }
- }
- private void FrmInOnlineStore_Shown(object sender, EventArgs e)
- {
- if (toolMenu.Toolbars[0].Tools.Exists("DoQueryMat"))
- {
- toolMenu.Toolbars[0].Tools["DoQueryMat"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("DoQueryMatB"))
- {
- toolMenu.Toolbars[0].Tools["DoQueryMatB"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("DoQueryInList"))
- {
- toolMenu.Toolbars[0].Tools["DoQueryInList"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("cancelInList"))
- {
- toolMenu.Toolbars[0].Tools["cancelInList"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("DoDecision"))
- {
- toolMenu.Toolbars[0].Tools["DoDecision"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("cancelDoDecision"))
- {
- toolMenu.Toolbars[0].Tools["cancelDoDecision"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("Print"))
- {
- toolMenu.Toolbars[0].Tools["Print"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("insertProssWt"))
- {
- toolMenu.Toolbars[0].Tools["insertProssWt"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("updateTarget"))
- {
- toolMenu.Toolbars[0].Tools["updateTarget"].InstanceProps.Visible = DefaultableBoolean.False;
- }
-
-
- }
- private void ultraTabControl1_SelectedTabChanged(object sender, Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventArgs e)
- {
- if (toolMenu == null) return;
- if (ultraTabControl1.SelectedTab.Key == "1")
- {
- if (toolMenu.Toolbars[0].Tools.Exists("DoQuery"))
- {
- toolMenu.Toolbars[0].Tools["DoQuery"].InstanceProps.Visible = DefaultableBoolean.True;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("DoSave"))
- {
- toolMenu.Toolbars[0].Tools["DoSave"].InstanceProps.Visible = DefaultableBoolean.True;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("DoQueryMat"))
- {
- toolMenu.Toolbars[0].Tools["DoQueryMat"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("DoQueryMatB"))
- {
- toolMenu.Toolbars[0].Tools["DoQueryMatB"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("DoQueryInList"))
- {
- toolMenu.Toolbars[0].Tools["DoQueryInList"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("cancelInList"))
- {
- toolMenu.Toolbars[0].Tools["cancelInList"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("DoDecision"))
- {
- toolMenu.Toolbars[0].Tools["DoDecision"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("DoBeside"))
- {
- toolMenu.Toolbars[0].Tools["DoBeside"].InstanceProps.Visible = DefaultableBoolean.True;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("cancelDoBeside"))
- {
- toolMenu.Toolbars[0].Tools["cancelDoBeside"].InstanceProps.Visible = DefaultableBoolean.True;
- }
-
- if (toolMenu.Toolbars[0].Tools.Exists("cancelDoDecision"))
- {
- toolMenu.Toolbars[0].Tools["cancelDoDecision"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("Print"))
- {
- toolMenu.Toolbars[0].Tools["Print"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("insertProssWt"))
- {
- toolMenu.Toolbars[0].Tools["insertProssWt"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("adjustWgt"))
- {
- toolMenu.Toolbars[0].Tools["adjustWgt"].InstanceProps.Visible = DefaultableBoolean.True;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("Export"))
- {
- toolMenu.Toolbars[0].Tools["Export"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("OfflineXX"))
- {
- toolMenu.Toolbars[0].Tools["OfflineXX"].InstanceProps.Visible = DefaultableBoolean.True;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("QuXiang"))
- {
- toolMenu.Toolbars[0].Tools["QuXiang"].InstanceProps.Visible = DefaultableBoolean.True;
- }
-
-
- }
- else if (ultraTabControl1.SelectedTab.Key == "2")
- {
- if (toolMenu.Toolbars[0].Tools.Exists("DoQuery"))
- {
- toolMenu.Toolbars[0].Tools["DoQuery"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("DoSave"))
- {
- toolMenu.Toolbars[0].Tools["DoSave"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("DoQueryMat"))
- {
- toolMenu.Toolbars[0].Tools["DoQueryMat"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("DoQueryMatB"))
- {
- toolMenu.Toolbars[0].Tools["DoQueryMatB"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("DoQueryInList"))
- {
- toolMenu.Toolbars[0].Tools["DoQueryInList"].InstanceProps.Visible = DefaultableBoolean.True;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("cancelInList"))
- {
- toolMenu.Toolbars[0].Tools["cancelInList"].InstanceProps.Visible = DefaultableBoolean.True;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("DoDecision"))
- {
- toolMenu.Toolbars[0].Tools["DoDecision"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("DoBeside"))
- {
- toolMenu.Toolbars[0].Tools["DoBeside"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("cancelDoBeside"))
- {
- toolMenu.Toolbars[0].Tools["cancelDoBeside"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("cancelDoDecision"))
- {
- toolMenu.Toolbars[0].Tools["cancelDoDecision"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("Print"))
- {
- toolMenu.Toolbars[0].Tools["Print"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("insertProssWt"))
- {
- toolMenu.Toolbars[0].Tools["insertProssWt"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("adjustWgt"))
- {
- toolMenu.Toolbars[0].Tools["adjustWgt"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("Export"))
- {
- toolMenu.Toolbars[0].Tools["Export"].InstanceProps.Visible = DefaultableBoolean.True;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("OfflineXX"))
- {
- toolMenu.Toolbars[0].Tools["OfflineXX"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("QuXiang"))
- {
- toolMenu.Toolbars[0].Tools["QuXiang"].InstanceProps.Visible = DefaultableBoolean.False;
- }
-
-
-
- }
- else if (ultraTabControl1.SelectedTab.Key == "3")
- {
- if (toolMenu.Toolbars[0].Tools.Exists("DoQuery"))
- {
- toolMenu.Toolbars[0].Tools["DoQuery"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("DoSave"))
- {
- toolMenu.Toolbars[0].Tools["DoSave"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("DoQueryMat"))
- {
- toolMenu.Toolbars[0].Tools["DoQueryMat"].InstanceProps.Visible = DefaultableBoolean.True;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("DoQueryMatB"))
- {
- toolMenu.Toolbars[0].Tools["DoQueryMatB"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("DoQueryInList"))
- {
- toolMenu.Toolbars[0].Tools["DoQueryInList"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("cancelInList"))
- {
- toolMenu.Toolbars[0].Tools["cancelInList"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("DoDecision"))
- {
- toolMenu.Toolbars[0].Tools["DoDecision"].InstanceProps.Visible = DefaultableBoolean.True;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("DoBeside"))
- {
- toolMenu.Toolbars[0].Tools["DoBeside"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("cancelDoBeside"))
- {
- toolMenu.Toolbars[0].Tools["cancelDoBeside"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("cancelDoDecision"))
- {
- toolMenu.Toolbars[0].Tools["cancelDoDecision"].InstanceProps.Visible = DefaultableBoolean.True;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("Print"))
- {
- toolMenu.Toolbars[0].Tools["Print"].InstanceProps.Visible = DefaultableBoolean.True;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("insertProssWt"))
- {
- toolMenu.Toolbars[0].Tools["insertProssWt"].InstanceProps.Visible = DefaultableBoolean.True;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("adjustWgt"))
- {
- toolMenu.Toolbars[0].Tools["adjustWgt"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("Export"))
- {
- toolMenu.Toolbars[0].Tools["Export"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("OfflineXX"))
- {
- toolMenu.Toolbars[0].Tools["OfflineXX"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("QuXiang"))
- {
- toolMenu.Toolbars[0].Tools["QuXiang"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- }
- else if (ultraTabControl1.SelectedTab.Key == "4")
- {
- if (toolMenu.Toolbars[0].Tools.Exists("DoQuery"))
- {
- toolMenu.Toolbars[0].Tools["DoQuery"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("DoSave"))
- {
- toolMenu.Toolbars[0].Tools["DoSave"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("DoQueryMat"))
- {
- toolMenu.Toolbars[0].Tools["DoQueryMat"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("DoQueryMatB"))
- {
- toolMenu.Toolbars[0].Tools["DoQueryMatB"].InstanceProps.Visible = DefaultableBoolean.True;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("DoQueryInList"))
- {
- toolMenu.Toolbars[0].Tools["DoQueryInList"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("cancelInList"))
- {
- toolMenu.Toolbars[0].Tools["cancelInList"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("DoDecision"))
- {
- toolMenu.Toolbars[0].Tools["DoDecision"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("DoBeside"))
- {
- toolMenu.Toolbars[0].Tools["DoBeside"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("cancelDoBeside"))
- {
- toolMenu.Toolbars[0].Tools["cancelDoBeside"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("cancelDoDecision"))
- {
- toolMenu.Toolbars[0].Tools["cancelDoDecision"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("Print"))
- {
- toolMenu.Toolbars[0].Tools["Print"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("insertProssWt"))
- {
- toolMenu.Toolbars[0].Tools["insertProssWt"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("adjustWgt"))
- {
- toolMenu.Toolbars[0].Tools["adjustWgt"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("Export"))
- {
- toolMenu.Toolbars[0].Tools["Export"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("OfflineXX"))
- {
- toolMenu.Toolbars[0].Tools["OfflineXX"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("QuXiang"))
- {
- toolMenu.Toolbars[0].Tools["QuXiang"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- }
- }
- private void chkTim_CheckedChanged(object sender, EventArgs e)
- {
- this.StartTime.Enabled = this.EndTime.Enabled = this.chkTim.Checked;
- }
- private void chkJugeHeatNo_CheckedChanged(object sender, EventArgs e)
- {
- this.txtJugeNo.Enabled = this.chkJugeHeatNo.Checked;
- }
- private void chkLotNo_CheckedChanged(object sender, EventArgs e)
- {
- this.txtLotNo.Enabled = this.chkLotNo.Checked;
- }
- private void chkTim1_CheckedChanged(object sender, EventArgs e)
- {
- this.StartTime1.Enabled = this.EndTime1.Enabled = this.chkTim1.Checked;
- }
- private void chkHeatNo1_CheckedChanged(object sender, EventArgs e)
- {
- this.txtHeatNo1.Enabled = this.chkHeatNo1.Checked;
- }
- private void chkTim2_CheckedChanged(object sender, EventArgs e)
- {
- this.StartTime2.Enabled = this.EndTime2.Enabled = this.chkTim2.Checked;
- }
- private void chkHeatNo2_CheckedChanged(object sender, EventArgs e)
- {
- this.txtHeatNo2.Enabled = this.chkHeatNo2.Checked;
- }
- private void chkTim3_CheckedChanged(object sender, EventArgs e)
- {
- this.StartTime3.Enabled = this.EndTime3.Enabled = this.chkTim3.Checked;
- }
- private void chkHeatNo3_CheckedChanged(object sender, EventArgs e)
- {
- this.txtHeatNo3.Enabled = this.chkHeatNo3.Checked;
- }
- private void ultraGrid6_AfterRowActivate(object sender, EventArgs e)
- {
- UltraGridRow uRow = this.ultraGrid6.ActiveRow;
- this.MatZcMEntity2bindingSource.Clear();
- List<MatZcMEntity> listSource = EntityHelper.GetData<MatZcMEntity>(
- "com.steering.mes.signature.FrmInOnlineStore.doQueryMatData", new object[] { uRow.Cells["HeatPlanNo"].Value.ToString(), this.ultraOptionSet1.CheckedItem.DataValue.ToString() }, this.ob);
- MatZcMEntity2bindingSource.DataSource = listSource;
- }
- private void ultraGrid7_AfterRowActivate(object sender, EventArgs e)
- {
- //查询转移信息
- UltraGridRow uRow = this.ultraGrid7.ActiveRow;
- List<MatZcMEntity> listSource = EntityHelper.GetData<MatZcMEntity>(
- "com.steering.mes.signature.FrmInOnlineStore.doQueryMatDataOut", new object[] { uRow.Cells["HeatPlanNo"].Value.ToString(), this.ultraOptionSet1.CheckedItem.DataValue.ToString() }, this.ob);
- MatZcMEntity3bindingSource.DataSource = listSource;
- }
- private void ultraGrid8_AfterRowActivate(object sender, EventArgs e)
- {
- proPlanId = this.ultraGrid8.ActiveRow.Cells["PRO_PLAN_ID"].Text.ToString();
- gxPlanNo = this.ultraGrid8.ActiveRow.Cells["GX_PLAN_NO"].Text.ToString();
- PlineCode = this.ultraGrid8.ActiveRow.Cells["PLINE_CODE"].Text.ToString();
- QuerySingleJugStove(this.ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Text, this.ultraGrid8.ActiveRow.Cells["LOT_NO"].Text, PlineCode);
- //QueryMinMaxDS();
- QueryThickDs(this.ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Text);
- QueryMilPlanPrt(this.ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Text);
- this.textMemo.Text = "";
- }
- /// <summary>
- /// 查询目标外径、控制壁厚
- /// </summary>
- /// <param name="p"></param>
- private void QueryThickDs(string p)
- {
- DataTable dt = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryThickDs", new object[] { p }, ob);
- if (dt.Rows.Count > 0)
- {
- if (dt.Rows[0]["VARIETIES"].ToString().Contains("套管") || dt.Rows[0]["VARIETIES"].ToString().Contains("油管") || dt.Rows[0]["VARIETIES"].ToString().Contains("接箍"))
- {
- if (dt.Rows[0]["VARIETIES"].ToString().Contains("管线"))
- {
- this.txt_dimer.Text = Math.Round((double.Parse(dt.Rows[0]["OUTDIAMETER"].ToString3()) * 1.003),2).ToString();
- }
- else
- {
- this.txt_dimer.Text = Math.Round((double.Parse(dt.Rows[0]["OUTDIAMETER"].ToString3()) * 1.006),2).ToString();
- //if (double.Parse(dt.Rows[0]["AIMOUTDIAMETER"].ToString()) > 0)
- //{
- // this.txt_dimer.Text = (double.Parse(dt.Rows[0]["AIMOUTDIAMETER"].ToString()) * 1.005).ToString();
- //}
- //else
- //{
- // this.txt_dimer.Text = (double.Parse(dt.Rows[0]["OUTDIAMETER"].ToString()) * 1.005).ToString();
- //}
- }
- }
- else
- {
- this.txt_dimer.Text = (double.Parse(dt.Rows[0]["OUTDIAMETER"].ToString3())).ToString();
- //if (double.Parse(dt.Rows[0]["AIMOUTDIAMETER"].ToString()) > 0)
- //{
- // this.txt_dimer.Text = dt.Rows[0]["AIMOUTDIAMETER"].ToString();
- //}
- //else
- //{
- // this.txt_dimer.Text = dt.Rows[0]["OUTDIAMETER"].ToString();
- //}
- }
- this.txt_height.Text = dt.Rows[0]["CONTROL_THICKP"].ToString3();
- }
- else
- {
- this.txt_dimer.Text = "0";
- this.txt_height.Text = "0";
- }
- }
- private void QueryMilPlanPrt(string p)
- {
- DataTable dt = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryMilPlanPrt", new object[] { p }, ob);
- if (dt.Rows[0][0].ToString() == "0")
- {
- this.chkPrn.Checked = false;
- }
- else if (dt.Rows[0][0].ToString() == "1")
- {
- this.chkPrn.Checked = true;
- }
- }
- private void sampleLen_CheckedChanged(object sender, EventArgs e)
- {
- string judgeStoveNo = this.ultraGrid1.ActiveRow.Cells["JUDGE_NO"].Value.ToString();
- string lotNo = this.ultraGrid1.ActiveRow.Cells["LOT_NO"].Value.ToString();
- string length = this.ultraGrid3.ActiveRow.Cells["ActLen"].Value.ToString2();
- string staus = this.ultraGrid3.ActiveRow.Cells["Astatus"].Value.ToString();
- string id = this.ultraGrid3.ActiveRow.Cells["id"].Value.ToString();
- string sampleFlag = "";
- if (this.sampleLen.Checked)
- {
- sampleFlag = "1";
- }
- else
- {
- sampleFlag = "0";
- }
- if (staus.Equals("样管"))
- {
- getBacthNoInformation(judgeStoveNo, lotNo, id, this.ultraGrid3.ActiveRow.Cells["Astatus"].Value.ToString(), sampleFlag);
- }
- }
- private void chkPrn_CheckedChanged(object sender, EventArgs e)
- {
- UltraGridRow uRow = this.ultraGrid8.ActiveRow;
- if(uRow == null)
- {
- MessageUtil.ShowTips("请选择对应炉进行勾选是否过磅!");
- return;
- }
- string jugeNo = uRow.Cells["JUDGE_STOVE_NO"].Text.ToString();
- string chkPrnFlag = "";
- if (chkPrn.Checked)
- {
- chkPrnFlag = "1";
- }
- else
- {
- chkPrnFlag = "0";
- }
- int count = ServerHelper.SetData("com.steering.mes.signature.FrmInOnlineStore.doUpdatePrn", new object[] { jugeNo, chkPrnFlag }, ob);
- if (count < 0)
- {
- MessageUtil.ShowTips("修改过磅标识异常!");
- return;
- }
- }
- /// <summary>
- /// 导出
- /// </summary>
- private void ExportData()
- {
- if (this.ultraTabControl1.Tabs[1].Active)
- {
- GridHelper.ulGridToExcel(ultraGrid4, "交库实绩");
- }
- else if (this.ultraTabControl1.Tabs[3].Active)
- {
- GridHelper.ulGridToExcel(ultraGrid5, "库存实绩");
- }
- }
- }
- }
|