| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212 |
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Format;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.PlnSaleOrd.BaseMethod;
- using Core.StlMes.Client.PlnSaleOrd.炼钢计划.entity;
- using CoreFS.CA06;
- using Infragistics.Win;
- using Infragistics.Win.UltraWinEditors;
- using Infragistics.Win.UltraWinGrid;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using ColumnStyle = Infragistics.Win.UltraWinGrid.ColumnStyle;
- namespace Core.StlMes.Client.PlnSaleOrd.炼钢计划
- {
- public partial class FrmSteelProcessCard : FrmBase
- {
- private string carftNo;
- private OpeBase ob;
- private string cic;
- private string furnaceNo;
- private string plineCodeA;
- private string plineNameA;
- private string gradCode;
- private string gradName;
- private string planRoute;//作业路线
- private string plineCodeB;
- private int count = 0;
- public bool Falg = false;
- UltraComboEditor uceCic = new UltraComboEditor();
- UltraComboEditor uceCicAll = new UltraComboEditor();
- UltraComboEditor ucePro = new UltraComboEditor();//品名
- UltraComboEditor uceItem = new UltraComboEditor();//合金物料码
- UltraCombo uceCcm = new UltraCombo();
- UltraComboEditor uceWd = new UltraComboEditor();
- private string flag;
- private string gxPlanSeq;
- public FrmSteelProcessCard(string _carftNo, OpeBase _ob, ArrayList _list,string _flag)
- {
- carftNo = _carftNo;
- ob = _ob;
- flag = _flag;
- if (_list != null)
- {
- string[] arrString = (string[])_list.ToArray(typeof(string));
- cic = arrString[0].ToString();
- furnaceNo = arrString[1].ToString();
- plineCodeA = arrString[2].ToString();
- plineNameA = arrString[3].ToString();
- gradCode = arrString[4].ToString();
- gradName = arrString[5].ToString();
- planRoute = arrString[6].ToString();
- plineCodeB = arrString[7].ToString();
- gxPlanSeq = arrString[8].ToString();
- }
- InitializeComponent();
- }
- private void FrmSteelProcessCard_Load(object sender, EventArgs e)
- {
- Controls.Add(uceCcm);
- uceCcm.Visible = false;
- Controls.Add(uceItem);
- uceItem.Visible = false;
- Controls.Add(uceWd);
- uceWd.Visible = false;
- //设置列头名称
- EntityHelper.ShowGridCaption<CraftLg2MEntity>(ultraGridLgM.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<CraftLg2CicEntity>(ultraGridLgCic.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<CraftLg2TarCicEntity>(ultraGridLgTarCic.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<CraftLg2CcmEntity>(ultraGridLgCcm.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<CraftLg2TemperatureEntity>(ultraGridLhTem.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<CraftLg2AlloyEntity>(ultraGridhJ.DisplayLayout.Bands[0]);
- //PlanComm.setGridActivation(ultraGridLgM.DisplayLayout.Bands[0], "CHC");
- //PlanComm.setGridActivation(ultraGridLgCic.DisplayLayout.Bands[0], "CHC");
- //PlanComm.setGridActivation(ultraGridLgTarCic.DisplayLayout.Bands[0], "CHC");
- //PlanComm.setGridActivation(ultraGridLgCcm.DisplayLayout.Bands[0], "CHC");
- //PlanComm.setGridActivation(ultraGridLhTem.DisplayLayout.Bands[0], "CHC");
- SteelHelper.InitPline(comAPline, "A", this.ob);
- SteelHelper.InitGrade(comGrade, this.ob);
- chenCode();
- SteelHelper.InitComboEditor(ucePro, "com.steering.pss.plnsaleord.steelMarkingPlan.FrmSteelProcessCard.queryProduName", "PRODUCCODE", ob, true);
- SteelHelper.BindColumn(ucePro, "Produccode", this.Controls, this.ultraGridLgM, 0);
- queryCraftType();
- queryComBaseCcm(cic);
- QueryM();
- QueryComMscChemCode();
- }
- /// <summary>
- /// 查询基础CIC
- /// </summary>
- private void QueryComMscChemCode()
- {
- DataTable dt = ServerHelper.GetData("com.steering.pss.plnsaleord.steelMarkingPlan.FrmSteelProcessCard.queryComMscChemCode", new object[] { cic.Split(',') }, ob);
- GridHelper.CopyDataToDatatable(dt, dataTable1, true);
- }
- /// <summary>
- /// 绑定元素下拉
- /// </summary>
- private void chenCode()
- {
- DataTable dt1 = ServerHelper.GetData("com.steering.pss.plnsaleord.steelMarkingPlan.FrmSteelProcessCard.queryChenName", new object[] { "", "" }, ob);
- Controls.Add(uceCic);
- uceCic.Visible = false;
- uceCic.DropDownListWidth = -1;
- uceCic.DropDownStyle = DropDownStyle.DropDownList;
- uceCic.DataSource = dt1.AsEnumerable().Where(p => (p["CHEM_TYPE"] is DBNull ? "" : p["CHEM_TYPE"].ToString()) == "A").CopyToDataTable();
- uceCic.DisplayMember = "CHEM_NAME";
- uceCic.ValueMember = "CHEM_CODE";
- Controls.Add(uceCicAll);
- uceCicAll.Visible = false;
- uceCicAll.DropDownListWidth = -1;
- uceCicAll.DropDownStyle = DropDownStyle.DropDownList;
- uceCicAll.DataSource = dt1;
- uceCicAll.DisplayMember = "CHEM_NAME";
- uceCicAll.ValueMember = "CHEM_CODE";
- ultraGridLgTarCic.DisplayLayout.Bands[0].Columns["ChemCode"].EditorComponent = uceCic;
- ultraGridLgTarCic.DisplayLayout.Bands[0].Columns["ChemCode"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
- ultraGridLgCic.DisplayLayout.Bands[0].Columns["ChemCode"].EditorComponent = uceCicAll;
- ultraGridLgCic.DisplayLayout.Bands[0].Columns["ChemCode"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
- ultraGridLgCic.DisplayLayout.Bands[0].Columns["EleCode"].EditorComponent = uceCicAll;
- ultraGridLgCic.DisplayLayout.Bands[0].Columns["EleCode"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
- ultraGridLgCic.DisplayLayout.Bands[0].Columns["RepCode"].EditorComponent = uceCicAll;
- ultraGridLgCic.DisplayLayout.Bands[0].Columns["RepCode"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
- SteelHelper.SetComboItemHeight(uceCic);
- DataTable dt2 = ServerHelper.GetData("com.steering.pss.plnsaleord.processOrder.base.BaseHelper.initPlinePowerA", new object[] { }, ob);
- UltraComboEditor uce2 = new UltraComboEditor();
- Controls.Add(uce2);
- uce2.Visible = false;
- uce2.DropDownListWidth = -1;
- uce2.DropDownStyle = DropDownStyle.DropDownList;
- uce2.DataSource = dt2;
- uce2.DisplayMember = "PLINE_NAME";
- uce2.ValueMember = "PLINE_CODE";
- ultraGridLgM.DisplayLayout.Bands[0].Columns["PlineCode"].EditorComponent = uce2;
- ultraGridLgM.DisplayLayout.Bands[0].Columns["PlineCode"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
- //下限符号
- UltraComboEditor uceMinFh = new UltraComboEditor();
- ultraGridLgTarCic.DisplayLayout.Bands[0].Columns["StdminSign"].EditorComponent = uceMinFh;
- ultraGridLgTarCic.DisplayLayout.Bands[0].Columns["StdminSign"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
- ultraGridLgCic.DisplayLayout.Bands[0].Columns["StdminSign"].EditorComponent = uceMinFh;
- ultraGridLgCic.DisplayLayout.Bands[0].Columns["StdminSign"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
- ultraGridLgCic.DisplayLayout.Bands[0].Columns["EleMinSign"].EditorComponent = uceMinFh;
- ultraGridLgCic.DisplayLayout.Bands[0].Columns["EleMinSign"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
- ultraGridLgCic.DisplayLayout.Bands[0].Columns["RepMinSign"].EditorComponent = uceMinFh;
- ultraGridLgCic.DisplayLayout.Bands[0].Columns["RepMinSign"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
- ultraGridLgTarCic.DisplayLayout.Bands[0].Columns["StdminSign"].ValueList = GetMinSignList();
- ultraGridLgCic.DisplayLayout.Bands[0].Columns["StdminSign"].ValueList = GetMinSignList();
- ultraGridLgCic.DisplayLayout.Bands[0].Columns["EleMinSign"].ValueList = GetMinSignList();
- ultraGridLgCic.DisplayLayout.Bands[0].Columns["RepMinSign"].ValueList = GetMinSignList();
- SteelHelper.SetComboItemHeight(uceMinFh);
- //上限符号
- UltraComboEditor uceMaxFh = new UltraComboEditor();
- ultraGridLgTarCic.DisplayLayout.Bands[0].Columns["StdmaxSign"].EditorComponent = uceMaxFh;
- ultraGridLgTarCic.DisplayLayout.Bands[0].Columns["StdmaxSign"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
- ultraGridLgCic.DisplayLayout.Bands[0].Columns["StdmaxSign"].EditorComponent = uceMaxFh;
- ultraGridLgCic.DisplayLayout.Bands[0].Columns["StdmaxSign"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
- ultraGridLgCic.DisplayLayout.Bands[0].Columns["EleMaxSign"].EditorComponent = uceMaxFh;
- ultraGridLgCic.DisplayLayout.Bands[0].Columns["EleMaxSign"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
- ultraGridLgCic.DisplayLayout.Bands[0].Columns["RepMaxSign"].EditorComponent = uceMaxFh;
- ultraGridLgCic.DisplayLayout.Bands[0].Columns["RepMaxSign"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
- ultraGridLgTarCic.DisplayLayout.Bands[0].Columns["StdmaxSign"].ValueList = GetMaxSignList();
- ultraGridLgCic.DisplayLayout.Bands[0].Columns["StdmaxSign"].ValueList = GetMaxSignList();
- ultraGridLgCic.DisplayLayout.Bands[0].Columns["EleMaxSign"].ValueList = GetMaxSignList();
- ultraGridLgCic.DisplayLayout.Bands[0].Columns["RepMaxSign"].ValueList = GetMaxSignList();
- SteelHelper.SetComboItemHeight(uceMaxFh);
- //CCM工序点
- UltraComboEditor uceStatGx = new UltraComboEditor();
- ultraGridLgTarCic.DisplayLayout.Bands[0].Columns["StationCode"].EditorComponent = uceStatGx;
- ultraGridLgTarCic.DisplayLayout.Bands[0].Columns["StationCode"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
- ValueList vlistSteelGx = new ValueList();
- vlistSteelGx.ValueListItems.Insert(0, "", "");
- vlistSteelGx.ValueListItems.Insert(1, "EAF", "EAF");
- vlistSteelGx.ValueListItems.Insert(2, "LF", "LF");
- vlistSteelGx.ValueListItems.Insert(3, "VD", "VD");
- vlistSteelGx.ValueListItems.Insert(4, "RH", "RH");
- vlistSteelGx.ValueListItems.Insert(5, "CCM", "CCM");
- ultraGridLgTarCic.DisplayLayout.Bands[0].Columns["StationCode"].ValueList = vlistSteelGx;
- SteelHelper.SetComboItemHeight(uceStatGx);
- //温度工序点
- UltraComboEditor uceStatGxWd = new UltraComboEditor();
- ultraGridLhTem.DisplayLayout.Bands[0].Columns["StationCode"].EditorComponent = uceStatGxWd;
- ultraGridLhTem.DisplayLayout.Bands[0].Columns["StationCode"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
- ValueList vlistSteelGxWd = new ValueList(); ;
- vlistSteelGxWd.ValueListItems.Insert(0, "", "");
- vlistSteelGxWd.ValueListItems.Insert(1, "EAF", "EAF");
- vlistSteelGxWd.ValueListItems.Insert(2, "LF", "LF");
- vlistSteelGxWd.ValueListItems.Insert(3, "VD", "VD");
- vlistSteelGxWd.ValueListItems.Insert(4, "RH", "RH");
- vlistSteelGxWd.ValueListItems.Insert(5, "CCM", "CCM");
- ultraGridLhTem.DisplayLayout.Bands[0].Columns["StationCode"].ValueList = vlistSteelGxWd;
- SteelHelper.SetComboItemHeight(uceStatGxWd);
- }
- private static ValueList GetMaxSignList()
- {
- ValueList vlistSteelMax = new ValueList();
- ;
- vlistSteelMax.ValueListItems.Insert(0, "=", "=");
- vlistSteelMax.ValueListItems.Insert(1, "<", "<");
- vlistSteelMax.ValueListItems.Insert(2, "<=", "<=");
- vlistSteelMax.ValueListItems.Insert(3, "", "");
- return vlistSteelMax;
- }
- private ValueList GetMinSignList()
- {
- ValueList vlistSteelMin = new ValueList();
- ;
- vlistSteelMin.ValueListItems.Insert(0, "=", "=");
- vlistSteelMin.ValueListItems.Insert(1, ">", ">");
- vlistSteelMin.ValueListItems.Insert(2, ">=", ">=");
- vlistSteelMin.ValueListItems.Insert(3, "", "");
- return vlistSteelMin;
- }
- /// <summary>
- /// 绑定工艺卡类型下拉
- /// </summary>
- private void queryCraftType()
- {
- UltraComboEditor uceType = new UltraComboEditor();
- ultraGridLgM.DisplayLayout.Bands[0].Columns["CraftType"].EditorComponent = uceType;
- ultraGridLgM.DisplayLayout.Bands[0].Columns["CraftType"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
- ValueList vlistSteel = new ValueList(); ;
- vlistSteel.ValueListItems.Insert(0, "A", "标准卡");
- vlistSteel.ValueListItems.Insert(1, "B", "联络卡");
- ultraGridLgM.DisplayLayout.Bands[0].Columns["CraftType"].ValueList = vlistSteel;
- SteelHelper.SetComboItemHeight(uceType);
- }
- /// <summary>
- /// 获取水表
- /// </summary>
- private void queryComBaseCcm(string wasetcic)
- {
- DataTable dtCcm = ServerHelper.GetData("com.steering.pss.plnsaleord.steelMarkingPlan.FrmSteelProcessCard.queryComBaseCcm", new object[] { plineCodeB, gradCode, wasetcic }, ob);
- //uceCcm.DropDownListWidth = -1;
- //uceCcm.DropDownStyle = DropDownStyle.DropDownList;
- uceCcm.DataSource = dtCcm;
- uceCcm.ValueMember = "CCM_CODE";
- //uceCcm.DisplayMember = "CCM_CODE";
- ultraGridLgCcm.DisplayLayout.Bands[0].Columns["CcmCode"].EditorComponent = uceCcm;
- //ultraGridLgCcm.DisplayLayout.Bands[0].Columns["CcmCode"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
-
- uceWd.DataSource = dtCcm;
- uceWd.ValueMember = "液相线温度";
- uceWd.DisplayMember = "液相线温度";
- ultraGridLhTem.DisplayLayout.Bands[0].Columns["TepVal"].EditorComponent = uceWd;
- SteelHelper.SetComboItemHeight(uceWd);
- DataTable dthj = ServerHelper.GetData("com.steering.pss.plnsaleord.steelMarkingPlan.FrmSteelProcessCard.queryItemCode", new object[] { "" }, ob);
- Object[] obj = new Object[] { "", "" };
- DataRow dr = dthj.NewRow();
- dr.ItemArray = obj;
- dthj.Rows.InsertAt(dr, 0);
- uceItem.DataSource = dthj;
- uceItem.ValueMember = "ITEM_CODE";
- uceItem.DisplayMember = "ITEM_NAME";
- SteelHelper.SetComboItemHeight(uceItem);
- ultraGridhJ.DisplayLayout.Bands[0].Columns["ItemCode"].EditorComponent = uceItem;
- }
- private void craftNo()
- {
- DataTable dt = ServerHelper.GetData("com.steering.pss.plnsaleord.steelMarkingPlan.FrmSteelProcessCard.queryCraftNo", new object[] { }, ob);
- comCraftNo.DataSource = dt;
- comCraftNo.ValueMember = "CRAFT_NO";
- comCraftNo.DisplayMember = "CRAFT_NO";
- }
- private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
- {
- switch (e.Tool.Key)
- {
- case "Query": //查询
- QueryLgM();
- break;
- case "Add": //保存
- doSaveUpdate("0");
- break;
- case "Update": //修改
- doSaveUpdate("1");
- break;
- case "Delete": //删除
- doDelete();
- break;
- case "Confirm": //确认
- doConfirm();
- break;
- case "Calculate": //计算
- doCalculate(0);
- break;
- case "Close":
- this.Close();
- break;
- }
- }
- private DataSourceList<CraftLg2CicEntity> listCic;
- private DataSourceList<CraftLg2TarCicEntity> listTarCic;
- private DataSourceList<CraftLg2CcmEntity> listCcm;
- private DataSourceList<CraftLg2TemperatureEntity> listTem;
- private DataSourceList<CraftLg2AlloyEntity> listHj;
- #region 查询
-
- /// <summary>
- /// 查询工艺主表
- /// </summary>
- private void QueryLgM()
- {
- count = 0;
- string carftNo1 = "";
- string plineCode = "";
- string gradCode = "";
- if (chcCraftNo.Checked)
- {
- if (comCraftNo.Text.Equals(""))
- {
- MessageUtil.ShowTips("请选择工艺卡号!");
- return;
- }
- else
- {
- carftNo1 = comCraftNo.Text.ToString();
- }
- }
- if (chcAPline.Checked)
- {
- if (comAPline.Text.Equals(""))
- {
- MessageUtil.ShowTips("请选择电炉产线!");
- return;
- }
- else
- {
- plineCode = comAPline.Value.ToString();
- }
- }
- if (chcGrade.Checked)
- {
- if (comGrade.Text.Equals(""))
- {
- MessageUtil.ShowTips("请选择钢种!");
- return;
- }
- else
- {
- gradCode = comGrade.Value.ToString();
- }
- }
- List<CraftLg2MEntity> listSource = EntityHelper.GetData<CraftLg2MEntity>
- ("com.steering.pss.plnsaleord.steelMarkingPlan.FrmSteelProcessCard.queryLgM", new object[] { "", carftNo1, plineCode, gradCode, planRoute, flag == "0" || flag == "2" }, ob);
- CraftLg2MEntityBindingSource.DataSource = listSource;
- UltraGridRow ugr = ultraGridLgM.ActiveRow;
- if (ugr == null)
- {
- CraftLg2TarCicEntityBindingSource.Clear();
- CraftLg2CcmEntityBindingSource.Clear();
- CraftLg2TemperatureEntitySource.Clear();
- if (cic.Split(',').Length > 1)
- {
- }
- else
- {
- queryOrdDesigStdCic();
- }
- }
- }
- private void QueryM()
- {
- List<CraftLg2MEntity> listSource = EntityHelper.GetData<CraftLg2MEntity>
- ("com.steering.pss.plnsaleord.steelMarkingPlan.FrmSteelProcessCard.queryLgM", new object[] { cic.Split(','), carftNo, plineCodeA, gradCode, planRoute, flag == "0" || flag == "2" }, ob);
- CraftLg2MEntityBindingSource.DataSource = listSource;
- UltraGridRow ugr = ultraGridLgM.ActiveRow;
- if (ugr == null)
- {
- ultraTabControl1.Enabled = false;
- CraftLg2TarCicEntityBindingSource.Clear();
- CraftLg2CcmEntityBindingSource.Clear();
- CraftLg2TemperatureEntitySource.Clear();
- CraftLg2AlloyEntityBindingSource.Clear();
- //if (flag.Equals("1"))
- //{
- // ultraExpandableGroupBox2.Visible = false;
- // if (cic.Split(',').Length > 1)
- // {
- // queryOrdDesigJJCic();
- // }
- // else
- // {
- // queryOrdDesigStdCic();
- // }
- //}
- //else
- //{
- //ultraExpandableGroupBox2.Visible = true;
- queryOrdDesigCic("");
- //}
-
- }
- foreach (UltraGridRow row in ultraGridLgM.Rows)
- {
- if (carftNo.Equals(row.Cells["CraftNo"].Text.ToString()))
- {
- row.Cells["CHC"].Value = true;
- }
- }
- }
- /// <summary>
- /// 查询工艺评审Cic
- /// </summary>
- private void queryOrdDesigStdCic()
- {
- listCic = EntityHelper.GetData<CraftLg2CicEntity>
- ("com.steering.pss.plnsaleord.steelMarkingPlan.FrmSteelProcessCard.queryOrdDesigStdCic", new object[] { cic, furnaceNo, gxPlanSeq, flag }, ob);
- listCic.AcceptChanges();
- CraftLg2CicEntityBindingSource.DataSource = listCic;
- foreach (UltraGridRow urg in ultraGridLgCic.Rows)
- {
- urg.Cells["CHC"].Value = true;
- }
- }
- /// <summary>
- /// 查询交集CIC
- /// </summary>
- private void gqueryOrdDesigJJCic()
- {
- listCic = EntityHelper.GetData<CraftLg2CicEntity>
- ("com.steering.pss.plnsaleord.steelMarkingPlan.FrmSteelProcessCard.queryOrdDesigJJCic", new object[] { cic, furnaceNo }, ob);
- listCic.AcceptChanges();
- CraftLg2CicEntityBindingSource.DataSource = listCic;
- foreach (UltraGridRow urg in ultraGridLgCic.Rows)
- {
- urg.Cells["CHC"].Value = true;
- }
- }
- DataTable dtCicAll = new DataTable();
- /// <summary>
- /// 查询CIC(工艺评审和交集)
- /// </summary>
- private void queryOrdDesigCic(string cicg)
- {
- dtCicAll =
- ServerHelper.GetData(
- "com.steering.pss.plnsaleord.steelMarkingPlan.FrmSteelProcessCard.queryOrdDesigCic",
- new object[] { cic, furnaceNo, gxPlanSeq,flag }, ob);
-
- DataTable dt = SteelHelper.GetDistinctTable(dtCicAll, "CIC");
- GridHelper.CopyDataToDatatable(dt, dataTable2, true);
- foreach (UltraGridRow ugr in ultraGrid2.Rows)
- {
- if (ugr.Cells["CIC"].Value.ToString().Equals(cicg))
- {
- ugr.Activate();
- }
- }
-
- }
- /// <summary>
- /// 查询工艺成分信息
- /// </summary>
- private void QueryLgCic(string cicGid)
- {
- listCic = EntityHelper.GetData<CraftLg2CicEntity>
- ("com.steering.pss.plnsaleord.steelMarkingPlan.FrmSteelProcessCard.queryLgCic", new object[] { cicGid }, ob);
- listCic.AcceptChanges();
- CraftLg2CicEntityBindingSource.DataSource = listCic;
- foreach (UltraGridRow urg in ultraGridLgCic.Rows)
- {
- urg.Cells["CHC"].Value = true;
- }
- }
- /// <summary>
- /// 查询目标工艺成分信息
- /// </summary>
- private void QueryLgTarCic(string tarCicGid)
- {
- listTarCic = EntityHelper.GetData<CraftLg2TarCicEntity>
- ("com.steering.pss.plnsaleord.steelMarkingPlan.FrmSteelProcessCard.queryLgTarCic", new object[] { tarCicGid }, ob);
- listTarCic.AcceptChanges();
- CraftLg2TarCicEntityBindingSource.DataSource = listTarCic;
- foreach (UltraGridRow urg in ultraGridLgTarCic.Rows)
- {
- urg.Cells["CHC"].Value = true;
- }
- }
- /// <summary>
- /// 查询CCM信息
- /// </summary>
- private void QueryLgCcm(string ccmGid)
- {
- listCcm = EntityHelper.GetData<CraftLg2CcmEntity>
- ("com.steering.pss.plnsaleord.steelMarkingPlan.FrmSteelProcessCard.queryLgCcm", new object[] { ccmGid }, ob);
- listCcm.AcceptChanges();
- CraftLg2CcmEntityBindingSource.DataSource = listCcm;
- foreach (UltraGridRow urg in ultraGridLgCcm.Rows)
- {
- urg.Cells["CHC"].Value = true;
- }
- }
- /// <summary>
- /// 查询温度信息
- /// </summary>
- private void QueryLgtTem(string tepGid)
- {
- listTem = EntityHelper.GetData<CraftLg2TemperatureEntity>
- ("com.steering.pss.plnsaleord.steelMarkingPlan.FrmSteelProcessCard.queryLgtTem", new object[] { tepGid }, ob);
- listTem.AcceptChanges();
- CraftLg2TemperatureEntitySource.DataSource = listTem;
- foreach (UltraGridRow urg in ultraGridLhTem.Rows)
- {
- urg.Cells["CHC"].Value = true;
- if (urg.Cells["StationCode"].Text.Equals("EAF"))
- {
- urg.Cells["TepVal1Min"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
- urg.Cells["TepVal1Max"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
- urg.Cells["TepVal2Min"].Appearance.BackColor = Color.Transparent;
- urg.Cells["TepVal2Max"].Appearance.BackColor = Color.Transparent;
- urg.Cells["TepVal"].Appearance.BackColor = Color.Transparent;
- urg.Cells["TepVal1Min"].Activation = Activation.AllowEdit;
- urg.Cells["TepVal1Max"].Activation = Activation.AllowEdit;
- urg.Cells["TepVal1Min"].IgnoreRowColActivation = true;
- urg.Cells["TepVal1Max"].IgnoreRowColActivation = true;
- urg.Cells["TepVal2Min"].Activation = Activation.ActivateOnly;
- urg.Cells["TepVal2Max"].Activation = Activation.ActivateOnly;
- urg.Cells["TepVal"].Activation = Activation.ActivateOnly;
- }
- else if (urg.Cells["StationCode"].Text.Equals("CCM"))
- {
- urg.Cells["TepVal1Min"].Appearance.BackColor = Color.Transparent;
- urg.Cells["TepVal1Max"].Appearance.BackColor = Color.Transparent;
- urg.Cells["TepVal2Min"].Appearance.BackColor = Color.Transparent;
- urg.Cells["TepVal2Max"].Appearance.BackColor = Color.Transparent;
- urg.Cells["TepVal"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
- urg.Cells["TepVal1Min"].Activation = Activation.ActivateOnly;
- urg.Cells["TepVal1Max"].Activation = Activation.ActivateOnly;
- urg.Cells["TepVal2Min"].Activation = Activation.ActivateOnly;
- urg.Cells["TepVal2Max"].Activation = Activation.ActivateOnly;
- urg.Cells["TepVal"].Activation = Activation.AllowEdit;
- urg.Cells["TepVal"].IgnoreRowColActivation = true;
- }
- else
- {
- urg.Cells["TepVal1Min"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
- urg.Cells["TepVal1Max"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
- urg.Cells["TepVal2Min"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
- urg.Cells["TepVal2Max"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
- urg.Cells["TepVal"].Appearance.BackColor = Color.Transparent;
- urg.Cells["TepVal1Min"].Activation = Activation.AllowEdit;
- urg.Cells["TepVal1Max"].Activation = Activation.AllowEdit;
- urg.Cells["TepVal2Min"].Activation = Activation.AllowEdit;
- urg.Cells["TepVal2Max"].Activation = Activation.AllowEdit;
- urg.Cells["TepVal1Min"].IgnoreRowColActivation = true;
- urg.Cells["TepVal1Max"].IgnoreRowColActivation = true;
- urg.Cells["TepVal2Min"].IgnoreRowColActivation = true;
- urg.Cells["TepVal2Max"].IgnoreRowColActivation = true;
- urg.Cells["TepVal"].Activation = Activation.ActivateOnly;
- }
- }
- }
- private void QueryLgHj(string alloyGid)
- {
- listHj = EntityHelper.GetData<CraftLg2AlloyEntity>
- ("com.steering.pss.plnsaleord.steelMarkingPlan.FrmSteelProcessCard.queryLgtHj", new object[] { alloyGid}, ob);
- listHj.AcceptChanges();
- CraftLg2AlloyEntityBindingSource.DataSource = listHj;
- foreach (UltraGridRow urg in ultraGridhJ.Rows)
- {
- urg.Cells["CHC"].Value = true;
- }
- }
- #endregion
- /// <summary>
- /// 保存
- /// </summary>ultraExpandableGroupBox2
- private void doSaveUpdate(string isFlag)
- {
- #region 条件
- ultraGridLgM.UpdateData();
- ultraGridLgCic.UpdateData();
- ultraGridLgTarCic.UpdateData();
- ultraGridLgCcm.UpdateData();
- ultraGridLhTem.UpdateData();
- UltraGridRow row = ultraGrid2.ActiveRow;
- if (row == null)
- {
- //MessageUtil.ShowTips("未找到成分索引码!!");
- return;
- }
- ArrayList listLgM = new ArrayList();
- IQueryable<UltraGridRow> ugLgM = ultraGridLgM.Rows.AsQueryable().Where("CHC = 'True'");
- if (ugLgM == null || ugLgM.Count() == 0)
- {
- MessageUtil.ShowTips("未勾选炼钢工艺主信息!");
- return;
- }
- else
- {
- foreach (UltraGridRow rowLgM in ugLgM)
- {
- listLgM.Add((CraftLg2MEntity)rowLgM.ListObject);
- }
- }
- ArrayList listTarCic = new ArrayList();
- IQueryable<UltraGridRow> ugTarCic = ultraGridLgTarCic.Rows.AsQueryable().Where("CHC = 'True'");
- if (ugTarCic == null || ugTarCic.Count() == 0)
- {
- MessageUtil.ShowTips("未勾选目标工艺成分信息!");
- return;
- }
- else
- {
- foreach (UltraGridRow rowTarCic in ugTarCic)
- {
- listTarCic.Add((CraftLg2TarCicEntity)rowTarCic.ListObject);
- }
- }
- ArrayList listLgCic = new ArrayList();
- IQueryable<UltraGridRow> ugLgCic = ultraGridLgCic.Rows.AsQueryable();
- // if (ugLgCic == null || ugLgCic.Count() == 0)
- // {
- // MessageUtil.ShowTips("未勾选工艺成分信息!");
- // return;
- // }
- // else
- //
- List<string> usedCode = new List<string>();
- foreach (UltraGridRow rowLgCic in ugLgCic)
- {
- CraftLg2CicEntity CraftLg2CicEntity = rowLgCic.ListObject as CraftLg2CicEntity;
- if (usedCode.Contains(CraftLg2CicEntity.ChemCode))
- {
- MessageUtil.ShowTips("工艺成分信息有重复元素!");
- return;
- }
- usedCode.Add(CraftLg2CicEntity.ChemCode);
- if (CraftLg2CicEntity != null)
- {
- if (CraftLg2CicEntity.ChemCode.Trim() == "")
- {
- MessageUtil.ShowTips("请选择工艺成分信息的元素!");
- return;
- }
- }
- listLgCic.Add((CraftLg2CicEntity)rowLgCic.ListObject);
- }
-
- //}
- ArrayList listLgCcm = new ArrayList();
- IQueryable<UltraGridRow> ugLgCcm = ultraGridLgCcm.Rows.AsQueryable().Where("CHC = 'True'");
- if (ugLgCcm == null || ugLgCcm.Count() == 0)
- {
- //MessageUtil.ShowTips("未勾选CCM工艺信息!");
- //return;
- }
- else
- {
- foreach (UltraGridRow rowLgCcm in ugLgCcm)
- {
- //if (rowLgCcm.Cells[""].Text.ToString())
- listLgCcm.Add((CraftLg2CcmEntity)rowLgCcm.ListObject);
- }
- }
- ArrayList listLgTem = new ArrayList();
- IQueryable<UltraGridRow> ugLgTem = ultraGridLhTem.Rows.AsQueryable().Where("CHC = 'True'");
- if (ugLgTem == null || ugLgTem.Count() == 0)
- {
- MessageUtil.ShowTips("未勾选温度参数信息!");
- return;
- }
- else
- {
- foreach (UltraGridRow rowLgTem in ugLgTem)
- {
- listLgTem.Add((CraftLg2TemperatureEntity)rowLgTem.ListObject);
- }
- }
- ArrayList listLgHj = new ArrayList();
- IQueryable<UltraGridRow> ugLgHj = ultraGridhJ.Rows.AsQueryable().Where("CHC = 'True'");
- if (ugLgHj == null || ugLgHj.Count() == 0)
- {
- MessageUtil.ShowTips("未勾选合金配置信息!");
- return;
- }
- else
- {
- foreach (UltraGridRow rowLgHj in ugLgHj)
- {
- listLgHj.Add((CraftLg2AlloyEntity)rowLgHj.ListObject);
- }
- }
- ArrayList jsonListM = new ArrayList();
- ArrayList jsonListCic = new ArrayList();
- ArrayList jsonListTarCic = new ArrayList();
- ArrayList jsonListCcm = new ArrayList();
- ArrayList jsonListTem = new ArrayList();
- ArrayList jsonListHj = new ArrayList();
- if (isFlag.Equals("0"))
- {
- #region 新增
- foreach (CraftLg2MEntity entityM in listLgM)
- {
- if (string.IsNullOrEmpty(entityM.PlineCode))
- {
- MessageUtil.ShowTips("请选择电炉产线!");
- return;
- }
- if (string.IsNullOrEmpty(entityM.CraftRoute))
- {
- MessageUtil.ShowTips("请选择工艺路径!");
- return;
- }
- if (entityM.CraftType.Equals(""))
- {
- MessageUtil.ShowTips("请选择工艺卡类型!");
- return;
- }
- if (entityM.GradeNo.Equals(""))
- {
- MessageUtil.ShowTips("请输入钢质代码!");
- return;
- }
- if (entityM.Produccode.Equals(""))
- {
- MessageUtil.ShowTips("请选择品名!");
- return;
- }
- if (entityM.CraftType.Equals("标准卡"))
- {
- entityM.CraftType = "A";
- }
- else if (entityM.CraftType.Equals("联络卡")) {
- entityM.CraftType = "B";
- }
- if (flag.Equals("1"))
- {
- if (ultraGrid2.ActiveRow != null)
- {
- entityM.Cic= ultraGrid2.ActiveRow.Cells["CIC"].Text;
- }
- else
- entityM.Cic = cic;
- }
- else {
-
- entityM.Cic = row.Cells["CIC"].Text.ToString();
- }
- jsonListM.Add(JSONFormat.Format(entityM));
- }
- foreach (CraftLg2CicEntity entityCic in listLgCic)
- { jsonListCic.Add(JSONFormat.Format(entityCic)); }
- foreach (CraftLg2TarCicEntity entityTar in listTarCic)
- {
- if (entityTar.StationCode.Equals(""))
- {
- MessageUtil.ShowTips("请选择目标成分工序点!");
- return;
- }
- if (entityTar.ChemCode.Equals(""))
- {
- MessageUtil.ShowTips("请选择目标成分化学元素!");
- return;
- }
- jsonListTarCic.Add(JSONFormat.Format(entityTar));
- }
- foreach (CraftLg2CcmEntity entityCcm in listLgCcm)
- {
- if (entityCcm.CcmCode.Equals(""))
- {
- MessageUtil.ShowTips("请选择CCM水表编码!");
- return;
- }
- jsonListCcm.Add(JSONFormat.Format(entityCcm));
- }
- string stationC = "";
- foreach (CraftLg2TemperatureEntity entityTem in listLgTem)
- {
- if (entityTem.StationCode.Equals(""))
- {
- MessageUtil.ShowTips("请选择温度工序点!");
- return;
- }
- //stationC = entityTem.StationCode;
- //foreach (CraftLg2TemperatureEntity entity in listLgTem)
- //{
- // if (entity.StationCode.Equals(stationC))
- // {
- // MessageUtil.ShowTips("相同的工序点在同一个工艺卡下只能选一个!");
- // return;
- // }
- //}
- jsonListTem.Add(JSONFormat.Format(entityTem));
- }
- string itemcode = "";
- foreach (CraftLg2AlloyEntity entityHj in listLgHj)
- {
- if (entityHj.ItemCode.Equals(""))
- {
- MessageUtil.ShowTips("物料不能为空!");
- return;
- }
- if (entityHj.InputAmount == 0 || entityHj.InputAmount==null)
- {
- MessageUtil.ShowTips("方案配置量不能为零或为空!");
- return;
- }
- //itemcode = entityHj.ItemCode;
- //foreach (CraftLg2AlloyEntity entity in listLgHj)
- //{ if(entity.ItemCode.Equals("")){
- //}
- jsonListHj.Add(JSONFormat.Format(entityHj));
- }
- #endregion
- }
- else
- {
- #region 修改
- foreach (CraftLg2MEntity entityM in listLgM)
- {
- if (entityM.CraftType.Equals("标准卡"))
- {
- entityM.CraftType = "A";
- }
- else
- {
- entityM.CraftType = "B";
- }
- jsonListM.Add(JSONFormat.Format(entityM));
- }
- foreach (CraftLg2CicEntity entityCic in listLgCic)
- { jsonListCic.Add(JSONFormat.Format(entityCic)); }
- foreach (CraftLg2TarCicEntity entityTar in listTarCic)
- {
- if (entityTar.TarCicGid.Equals(""))
- {
- MessageUtil.ShowTips("修改时不能新增目标成分行!");
- return;
- }
- jsonListTarCic.Add(JSONFormat.Format(entityTar));
- }
- foreach (CraftLg2CcmEntity entityCcm in listLgCcm)
- {
- if (entityCcm.CcmGid.Equals(""))
- {
- MessageUtil.ShowTips("修改时不能新增CCM行!");
- return;
- }
- jsonListCcm.Add(JSONFormat.Format(entityCcm));
- }
- string stationC = "";
- foreach (CraftLg2TemperatureEntity entityTem in listLgTem)
- {
- if (entityTem.TepGid.Equals(""))
- {
- MessageUtil.ShowTips("修改时不能新增温度行!");
- return;
- }
- //stationC = entityTem.StationCode;
- //foreach (CraftLg2TemperatureEntity entity in listLgTem)
- //{
- // if (entity.StationCode.Equals(stationC))
- // {
- // MessageUtil.ShowTips("相同的工序点在同一个工艺卡下只能选一个!");
- // return;
- // }
- //}
- jsonListTem.Add(JSONFormat.Format(entityTem));
- }
- foreach (CraftLg2AlloyEntity entityHj in listLgHj)
- {
- if (entityHj.AlloyGid.Equals(""))
- {
- MessageUtil.ShowTips("修改时不能新增合金配置行!");
- return;
- }
- jsonListHj.Add(JSONFormat.Format(entityHj));
- }
- #endregion
- }
- #endregion
- if (MessageUtil.ShowYesNoAndQuestion(isFlag.Equals("0") ? "是否新增?" : "是否修改?") == DialogResult.No)
- {
- return;
- }
- PlanComm.WaitFromOpen(this.Cursor);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.steelMarkingPlan.FrmSteelProcessCard";
- ccp.MethodName = "doSaveUpdate";
- ccp.ServerParams = new object[] { jsonListM, jsonListCic, jsonListTarCic, jsonListCcm, jsonListTem, this.UserInfo.GetUserName(), isFlag, gradCode, jsonListHj };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- PlanComm.WaitFromColse(this.Cursor);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("新增成功!") || ccp.ReturnInfo.Equals("修改成功!"))
- {
- QueryM();
- }
- }
- /// <summary>
- /// 删除
- /// </summary>
- private void doDelete()
- {
- ultraGridLgM.UpdateData();
- ArrayList listLgM = new ArrayList();
- IQueryable<UltraGridRow> ugLgM = ultraGridLgM.Rows.AsQueryable().Where("CHC = 'True'");
- if (ugLgM == null || ugLgM.Count() == 0)
- {
- MessageUtil.ShowTips("未勾选炼钢工艺主信息!");
- return;
- }
- else
- {
- foreach (UltraGridRow rowLgM in ugLgM)
- {
- listLgM.Add((CraftLg2MEntity)rowLgM.ListObject);
- }
- }
- ArrayList jsonListM = new ArrayList();
- foreach (CraftLg2MEntity entityM in listLgM)
- {
- jsonListM.Add(JSONFormat.Format(entityM));
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否删除?") == DialogResult.No)
- {
- return;
- }
- PlanComm.WaitFromOpen(this.Cursor);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.steelMarkingPlan.FrmSteelProcessCard";
- ccp.MethodName = "doDelete";
- ccp.ServerParams = new object[] { jsonListM, furnaceNo, gxPlanSeq, flag };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- PlanComm.WaitFromColse(this.Cursor);
- if (ccp.ReturnCode == -1) return;
- if (ccp.ReturnInfo.Equals("删除成功!"))
- {
- QueryM();
- }
- }
- /// <summary>
- /// 确认
- /// </summary>
- private void doConfirm()
- {
- if (flag == "2")
- {
- Falg = true;
- this.Close();
- return;
- }
- UltraGridRow row = ultraGridLgM.ActiveRow;
- if (row == null) return;
- ultraGridLgM.UpdateData();
- ArrayList listLgM = new ArrayList();
- IQueryable<UltraGridRow> ugLgM = ultraGridLgM.Rows.AsQueryable().Where("CHC = 'True'");
- if (ugLgM == null || ugLgM.Count() == 0)
- {
- MessageUtil.ShowTips("未勾选炼钢工艺主信息!");
- return;
- }
- if (ugLgM.Count() > 1)
- {
- MessageUtil.ShowTips("请选择炼钢工艺卡号!");
- return;
- }
- string craftNo = row.Cells["CraftNo"].Text.ToString();
- if (craftNo.Equals(""))
- {
- MessageUtil.ShowTips("您选择炼钢工艺卡号未生成,请先保存!");
- return;
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否确认?") == DialogResult.No)
- {
- return;
- }
- PlanComm.WaitFromOpen(this.Cursor);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.steelMarkingPlan.FrmSteelProcessCard";
- ccp.MethodName = "doConfirm";
- ccp.ServerParams = new object[] { craftNo, furnaceNo, flag, gxPlanSeq };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- PlanComm.WaitFromColse(this.Cursor);
- if (ccp.ReturnCode == -1) return;
- if (ccp.ReturnInfo.Equals("确认成功!"))
- {
- Falg = true;
- this.Close();
- }
- }
- /// <summary>
- /// 计算
- /// </summary>
- private void doCalculate(int temperature)
- {
- int count = 0;
- foreach (UltraGridRow urg in ultraGridLgM.Rows)
- {
- if (Convert.ToBoolean(urg.Cells["CHC"].Text) == true)
- {
- count++;
- }
- }
- if (count == 0)
- {
- MessageUtil.ShowTips("请先勾选工艺卡主信息!"); return;
- }
- if (count > 1)
- {
- MessageUtil.ShowTips("请勾选一个工艺卡主信息!"); return;
- }
- #region 计算液相温度,目标成分EAF C出钢,P出钢
- if (temperature == 0)
- {
- double Ctemp = 0;//碳温度
- double Sitemp = 0;//硅温度
- double Mntemp = 0;//锰温度
- double Crtemp = 0;
- double Motemp = 0;
- double Nitemp = 0;
- double Cutemp = 0;
- double Titemp = 0;
- string Csteel = "";
- string Psteel = "";
- UltraGridRow urgT = ultraGridLgTarCic.ActiveRow;
- List<CraftLg2TarCicEntity> list = new List<CraftLg2TarCicEntity>();
- foreach (UltraGridRow urg in ultraGridLgCic.Rows)
- {
- CraftLg2TarCicEntity CraftLg2TarCicEntity = new entity.CraftLg2TarCicEntity();
- double min = 0;
- if (!urg.Cells["Stdmin"].Text.ToString().Equals(""))
- {
- min = double.Parse(urg.Cells["Stdmin"].Text.ToString());
- }
- double max = 0;
- if (!urg.Cells["Stdmax"].Text.ToString().Equals(""))
- {
- max = double.Parse(urg.Cells["Stdmax"].Text.ToString());
- }
- if (urg.Cells["ChemName"].Text.ToString().Equals("C"))
- {
- Ctemp = (max + min) / 2;
- if (min >= 0.20)
- {
- Csteel = (min - 0.10).ToString();
- }
- else if (0.10 <= min && min < 0.15)
- {
- Csteel = "0.07";
- }
- else if (0.15 <= min && min < 0.20)
- {
- Csteel = "0.09";
- }
- else if (min < 0.1)
- {
- Csteel = "0.06";
- }
- CraftLg2TarCicEntity.StationCode = "EAF";
- CraftLg2TarCicEntity.ChemCode = "C001";
- CraftLg2TarCicEntity.ChemName = "C";
- CraftLg2TarCicEntity.Stdmax = Csteel;
- CraftLg2TarCicEntity.StdmaxSign = "<=";
- list.Add(CraftLg2TarCicEntity);
- }
- if (urg.Cells["ChemName"].Text.ToString().Equals("P"))
- {
- if (max >= 0.015)
- {
- Psteel = (max - 0.005).ToString();
- }
- else if (0.10 <= max && max < 0.015)
- {
- Psteel = "0.007";
- }
- else if (max < 0.010)
- {
- Psteel = "0.006";
- }
- CraftLg2TarCicEntity.StationCode = "EAF";
- CraftLg2TarCicEntity.ChemCode = "C004";
- CraftLg2TarCicEntity.ChemName = "P";
- CraftLg2TarCicEntity.Stdmax = Psteel;
- CraftLg2TarCicEntity.StdmaxSign = "<=";
- list.Add(CraftLg2TarCicEntity);
- }
- if (urg.Cells["ChemName"].Text.ToString().Equals("Si"))
- {
- Sitemp = (max + min) / 2;
- }
- if (urg.Cells["ChemName"].Text.ToString().Equals("Mn"))
- {
- Mntemp = (max + min) / 2;
- }
- if (urg.Cells["ChemName"].Text.ToString().Equals("Cr"))
- {
- if (min != 0)
- {
- Mntemp = (max + min) / 2;
- }
- }
- if (urg.Cells["ChemName"].Text.ToString().Equals("Mo"))
- {
- if (min != 0)
- {
- Motemp = (max + min) / 2;
- }
- }
- if (urg.Cells["ChemName"].Text.ToString().Equals("Ni"))
- {
- if (min != 0)
- {
- Nitemp = (max + min) / 2;
- }
- }
- if (urg.Cells["ChemName"].Text.ToString().Equals("Cu"))
- {
- if (min != 0)
- {
- Cutemp = (max + min) / 2;
- }
- }
- if (urg.Cells["ChemName"].Text.ToString().Equals("Ti"))
- {
- if (min != 0)
- {
- Titemp = (max + min) / 2;
- }
- }
- }
- CraftLg2TarCicEntityBindingSource.DataSource = list;
- foreach (UltraGridRow urg in ultraGridLgTarCic.Rows)
- {
- urg.Cells["CHC"].Value = true;
- }
- temperature = (int)Math.Ceiling(1536 - (88 * Ctemp + 8 * Sitemp + 5 * Mntemp + 1.5 * Crtemp + 5 * Cutemp + 4 * Nitemp + 2 * Motemp + 18 * Titemp + 3));
- }
- UltraGridRow urgM = ultraGridLgM.ActiveRow;
- List<CraftLg2TemperatureEntity> listtep = new List<CraftLg2TemperatureEntity>();
- CraftLg2TemperatureEntity EntityTep = new entity.CraftLg2TemperatureEntity();
- CraftLg2TemperatureEntity EntityTep3 = new entity.CraftLg2TemperatureEntity();
- EntityTep3.StationCode = "EAF";
- EntityTep3.TepVal1Min = "1630";
- EntityTep3.TepVal1Max = "1690";
- listtep.Add(EntityTep3);
- if (string.IsNullOrEmpty(urgM.Cells["PlineCode"].Text) ||
- string.IsNullOrEmpty(urgM.Cells["CraftRoute"].Text))
- {
- MessageUtil.ShowTips("请选择产线和工艺路径!"); return;
- }
-
- if (urgM.Cells["PlineCode"].Text.ToString().Equals("C001"))//一炼钢
- {
- if (urgM.Cells["CraftRoute"].Text.ToString().Contains("V") || urgM.Cells["CraftRoute"].Text.ToString().Contains("R"))
- { //LF
- int minLF1 = 120;
- int maxLF1 = 140;
- int minLF2 = 100;
- int maxLF2 = 120;
- DataTable dt = ServerHelper.GetData("com.steering.pss.plnsaleord.steelMarkingPlan.FrmSteelProcessCard.queryComBaseTep", new object[] { urgM.Cells["PlineCode"].Text.ToString(), urgM.Cells["CraftRoute"].Text.ToString(), gradCode, "LF" }, ob);
- if (dt.Rows.Count > 0)
- {
- minLF1 = int.Parse(dt.Rows[0]["DEVIATION_NO1"].ToString());
- maxLF1 = int.Parse(dt.Rows[0]["DEVIATION_UN1"].ToString());
- minLF2 = int.Parse(dt.Rows[0]["DEVIATION_NO2"].ToString());
- maxLF2 = int.Parse(dt.Rows[0]["DEVIATION_NU2"].ToString());
- }
- EntityTep.StationCode = "LF";
- EntityTep.TepVal1Min = (temperature + minLF1).ToString();
- EntityTep.TepVal1Max = (temperature + maxLF1).ToString();
- EntityTep.TepVal2Min = (temperature + minLF2).ToString();
- EntityTep.TepVal2Max = (temperature + maxLF2).ToString();
- EntityTep.TepVal = "";
- listtep.Add(EntityTep);
- //VD
- int minVD1 = 70;
- int maxVD1 = 95;
- int minVD2 = 50;
- int maxVD2 = 70;
- DataTable dt1 = ServerHelper.GetData("com.steering.pss.plnsaleord.steelMarkingPlan.FrmSteelProcessCard.queryComBaseTep", new object[] { urgM.Cells["PlineCode"].Text.ToString(), urgM.Cells["CraftRoute"].Text.ToString(), gradCode, "VD" }, ob);
- if (dt.Rows.Count > 0)
- {
- minVD1 = int.Parse(dt1.Rows[0]["DEVIATION_NO1"].ToString());
- maxVD1 = int.Parse(dt1.Rows[0]["DEVIATION_UN1"].ToString());
- minVD2 = int.Parse(dt1.Rows[0]["DEVIATION_NO2"].ToString());
- maxVD2 = int.Parse(dt1.Rows[0]["DEVIATION_NU2"].ToString());
- }
- CraftLg2TemperatureEntity EntityTep1 = new entity.CraftLg2TemperatureEntity();
- //CraftLg2TemperatureEntity EntityTepClone = EntityTep.Clone();
- EntityTep1.StationCode = "VD";
- EntityTep1.TepVal1Min = (temperature + minVD1).ToString();
- EntityTep1.TepVal1Max = (temperature + maxVD1).ToString();
- EntityTep1.TepVal2Min = (temperature + minVD2).ToString();
- EntityTep1.TepVal2Max = (temperature + maxVD2).ToString();
- EntityTep1.TepVal = "";
- listtep.Add(EntityTep1);
- }
- else
- {//LF
- int minLF1 = 70;
- int maxLF1 = 95;
- int minLF2 = 50;
- int maxLF2 = 70;
- DataTable dt = ServerHelper.GetData("com.steering.pss.plnsaleord.steelMarkingPlan.FrmSteelProcessCard.queryComBaseTep", new object[] { urgM.Cells["PlineCode"].Text.ToString(), urgM.Cells["CraftRoute"].Text.ToString(), gradCode, "LF" }, ob);
- if (dt.Rows.Count > 0)
- {
- minLF1 = int.Parse(dt.Rows[0]["DEVIATION_NO1"].ToString());
- maxLF1 = int.Parse(dt.Rows[0]["DEVIATION_UN1"].ToString());
- minLF2 = int.Parse(dt.Rows[0]["DEVIATION_NO2"].ToString());
- maxLF2 = int.Parse(dt.Rows[0]["DEVIATION_NU2"].ToString());
- }
- EntityTep.StationCode = "LF";
- EntityTep.TepVal1Min = (temperature + minLF1).ToString();
- EntityTep.TepVal1Max = (temperature + maxLF1).ToString();
- EntityTep.TepVal2Min = (temperature + minLF2).ToString();
- EntityTep.TepVal2Max = (temperature + maxLF2).ToString();
- EntityTep.TepVal = "";
- listtep.Add(EntityTep);
- }
- }
- else if (urgM.Cells["PlineCode"].Text.ToString().Equals("C003"))//二炼钢
- {
- if (urgM.Cells["CraftRoute"].Text.ToString().Contains("V") || urgM.Cells["CraftRoute"].Text.ToString().Contains("R"))
- {
- //LF
- int minLF1 = 130;
- int maxLF1 = 150;
- int minLF2 = 110;
- int maxLF2 = 130;
- DataTable dt = ServerHelper.GetData("com.steering.pss.plnsaleord.steelMarkingPlan.FrmSteelProcessCard.queryComBaseTep", new object[] { urgM.Cells["PlineCode"].Text.ToString(), urgM.Cells["CraftRoute"].Text.ToString(), gradCode, "LF" }, ob);
- if (dt.Rows.Count > 0)
- {
- minLF1 = int.Parse(dt.Rows[0]["DEVIATION_NO1"].ToString());
- maxLF1 = int.Parse(dt.Rows[0]["DEVIATION_UN1"].ToString());
- minLF2 = int.Parse(dt.Rows[0]["DEVIATION_NO2"].ToString());
- maxLF2 = int.Parse(dt.Rows[0]["DEVIATION_NU2"].ToString());
- }
- EntityTep.StationCode = "LF";
- EntityTep.TepVal1Min = (temperature + minLF1).ToString();
- EntityTep.TepVal1Max = (temperature + maxLF1).ToString();
- EntityTep.TepVal2Min = (temperature + minLF2).ToString();
- EntityTep.TepVal2Max = (temperature + maxLF2).ToString();
- EntityTep.TepVal = "";
- listtep.Add(EntityTep);
- //VD
- int minVD1 = 70;
- int maxVD1 = 95;
- int minVD2 = 60;
- int maxVD2 = 80;
- DataTable dt1 = ServerHelper.GetData("com.steering.pss.plnsaleord.steelMarkingPlan.FrmSteelProcessCard.queryComBaseTep", new object[] { urgM.Cells["PlineCode"].Text.ToString(), urgM.Cells["CraftRoute"].Text.ToString(), gradCode, "VD" }, ob);
- if (dt.Rows.Count > 0)
- {
- minVD1 = int.Parse(dt1.Rows[0]["DEVIATION_NO1"].ToString());
- maxVD1 = int.Parse(dt1.Rows[0]["DEVIATION_UN1"].ToString());
- minVD2 = int.Parse(dt1.Rows[0]["DEVIATION_NO2"].ToString());
- maxVD2 = int.Parse(dt1.Rows[0]["DEVIATION_NU2"].ToString());
- }
- CraftLg2TemperatureEntity EntityTep1 = new entity.CraftLg2TemperatureEntity();
- EntityTep1.StationCode = "VD";
- EntityTep1.TepVal1Min = (temperature + minVD1).ToString();
- EntityTep1.TepVal1Max = (temperature + maxVD1).ToString();
- EntityTep1.TepVal2Min = (temperature + minVD2).ToString();
- EntityTep1.TepVal2Max = (temperature + maxVD2).ToString();
- EntityTep1.TepVal = "";
- listtep.Add(EntityTep1);
-
- }
- else
- { //LF
- int minLF1 = 70;
- int maxLF1 = 95;
- int minLF2 = 60;
- int maxLF2 = 80;
- DataTable dt = ServerHelper.GetData("com.steering.pss.plnsaleord.steelMarkingPlan.FrmSteelProcessCard.queryComBaseTep", new object[] { urgM.Cells["PlineCode"].Text.ToString(), urgM.Cells["CraftRoute"].Text.ToString(), gradCode, "LF" }, ob);
- if (dt.Rows.Count > 0)
- {
- minLF1 = int.Parse(dt.Rows[0]["DEVIATION_NO1"].ToString());
- maxLF1 = int.Parse(dt.Rows[0]["DEVIATION_UN1"].ToString());
- minLF2 = int.Parse(dt.Rows[0]["DEVIATION_NO2"].ToString());
- maxLF2 = int.Parse(dt.Rows[0]["DEVIATION_NU2"].ToString());
- }
- EntityTep.StationCode = "LF";
- EntityTep.TepVal1Min = (temperature + minLF1).ToString();
- EntityTep.TepVal1Max = (temperature + maxLF1).ToString();
- EntityTep.TepVal2Min = (temperature + minLF2).ToString();
- EntityTep.TepVal2Max = (temperature + maxLF2).ToString();
- EntityTep.TepVal = "";
- listtep.Add(EntityTep);
- }
- }
- else if (urgM.Cells["PlineCode"].Text.ToString().Equals("C006"))//三炼钢
- {
- if (urgM.Cells["CraftRoute"].Text.ToString().Contains("V") || urgM.Cells["CraftRoute"].Text.ToString().Contains("R"))
- { //LF
- int minLF1 = 130;
- int maxLF1 = 150;
- int minLF2 = 110;
- int maxLF2 = 130;
- DataTable dt = ServerHelper.GetData("com.steering.pss.plnsaleord.steelMarkingPlan.FrmSteelProcessCard.queryComBaseTep", new object[] { urgM.Cells["PlineCode"].Text.ToString(), urgM.Cells["CraftRoute"].Text.ToString(), gradCode, "LF" }, ob);
- if (dt.Rows.Count > 0)
- {
- minLF1 = int.Parse(dt.Rows[0]["DEVIATION_NO1"].ToString());
- maxLF1 = int.Parse(dt.Rows[0]["DEVIATION_UN1"].ToString());
- minLF2 = int.Parse(dt.Rows[0]["DEVIATION_NO2"].ToString());
- maxLF2 = int.Parse(dt.Rows[0]["DEVIATION_NU2"].ToString());
- }
- EntityTep.StationCode = "LF";
- EntityTep.TepVal1Min = (temperature + minLF1).ToString();
- EntityTep.TepVal1Max = (temperature + maxLF1).ToString();
- EntityTep.TepVal2Min = (temperature + minLF2).ToString();
- EntityTep.TepVal2Max = (temperature + maxLF2).ToString();
- EntityTep.TepVal = "";
- listtep.Add(EntityTep);
- //VD
- int minRH1 = 75;
- int maxRH1 = 95;
- int minRH2 = 60;
- int maxRH2 = 80;
- DataTable dt1 = ServerHelper.GetData("com.steering.pss.plnsaleord.steelMarkingPlan.FrmSteelProcessCard.queryComBaseTep", new object[] { urgM.Cells["PlineCode"].Text.ToString(), urgM.Cells["CraftRoute"].Text.ToString(), gradCode, "RH" }, ob);
- if (dt.Rows.Count > 0)
- {
- minRH1 = int.Parse(dt1.Rows[0]["DEVIATION_NO1"].ToString());
- maxRH1 = int.Parse(dt1.Rows[0]["DEVIATION_UN1"].ToString());
- minRH2 = int.Parse(dt1.Rows[0]["DEVIATION_NO2"].ToString());
- maxRH2 = int.Parse(dt1.Rows[0]["DEVIATION_NU2"].ToString());
- }
- CraftLg2TemperatureEntity EntityTep1 = new entity.CraftLg2TemperatureEntity();
- EntityTep1.StationCode = "RH";
- EntityTep1.TepVal1Min = (temperature + minRH1).ToString();
- EntityTep1.TepVal1Max = (temperature + maxRH1).ToString();
- EntityTep1.TepVal2Min = (temperature + minRH2).ToString();
- EntityTep1.TepVal2Max = (temperature + maxRH2).ToString();
- EntityTep1.TepVal = "";
- listtep.Add(EntityTep1);
- }
- else
- {//LF
- int minLF1 = 75;
- int maxLF1 = 95;
- int minLF2 = 60;
- int maxLF2 = 80;
- DataTable dt = ServerHelper.GetData("com.steering.pss.plnsaleord.steelMarkingPlan.FrmSteelProcessCard.queryComBaseTep", new object[] { urgM.Cells["PlineCode"].Text.ToString(), urgM.Cells["CraftRoute"].Text.ToString(), gradCode, "LF" }, ob);
- if (dt.Rows.Count > 0)
- {
- minLF1 = int.Parse(dt.Rows[0]["DEVIATION_NO1"].ToString());
- maxLF1 = int.Parse(dt.Rows[0]["DEVIATION_UN1"].ToString());
- minLF2 = int.Parse(dt.Rows[0]["DEVIATION_NO2"].ToString());
- maxLF2 = int.Parse(dt.Rows[0]["DEVIATION_NU2"].ToString());
- }
- EntityTep.StationCode = "LF";
- EntityTep.TepVal1Min = (temperature + minLF1).ToString();
- EntityTep.TepVal1Max = (temperature + maxLF1).ToString();
- EntityTep.TepVal2Min = (temperature + minLF2).ToString();
- EntityTep.TepVal2Max = (temperature + maxLF2).ToString();
- EntityTep.TepVal = "";
- listtep.Add(EntityTep);
- }
- }
- CraftLg2TemperatureEntity EntityTep2 = new entity.CraftLg2TemperatureEntity();
- EntityTep2.StationCode = "CCM";
- EntityTep2.TepVal = temperature.ToString();
- listtep.Add(EntityTep2);
-
- CraftLg2TemperatureEntitySource.DataSource = listtep;
- foreach (UltraGridRow urg in ultraGridLhTem.Rows)
- {
- urg.Cells["CHC"].Value = true;
- if (urg.Cells["StationCode"].Text.Equals("EAF"))
- {
- urg.Cells["TepVal1Min"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
- urg.Cells["TepVal1Max"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
- urg.Cells["TepVal2Min"].Appearance.BackColor = Color.Transparent;
- urg.Cells["TepVal2Max"].Appearance.BackColor = Color.Transparent;
- urg.Cells["TepVal"].Appearance.BackColor = Color.Transparent;
- urg.Cells["TepVal1Min"].Activation = Activation.AllowEdit;
- urg.Cells["TepVal1Max"].Activation = Activation.AllowEdit;
- urg.Cells["TepVal1Min"].IgnoreRowColActivation = true;
- urg.Cells["TepVal1Max"].IgnoreRowColActivation = true;
- urg.Cells["TepVal2Min"].Activation = Activation.ActivateOnly;
- urg.Cells["TepVal2Max"].Activation = Activation.ActivateOnly;
- urg.Cells["TepVal"].Activation= Activation.ActivateOnly;
- }
- else if (urg.Cells["StationCode"].Text.Equals("CCM"))
- {
- urg.Cells["TepVal1Min"].Appearance.BackColor = Color.Transparent;
- urg.Cells["TepVal1Max"].Appearance.BackColor = Color.Transparent;
- urg.Cells["TepVal2Min"].Appearance.BackColor = Color.Transparent;
- urg.Cells["TepVal2Max"].Appearance.BackColor = Color.Transparent;
- urg.Cells["TepVal"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
- urg.Cells["TepVal1Min"].Activation = Activation.ActivateOnly;
- urg.Cells["TepVal1Max"].Activation = Activation.ActivateOnly;
- urg.Cells["TepVal2Min"].Activation = Activation.ActivateOnly;
- urg.Cells["TepVal2Max"].Activation = Activation.ActivateOnly;
- urg.Cells["TepVal"].Activation = Activation.AllowEdit;
- urg.Cells["TepVal"].IgnoreRowColActivation = true;
- }
- else
- {
- urg.Cells["TepVal1Min"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
- urg.Cells["TepVal1Max"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
- urg.Cells["TepVal2Min"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
- urg.Cells["TepVal2Max"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
- urg.Cells["TepVal"].Appearance.BackColor = Color.Transparent;
- urg.Cells["TepVal1Min"].Activation = Activation.AllowEdit;
- urg.Cells["TepVal1Max"].Activation = Activation.AllowEdit;
- urg.Cells["TepVal2Min"].Activation = Activation.AllowEdit;
- urg.Cells["TepVal2Max"].Activation = Activation.AllowEdit;
- urg.Cells["TepVal1Min"].IgnoreRowColActivation = true;
- urg.Cells["TepVal1Max"].IgnoreRowColActivation = true;
- urg.Cells["TepVal2Min"].IgnoreRowColActivation = true;
- urg.Cells["TepVal2Max"].IgnoreRowColActivation = true;
- urg.Cells["TepVal"].Activation = Activation.ActivateOnly;
- }
- }
- #endregion
- }
- private void chcCraftNo_CheckedChanged(object sender, EventArgs e)
- {
- if (chcCraftNo.Checked) { comCraftNo.Enabled = true; } else { comCraftNo.Enabled = false; }
- if (chcAPline.Checked) { comAPline.Enabled = true; } else { comAPline.Enabled = false; }
- if (chcGrade.Checked) { comGrade.Enabled = true; } else { comGrade.Enabled = false; }
- }
- #region 事件
- private void ultraGridLgTarCic_CellChange(object sender, CellEventArgs e)
- {
- int count = 0;
- foreach (UltraGridRow urg in ultraGridLgM.Rows)
- {
- if (Convert.ToBoolean(urg.Cells["CHC"].Text) == true)
- {
- count++;
- }
- }
- if (count == 0)
- {
- MessageUtil.ShowTips("请先勾选工艺卡主信息!"); return;
- }
- if (count >1)
- {
- MessageUtil.ShowTips("请勾选一个工艺卡主信息!"); return;
- }
- UltraGridRow row = ultraGridLgTarCic.ActiveRow;
- if (row == null) return;
- ultraGridLgTarCic.UpdateData();
- #region 获取C,P上限
- string Csteel = "";
- string Psteel = "";
- foreach (UltraGridRow urg in ultraGridLgCic.Rows)
- {
- CraftLg2TarCicEntity CraftLg2TarCicEntity = new entity.CraftLg2TarCicEntity();
- double min = 0;
- if (!urg.Cells["Stdmin"].Text.ToString().Equals(""))
- {
- min = double.Parse(urg.Cells["Stdmin"].Text.ToString());
- }
- double max = 0;
- if (!urg.Cells["Stdmax"].Text.ToString().Equals(""))
- {
- max = double.Parse(urg.Cells["Stdmax"].Text.ToString());
- }
- if (urg.Cells["ChemName"].Text.ToString().Equals("C"))
- {
- if (min >= 0.20)
- {
- Csteel = (min - 0.10).ToString();
- }
- else if (0.10 <= min && min < 0.15)
- {
- Csteel = "0.07";
- }
- else if (0.15 <= min && min < 0.20)
- {
- Csteel = "0.09";
- }
- else if (min < 0.1)
- {
- Csteel = "0.06";
- }
- }
- if (urg.Cells["ChemName"].Text.ToString().Equals("P"))
- {
- if (max >= 0.015)
- {
- Psteel = (max - 0.005).ToString();
- }
- else if (0.10 <= max && max < 0.015)
- {
- Psteel = "0.007";
- }
- else if (max < 0.010)
- {
- Psteel = "0.006";
- }
- }
- }
- #endregion
- if (e.Cell.Column.Key.Equals("ChemCode"))
- {
- e.Cell.Row.Cells["ChemCode"].Value = e.Cell.Value;
- e.Cell.Row.Cells["ChemName"].Value = e.Cell.Text;
- if (e.Cell.Row.Cells["StationCode"].Text.ToString().Equals("EAF"))
- {
- if (e.Cell.Row.Cells["ChemName"].Text.ToString().Equals("C"))
- {
- e.Cell.Row.Cells["Stdmax"].Value = Csteel;
- e.Cell.Row.Cells["StdmaxSign"].Value = "<=";
- }
- else if (e.Cell.Row.Cells["ChemName"].Text.ToString().Equals("C"))
- {
- e.Cell.Row.Cells["Stdmax"].Value = Psteel;
- e.Cell.Row.Cells["StdmaxSign"].Value = "<=";
- }
- }
- }
- listTarCic.Change((CraftLg2TarCicEntity)e.Cell.Row.ListObject);
- }
-
- /// <summary>
- /// 工艺主信息新增事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraGridLgM_AfterRowInsert(object sender, RowEventArgs e)
- {
- UltraGridRow row = ultraGridLgM.ActiveRow;
- ultraGridLgM.UpdateData();
- ////查询最大工艺卡号
- //DataTable dt = ServerHelper.GetData("com.steering.pss.plnsaleord.steelMarkingPlan.FrmSteelProcessCard.queryMaxCraftNo", new object[] { gradCode }, ob);
- DataTable dt1 = ServerHelper.GetData("com.steering.pss.plnsaleord.steelMarkingPlan.FrmSteelProcessCard.queryStdCic", new object[] { cic }, ob);
- //if (dt.Rows.Count > 0)
- //{
- // row.Cells["CraftNo"].Value = dt.Rows[0]["CRAFT_NO"].ToString();
- //}
- if (dt1.Rows.Count > 0)
- {
- row.Cells["StdCodeNk"].Value = dt1.Rows[0]["STD_CODE"].ToString();
- row.Cells["StdNameNk"].Value = dt1.Rows[0]["STD_NAME"].ToString();
- row.Cells["StdVersion"].Value = dt1.Rows[0]["STD_VERSION"].ToString();
- if (dt1.Rows[0]["STD_NAME"].ToString().Contains("NSYK") || cic.Contains(","))
- {
- row.Cells["CraftType"].Value = "B";
- }
- else
- {
- row.Cells["CraftType"].Value = "A";
- }
- }
- //查询品名
- DataTable dt2 = ServerHelper.GetData("com.steering.pss.plnsaleord.steelMarkingPlan.FrmSteelProcessCard.queryProdu", new object[] { furnaceNo ,flag}, ob);
- if (dt2.Rows.Count> 0)
- {
- row.Cells["Produccode"].Value = dt2.Rows[0]["PRODUCCODE"].ToString();
- row.Cells["Producname"].Value = dt2.Rows[0]["PRODUCNAME"].ToString();
- }
- row.Cells["GradeCode"].Value = gradCode;
- row.Cells["GradeName"].Value = gradName;
- row.Cells["PlineCode"].Value = plineCodeA;
- row.Cells["PlineName"].Value = plineNameA;
- row.Cells["CraftRoute"].Value = planRoute;
- //row.Cells["Cic"].Value = row.Cells["CIC"].Text.ToString();
- row.Cells["MarkMan"].Value = this.UserInfo.GetUserName();
- if (flag == "2")
- {
- UltraComboEditor ucePath = new UltraComboEditor();
- e.Row.Cells["CraftRoute"].EditorComponent = ucePath;
- e.Row.Cells["CraftRoute"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
- e.Row.Cells["CraftRoute"].IgnoreRowColActivation = true;
- ValueList vlistSteel = new ValueList(); ;
- vlistSteel.ValueListItems.Insert(0, "ELC", "ELC");
- vlistSteel.ValueListItems.Insert(1, "ELVC", "ELVC");
- vlistSteel.ValueListItems.Insert(2, "ELRC", "ELRC");
- vlistSteel.ValueListItems.Insert(3, "ELVI", "ELVI");
- vlistSteel.ValueListItems.Insert(4, "RLRI", "RLRI");
- e.Row.Cells["CraftRoute"].ValueList = vlistSteel;
- e.Row.Cells["CraftRoute"].Activation = Activation.AllowEdit;
- e.Row.Cells["CraftRoute"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
- e.Row.Cells["PlineCode"].IgnoreRowColActivation = true;
- e.Row.Cells["PlineCode"].Activation = Activation.AllowEdit;
- e.Row.Cells["PlineCode"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
- }
- }
-
- private void ultraGridLgM_AfterRowActivate(object sender, EventArgs e)
- {
- UltraGridRow row = ultraGridLgM.ActiveRow;
- if (row == null) return;
-
- if (row.Cells["CicGid"].Text.ToString().Equals(""))
- {
- //if (flag.Equals("1"))
- //{
- // ultraExpandableGroupBox2.Visible = false;
- // if (cic.Split(',').Length > 1)
- // {
- // queryOrdDesigJJCic();
- // }
- // else
- // {
- // queryOrdDesigStdCic();
- // }
- //}
- //else
- //{
- ultraExpandableGroupBox2.Expanded = true;
- queryOrdDesigCic(row.Cells["Cic"].Text.ToString());
- //}
- }
- else {
- queryOrdDesigCic(row.Cells["Cic"].Text.ToString());
- ultraExpandableGroupBox2.Expanded = false;
- QueryLgCic(row.Cells["CicGid"].Text.ToString());
- }
- QueryLgTarCic(row.Cells["TarCicGid"].Text.ToString());
- QueryLgCcm(row.Cells["CcmGid"].Text.ToString());
- QueryLgtTem(row.Cells["TepGid"].Text.ToString());
- if (Convert.ToBoolean(row.Cells["CHC"].Text)==true)
- {
- ultraTabControl1.Enabled = true;
- }
- else
- {
- ultraTabControl1.Enabled = false;
- }
- //合金配置为空是根据钢种获取
- if (row.Cells["AlloyGid"].Text.ToString().Equals(""))
- {
- listHj = EntityHelper.GetData<CraftLg2AlloyEntity>
- ("com.steering.pss.plnsaleord.steelMarkingPlan.FrmSteelProcessCard.queryLgtHjGrae", new object[] { gradCode,"" }, ob);
- listHj.AcceptChanges();
- CraftLg2AlloyEntityBindingSource.DataSource = listHj;
- foreach (UltraGridRow urg in ultraGridhJ.Rows)
- {
- urg.Cells["CHC"].Value = true;
- }
- }
- else
- {
- QueryLgHj(row.Cells["AlloyGid"].Text.ToString());
- }
- }
-
-
- private void ultraGridLgM_BeforeRowDeactivate(object sender, CancelEventArgs e)
- {
- if (listCic.IsChanged)
- {
- if (MessageUtil.ShowYesNoAndQuestion("是否放弃成分CIC编辑?") == DialogResult.No)
- {
- e.Cancel = true;
- }
- }
- if (listTarCic != null)
- {
- if (listTarCic.IsChanged)
- {
- if (MessageUtil.ShowYesNoAndQuestion("是否放弃目标成分CIC编辑?") == DialogResult.No)
- {
- e.Cancel = true;
- }
- }
- }
- if (listCcm != null)
- {
- if (listCcm.IsChanged)
- {
- if (MessageUtil.ShowYesNoAndQuestion("是否放弃CCM编辑?") == DialogResult.No)
- {
- e.Cancel = true;
- }
- }
- }
- if (listTem != null)
- {
- if (listTem.IsChanged)
- {
- if (MessageUtil.ShowYesNoAndQuestion("是否放弃温度编辑?") == DialogResult.No)
- {
- e.Cancel = true;
- }
- }
- }
- if (listHj != null)
- {
- if (listHj.IsChanged)
- {
- if (MessageUtil.ShowYesNoAndQuestion("是否放弃合金配置编辑?") == DialogResult.No)
- {
- e.Cancel = true;
- }
- }
- }
- }
- private void ultraGridLgCic_CellChange(object sender, CellEventArgs e)
- {
- int count = 0;
- /*foreach (UltraGridRow urg in ultraGridLgM.Rows)
- {
- if (Convert.ToBoolean(urg.Cells["CHC"].Text) == true)
- {
- count++;
- }
- }
- if (count == 0)
- {
- MessageUtil.ShowTips("请先勾选工艺卡主信息!"); return;
- }
- if (count > 1)
- {
- MessageUtil.ShowTips("请勾选一个工艺卡主信息!"); return;
- }*/
- ultraGridLgCic.UpdateData();
- if (e.Cell.Column.Key == "ChemCode")
- {
- DataTable dt1 = uceCicAll.DataSource as DataTable;
- if (dt1 != null)
- {
- DataRow dr = dt1.AsEnumerable().FirstOrDefault(p => p["CHEM_CODE"] == e.Cell.Value);
- if (dr != null)
- {
- e.Cell.Row.Cells["ChemType"].Value = dr["CHEM_TYPE"] is DBNull ? "" : dr["CHEM_TYPE"];
- e.Cell.Row.Cells["ChemFormula"].Value = dr["CHEM_FORMULA"] is DBNull ? "" : dr["CHEM_FORMULA"];
- e.Cell.Row.Cells["ChemName"].Value = dr["CHEM_NAME"] is DBNull ? "" : dr["CHEM_NAME"];
- }
- }
- }
- UltraGridRow row = ultraGridLgCic.ActiveRow;
- if (row == null) return;
- if (listCic!=null)
- {
- listCic.Change((CraftLg2CicEntity)e.Cell.Row.ListObject);
- }
-
- //string oldStdMax = row.Cells["Stdmax"].Text.ToString();
-
- //if (e.Cell.Column.Key.Equals("Stdmin"))
- //{
- // string oldStdMin = "";
- // foreach (CraftLg2CicEntity entity in listCic)
- // {
- // if (entity.ChemName.Equals(e.Cell.Row.Cells["ChemName"].Text.ToString()))
- // {
- // oldStdMin = row.Cells["Stdmin"].Text.ToString();
- // break;
- // }
- // }
- // string actCountMin = e.Cell.Row.Cells["Stdmin"].Text.ToString();
- // if (actCountMin != null && !StringUtil.IsFloat(actCountMin))
- // {
- // MessageUtil.ShowTips("请输入数字类型!");
- // row.Cells["Stdmin"].Value = "";
- // return;
- // }
- // else
- // {
- // if (double.Parse(actCountMin) < double.Parse(oldStdMin))
- // {
- // MessageUtil.ShowTips("输入标准下限不能小于原标准下限!");
- // row.Cells["Stdmin"].Value = oldStdMin;
- // return;
- // }
- // else
- // {
- // row.Cells["Stdmin"].Value = actCountMin;
- // }
- // }
- //}
- //if (e.Cell.Column.Key.Equals("Stdmax"))
- //{
- // string actCountMax = e.Cell.Row.Cells["Stdmax"].Text.ToString();
- // if (actCountMax != null && !StringUtil.IsFloat(actCountMax))
- // {
- // MessageUtil.ShowTips("请输入数字类型!");
- // row.Cells["Stdmin"].Value = "";
- // return;
- // }
- // else
- // {
-
- // if (double.Parse(actCountMax) > double.Parse(oldStdMax))
- // {
- // MessageUtil.ShowTips("输入标准上限不能大于原标准上限!");
- // row.Cells["Stdmax"].Value = oldStdMax;
- // return;
- // }
- // else
- // {
- // row.Cells["Stdmax"].Value = actCountMax;
- // }
- // }
- //}
- }
- private void ultraGridLgCcm_CellChange(object sender, CellEventArgs e)
- {
- int count = 0;
- foreach (UltraGridRow urg in ultraGridLgM.Rows)
- {
- if (Convert.ToBoolean(urg.Cells["CHC"].Text) == true)
- {
- count++;
- }
- }
- if (count == 0)
- {
- MessageUtil.ShowTips("请先勾选工艺卡主信息!"); return;
- }
- if (count > 1)
- {
- MessageUtil.ShowTips("请勾选一个工艺卡主信息!"); return;
- }
- UltraGridRow row = ultraGridLgCcm.ActiveRow;
- if (row == null) return;
- ultraGridLgCcm.UpdateData();
- string ccmName = "";
- if (e.Cell.Column.Key.Equals("CcmCode"))
- {
- if (!e.Cell.Row.Cells["CcmCode"].Text.ToString().Equals(""))
- {
- DataTable dt = ServerHelper.GetData("com.steering.pss.plnsaleord.steelMarkingPlan.FrmSteelProcessCard.queryComBaseCcm", new object[] { plineCodeB, gradCode, cic }, ob);
- if (dt.Rows.Count> 0)
- {
- e.Cell.Row.Cells["Diameter"].Value = dt.Rows[0]["直径"].ToString();
- e.Cell.Row.Cells["WaterNo"].Value = dt.Rows[0]["水表号"].ToString();
- e.Cell.Row.Cells["CoolingVal"].Value = dt.Rows[0]["冷却强度"].ToString();
-
- }
- int counntcm = 0;
- foreach (UltraGridRow rows in ultraGridLgCcm.Rows)
- {
- if (ccmName.Equals(""))
- {
- ccmName = e.Cell.Row.Cells["CcmCode"].Value.ToString();
- }
- if (ccmName.Equals(rows.Cells["CcmCode"].Text.ToString()) && !ccmName.Equals(""))
- {
- counntcm++;
- }
- }
- if (counntcm > 1)
- {
- MessageUtil.ShowTips("存在相同水表数据!");
- e.Cell.Row.Cells["Diameter"].Value = "";
- e.Cell.Row.Cells["WaterNo"].Value = "";
- e.Cell.Row.Cells["CoolingVal"].Value = "";
- e.Cell.Row.Cells["CcmCode"].Value = "";
- return;
- }
- }
- }
-
- if (listCcm!=null)
- {
- listCcm.Change((CraftLg2CcmEntity)e.Cell.Row.ListObject);
- }
- }
- private void ultraGridLhTem_CellChange(object sender, CellEventArgs e)
- { int count = 0;
- foreach (UltraGridRow urg in ultraGridLgM.Rows)
- {
- if (Convert.ToBoolean(urg.Cells["CHC"].Text) == true)
- {
- count++;
- }
- }
- if (count == 0)
- {
- MessageUtil.ShowTips("请先勾选工艺卡主信息!"); return;
- }
- if (count >1)
- {
- MessageUtil.ShowTips("请勾选一个工艺卡主信息!"); return;
- }
- UltraGridRow row = ultraGridLhTem.ActiveRow;
- if (row == null) return;
- ultraGridLhTem.UpdateData();
- if (e.Cell.Column.Key.Equals("StationCode"))
- {
- if (e.Cell.Row.Cells["StationCode"].Text.Equals("EAF"))
- {
- e.Cell.Row.Cells["TepVal1Min"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
- e.Cell.Row.Cells["TepVal1Max"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
- e.Cell.Row.Cells["TepVal2Min"].Appearance.BackColor = Color.Transparent;
- e.Cell.Row.Cells["TepVal2Max"].Appearance.BackColor = Color.Transparent;
- e.Cell.Row.Cells["TepVal"].Appearance.BackColor = Color.Transparent;
- e.Cell.Row.Cells["TepVal1Min"].Activation = Activation.AllowEdit;
- e.Cell.Row.Cells["TepVal1Max"].Activation = Activation.AllowEdit;
- e.Cell.Row.Cells["TepVal1Min"].IgnoreRowColActivation = true;
- e.Cell.Row.Cells["TepVal1Max"].IgnoreRowColActivation = true;
- e.Cell.Row.Cells["TepVal2Min"].Activation = Activation.ActivateOnly;
- e.Cell.Row.Cells["TepVal2Max"].Activation = Activation.ActivateOnly;
- e.Cell.Row.Cells["TepVal"].Activation = Activation.ActivateOnly;
- }
- else if (e.Cell.Row.Cells["StationCode"].Text.Equals("CCM"))
- {
- e.Cell.Row.Cells["TepVal1Min"].Appearance.BackColor = Color.Transparent;
- e.Cell.Row.Cells["TepVal1Max"].Appearance.BackColor = Color.Transparent;
- e.Cell.Row.Cells["TepVal2Min"].Appearance.BackColor = Color.Transparent;
- e.Cell.Row.Cells["TepVal2Max"].Appearance.BackColor = Color.Transparent;
- e.Cell.Row.Cells["TepVal"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
- e.Cell.Row.Cells["TepVal1Min"].Activation = Activation.ActivateOnly;
- e.Cell.Row.Cells["TepVal1Max"].Activation = Activation.ActivateOnly;
- e.Cell.Row.Cells["TepVal2Min"].Activation = Activation.ActivateOnly;
- e.Cell.Row.Cells["TepVal2Max"].Activation = Activation.ActivateOnly;
- e.Cell.Row.Cells["TepVal"].Activation = Activation.AllowEdit;
- e.Cell.Row.Cells["TepVal"].IgnoreRowColActivation = true;
- }
- else
- {
- e.Cell.Row.Cells["TepVal1Min"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
- e.Cell.Row.Cells["TepVal1Max"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
- e.Cell.Row.Cells["TepVal2Min"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
- e.Cell.Row.Cells["TepVal2Max"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
- e.Cell.Row.Cells["TepVal"].Appearance.BackColor = Color.Transparent;
- e.Cell.Row.Cells["TepVal1Min"].Activation = Activation.AllowEdit;
- e.Cell.Row.Cells["TepVal1Max"].Activation = Activation.AllowEdit;
- e.Cell.Row.Cells["TepVal2Min"].Activation = Activation.AllowEdit;
- e.Cell.Row.Cells["TepVal2Max"].Activation = Activation.AllowEdit;
- e.Cell.Row.Cells["TepVal1Min"].IgnoreRowColActivation = true;
- e.Cell.Row.Cells["TepVal1Max"].IgnoreRowColActivation = true;
- e.Cell.Row.Cells["TepVal2Min"].IgnoreRowColActivation = true;
- e.Cell.Row.Cells["TepVal2Max"].IgnoreRowColActivation = true;
- e.Cell.Row.Cells["TepVal"].Activation = Activation.ActivateOnly;
- }
- int count1 = 0;
- foreach (UltraGridRow urg in ultraGridLhTem.Rows)
- {
- if (e.Cell.Row.Cells["StationCode"].Text.Equals(urg.Cells["StationCode"].Text.ToString()))
- {
- count1++;
- if (count1 > 1)
- {
- MessageUtil.ShowTips("一个工艺卡下对应的工序点不能重复!");
- e.Cell.Row.Cells["StationCode"].Value = null;
- return;
- }
- }
- }
- }
- //计算温度
- if (e.Cell.Column.Key.Equals("TepVal"))
- {
- if (e.Cell.Row.Cells["StationCode"].Text.Equals("CCM"))
- {
- doCalculate(int.Parse(e.Cell.Row.Cells["TepVal"].Value.ToString()));
- }
- }
- if (listTem != null && listTem.Count!=0)
- {
- listTem.Change((CraftLg2TemperatureEntity)e.Cell.Row.ListObject);
-
- }
- }
- private void ultraGridLgM_CellChange(object sender, CellEventArgs e)
- {
- UltraGridRow ugr=ultraGridLgM.ActiveRow;
- if (ugr == null) return;
- ultraGridLgM.UpdateData();
- if (e.Cell.Column.Key.Equals("Produccode"))
- {
- e.Cell.Row.Cells["Produccode"].Value = e.Cell.Value.ToString();
- e.Cell.Row.Cells["Producname"].Value = e.Cell.Text;
- }
- if (Convert.ToBoolean(e.Cell.Row.Cells["CHC"].Text) == true)
- {
- ultraTabControl1.Enabled = true;
- }
- else
- {
- ultraTabControl1.Enabled = false;
- }
- }
- private void ultraGridhJ_CellChange(object sender, CellEventArgs e)
- {
- UltraGridRow row = ultraGridhJ.ActiveRow;
- if (row == null) return;
- ultraGridhJ.UpdateData();
- if (e.Cell.Column.Key.Equals("ItemCode"))
- {
- if (!e.Cell.Row.Cells["ItemCode"].Text.ToString().Equals(""))
- {
- e.Cell.Row.Cells["ItemCode"].Value = e.Cell.Value.ToString();
- e.Cell.Row.Cells["ItemName"].Value = e.Cell.Text.ToString();
- DataTable dt = ServerHelper.GetData("com.steering.pss.plnsaleord.steelMarkingPlan.FrmSteelProcessCard.queryLgtHjGrae", new object[] { gradCode, e.Cell.Value.ToString() }, ob);
- if (dt.Rows.Count > 0)
- {
- e.Cell.Row.Cells["InputAmount"].Value = dt.Rows[0]["INPUT_AMOUNT"].ToString();
- }
- else
- {
- e.Cell.Row.Cells["InputAmount"].Value = "0";
- }
- }
- int count = 0;
- foreach (UltraGridRow urg in ultraGridhJ.Rows)
- {
- if (e.Cell.Row.Cells["ItemCode"].Value.Equals(urg.Cells["ItemCode"].Value.ToString()))
- {
- count++;
- if (count > 1)
- {
- MessageUtil.ShowTips("一个工艺卡下对应的合金物料不能重复!");
- e.Cell.Row.Cells["ItemCode"].Value = null;
- e.Cell.Row.Cells["ItemName"].Value = null;
- e.Cell.Row.Cells["InputAmount"].Value = null;
- return;
- }
- }
- }
- }
- if (listHj != null)
- {
- listHj.Change((CraftLg2AlloyEntity)e.Cell.Row.ListObject);
- }
- }
- #endregion
- private DataTable _data1;
- private void ultraGrid2_AfterRowActivate(object sender, EventArgs e)
- {
- UltraGridRow row = ultraGrid2.ActiveRow;
- if (row == null) return;
- ultraGrid2.UpdateData();
- _data1 = SteelHelper.GetNewDataTable(dtCicAll, "CIC='" + row.Cells["CIC"].Text.ToString() + "'", "CHEMCODE ASC");
- //_data1 = dataTable2.AsEnumerable().Where(p => p["CIC"] == row.Cells["CIC"].Text.ToString()).ConvertToDataTable();
- listCic =SteelHelper.GetModelByDt<CraftLg2CicEntity>(_data1);
- listCic.AcceptChanges();
- CraftLg2CicEntityBindingSource.DataSource = listCic;
- int count=1;
- foreach (UltraGridRow urg in ultraGridLgCic.Rows)
- {
- urg.Cells["CHC"].Value = true;
- urg.Cells["Xh"].Value = (decimal)count++;
- }
- queryComBaseCcm(row.Cells["CIC"].Text.ToString());
- //ultraGrid2.Refresh();
- //ultraGrid2.Update();
- }
- private void ultraGridLgM_InitializeRow(object sender, InitializeRowEventArgs e)
- {
- CraftLg2MEntity CraftLg2MEntity = e.Row.ListObject as CraftLg2MEntity;
- if (CraftLg2MEntity != null && CraftLg2MEntity.Defaultcraft != "1" && CraftLg2MEntity.Defaultcraft != "默认")
- {
- e.Row.Cells["Defaultcraft"].IgnoreRowColActivation = true;
- e.Row.Cells["Defaultcraft"].EditorComponent = setDefault;
- }
- }
- private void setDefault_EditorButtonClick(object sender, EditorButtonEventArgs e)
- {
- string craftNo = ultraGridLgM.ActiveRow.Cells["CraftNo"].Text.ToString();
- if (craftNo.Equals(""))
- {
- MessageUtil.ShowTips("您选择炼钢工艺卡号未生成,请先保存!");
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.steelMarkingPlan.FrmSteelProcessCard";
- ccp.MethodName = "doSetDefault";
- ccp.ServerParams = new object[] { cic, craftNo, plineCodeA, gradCode, planRoute };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("设置成功!"))
- {
- QueryM();
- }
- }
- private void ultraGridLgCic_AfterRowInsert(object sender, RowEventArgs e)
- {
- e.Row.Cells["Newflag"].Value = "1";
- e.Row.Cells["Xh"].Value = (decimal)(e.Row.Index + 1);
- e.Row.Cells["CicGid"].Value = ultraGridLgM.ActiveRow.Cells["CicGid"].Value;
- }
- private void ultraGridLgCic_InitializeRow(object sender, InitializeRowEventArgs e)
- {
- if (e.Row.Cells["Newflag"].Value.ToString() == "1")
- {
- e.Row.Cells["ChemCode"].Activation = Activation.AllowEdit;
- e.Row.Cells["ChemCode"].IgnoreRowColActivation = true;
- e.Row.Cells["ChemCode"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
- e.Row.Cells["BIscheck"].Activation = Activation.AllowEdit;
- e.Row.Cells["BIscheck"].IgnoreRowColActivation = true;
- e.Row.Cells["BIscheck"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
- e.Row.Cells["BIsjudge"].Activation = Activation.AllowEdit;
- e.Row.Cells["BIsjudge"].IgnoreRowColActivation = true;
- e.Row.Cells["BIsjudge"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
- e.Row.Cells["BIsquote"].Activation = Activation.AllowEdit;
- e.Row.Cells["BIsquote"].IgnoreRowColActivation = true;
- e.Row.Cells["BIsquote"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
- e.Row.Cells["Xh"].Style = ColumnStyle.EditButton;
- }
- }
- private void ultraGridLgCic_ClickCellButton(object sender, CellEventArgs e)
- {
- e.Cell.Row.Delete(false);
- }
- private void utlCopy_EditorButtonClick(object sender, EditorButtonEventArgs e)
- {
- using (FrmSteelProcessSelect FrmSteelProcessSelect = new FrmSteelProcessSelect(ultraGrid2.ActiveRow.Cells[0].Text,ob))
- {
- if (FrmSteelProcessSelect.ShowDialog() == DialogResult.OK)
- {
- QueryLgCic(FrmSteelProcessSelect.CraftLg2MEntity.CicGid);
- }
- }
-
- }
- private void ultraGrid2_InitializeRow(object sender, InitializeRowEventArgs e)
- {
- if (e.Row.Cells[0].Text != "" && !e.Row.Cells[0].Text.Contains(","))
- {
- e.Row.Cells[0].EditorComponent = utlCopy;
- e.Row.Cells[0].IgnoreRowColActivation = true;
- }
- }
-
-
- }
- }
|