| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864 |
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.PlnSaleOrd.BaseMethod;
- using Core.StlMes.Client.PlnSaleOrd.工序排产;
- using Core.StlMes.Client.PlnSaleOrd.工序排产.entity;
- using Core.StlMes.Client.PlnSaleOrd.炼钢计划;
- using Core.StlMes.Client.PlnSaleOrd.炉计划.Entity;
- using Core.StlMes.Client.PlnSaleOrd.炉计划.Tool;
- using CoreFS.CA06;
- 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;
- namespace Core.StlMes.Client.PlnSaleOrd.炉计划
- {
- public partial class FrmEndLibrary : FrmBase
- {
- private string[] plineCode = null;//获取产线代码
- public delegate int MyDelegate(int number);
- public FrmEndLibrary()
- {
- InitializeComponent();
- }
- private string proessCode = "";
- private void FrmEndLibrary_Load(object sender, EventArgs e)
- {
- EntityHelper.ShowGridCaption<MatBcMEntityEnd>(ultraGridChoose.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<MatBcTrackEntity>(entityGrid1.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<QcmBcJudgeChangeEntity>(entityGrid3.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<PlnOrderZgSOEntityGp>(ultraGridZgS.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<PlnOrderDbkSOEntity>(ultraGridDbks.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<PlnOrderRclSOEntity>(ultraGridRcls.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<PlnOrderJgxSOEntity>(ultraGridJgxs.DisplayLayout.Bands[0]);
- SteelHelper.InitGrade(comGrade, this.ob);
- BaseHelper.setOtherColumnReadOnly(ultraGridChoose, new string[] { "CHC", "TakeCount" });
- BaseHelper.InitCellPosition(ultraGridChoose, new string[] { "ActTheoryWeight", "ActWeight", "ActCount", "ActLen" });
- BaseHelper.GridColumnSum(ultraGridChoose, new string[] { "ActWeight", "ActTheoryWeight" });
- BaseHelper.GridColumnCount(ultraGridChoose, new string[] { "ActCount" });
- BaseHelper.setUltraGridColumnMaxInput(ultraGridChoose, new string[] { "ActTheoryWeight", "ActWeight" });
- BaseHelper.setUltraGridColumnBits(ultraGridChoose, new string[] { "ActCount" });
- //BaseHelper.ForbidSort(ultraGridChoose);
- BaseHelper.setColumnBackColor(ultraGridChoose, new string[] { "SpecCic" });
- ultraTabControl1.Tabs[0].Visible = false;
- ultraTabControl1.Tabs[1].Visible = false;
- ultraTabControl1.Tabs[2].Visible = false;
- ultraTabControl1.Tabs[3].Visible = false;
- if (CustomInfo.Equals("D"))//查询轧管可利库
- {
- proessCode = "D";
- plineCode = PlanHelper.InitDropPlinePower("D", txtbelong, this.ValidDataPurviewIds, this.ob);
- }
- else if (CustomInfo.Equals("E"))//查询镦拔扩可利库
- {
- proessCode = "E";
- plineCode = PlanHelper.InitDropPlinePower("E", txtbelong, this.ValidDataPurviewIds, this.ob);
- }
- else if (CustomInfo.Equals("F"))//查询热处理可利库
- {
- proessCode = "F";
- plineCode = PlanHelper.InitDropPlinePower("F", txtbelong, this.ValidDataPurviewIds, this.ob);
- }
- else if (CustomInfo.Equals("G"))//查询加工线可利库
- {
- proessCode = "G";
- plineCode = PlanHelper.InitDropPlinePower("G", txtbelong, this.ValidDataPurviewIds, this.ob);
- }
- ultraGridChoose.DisplayLayout.Bands[0].Columns["SpecCic"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.EditButton;
- }
- private void chcGrade_CheckedChanged(object sender, EventArgs e)
- {
- if (Chcbelong.Checked) { txtbelong.Enabled = true; } else { txtbelong.Enabled = false; }
- if (chcGrade.Checked) { comGrade.Enabled = true; } else { comGrade.Enabled = false; }
- if (chcJudgeNo.Checked) { txtJudgeNo.Enabled = true; } else { txtJudgeNo.Enabled = false; }
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- base.ToolBar_Click(sender, ToolbarKey);
- switch (ToolbarKey)
- {
- case "Query":
- QueryAll();
- break;
- case "Liku": //利库
- Liku();
- break;
- case "Monomer": // 脱单
- Monomer();
- break;
- case "Sentence": // 物料改判
- doSentence();
- break;
- case"NoOrderSentence"://无合同改判
- doNoSentence();
- break;
- case "UnSentence": // 撤销物料改判
- doUnSentence();
- break;
- case "ReturnLine": // 返线
- doReturnLine();
- break;
- case "ProcessLk": // 跨工序利库
- doProcessLk();
- break;
- case "UpdateReq": // 修改转短节备料合同
- doUpdateReq();
- break;
- case "Export":
- ExportData();
- break;
- case "Close":
- this.Close();
- break;
- default:
- break;
- }
- }
- /// <summary>
- /// 导出
- /// </summary>
- private void ExportData()
- {
- if (ultraTabControl2.SelectedTab.Key == "0")
- {
- GridHelper.ulGridToExcel(ultraGridChoose, "半成品库存信息");
- }
- else if (ultraTabControl2.SelectedTab.Key == "1")
- {
- GridHelper.ulGridToExcel(entityGrid1, "脱单利库历史记录");
- }
- else if (ultraTabControl2.SelectedTab.Key == "2")
- {
- GridHelper.ulGridToExcel(entityGrid3, "改判历史记录");
- }
- }
- /// <summary>
- /// 无合同改判
- /// </summary>
- private void doNoSentence()
- {
- this.ultraGridChoose.UpdateData();
- IQueryable<UltraGridRow> checkMagRows = this.ultraGridChoose.Rows.AsQueryable().Where(" CHC = 'True'");
- if (checkMagRows.Count() == 0)
- {
- MessageUtil.ShowTips("请选择需要做无合同改判物料信息!");
- return;
- }
- if(checkMagRows.Count() >1)
- {
- MessageUtil.ShowTips("无合同改判时,只允许选择一条物料信息!");
- return;
- }
- int m = 0;
- MatBcMEntityEnd ydmTity = new MatBcMEntityEnd();
- foreach (UltraGridRow row in checkMagRows)
- {
- ydmTity = (MatBcMEntityEnd)row.ListObject;
- if (int.Parse(ydmTity.ActCount.ToString3()) < int.Parse(row.Cells["TakeCount"].Text.ToString3()))
- {
- m = m + 1;
- }
- }
- if(m > 0)
- {
- MessageUtil.ShowTips("改判支数不能大于库存支数!");
- return;
- }
- FrmNoOrderSentence frm = new FrmNoOrderSentence(this.ob, ydmTity);
- frm.ShowDialog();
- if (frm.flag.Equals("1"))
- {
- QueryAll();
- MessageUtil.ShowTips("改判成功!");
- }
- }
- /// <summary>
- /// 查询
- /// </summary>
- private void QueryAll()
- {
- #region 查询条件
- string belongCode = "";
- string gradeCode = "";
- string judgeNo = "";
- if (Chcbelong.Checked)
- {
- if (txtbelong.Text.ToString().Trim().Equals(""))
- {
- MessageUtil.ShowTips("请选择产线!");
- return;
- }
- else
- {
- belongCode = txtbelong.Value.ToString();
- }
- }
- if (chcGrade.Checked)
- {
- if (comGrade.Text.ToString().Trim().Equals(""))
- {
- MessageUtil.ShowTips("请选择钢种!");
- return;
- }
- else
- {
- gradeCode = comGrade.Value.ToString();
- }
- }
- if (chcJudgeNo.Checked)
- {
- if (txtJudgeNo.Text.ToString().Trim().Equals(""))
- {
- MessageUtil.ShowTips("请输入判定炉号!");
- return;
- }
- else
- {
- judgeNo = txtJudgeNo.Text.ToString();
- }
- }
- if (plineCode == null)
- {
- MessageUtil.ShowTips("该用户没有产线查看权限!");
- return;
- }
- #endregion
- if (ultraTabControl2.SelectedTab.Key.Equals("0"))
- {
- Query(belongCode, gradeCode, judgeNo);
- }
- else if (ultraTabControl2.SelectedTab.Key.Equals("1"))
- {
- QueryTrack(belongCode, gradeCode, judgeNo);
- }
- else
- {
- QueryQcmBcJude(judgeNo);
- }
- }
- /// <summary>
- /// 查询利库信息
- /// </summary>
- private void Query(string belongCode, string gradeCode, string judgeNo)
- {
- List<MatBcMEntityEnd> listSourceM = null;
- if (chcLen.Checked)
- {
- listSourceM = EntityHelper.GetData<MatBcMEntityEnd>
- ("com.steering.pss.plnsaleord.planStove.FrmEndLibrary.queryMaterial1", new object[] { belongCode, gradeCode, judgeNo, plineCode, proessCode }, ob);
- }
- else
- {
- listSourceM = EntityHelper.GetData<MatBcMEntityEnd>
- ("com.steering.pss.plnsaleord.planStove.FrmEndLibrary.queryMaterial", new object[] { belongCode, gradeCode, judgeNo, plineCode, proessCode }, ob);
-
- }
- matBcMEntityBindingSource.DataSource = listSourceM;
- GridHelper.RefreshAndAutoSize(ultraGridChoose);
- if (listSourceM.Count <= 0)
- {
- plnOrderZgSOEntityBindingSource.DataSource = new List<PlnOrderZgSOEntityGp>();
- plnOrderDbkSOEntityBindingSource.DataSource = new List<PlnOrderDbkSOEntity>();
- plnOrderRclSOEntityBindingSource.DataSource = new List<PlnOrderRclSOEntity>();
- plnOrderJgxSOEntityBindingSource.DataSource = new List<PlnOrderJgxSOEntity>();
- DataTable tab = new DataTable();
- GridHelper.CopyDataToDatatable(tab, dataTable2, true);
- }
- }
- /// <summary>
- /// 查询精整脱单利库记录
- /// </summary>
- /// <param name="belongCode"></param>
- /// <param name="gradeCode"></param>
- /// <param name="judgeNo"></param>
- private void QueryTrack(string belongCode, string gradeCode, string judgeNo)
- {
- List<MatBcTrackEntity> listSource = EntityHelper.GetData<MatBcTrackEntity>
- ("com.steering.pss.plnsaleord.planStove.FrmEndLibrary.queryMatGpTrack", new object[] { belongCode, gradeCode, judgeNo, plineCode, proessCode }, this.ob);
- matBcTrackEntityBindingSource.DataSource = listSource;
- GridHelper.RefreshAndAutoSize(entityGrid1);
- }
- /// <summary>
- /// 查询改判记录
- /// </summary>
- /// <param name="judgeNo"></param>
- private void QueryQcmBcJude(string judgeNo)
- {
- List<QcmBcJudgeChangeEntity> listSource = EntityHelper.GetData<QcmBcJudgeChangeEntity>
- ("com.steering.pss.plnsaleord.planStove.FrmEndLibrary.queryQcmBcJude", new object[] { judgeNo, proessCode }, this.ob);
- bindingSource1.DataSource = listSource;
- GridHelper.RefreshAndAutoSize(entityGrid3);
- }
- /// <summary>
- /// 脱单
- /// </summary>
- private void Monomer()
- {
- UltraGridRow row = ultraGridChoose.ActiveRow;
- if (row == null) return;
- ArrayList list1 = new ArrayList();
- int count = 0;
- foreach (UltraGridRow item in ultraGridChoose.Rows)
- {
- if (Convert.ToBoolean(item.Cells["CHC"].Text) == true)
- {
- count++;
- if (!item.Cells["JugdeApplyCode"].Text.ToString().Equals("") && !item.Cells["MatStatus"].Text.ToString().Contains("材料产出待判"))
- {
- MessageUtil.ShowTips("你选择的半成品物料已送判且不是材料产出未判,不能脱单!");
- return;
- }
- ArrayList list = new ArrayList();
- list.Add(item.Cells["JudgeStoveNo"].Text.ToString());
- list.Add(item.Cells["BatchNo"].Text.ToString());
- list.Add(item.Cells["BatchGroudNo"].Text.ToString());
- list.Add(item.Cells["TakeCount"].Value.ToString());
- list.Add(item.Cells["HeatPlanNoNext"].Text.ToString());
- list.Add(item.Cells["ProcessCdoe"].Text.ToString());
- list.Add(item.Cells["JugdeApplyCode"].Text.ToString());
- list.Add(item.Cells["ProOrderNo"].Text.ToString());
- list.Add(item.Cells["ActLen"].Text.ToString());
- list.Add(item.Cells["MatNo"].Text.ToString());
- list.Add(item.Cells["MaterialNo"].Text.ToString());
- list1.Add(list);
- }
- }
- if (count == 0)
- {
- MessageUtil.ShowTips("请选择库存信息!");
- return;
- }
- string lenFalg = "0";//不分组
- if (chcLen.Checked)
- {
- lenFalg = "1";//分组
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否确认脱单,脱单后不能利原合同!") ==
- DialogResult.No)
- return;
- PlanComm.WaitFromOpen(this.Cursor);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.planStove.FrmEndLibrary";
- ccp.MethodName = "doDeleteMonomerLg";
- ccp.ServerParams = new object[] { list1, this.UserInfo.GetUserName(), lenFalg };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- PlanComm.WaitFromColse(this.Cursor);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("脱单成功!"))
- {
- QueryAll();
- }
- }
-
- /// <summary>
- /// 利库
- /// </summary>
- private void Liku()
- {
- UltraGridRow row = ultraGridChoose.ActiveRow;
- if (row == null) return;
- double wt = 0;
- if (row.Cells["ActWeight"].Value.ToString().Equals("0"))
- {
- MessageUtil.ShowTips("您选择的判定炉号重量为零,不能利库!");
- return;
- }
- //if (!row.Cells["HeatPlanNoNext"].Text.ToString().Equals(""))
- //{
- // MessageUtil.ShowTips("您选择的判定炉号已挂下个工序订单,不能利库!");
- // return;
- //}
- if (!row.Cells["ProOrderNo"].Text.ToString().Equals(""))
- {
- MessageUtil.ShowTips("您选择的判定炉号已存在生产合同,不能利库!");
- return;
- }
- string porderstatus = "";//合同状态
- DataTable dt = ServerHelper.GetData("com.steering.pss.plnsaleord.processOrder.base.ProducHelper.doQueryPorderstatus", new object[] { row.Cells["OrdLnDlyPk"].Text.Trim() }, ob);
- if (dt.Rows.Count > 0)
- {
- porderstatus = dt.Rows[0]["PORDERSTATUS"].ToString();
- }
- if (porderstatus.Equals("4") || porderstatus.Equals("5"))
- {
- MessageUtil.ShowTips("该合同已生产完成或关闭,请联系销售!");
- return;
- }
- string specCic = row.Cells["SpecCic"].Text.ToString();
- int countCic = 0;
- if (specCic.Equals(""))
- {
- string gradeName = row.Cells["Gradename"].Text.ToString();
- string cic = row.Cells["Cic"].Text.ToString();
- UltraGridRow rowCic = entityGrid2.ActiveRow;
- //if (rowCic == null) return;
- //int countCic = 0;
- foreach (UltraGridRow item in entityGrid2.Rows)
- {
- if (item.Cells["GRADENAME"].Text.ToString().Equals(gradeName) && item.Cells["CIC"].Text.ToString().Equals(cic))
- {
- countCic++;
- }
- }
- }
-
- wt += double.Parse(row.Cells["ActWeight"].Value.ToString());
- ArrayList list = new ArrayList();
- string processCdoe=row.Cells["ProcessCdoe"].Text.ToString().Trim();
- list.Add(row.Cells["JudgeStoveNo"].Text.ToString());
- list.Add(row.Cells["BatchNo"].Value.ToString());
- list.Add(row.Cells["BatchGroudNo"].Value.ToString());
- list.Add(row.Cells["TakeCount"].Value.ToString());
- list.Add(row.Cells["ActWeight"].Value.ToString());
- list.Add(processCdoe);
- //list.Add(item.Cells["Gradecode"].Text.ToString());
- list.Add(row.Cells["MaterialNo"].Text.ToString());
- if (!specCic.Equals(""))
- {
- list.Add(row.Cells["SpecCic"].Text.ToString());
- }
- else
- {
- list.Add(row.Cells["Cic"].Text.ToString());
- specCic = row.Cells["Cic"].Text.ToString();
- }
- list.Add(row.Cells["ProOrderNo"].Text.ToString());
- list.Add(row.Cells["ActLen"].Text.ToString());
- list.Add(row.Cells["MatNo"].Text.ToString());
- if (processCdoe.Equals("D"))
- {
- doAddLibraryZg(list, countCic, specCic, "");
- // if (comPlanEndZg1.flag == true)
- // {
- // QueryAll();
- // }
- }
- else if (processCdoe.Equals("E"))
- {
- doAddLibraryDbk(list,countCic, specCic);
- //if (comPlanEndDbk1.flag == true)
- //{
- // QueryAll();
- //}
- }
- else if (processCdoe.Equals("F"))
- {
- doAddLibraryRcl(list, countCic, specCic);
- //if (comPlanEndRcl1.flag == true)
- //{
- // QueryAll();
- //}
- }
- else if (processCdoe.Equals("G"))
- {
- doAddLibraryJgx(list, countCic,specCic);
- //if (comPlanEndJgx1.flag == true)
- //{
- // QueryAll();
- //}
- }
- }
- /// <summary>
- /// 跨工序利库
- /// </summary>
- private void doProcessLk()
- {
- UltraGridRow row = ultraGridChoose.ActiveRow;
- if (row == null) return;
- double wt = 0;
- if (row.Cells["ActWeight"].Value.ToString().Equals("0"))
- {
- MessageUtil.ShowTips("您选择的判定炉号重量为零,不能利库!");
- return;
- }
- //if (!row.Cells["HeatPlanNoNext"].Text.ToString().Equals(""))
- //{
- // MessageUtil.ShowTips("您选择的判定炉号已挂下个工序订单,不能利库!");
- // return;
- //}
- if (!row.Cells["ProOrderNo"].Text.ToString().Equals(""))
- {
- MessageUtil.ShowTips("您选择的判定炉号已存在生产合同,不能利库!");
- return;
- }
- string porderstatus = "";//合同状态
- DataTable dt = ServerHelper.GetData("com.steering.pss.plnsaleord.processOrder.base.ProducHelper.doQueryPorderstatus", new object[] { row.Cells["OrdLnDlyPk"].Text.Trim() }, ob);
- if (dt.Rows.Count > 0)
- {
- porderstatus = dt.Rows[0]["PORDERSTATUS"].ToString();
- }
- if (porderstatus.Equals("4") || porderstatus.Equals("5"))
- {
- MessageUtil.ShowTips("该合同已生产完成或关闭,请联系销售!");
- return;
- }
- string specCic = row.Cells["SpecCic"].Text.ToString();
- int countCic = 0;
- if (specCic.Equals(""))
- {
- string gradeName = row.Cells["Gradename"].Text.ToString();
- string cic = row.Cells["Cic"].Text.ToString();
- UltraGridRow rowCic = entityGrid2.ActiveRow;
- if (rowCic == null) return;
- //int countCic = 0;
- foreach (UltraGridRow item in entityGrid2.Rows)
- {
- if (item.Cells["GRADENAME"].Text.ToString().Equals(gradeName) && item.Cells["CIC"].Text.ToString().Equals(cic))
- {
- countCic++;
- }
- }
- }
- wt += double.Parse(row.Cells["ActWeight"].Value.ToString());
- ArrayList list = new ArrayList();
- string processCdoe = "D";//row.Cells["ProcessCdoe"].Text.ToString().Trim();
- list.Add(row.Cells["JudgeStoveNo"].Text.ToString());
- list.Add(row.Cells["BatchNo"].Value.ToString());
- list.Add(row.Cells["BatchGroudNo"].Value.ToString());
- list.Add(row.Cells["TakeCount"].Value.ToString());
- list.Add(row.Cells["ActWeight"].Value.ToString());
- list.Add(processCdoe);
- //list.Add(item.Cells["Gradecode"].Text.ToString());
- list.Add(row.Cells["MaterialNo"].Text.ToString());
- if (!specCic.Equals(""))
- {
- list.Add(row.Cells["SpecCic"].Text.ToString());
- }
- else
- {
- list.Add(row.Cells["Cic"].Text.ToString());
- }
- list.Add(row.Cells["ProOrderNo"].Text.ToString());
- list.Add(row.Cells["ActLen"].Text.ToString());
- list.Add(row.Cells["MatNo"].Text.ToString());
- if (processCdoe.Equals("D"))
- {
- doAddLibraryZg(list, countCic, specCic,"1");
- // if (comPlanEndZg1.flag == true)
- // {
- // QueryAll();
- // }
- }
- else if (processCdoe.Equals("E"))
- {
- doAddLibraryDbk(list, countCic, specCic);
- //if (comPlanEndDbk1.flag == true)
- //{
- // QueryAll();
- //}
- }
- else if (processCdoe.Equals("F"))
- {
- doAddLibraryRcl(list, countCic, specCic);
- //if (comPlanEndRcl1.flag == true)
- //{
- // QueryAll();
- //}
- }
- else if (processCdoe.Equals("G"))
- {
- doAddLibraryJgx(list, countCic, specCic);
- //if (comPlanEndJgx1.flag == true)
- //{
- // QueryAll();
- //}
- }
- }
- /// <summary>
- /// 返线
- /// </summary>
- private void doReturnLine()
- {
- UltraGridRow row = ultraGridChoose.ActiveRow;
- if (row == null) return;
- double wt = 0;
- if (row.Cells["TakeCount"].Value.ToString().Equals("0"))
- {
- MessageUtil.ShowTips("您选择的脱单/利库支为零,不能返线!");
- return;
- }
- string porderstatus = "";//合同状态
- DataTable dt = ServerHelper.GetData("com.steering.pss.plnsaleord.processOrder.base.ProducHelper.doQueryPorderstatus", new object[] { row.Cells["OrdLnDlyPk"].Text.Trim() }, ob);
- if (dt.Rows.Count > 0)
- {
- porderstatus = dt.Rows[0]["PORDERSTATUS"].ToString();
- }
- if (porderstatus.Equals("4") || porderstatus.Equals("5"))
- {
- MessageUtil.ShowTips("该合同已生产完成或关闭,请联系销售!");
- return;
- }
- int countCic = 0;
- string gradeName = row.Cells["Gradename"].Text.ToString();
- string cic = row.Cells["Cic"].Text.ToString();
- UltraGridRow rowCic = entityGrid2.ActiveRow;
- //if (rowCic == null) return;
- //int countCic = 0;
- foreach (UltraGridRow item in entityGrid2.Rows)
- {
- if (item.Cells["GRADENAME"].Text.ToString().Equals(gradeName) && item.Cells["CIC"].Text.ToString().Equals(cic))
- {
- countCic++;
- }
- }
- ArrayList list = new ArrayList();
- string processCdoe = row.Cells["ProcessCdoe"].Text.ToString().Trim();
- list.Add(row.Cells["JudgeStoveNo"].Text.ToString());
- list.Add(row.Cells["BatchNo"].Value.ToString());
- list.Add(row.Cells["BatchGroudNo"].Value.ToString());
- list.Add(row.Cells["TakeCount"].Value.ToString());
- list.Add(row.Cells["ActWeight"].Value.ToString());
- list.Add(processCdoe);
- list.Add(row.Cells["OnProOrderId"].Value.ToString());
- list.Add(row.Cells["HeatPlanNoOld"].Value.ToString());
- list.Add(row.Cells["HeatPlanNo"].Value.ToString());
- list.Add(row.Cells["ProOrderNo"].Text.ToString());
- list.Add(row.Cells["ActLen"].Text.ToString());
- list.Add(row.Cells["MaterialNo"].Text.ToString());
- if (processCdoe.Equals("F"))
- {
- string pointGx = "";
- string plineName = "";
- FrmReturnCon line = new FrmReturnCon(plineName, ob, "6002");
- //FrmReturnCon line = new FrmReturnCon(plineCode, ob, "6002");
- line.ShowDialog();
- if (line.DialogResult == System.Windows.Forms.DialogResult.OK)
- {
- //获取弹出窗体的属性值
- pointGx = line.RetPro;
- }
- else
- {
- //MessageUtil.ShowTips("请选择返线经过工序点!");
- return;
- }
- list.Add(pointGx);
- list.Add(this.UserInfo.GetUserOrder());
- list.Add(this.UserInfo.GetUserGroup());
- list.Add(row.Cells["HeatPlanNoNext"].Value.ToString());
- doAddLibraryRclFx(list);
- }
- else if (processCdoe.Equals("G"))
- {
- list.Add("");
- list.Add(this.UserInfo.GetUserOrder());
- list.Add(this.UserInfo.GetUserGroup());
- list.Add(row.Cells["HeatPlanNoNext"].Value.ToString());
- doAddLibraryJgxFx(list);
- }
- else if (processCdoe.Equals("E"))
- {
- list.Add("");
- list.Add(this.UserInfo.GetUserOrder());
- list.Add(this.UserInfo.GetUserGroup());
- list.Add(row.Cells["HeatPlanNoNext"].Value.ToString());
- doAddLibraryDbkFx(list);
- }
-
- }
- /// <summary>
- ///镦拔扩炉计划返线
- /// </summary>
- /// <param name="list"></param>
- public void doAddLibraryDbkFx(ArrayList list)
- {
- UltraGridRow row = ultraGridDbks.ActiveRow;
- if (row == null) return;
- int count = 0;
- string proPlanId = "";
- string gxPlanNo = "";
- foreach (UltraGridRow ugr in ultraGridDbks.Rows)
- {
- if (Convert.ToBoolean(ugr.Cells["CHC"].Text) == true)
- {
- count++;
- proPlanId = ugr.Cells["ProPlanId"].Value.ToString();
- gxPlanNo = ugr.Cells["GxPlanNo"].Value.ToString();
- }
- }
- if (count == 0 || count > 1)
- {
- MessageUtil.ShowTips("请选择一个镦拔扩订单!");
- return;
- }
- string lenFalg = "0";//不分组
- if (chcLen.Checked)
- {
- lenFalg = "1";//分组
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否确认返线?") ==
- DialogResult.No)
- return;
- PlanComm.WaitFromOpen(this.Cursor);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.planStove.FrmEndLibrary";
- ccp.MethodName = "doReturnLine";
- ccp.ServerParams = new object[] { list, this.UserInfo.GetUserName(), proPlanId, gxPlanNo, lenFalg };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- PlanComm.WaitFromColse(this.Cursor);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("返线成功!"))
- {
- QueryAll();
- }
- }
- /// <summary>
- /// 加工线炉计划返线
- /// </summary>
- /// <param name="list"></param>
- public void doAddLibraryJgxFx(ArrayList list)
- {
- UltraGridRow row = ultraGridJgxs.ActiveRow;
- if (row == null) return;
- int count = 0;
- string proPlanId = "";
- string gxPlanNo = "";
- foreach (UltraGridRow ugr in ultraGridJgxs.Rows)
- {
- if (Convert.ToBoolean(ugr.Cells["CHC"].Text) == true)
- {
- count++;
- proPlanId = ugr.Cells["ProPlanId"].Value.ToString();
- gxPlanNo = ugr.Cells["GxPlanNo"].Value.ToString();
- }
- }
- if (count == 0 || count > 1)
- {
- MessageUtil.ShowTips("请选择一个加工线订单!");
- return;
- }
- string lenFalg = "0";//不分组
- if (chcLen.Checked)
- {
- lenFalg = "1";//分组
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否确认返线?") ==
- DialogResult.No)
- return;
- PlanComm.WaitFromOpen(this.Cursor);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.planStove.FrmEndLibrary";
- ccp.MethodName = "doReturnLine";
- ccp.ServerParams = new object[] { list, this.UserInfo.GetUserName(), proPlanId, gxPlanNo, lenFalg};
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- PlanComm.WaitFromColse(this.Cursor);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("返线成功!"))
- {
- QueryAll();
- }
- }
- /// <summary>
- /// 热处理返线
- /// </summary>
- /// <param name="list"></param>
- public void doAddLibraryRclFx(ArrayList list)
- {
- UltraGridRow row = ultraGridRcls.ActiveRow;
- if (row == null) return;
- int count = 0;
- string proPlanId = "";
- string gxPlanNo = "";
- foreach (UltraGridRow ugr in ultraGridRcls.Rows)
- {
- if (Convert.ToBoolean(ugr.Cells["CHC"].Text) == true)
- {
- count++;
- proPlanId = ugr.Cells["ProPlanId"].Value.ToString();
- gxPlanNo = ugr.Cells["GxPlanNo"].Value.ToString();
- }
- }
- if (count == 0 || count > 1)
- {
- MessageUtil.ShowTips("请选择一个热处理订单!");
- return;
- }
- string lenFalg = "0";//不分组
- if (chcLen.Checked)
- {
- lenFalg = "1";//分组
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否确认返线?") ==
- DialogResult.No)
- return;
- PlanComm.WaitFromOpen(this.Cursor);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.planStove.FrmEndLibrary";
- ccp.MethodName = "doReturnLine";
- ccp.ServerParams = new object[] { list, this.UserInfo.GetUserName(), proPlanId, gxPlanNo, lenFalg };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- PlanComm.WaitFromColse(this.Cursor);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("返线成功!"))
- {
- QueryAll();
- }
- }
- /// <summary>
- /// 物料改判
- /// </summary>
- private void doSentence()
- {
- UltraGridRow row = ultraGridChoose.ActiveRow;
- if (row == null) return;
- double wt = 0;
- if (row.Cells["ActWeight"].Value.ToString().Equals("0"))
- {
- MessageUtil.ShowTips("您选择的判定炉号重量为零,不能改判!");
- return;
- }
- /* if (!row.Cells["HeatPlanNoNext"].Text.ToString().Equals(""))
- {
- MessageUtil.ShowTips("您选择的判定炉号已挂下个工序订单,不能改判!");
- return;
- }*/
- //if (!row.Cells["ProOrderNo"].Text.ToString().Equals(""))
- //{
- // MessageUtil.ShowTips("您选择的判定炉号已存在生产合同,不能改判!");
- // return;
- //}
- //string specCic = row.Cells["SpecCic"].Text.ToString();
- //int countCic = 0;
- //if (specCic.Equals(""))
- //{
- // string gradeName = row.Cells["Gradename"].Text.ToString();
- // string cic = row.Cells["Cic"].Text.ToString();
- // UltraGridRow rowCic = entityGrid2.ActiveRow;
- // if (rowCic == null) return;
- // //int countCic = 0;
- // foreach (UltraGridRow item in entityGrid2.Rows)
- // {
- // if (item.Cells["GRADENAME"].Text.ToString().Equals(gradeName) && item.Cells["CIC"].Text.ToString().Equals(cic))
- // {
- // countCic++;
- // }
- // }
- //}
- wt += double.Parse(row.Cells["ActWeight"].Value.ToString());
- ArrayList list = new ArrayList();
- string processCdoe = row.Cells["ProcessCdoe"].Text.ToString().Trim();
- list.Add(row.Cells["JudgeStoveNo"].Text.ToString());
- list.Add(row.Cells["BatchNo"].Value.ToString());
- list.Add(row.Cells["BatchGroudNo"].Value.ToString());
- list.Add(row.Cells["TakeCount"].Value.ToString());
- list.Add(row.Cells["ActWeight"].Value.ToString());
- list.Add(processCdoe);
- //list.Add(item.Cells["Gradecode"].Text.ToString());
- list.Add(row.Cells["MaterialNo"].Text.ToString());
- //if (!specCic.Equals(""))
- //{
- // list.Add(row.Cells["SpecCic"].Text.ToString());
- //}
- //else
- //{
- // list.Add(row.Cells["Cic"].Text.ToString());
- //}
- list.Add(row.Cells["ProOrderNo"].Text.ToString());
- list.Add(row.Cells["ActLen"].Text.ToString());
- string judgeId = row.Cells["JudgeId"].Text.ToString();
- if (!judgeId.Equals(""))
- {
- if (MessageUtil.ShowYesNoAndQuestion("选中的炉号已物料改判,是否继续改判!") ==
- DialogResult.No)
- return;
- }
- if (processCdoe.Equals("D"))
- {
- doSentenceZg(list);
- //if (comPlanEndZg1.flag == true)
- //{
- // QueryAll();
- //}
- }
- else if (processCdoe.Equals("E"))
- {
- doSentenceDbk(list);
- //if (comPlanEndDbk1.flag == true)
- //{
- // QueryAll();
- //}
- }
- else if (processCdoe.Equals("F"))
- {
- doSentenceRcl(list);
- //if (comPlanEndRcl1.flag == true)
- //{
- // QueryAll();
- //}
- }
- else if (processCdoe.Equals("G"))
- {
- doSentenceJgx(list);
- //if (comPlanEndJgx1.flag == true)
- //{
- // QueryAll();
- //}
- }
- }
- /// <summary>
- /// 撤销物料改判
- /// </summary>
- private void doUnSentence()
- {
- UltraGridRow row = ultraGridChoose.ActiveRow;
- if (row == null) return;
- ArrayList list1 = new ArrayList();
- int count = 0;
- foreach (UltraGridRow item in ultraGridChoose.Rows)
- {
- if (Convert.ToBoolean(item.Cells["CHC"].Text) == true)
- {
- count++;
- string judgeId = row.Cells["JudgeId"].Text.ToString();
- if (judgeId.Equals(""))
- {
- MessageUtil.ShowTips("选中的炉号未物料改判,不能撤销改判!");
- return;
- }
- if (!item.Cells["JugdeApplyCode"].Text.ToString().Equals("") && !item.Cells["MatStatus"].Text.ToString().Equals("材料产出(已判定)"))
- {
- MessageUtil.ShowTips("你选择的半成品物料已送判且不是材料产出已判,不能撤销改判!");
- return;
- }
- /*if (!row.Cells["HeatPlanNoNext"].Text.ToString().Equals(""))
- {
- MessageUtil.ShowTips("您选择的判定炉号已挂下个工序订单,不能撤销改判!");
- return;
- }*/
- ArrayList list = new ArrayList();
- list.Add(item.Cells["JudgeStoveNo"].Text.ToString());
- list.Add(item.Cells["BatchNo"].Text.ToString());
- list.Add(item.Cells["BatchGroudNo"].Text.ToString());
- list.Add(item.Cells["TakeCount"].Text.ToString());
- list.Add(item.Cells["HeatPlanNoNext"].Text.ToString());
- list.Add(item.Cells["ProcessCdoe"].Text.ToString());
- list.Add(item.Cells["JugdeApplyCode"].Text.ToString());
- list.Add(item.Cells["JudgeId"].Text.ToString());
- list.Add(item.Cells["ProOrderNo"].Text.ToString());
- list.Add(item.Cells["ActLen"].Text.ToString());
- list.Add(item.Cells["MaterialNo"].Text.ToString());
- list1.Add(list);
- }
- }
- if (count == 0)
- {
- MessageUtil.ShowTips("请选择库存信息!");
- return;
- }
- string lenFalg = "0";//不分组
- if (chcLen.Checked)
- {
- lenFalg = "1";//分组
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否确认撤销改判!") ==
- DialogResult.No)
- return;
- PlanComm.WaitFromOpen(this.Cursor);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.planStove.FrmEndLibrary";
- ccp.MethodName = "doUnSentence";
- ccp.ServerParams = new object[] { list1, this.UserInfo.GetUserName(), lenFalg };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- PlanComm.WaitFromColse(this.Cursor);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("撤销改判成功!"))
- {
- QueryAll();
- }
- }
- ///
- private void doUpdateReq()
- {
- }
- DataTable dtCic = new DataTable();
-
-
- /// <summary>
- /// 查询工艺评审CIC
- /// </summary>
- /// <param name="ordLnDlyPk"></param>
- /// <param name="indexSeq"></param>
- /// <param name="carftSeq"></param>
- public void QueryCic(string ordLnDlyPk, string indexSeq, string carftSeq, string gradeName)
- {
- dtCic = ServerHelper.GetData("com.steering.pss.plnsaleord.planStove.StoveHelper.queryCic", new object[] { ordLnDlyPk, indexSeq, carftSeq },ob);
- DataRow[] datarows = dtCic.Select("GRADENAME = '" + gradeName + "'");
- DataTable tab = StoveHelper.ToDataTable(datarows);
- GridHelper.CopyDataToDatatable(tab, dataTable2, true);
- GridHelper.RefreshAndAutoSize(entityGrid2);
- foreach (UltraGridRow ugr in entityGrid2.Rows)
- {
- ugr.Cells["CHC"].Value = "指定";
- }
- }
- public void QueryCicAll(string ordLnDlyPk, string indexSeq, string carftSeq, string gradeName,OpeBase _ob)
- {
- //QueryCic(ordLnDlyPk, indexSeq, carftSeq, _ob);
-
- entityGrid2.UpdateData();
- DataRow[] datarows = dtCic.Select("GRADENAME = '" + gradeName + "'");
- DataTable tab = StoveHelper.ToDataTable(datarows);
- GridHelper.CopyDataToDatatable(ref tab, ref dataTable2, true);
- GridHelper.RefreshAndAutoSize(entityGrid2);
- foreach (UltraGridRow ugr in entityGrid2.Rows)
- {
- ugr.Cells["CHC"].Value = "指定";
- }
- entityGrid2.Refresh();
- entityGrid2.Update();
- //comPlanEndZg1.ordLnDlyPk = "";
- }
- private void ultraGridChoose_AfterRowActivate(object sender, EventArgs e)
- {
- UltraGridRow row = ultraGridChoose.ActiveRow;
- if (row == null) return;
- string processCode = row.Cells["ProcessCdoe"].Value.ToString();
- string materialNo= row.Cells["MaterialNo"].Text.ToString();
- string StoveNo = row.Cells["StoveNo"].Text.ToString();
- string gradeName = row.Cells["Gradename"].Text.ToString();
- if (processCode.Equals("D"))
- {
- ultraTabControl1.Tabs[0].Visible = true;
- ultraTabControl1.Tabs[1].Visible = false;
- ultraTabControl1.Tabs[2].Visible = false;
- ultraTabControl1.Tabs[3].Visible = false;
- //查询满足产出物料的订单信息
- QueryPlanZg(materialNo, StoveNo);
- //if (!comPlanEndZg1.ordLnDlyPk.Equals(""))
- //{
- // QueryCic(comPlanEndZg1.ordLnDlyPk, comPlanEndZg1.indexSeq, comPlanEndZg1.carftSeq);
- // string gradeName = row.Cells["Gradename"].Text.ToString();
- // entityGrid2.UpdateData();
- // DataRow[] datarows = dtCic.Select("GRADENAME = '" + gradeName + "'");
- // DataTable tab = StoveHelper.ToDataTable(datarows);
- // GridHelper.CopyDataToDatatable(tab, dataTable2, true);
- // GridHelper.RefreshAndAutoSize(entityGrid2);
- // foreach (UltraGridRow ugr in entityGrid2.Rows)
- // {
- // ugr.Cells["CHC"].Value = "指定";
- // }
- // entityGrid2.Refresh();
- // entityGrid2.Update();
- // comPlanEndZg1.ordLnDlyPk = "";
- //}
- //else
- //{
- // DataTable tab = new DataTable();
- // GridHelper.CopyDataToDatatable(tab, dataTable2, true);
- //}
- }
- else if (processCode.Equals("E"))
- {
- ultraTabControl1.Tabs[0].Visible = false;
- ultraTabControl1.Tabs[1].Visible = true;
- ultraTabControl1.Tabs[2].Visible = false;
- ultraTabControl1.Tabs[3].Visible = false;
- QueryPlanDbk(materialNo, StoveNo);
- //if (!comPlanEndDbk1.ordLnDlyPk.Equals(""))
- //{
- // QueryCic(comPlanEndDbk1.ordLnDlyPk, comPlanEndDbk1.indexSeq, comPlanEndDbk1.carftSeq);
- // string gradeName = row.Cells["Gradename"].Text.ToString();
- // entityGrid2.UpdateData();
- // DataRow[] datarows = dtCic.Select("GRADENAME = '" + gradeName + "'");
- // DataTable tab = StoveHelper.ToDataTable(datarows);
- // GridHelper.CopyDataToDatatable(tab, dataTable2, true);
- // GridHelper.RefreshAndAutoSize(entityGrid2);
- // foreach (UltraGridRow ugr in entityGrid2.Rows)
- // {
- // ugr.Cells["CHC"].Value = "指定";
- // }
- // entityGrid2.Refresh();
- // entityGrid2.Update();
- // comPlanEndDbk1.ordLnDlyPk = "";
- //}
- //else
- //{
- // DataTable tab = new DataTable();
- // GridHelper.CopyDataToDatatable(tab, dataTable2, true);
- //}
- }
- else if (processCode.Equals("F"))
- {
- ultraTabControl1.Tabs[0].Visible = true;
- ultraTabControl1.Tabs[1].Visible = false;
- ultraTabControl1.Tabs[2].Visible = true;
- ultraTabControl1.Tabs[3].Visible = false;
- QueryPlanZg(materialNo, StoveNo);
- QueryPlanRcl(materialNo, StoveNo);
- //if (!comPlanEndRcl1.ordLnDlyPk.Equals(""))
- //{
- // QueryCic(comPlanEndRcl1.ordLnDlyPk, comPlanEndRcl1.indexSeq, comPlanEndRcl1.carftSeq);
- // string gradeName = row.Cells["Gradename"].Text.ToString();
- // entityGrid2.UpdateData();
- // DataRow[] datarows = dtCic.Select("GRADENAME = '" + gradeName + "'");
- // DataTable tab = StoveHelper.ToDataTable(datarows);
- // GridHelper.CopyDataToDatatable(tab, dataTable2, true);
- // GridHelper.RefreshAndAutoSize(entityGrid2);
- // foreach (UltraGridRow ugr in entityGrid2.Rows)
- // {
- // ugr.Cells["CHC"].Value = "指定";
- // }
- // entityGrid2.Refresh();
- // entityGrid2.Update();
- // comPlanEndRcl1.ordLnDlyPk = "";
- //}
- //else
- //{
- // DataTable tab = new DataTable();
- // GridHelper.CopyDataToDatatable(tab, dataTable2, true);
- //}
- }
- else if (processCode.Equals("G"))
- {
- ultraTabControl1.Tabs[0].Visible = false;
- ultraTabControl1.Tabs[1].Visible = false;
- ultraTabControl1.Tabs[2].Visible = false;
- ultraTabControl1.Tabs[3].Visible = true;
- QueryPlanJgx(materialNo, StoveNo);
- //if (!comPlanEndJgx1.ordLnDlyPk.Equals(""))
- //{
- // QueryCic(comPlanEndJgx1.ordLnDlyPk, comPlanEndJgx1.indexSeq, comPlanEndJgx1.carftSeq);
- // string gradeName = row.Cells["Gradename"].Text.ToString();
- // entityGrid2.UpdateData();
- // DataRow[] datarows = dtCic.Select("GRADENAME = '" + gradeName + "'");
- // DataTable tab = StoveHelper.ToDataTable(datarows);
- // GridHelper.CopyDataToDatatable(tab, dataTable2, true);
- // GridHelper.RefreshAndAutoSize(entityGrid2);
- // foreach (UltraGridRow ugr in entityGrid2.Rows)
- // {
- // ugr.Cells["CHC"].Value = "指定";
- // }
- // entityGrid2.Refresh();
- // entityGrid2.Update();
- // comPlanEndJgx1.ordLnDlyPk = "";
- //}
- //else
- //{
- // DataTable tab = new DataTable();
- // GridHelper.CopyDataToDatatable(tab, dataTable2, true);
- //}
- }
-
- }
- private void entityGrid2_ClickCellButton(object sender, CellEventArgs e)
- {
- UltraGridRow row = ultraGridChoose.ActiveRow;
- if (row == null) return;
- if (e.Cell.Column.Key.Equals("CHC"))
- {
- UltraGridRow rowCic = entityGrid2.ActiveRow;
- if (rowCic == null) return;
- row.Cells["SpecCic"].Value = rowCic.Cells["CIC"].Value.ToString();
- }
- }
- private void ultraGridChoose_ClickCellButton(object sender, CellEventArgs e)
- {
- UltraGridRow row = ultraGridChoose.ActiveRow;
- if (row == null) return;
- if (e.Cell.Column.Key.Equals("SpecCic"))
- {
- e.Cell.Row.Cells["SpecCic"].Value = "";
- }
- }
- #region 轧管订单
- /// <summary>
- /// 查询轧管订单信息
- /// </summary>
- public void QueryPlanZg(string materialNo, string gradecode)
- {
- List<PlnOrderZgSOEntityGp> listSource = EntityHelper.GetData<PlnOrderZgSOEntityGp>("com.steering.pss.plnsaleord.planStove.FrmEndLibrary.getPlnOrderZgS",
- new object[] { materialNo, gradecode, "D" }, ob);
- plnOrderZgSOEntityBindingSource.DataSource = listSource;
- //GridHelper.RefreshAndAutoSize(ultraGridZgS);
- foreach (UltraGridRow ugr in ultraGridZgS.Rows)
- {
- #region 赋值LJ,装炉,出库
- int numLj = 0;
- double wtLj = 0;
- if (!ugr.Cells["LjNum"].Text.Equals(""))
- {
- numLj = int.Parse(ugr.Cells["LjNum"].Value.ToString());
- wtLj = double.Parse(ugr.Cells["LjWeight"].Value.ToString());
- }
- int gpNum = 0;
- double gpWt = 0;
- if (!ugr.Cells["GpreqNum"].Text.Equals(""))
- {
- gpNum = int.Parse(ugr.Cells["GpreqNum"].Value.ToString());
- gpWt = double.Parse(ugr.Cells["GpreqWeight"].Value.ToString());
- }
- if (gpNum - numLj <= 0)
- {
- ugr.Cells["ReallNum"].Value = "0";
- ugr.Cells["ReallWt"].Value = "0";
- }
- else
- {
- ugr.Cells["ReallNum"].Value = (gpNum - numLj).ToString();
- ugr.Cells["ReallWt"].Value = (gpWt - wtLj).ToString("f3");
- }
- #endregion
- }
- plnOrderZgSOEntityBindingSource.DataSource = listSource.Where(w => w.ReallWt > 0).ToList();
- //if (listSource.Count == 0)
- //{
- // ordLnDlyPk = "";
- //}
- }
- /// <summary>
- /// 利库
- /// </summary>
- /// <param name="materialNo"></param>
- /// <param name="ob"></param>
- public void doAddLibraryZg(ArrayList list, int countCic, string specCic, string falg)
- {
- UltraGridRow row = ultraGridZgS.ActiveRow;
- if (row == null) return;
- int count = 0;
- string proPlanId = "";
- string gxPlanNo = "";
- foreach (UltraGridRow ugr in ultraGridZgS.Rows)
- {
- if (Convert.ToBoolean(ugr.Cells["CHC"].Text) == true)
- {
- count++;
- proPlanId = ugr.Cells["ProPlanId"].Value.ToString();
- gxPlanNo = ugr.Cells["GxPlanNo"].Value.ToString();
- }
- }
- if (count == 0 || count > 1)
- {
- MessageUtil.ShowTips("请选择一个轧管订单!");
- return;
- }
- if (specCic.Equals("") && countCic == 0)
- {
- MessageUtil.ShowTips("库存CIC在订单炼钢CIC集合里没有,请指定CIC!");
- return;
- }
- string lenFalg = "0";//不分组
- if (chcLen.Checked)
- {
- lenFalg = "1";//分组
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否确认利库?") ==
- DialogResult.No)
- return;
- PlanComm.WaitFromOpen(this.Cursor);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.planStove.FrmEndLibrary";
- ccp.MethodName = "doAddLibrary";
- ccp.ServerParams = new object[] { list, proPlanId, gxPlanNo, this.UserInfo.GetUserName(), "", falg, lenFalg };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- PlanComm.WaitFromColse(this.Cursor);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("利库成功!"))
- {
- QueryAll();
- }
- }
- /// <summary>
- /// 物料改判
- /// </summary>
- /// <param name="materialNo"></param>
- /// <param name="ob"></param>
- public void doSentenceZg(ArrayList list)
- {
- UltraGridRow row = ultraGridZgS.ActiveRow;
- if (row == null) return;
- int count = 0;
- string proPlanId = "";
- string gxPlanNo = "";
- foreach (UltraGridRow ugr in ultraGridZgS.Rows)
- {
- if (Convert.ToBoolean(ugr.Cells["CHC"].Text) == true)
- {
- count++;
- proPlanId = ugr.Cells["ProPlanId"].Value.ToString();
- gxPlanNo = ugr.Cells["GxPlanNo"].Value.ToString();
- }
- }
- if (count == 0 || count > 1)
- {
- MessageUtil.ShowTips("请选择一个轧管订单!");
- return;
- }
- string lenFalg = "0";//不分组
- if (chcLen.Checked)
- {
- lenFalg = "1";//分组
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否确认改判?") ==
- DialogResult.No)
- return;
- PlanComm.WaitFromOpen(this.Cursor);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.planStove.FrmEndLibrary";
- ccp.MethodName = "doSentence";
- ccp.ServerParams = new object[] { list, proPlanId, gxPlanNo, this.UserInfo.GetUserName(), lenFalg };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- PlanComm.WaitFromColse(this.Cursor);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("改判成功!"))
- {
- QueryAll();
- }
- }
- private void ultraGridZgS_AfterRowActivate(object sender, EventArgs e)
- {
- UltraGridRow row1 = ultraGridChoose.ActiveRow;
- if (row1== null) return;
- string gradeName = row1.Cells["Gradename"].Text.ToString();
- UltraGridRow row = ultraGridZgS.ActiveRow;
- if (row == null) return;
- string ordLnDlyPk = row.Cells["OrdLnDlyPk"].Value.ToString();
- string indexSeq = row.Cells["IndexSeq"].Value.ToString();
- string carftSeq = row.Cells["CraftSeq"].Value.ToString();
-
- QueryCic(ordLnDlyPk, indexSeq, carftSeq,gradeName);
- }
- #endregion
- #region 镦拔扩订单
- /// <summary>
- /// 查询订单信息
- /// </summary>
- public void QueryPlanDbk(string materialNo, string gradecode)
- {
- List<PlnOrderDbkSOEntity> listSource = EntityHelper.GetData<PlnOrderDbkSOEntity>("com.steering.pss.plnsaleord.planStove.FrmEndLibrary.getPlnOrderZgS",
- new object[] { materialNo, gradecode, "E" }, ob);
- plnOrderDbkSOEntityBindingSource.DataSource = listSource;
- GridHelper.RefreshAndAutoSize(ultraGridDbks);
- //plnOrderDbkSOEntityBindingSource.DataSource = listSource.Where(w => w.ReallWt > 0).ToList();
- //if (listSource.Count == 0)
- //{
- // ordLnDlyPk = "";
- //}
- }
- /// <summary>
- /// 利库
- /// </summary>
- /// <param name="materialNo"></param>
- /// <param name="ob"></param>
- public void doAddLibraryDbk(ArrayList list, int countCic, string specCic)
- {
- UltraGridRow row = ultraGridDbks.ActiveRow;
- if (row == null) return;
- int count = 0;
- string proPlanId = "";
- string gxPlanNo = "";
- foreach (UltraGridRow ugr in ultraGridDbks.Rows)
- {
- if (Convert.ToBoolean(ugr.Cells["CHC"].Text) == true)
- {
- count++;
- proPlanId = ugr.Cells["ProPlanId"].Value.ToString();
- gxPlanNo = ugr.Cells["GxPlanNo"].Value.ToString();
- }
- }
- if (count == 0 || count > 1)
- {
- MessageUtil.ShowTips("请选择一个镦拔扩订单!");
- return;
- }
- if (specCic.Equals("") && countCic == 0)
- {
- MessageUtil.ShowTips("库存CIC在订单炼钢CIC集合里没有,请指定CIC!");
- return;
- }
- string lenFalg = "0";//不分组
- if (chcLen.Checked)
- {
- lenFalg = "1";//分组
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否确认利库?") ==
- DialogResult.No)
- return;
- string planstatus = "";
- //var a = MessageUtil.ShowYesNoCancelAndQuestion("是否需要重新镦拔扩?");
- //if (a == DialogResult.Yes) { planstatus = "10"; } else if (a == DialogResult.No) { planstatus = "40"; } else { return; }
-
- PlanComm.WaitFromOpen(this.Cursor);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.planStove.FrmEndLibrary";
- ccp.MethodName = "doAddLibrary";
- ccp.ServerParams = new object[] { list, proPlanId, gxPlanNo, this.UserInfo.GetUserName(), planstatus, "", lenFalg };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- PlanComm.WaitFromColse(this.Cursor);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("利库成功!"))
- {
- QueryAll();
- }
- }
- /// <summary>
- /// 物料改判
- /// </summary>
- /// <param name="materialNo"></param>
- /// <param name="ob"></param>
- public void doSentenceDbk(ArrayList list)
- {
- UltraGridRow row = ultraGridDbks.ActiveRow;
- if (row == null) return;
- int count = 0;
- string proPlanId = "";
- string gxPlanNo = "";
- foreach (UltraGridRow ugr in ultraGridDbks.Rows)
- {
- if (Convert.ToBoolean(ugr.Cells["CHC"].Text) == true)
- {
- count++;
- proPlanId = ugr.Cells["ProPlanId"].Value.ToString();
- gxPlanNo = ugr.Cells["GxPlanNo"].Value.ToString();
- }
- }
- if (count == 0 || count > 1)
- {
- MessageUtil.ShowTips("请选择一个轧管订单!");
- return;
- }
- string lenFalg = "0";//不分组
- if (chcLen.Checked)
- {
- lenFalg = "1";//分组
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否确认改判?") ==
- DialogResult.No)
- return;
- PlanComm.WaitFromOpen(this.Cursor);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.planStove.FrmEndLibrary";
- ccp.MethodName = "doSentence";
- ccp.ServerParams = new object[] { list, proPlanId, gxPlanNo, this.UserInfo.GetUserName(), lenFalg };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- PlanComm.WaitFromColse(this.Cursor);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("改判成功!"))
- {
- QueryAll();
- }
- }
- private void ultraGridDbks_AfterRowActivate(object sender, EventArgs e)
- {
- UltraGridRow row1 = ultraGridChoose.ActiveRow;
- if (row1 == null) return;
- string gradeName = row1.Cells["Gradename"].Text.ToString();
- UltraGridRow row = ultraGridDbks.ActiveRow;
- if (row == null) return;
- string ordLnDlyPk = row.Cells["OrdLnDlyPk"].Value.ToString();
- string indexSeq = row.Cells["IndexSeq"].Value.ToString();
- string carftSeq = row.Cells["CraftSeq"].Value.ToString();
-
- QueryCic(ordLnDlyPk, indexSeq, carftSeq, gradeName);
- }
- #endregion
- #region 热处理
- /// <summary>
- /// 查询轧管订单信息
- /// </summary>
- public void QueryPlanRcl(string materialNo, string gradecode)
- {
- List<PlnOrderRclSOEntity> listSource = EntityHelper.GetData<PlnOrderRclSOEntity>("com.steering.pss.plnsaleord.planStove.FrmEndLibrary.getPlnOrderZgS",
- new object[] { materialNo, gradecode, "F" }, ob);
- plnOrderRclSOEntityBindingSource.DataSource = listSource;
- GridHelper.RefreshAndAutoSize(ultraGridRcls);
- //plnOrderRclSOEntityBindingSource.DataSource = listSource.Where(w => w.ReallWt > 0).ToList();
- //if (listSource.Count == 0)
- //{
- // ordLnDlyPk = "";
- //}
- }
- /// <summary>
- /// 利库
- /// </summary>
- /// <param name="materialNo"></param>
- /// <param name="ob"></param>
- public void doAddLibraryRcl(ArrayList list,int countCic, string specCic)
- {
- UltraGridRow row = ultraGridRcls.ActiveRow;
- if (row == null) return;
- int count = 0;
- string proPlanId = "";
- string gxPlanNo = "";
- foreach (UltraGridRow ugr in ultraGridRcls.Rows)
- {
- if (Convert.ToBoolean(ugr.Cells["CHC"].Text) == true)
- {
- count++;
- proPlanId = ugr.Cells["ProPlanId"].Value.ToString();
- gxPlanNo = ugr.Cells["GxPlanNo"].Value.ToString();
- }
- }
- if (count == 0 || count > 1)
- {
- MessageUtil.ShowTips("请选择一个热处理订单!");
- return;
- }
- if (specCic.Equals("") && countCic == 0)
- {
- MessageUtil.ShowTips("库存CIC在订单炼钢CIC集合里没有,请指定CIC!");
- return;
- }
- string lenFalg = "0";//不分组
- if (chcLen.Checked)
- {
- lenFalg = "1";//分组
- }
- //if (MessageUtil.ShowYesNoAndQuestion("是否确认利库?") ==
- // DialogResult.No)
- // return;
- string planstatus = "40";
- //var a = MessageUtil.ShowYesNoCancelAndQuestion("是否需要重新热处理?");
- //if (a == DialogResult.Yes) { planstatus = "10"; } else if (a == DialogResult.No) { planstatus = "40"; } else { return; }
- //
- PlanComm.WaitFromOpen(this.Cursor);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.planStove.FrmEndLibrary";
- ccp.MethodName = "doAddLibrary";
- ccp.ServerParams = new object[] { list, proPlanId, gxPlanNo, this.UserInfo.GetUserName(), planstatus, "", lenFalg };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- PlanComm.WaitFromColse(this.Cursor);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("利库成功!"))
- {
- QueryAll();
- }
- }
- /// <summary>
- /// 物料改判
- /// </summary>
- /// <param name="materialNo"></param>
- /// <param name="ob"></param>
- public void doSentenceRcl(ArrayList list)
- {
- UltraGridRow row = ultraGridRcls.ActiveRow;
- if (row == null) return;
- int count = 0;
- string proPlanId = "";
- string gxPlanNo = "";
- foreach (UltraGridRow ugr in ultraGridRcls.Rows)
- {
- if (Convert.ToBoolean(ugr.Cells["CHC"].Text) == true)
- {
- count++;
- proPlanId = ugr.Cells["ProPlanId"].Value.ToString();
- gxPlanNo = ugr.Cells["GxPlanNo"].Value.ToString();
- }
- }
- if (count == 0 || count > 1)
- {
- MessageUtil.ShowTips("请选择一个轧管订单!");
- return;
- }
- string lenFalg = "0";//不分组
- if (chcLen.Checked)
- {
- lenFalg = "1";//分组
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否确认改判?") ==
- DialogResult.No)
- return;
- PlanComm.WaitFromOpen(this.Cursor);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.planStove.FrmEndLibrary";
- ccp.MethodName = "doSentence";
- ccp.ServerParams = new object[] { list, proPlanId, gxPlanNo, this.UserInfo.GetUserName(), lenFalg };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- PlanComm.WaitFromColse(this.Cursor);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("改判成功!"))
- {
- QueryAll();
- }
- }
- private void ultraGridRcls_AfterRowActivate(object sender, EventArgs e)
- {
- UltraGridRow row1 = ultraGridChoose.ActiveRow;
- if (row1 == null) return;
- string gradeName = row1.Cells["Gradename"].Text.ToString();
- UltraGridRow row = ultraGridRcls.ActiveRow;
- if (row == null) return;
- string ordLnDlyPk = row.Cells["OrdLnDlyPk"].Value.ToString();
- string indexSeq = row.Cells["IndexSeq"].Value.ToString();
- string carftSeq = row.Cells["CraftSeq"].Value.ToString();
-
- QueryCic(ordLnDlyPk, indexSeq, carftSeq, gradeName);
- }
- #endregion
- #region 加工线
- /// <summary>
- /// 查询轧管订单信息
- /// </summary>
- public void QueryPlanJgx(string materialNo, string gradecode)
- {
- List<PlnOrderJgxSOEntity> listSource = EntityHelper.GetData<PlnOrderJgxSOEntity>("com.steering.pss.plnsaleord.planStove.FrmEndLibrary.getPlnOrderZgS",
- new object[] { materialNo, gradecode, "G" }, ob);
- plnOrderJgxSOEntityBindingSource.DataSource = listSource;
- GridHelper.RefreshAndAutoSize(entityGrid1);
- //plnOrderJgxSOEntityBindingSource.DataSource = listSource.Where(w => w.ReallWt > 0).ToList();
- //if (listSource.Count == 0)
- //{
- // ordLnDlyPk = "";
- //}
- }
- /// <summary>
- /// 利库
- /// </summary>
- /// <param name="materialNo"></param>
- /// <param name="ob"></param>
- public void doAddLibraryJgx(ArrayList list, int countCic, string specCic)
- {
- UltraGridRow row = ultraGridJgxs.ActiveRow;
- UltraGridRow row2 = ultraGridChoose.ActiveRow;
- if (row == null) return;
- int count = 0;
- string proPlanId = "";
- string gxPlanNo = "";
- foreach (UltraGridRow ugr in ultraGridJgxs.Rows)
- {
- if (Convert.ToBoolean(ugr.Cells["CHC"].Text) == true)
- {
- count++;
- proPlanId = ugr.Cells["ProPlanId"].Value.ToString();
- gxPlanNo = ugr.Cells["GxPlanNo"].Value.ToString();
- }
- }
- if (count == 0 || count > 1)
- {
- MessageUtil.ShowTips("请选择一个加工订单!");
- return;
- }
- if (specCic.Equals("") && countCic == 0)
- {
- MessageUtil.ShowTips("库存CIC在订单炼钢CIC集合里没有,请指定CIC!");
- return;
- }
- if (!row.Cells["PlineName"].Value.ToString().Equals(row2.Cells["PlineName"].Value.ToString()))
- {
- MessageUtil.ShowTips("生产产线不一样,不能利库!");
- return;
- }
- string lenFalg = "0";//不分组
- if (chcLen.Checked)
- {
- lenFalg = "1";//分组
- }
- string planstatus = "40";
- //var a = MessageUtil.ShowYesNoCancelAndQuestion("是否需要重新加工?");
- //if (a == DialogResult.Yes) { planstatus = "10"; } else if (a == DialogResult.No) { planstatus = "40"; } else { return; }
- PlanComm.WaitFromOpen(this.Cursor);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.planStove.FrmEndLibrary";
- ccp.MethodName = "doAddLibrary";
- ccp.ServerParams = new object[] { list, proPlanId, gxPlanNo, this.UserInfo.GetUserName(), planstatus, "", lenFalg };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- PlanComm.WaitFromColse(this.Cursor);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("利库成功!"))
- {
- QueryAll();
- }
- }
- /// <summary>
- /// 物料改判
- /// </summary>
- /// <param name="materialNo"></param>
- /// <param name="ob"></param>
- public void doSentenceJgx(ArrayList list)
- {
- UltraGridRow row = ultraGridJgxs.ActiveRow;
- if (row == null) return;
- int count = 0;
- string proPlanId = "";
- string gxPlanNo = "";
- foreach (UltraGridRow ugr in ultraGridJgxs.Rows)
- {
- if (Convert.ToBoolean(ugr.Cells["CHC"].Text) == true)
- {
- count++;
- proPlanId = ugr.Cells["ProPlanId"].Value.ToString();
- gxPlanNo = ugr.Cells["GxPlanNo"].Value.ToString();
- }
- }
- if (count == 0 || count > 1)
- {
- MessageUtil.ShowTips("请选择一个轧管订单!");
- return;
- }
- string lenFalg = "0";//不分组
- if (chcLen.Checked)
- {
- lenFalg = "1";//分组
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否确认改判?") ==
- DialogResult.No)
- return;
- PlanComm.WaitFromOpen(this.Cursor);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.planStove.FrmEndLibrary";
- ccp.MethodName = "doSentence";
- ccp.ServerParams = new object[] { list, proPlanId, gxPlanNo, this.UserInfo.GetUserName(), lenFalg };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- PlanComm.WaitFromColse(this.Cursor);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("改判成功!"))
- {
- QueryAll();
- }
- }
- private void ultraGridJgxs_AfterRowActivate(object sender, EventArgs e)
- {
- UltraGridRow row1 = ultraGridChoose.ActiveRow;
- if (row1 == null) return;
- string gradeName = row1.Cells["Gradename"].Text.ToString();
- UltraGridRow row = ultraGridJgxs.ActiveRow;
- if (row == null) return;
- string ordLnDlyPk = row.Cells["OrdLnDlyPk"].Value.ToString();
- string indexSeq = row.Cells["IndexSeq"].Value.ToString();
- string carftSeq = row.Cells["CraftSeq"].Value.ToString();
- QueryCic(ordLnDlyPk, indexSeq, carftSeq, gradeName);
- }
- #endregion
- private void ultraGridChoose_CellChange(object sender, CellEventArgs e)
- {
- UltraGridRow row = ultraGridChoose.ActiveRow;
- if (row == null) return;
- //利库/脱单支
- if (e.Cell.Column.Key.Equals("TakeCount"))
- {
- if (e.Cell.Row.Cells["TakeCount"].Value == null)
- {
- e.Cell.Row.Cells["TakeCount"].Value = "0";
- }
- else
- {
- ultraGridChoose.UpdateData();
- string hbConNum = e.Cell.Row.Cells["TakeCount"].Value.ToString();
- if (!StringUtil.IsInt(hbConNum) || hbConNum == "0")
- {
- e.Cell.Row.Cells["TakeCount"].Value = "0";
- }
- if (int.Parse(e.Cell.Row.Cells["TakeCount"].Value.ToString()) > int.Parse(e.Cell.Row.Cells["ActCount"].Value.ToString()))
- {
- e.Cell.Row.Cells["TakeCount"].Value = e.Cell.Row.Cells["ActCount"].Value.ToString();
-
- }
- }
- }
- }
- private void cmbMatBc_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
- {
- this.ultraGridChoose.UpdateData();
- UltraGridRow row = this.ultraGridChoose.ActiveRow;
- if (row == null)
- {
- return;
- }
- FrmMatNo frm = new FrmMatNo(row, ob);
- frm.ShowDialog();
- if (frm.flag.Equals("1"))
- {
- row.Cells["MatNo"].Value = frm.matNo.TrimEnd(new char[] { ',' }).ToString();
- row.Cells["ActCount"].Value = frm.count.ToString();
- }
- else
- {
- return;
- }
- }
- private void cheGaiPan_CheckedChanged(object sender, EventArgs e)
- {
- if (cheGaiPan.Checked) {
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.planStove.FrmEndLibrary";
- ccp.MethodName = "CheckGaiPan";
- ccp.ServerParams = new object[] { this.CustomInfo };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- }
|