| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using CoreFS.CA06;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Control;
- using Infragistics.Win.UltraWinGrid;
- using System.Collections;
- using com.steering.mes.mcp.entity;
- using Core.StlMes.Client.Mcp.Common;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.Mcp;
- using Core.StlMes.Client.Mcp.CollarMaterial;
- using Core.StlMes.Client.Mcp.Control;
- using Core.StlMes.Client.Mcp.Entity;
- using Core.StlMes.Client.Mcp.BaseMethod;
- using Core.StlMes.Client.Mcp.Coupling;
- using Core.StlMes.Client.Mcp.Report;
- namespace Core.StlMes.Client.Coup
- {
- public partial class FrmCoupLoading : FrmBase
- {
- private string departm="";//获取部门ID
- private string[] plineCode = null;//获取产线代码
- private string SlGx = "";//上料工序
- private string SLGxName = "";//上料名称
- public string LiXian = "";
- private string StrMemo = "";//备注
- private string[] plineCodes;
- public FrmCoupLoading()
- {
- InitializeComponent();
- this.IsLoadUserView = true;
- }
- protected override void OnLoad(EventArgs e)
- {
- base.OnLoad(e);
- //禁控件过滤
- // this.coupWoIdPlanControl1.Grid.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- // //设置计划区控件只读
- ////this.coupWoIdPlanControl1.SetAllColumnsActiveOnly();
- //coupWoIdPlanControl1.Ob = this.ob;
- }
- /// <summary>
- /// 初始化页面
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void FrmCoupLoading_Load(object sender, EventArgs e)
- {
- EntityHelper.ShowGridCaption<PlnZyJgWorkbillEntity>(ultraGridWoId.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<PlnZyJgWorkbillEntity>(ultraGrid1.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<CouplingLoadingResultEntity>(ultraGridLoad.DisplayLayout.Bands[0]);
- departm = UserInfo.GetDeptid();
- //plineCode = McpBaseHelper.GetPCodePline(departm,this.ob);
- plineCodes = comm.GetPlineCode(this.ValidDataPurviewIds, "H", ob);
- //获取工序
- DataTable dt2 = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getQueryGX", new object[] { "700301" }, this.ob);
- if (dt2.Rows.Count > 0)
- {
- SlGx = dt2.Rows[0]["BASECODE"].ToString();
- SLGxName = dt2.Rows[0]["BASENAME"].ToString();
- }
- ProTime.Value = DateTime.Today;
- txtBC.Value = this.UserInfo.GetUserOrder();
- txtBz.Value = this.UserInfo.GetUserGroup();
- txtUser.Text = this.UserInfo.GetUserName();
- BaseHelper.setOtherColumnReadOnly(ultraGridWoId, new string[] { "CHC", "CraftNoJg2" });
- BaseHelper.setUltraGridColumnMaxInput(ultraGridWoId, new string[] { "PlanBlWt", "RealBlWt", "OutWt" });
- BaseHelper.setUltraGridColumnBits(ultraGridWoId, new string[] { "PlanJgNum", "CsJgNum", "XqJgNum", "PlanBlNum", "RealBlNum", "OutNum" });
- BaseHelper.InitCellPosition(ultraGridWoId, new string[] { "PlanBlWt", "RealBlWt", "OutWt", "PlanJgNum", "CsJgNum", "XqJgNum", "PlanBlNum", "RealBlNum", "OutNum" });
- BaseHelper.GridColumnSum(ultraGridWoId, new string[] { "PlanBlWt", "RealBlWt", "OutWt" });
- BaseHelper.GridColumnCount(ultraGridWoId, new string[] { "PlanJgNum", "CsJgNum", "XqJgNum", "PlanBlNum", "RealBlNum", "OutNum" });
- }
-
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- QuerySinglePlan();
- break;
- case "Save":
- Save();
- break;
- case "Delete":
- DoDelete();
- break;
- case"Back"://回库
- doBack();
- break;
- case "CancelBack"://撤销回库
- CancelBack();
- break;
- case "Offline"://离线
- Offline();
- break;
- case "unOffline":
- unOffline();
- break;
- case "DoBeside"://结炉
- DoBeside();
- break;
- case "UndoBeside"://撤销结炉
- UndoBeside();
- break;
- case "Confirm":
- confirm();//确认
- break;
- case"CancelConfirm":
- cancelConfirm();
- break;
- case "Print":
- Print();
- break;
- case "Close":
- this.Close();
- break;
- }
- }
- /// <summary>
- /// 打印收料单
- /// </summary>
- private void Print()
- {
- this.ultraGridWoId.UpdateData();
- UltraGridRow uRow = this.ultraGridWoId.ActiveRow;
- if (uRow == null) return;
- string woId = uRow.Cells["WoId"].Text.Trim();
- string strurl = "";
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepJgConsignationForm.cpt" + "&WO_ID=" + woId;
- FrmRepExcel fBug = new FrmRepExcel(ob, strurl);
- fBug.AutoSize = true;
- fBug.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- fBug.WindowState = FormWindowState.Maximized;
- fBug.Text = "收料单";
- fBug.Show();
- }
- ///
- /// 取消确认
- ///
- private void cancelConfirm()
- {
- ultraGridLoad.UpdateData();
- UltraGridRow uRow = this.ultraGridLoad.ActiveRow;
- if (uRow == null) { MessageUtil.ShowTips("无上料实绩!"); return; }
- UltraGridRow row = this.ultraGridWoId.ActiveRow;
- if (row == null)
- {
- MessageUtil.ShowTips("无工单信息,不允许此操作!");
- }
- ArrayList list1 = new ArrayList();
- int UpdaCount = 0;
- foreach (UltraGridRow ugr in ultraGridLoad.Rows)
- {
- if (Convert.ToBoolean(ugr.Cells["CHECK"].Text) == true)
- {
- if (ugr.Cells["Confirm"].Value.ToString().Equals("0"))
- {
- MessageUtil.ShowTips("选中有没确认实绩,不允许取消确认!");
- return;
- }
- UpdaCount += 1;
- ArrayList list = new ArrayList();
- list.Add(ugr.Cells["ResultNo"].Text.ToString());
- list.Add(UserInfo.GetUserName());
- list.Add(DateTime.Now.ToString());
- list1.Add(list);
- }
- }
- if (UpdaCount == 0) { MessageUtil.ShowTips("请选择上料实绩数据!"); return; }
- if (MessageUtil.ShowYesNoAndQuestion("是否取消确认上料实绩?") == DialogResult.No)
- {
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- try
- {
- this.Cursor = Cursors.WaitCursor; //控制鼠标的样式为等待
- if (Constant.WaitingForm == null)
- {
- Constant.WaitingForm = new WaitingForm();
- }
- Constant.WaitingForm.ShowToUser = true;
- Constant.WaitingForm.Show();
- Constant.WaitingForm.Update();
- ccp.ServerName = "com.steering.mes.mcp.coup.CoupLoadingService";
- ccp.MethodName = "getCancelConfirm";
- ccp.ServerParams = new object[] { list1 };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- this.Cursor = Cursors.Default;
- Constant.WaitingForm.ShowToUser = false;
- Constant.WaitingForm.Close();
- Constant.WaitingForm = null;
- }
- catch (Exception ex)
- {
- this.Cursor = Cursors.Default;
- Constant.WaitingForm.ShowToUser = false;
- Constant.WaitingForm.Close();
- Constant.WaitingForm = null;
- }
- if (ccp.ReturnCode != -1)
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("取消确认成功!"))
- {
- QuerySinglePlan();
- }
- }
- }
- ///
- /// 确认
- ///
- private void confirm()
- {
- ultraGridLoad.UpdateData();
- UltraGridRow uRow = this.ultraGridLoad.ActiveRow;
- if (uRow == null) { MessageUtil.ShowTips("无上料实绩!"); return; }
- UltraGridRow row = this.ultraGridWoId.ActiveRow;
- if (row == null)
- {
- MessageUtil.ShowTips("无工单信息,不允许此操作!");
- }
- ArrayList list1 = new ArrayList();
- int UpdaCount = 0;
- foreach (UltraGridRow ugr in ultraGridLoad.Rows)
- {
- if (Convert.ToBoolean(ugr.Cells["CHECK"].Text) == true)
- {
- if (ugr.Cells["Confirm"].Value.ToString().Equals("1"))
- {
- MessageUtil.ShowTips("选中有已确认实绩,不允许再次确认!");
- return;
- }
- UpdaCount += 1;
- ArrayList list = new ArrayList();
- list.Add(ugr.Cells["ResultNo"].Text.ToString());
- list.Add(UserInfo.GetUserName());
- list.Add(DateTime.Now.ToString());
- list1.Add(list);
- }
- }
- if (UpdaCount == 0) { MessageUtil.ShowTips("请选择上料实绩数据!"); return; }
- if (MessageUtil.ShowYesNoAndQuestion("是否确认上料实绩?") == DialogResult.No)
- {
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- try
- {
- this.Cursor = Cursors.WaitCursor; //控制鼠标的样式为等待
- if (Constant.WaitingForm == null)
- {
- Constant.WaitingForm = new WaitingForm();
- }
- Constant.WaitingForm.ShowToUser = true;
- Constant.WaitingForm.Show();
- Constant.WaitingForm.Update();
- ccp.ServerName = "com.steering.mes.mcp.coup.CoupLoadingService";
- ccp.MethodName = "getConfirm";
- ccp.ServerParams = new object[] { list1 };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- this.Cursor = Cursors.Default;
- Constant.WaitingForm.ShowToUser = false;
- Constant.WaitingForm.Close();
- Constant.WaitingForm = null;
- }
- catch (Exception ex)
- {
- this.Cursor = Cursors.Default;
- Constant.WaitingForm.ShowToUser = false;
- Constant.WaitingForm.Close();
- Constant.WaitingForm = null;
- }
- if (ccp.ReturnCode != -1)
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("确认成功!"))
- {
- QuerySinglePlan();
- }
- }
- }
- /// <summary>
- /// 离线
- /// </summary>
- private void Offline()
- {
- string _strat = "";
- UltraGridRow row = ultraGridWoId.ActiveRow;
- if (row == null) return;
- if (row.Cells["ZyBillStatus"].Value.ToString() == "生产完成")
- {
- MessageUtil.ShowTips("此炉次计划整体已生产完成,不允许此操作!");
- return;
- }
- if (row.Cells["FeedHeatNo"].Text.ToString() == "A21032378")
- {
- MessageUtil.ShowTips("天淮来料离线需要测试,请联系视拓!");
- return;
- }
- if (row.Cells["FeedHeatNo"].Text.ToString() == "A21032381")
- {
- MessageUtil.ShowTips("天淮来料离线需要测试,请联系视拓!");
- return;
- }
- if (row.Cells["FeedHeatNo"].Text.ToString() == "A21032548")
- {
- MessageUtil.ShowTips("天淮来料离线需要测试,请联系视拓!");
- return;
- }
- UltraGridRow row1 = ultraGridLoad.ActiveRow;
- if (row1 == null)
- {
- MessageUtil.ShowTips("没有上料实绩不能离线!");
- return;
- }
- OffLine frm = new OffLine();
- frm.ShowDialog();
- LiXian = frm.StrNum;
- _strat = frm.Strat;
- StrMemo = frm.StrMemo;
- if (_strat.Equals("")) return;
- if (LiXian.Equals("") || LiXian.Equals("0")) { MessageUtil.ShowTips("离线支数不能为空!"); return; }
- //查询上料实绩支数总和
- DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.coup.CoupLoadingService.getLoadResult1", new object[] { row.Cells["WoId"].Value.ToString() }, this.ob);
- string pronum = "";
- if (dt.Rows.Count > 0)
- {
- pronum = dt.Rows[0]["PRO_NUM"].ToString();
- }
- else
- {
- pronum = "0";
- }
- string woId = row.Cells["WoId"].Value.ToString();
- if (row1.Cells["OffNum"].Value.ToString() == "")
- {
- row1.Cells["OffNum"].Value = "0";
- }
- if (int.Parse(pronum) < int.Parse(LiXian) + int.Parse(offlinePiece.Value.ToString()))
- {
- MessageUtil.ShowTips("离线支数不能大于上料支数!");
- return;
- }
- string time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
- ArrayList list = new ArrayList();
- list.Add(LiXian);
- list.Add(row.Cells["WoId"].Text.ToString());
- list.Add(row.Cells["HeatPlanNo"].Text.ToString());
- list.Add(row.Cells["JudgeStoveNo"].Text.ToString());
-
- list.Add(row.Cells["BatchNo"].Text.ToString());
- list.Add(row.Cells["PlineCode"].Text.ToString());
- list.Add(row.Cells["PlineName"].Text.ToString());
- list.Add(this.UserInfo.GetUserName());
- list.Add(this.UserInfo.GetUserOrder());
- list.Add(this.UserInfo.GetUserGroup());
- list.Add(time);
- list.Add(row1.Cells["ResultNo"].Value.ToString());
- list.Add(StrMemo);
- list.Add(row.Cells["BatchGroudNo"].Value.ToString());
- list.Add(row.Cells["FeedHeatNo"].Text.ToString());
- CoreClientParam ccp = new CoreClientParam();
- try
- {
- this.Cursor = Cursors.WaitCursor; //控制鼠标的样式为等待
- if (Constant.WaitingForm == null)
- {
- Constant.WaitingForm = new WaitingForm();
- }
- Constant.WaitingForm.ShowToUser = true;
- Constant.WaitingForm.Show();
- Constant.WaitingForm.Update();
- ccp.ServerName = "com.steering.mes.mcp.coup.CoupCutService";
- ccp.MethodName = "lixianThreadingResult";
- ccp.ServerParams = new object[] { list, SlGx, SLGxName };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- this.Cursor = Cursors.Default;
- Constant.WaitingForm.ShowToUser = false;
- Constant.WaitingForm.Close();
- Constant.WaitingForm = null;
- }
- catch (Exception ex)
- {
- this.Cursor = Cursors.Default;
- Constant.WaitingForm.ShowToUser = false;
- Constant.WaitingForm.Close();
- Constant.WaitingForm = null;
- }
- if (ccp.ReturnCode != -1)
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("离线成功!"))
- {
- QuerySinglePlan();
- // DoClean();
- }
- }
- }
- /// <summary>
- /// 撤销离线
- /// </summary>
- private void unOffline()
- {
- ultraGrid2.UpdateData();
- UltraGridRow uRow = this.ultraGrid2.ActiveRow;
- if (uRow == null) { MessageUtil.ShowTips("切管实绩无数据!"); return; }
- UltraGridRow row = this.ultraGridWoId.ActiveRow;
- if (uRow == null)
- {
- MessageUtil.ShowTips("无工单信息,不允许此操作!");
- }
- if (row.Cells["ZyBillStatus"].Value.ToString() == "生产完成")
- {
- MessageUtil.ShowTips("此炉次计划整体已生产完成,不允许此操作!");
- return;
- }
- string woId = row.Cells["WoId"].Value.ToString();
- ArrayList list1 = new ArrayList();
- int UpdaCount = 0;
- foreach (UltraGridRow ugr in ultraGridLoad.Rows)
- {
- if (Convert.ToBoolean(ugr.Cells["CHECK"].Text) == true)
- {
- UpdaCount += 1;
- ArrayList list = new ArrayList();
- list.Add(ugr.Cells["ResultNo"].Text.ToString());
- list.Add(ugr.Cells["OffNum"].Text.ToString());
- list1.Add(list);
- }
- }
- if (UpdaCount == 0) { MessageUtil.ShowTips("请选择离线数据!"); return; }
- if (MessageUtil.ShowYesNoAndQuestion("是否撤销离线?") == DialogResult.No)
- {
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- try
- {
- this.Cursor = Cursors.WaitCursor; //控制鼠标的样式为等待
- if (Constant.WaitingForm == null)
- {
- Constant.WaitingForm = new WaitingForm();
- }
- Constant.WaitingForm.ShowToUser = true;
- Constant.WaitingForm.Show();
- Constant.WaitingForm.Update();
- ccp.ServerName = "com.steering.mes.mcp.coup.CoupCutService";
- ccp.MethodName = "unlixianThreadingResult";
- ccp.ServerParams = new object[] { list1, row.Cells["WoId"].Text.ToString(), SlGx };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- this.Cursor = Cursors.Default;
- Constant.WaitingForm.ShowToUser = false;
- Constant.WaitingForm.Close();
- Constant.WaitingForm = null;
- }
- catch (Exception ex)
- {
- this.Cursor = Cursors.Default;
- Constant.WaitingForm.ShowToUser = false;
- Constant.WaitingForm.Close();
- Constant.WaitingForm = null;
- }
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("撤销离线成功!"))
- {
- QuerySinglePlan();
- }
- }
- /// <summary>
- /// 结炉
- /// </summary>
- private void DoBeside()
- {
- UltraGridRow uRow = this.ultraGridWoId.ActiveRow;
- if (uRow == null)
- {
- MessageUtil.ShowTips("请选择需要结炉的工单号!");
- return;
- }
- //查询上料实绩支数总和
- DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.coup.CoupLoadingService.getLoadResult1", new object[] { uRow.Cells["WoId"].Value.ToString() }, this.ob);
- string pronum = "";
- if (dt.Rows.Count > 0)
- {
- pronum = dt.Rows[0]["PRO_NUM"].ToString();
- }
- else
- {
- pronum = "0";
- }
- UltraGridRow Row = this.ultraGrid2.ActiveRow;
- if(Row!=null)
- {
- if (Convert.ToInt32(uRow.Cells["PlanBlNum"].Value) > Convert.ToInt32(pronum))
- {
- MessageUtil.ShowTips("上料支数的和不能小于计划支数!");
- return;
- }
- }
- string woId = uRow.Cells["WoId"].Value.ToString();
- if (MessageUtil.ShowYesNoAndQuestion("是否结炉?") == DialogResult.No)
- {
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.mcp.coup.CoupLoadingService";
- ccp.MethodName = "doBeside";
- ccp.ServerParams = new object[] { SlGx, woId };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("结炉成功!"))
- {
- QuerySinglePlan();
- }
- }
- }
- /// <summary>
- /// 撤销结炉
- /// </summary>
- private void UndoBeside()
- {
- UltraGridRow uRow = this.ultraGridWoId.ActiveRow;
- if (uRow == null)
- {
- MessageUtil.ShowTips("请选择需要撤销结炉的工单号!");
- return;
- }
- //string zYgNo = uRow.Cells["ZY_PLAN_ID"].Value.ToString();
- string woId = uRow.Cells["WoId"].Value.ToString();
- //DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getQueryWoIdDetails", new object[] { woId, zYgNo }, this.ob);
- //if (!dt.Rows[0]["CUT_STATUS"].ToString().Equals("生产完成"))
- //{
- // MessageUtil.ShowTips("此工单工序点未结炉,不允许此操作!");
- // return;
- //}
- //if (dt.Rows[0]["ZY_BILL_STATUS"].ToString().Equals("生产完成"))
- //{
- // MessageUtil.ShowTips("此工单状态生产完成,不允许此操作!");
- // return;
- //}
- if (MessageUtil.ShowYesNoAndQuestion("是否撤销结炉?") == DialogResult.No)
- {
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.mcp.coup.CoupLoadingService";
- ccp.MethodName = "undoBeside";
- ccp.ServerParams = new object[] { SlGx, woId };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("撤销结炉成功!"))
- {
- QuerySinglePlan();
- }
- }
- }
- /// <summary>
- /// 简单查询
- /// </summary>
- private void QuerySinglePlan()
- {
- string woId = "";
- string[] starts = { };
- string judgeStoveNo = "";
- string plnNo = "";
- #region 条件
- if (chkStarts.Checked)
- {
- if (string.IsNullOrEmpty(cmbStarts.Text.Trim()))
- {
- MessageUtil.ShowTips("请选择工单状态!");
- return;
- }
- else
- {
- starts = (cmbStarts.Value as List<object>).Select(p => p.ToString().Trim()).ToArray();
- }
- }
- if (chkwoId.Checked)
- {
- if (chkwoId.Checked && string.IsNullOrEmpty(txtWoId.Text.Trim()))
- {
- MessageUtil.ShowTips("请输入工单号!");
- return;
- }
- else
- {
- woId = txtWoId.Text.ToString().Trim();
- }
- }
- else
- {
- woId = "";
- }
-
- if (chkPlnNo.Checked)
- {
- if (chkPlnNo.Checked && string.IsNullOrEmpty(txtPlnNo.Text.Trim()))
- {
- MessageUtil.ShowTips("请输入炉次计划号!");
- return;
- }
- else
- {
- plnNo = txtPlnNo.Text.ToString().Trim();
- }
- }
- else
- {
- plnNo = "";
- }
-
- if (chkJuNo.Checked)
- {
- if (chkJuNo.Checked && string.IsNullOrEmpty(txtJudgeStoveNO.Text.Trim()))
- {
- MessageUtil.ShowTips("请输入炉号!");
- return;
- }
- else
- {
- judgeStoveNo = txtJudgeStoveNO.Text.ToString().Trim();
- }
- }
- else
- {
- judgeStoveNo = "";
- }
-
- #endregion
- List<PlnZyJgWorkbillEntity> listSource = EntityHelper.GetData<PlnZyJgWorkbillEntity>
- ("com.steering.mes.mcp.coup.CoupLoadingService.getQueryWoId", new object[] { woId, plnNo, judgeStoveNo, starts, plineCodes }, this.ob);
- plnZyJgWorkbillEntitySource.DataSource = listSource;
- GridHelper.RefreshAndAutoSize(ultraGridWoId);
- List<PlnZyJgWorkbillEntity> listSource1 = EntityHelper.GetData<PlnZyJgWorkbillEntity>
- ("com.steering.mes.mcp.coup.CoupLoadingService.ulgetQueryWoId", new object[] { woId, plnNo, judgeStoveNo, starts, plineCodes }, this.ob);
- bindingSource1.DataSource = listSource1;
- GridHelper.RefreshAndAutoSize(ultraGrid1);
-
- }
- private void ultraGridWoId_AfterRowActivate(object sender, EventArgs e)
- {
- this.ultraGrid1AfterRowActivate();
- }
- /// <summary>
- /// 上料计划详情
- /// </summary>
- private void ultraGrid1AfterRowActivate()
- {
- UltraGridRow row = ultraGridWoId.ActiveRow;
- if (row != null)
- {
- string zYgNo = row.Cells["HeatPlanNo"].Value.ToString();
- string woId = row.Cells["WoId"].Value.ToString();
- string judNo = row.Cells["FeedHeatNo"].Value.ToString();
- //string judNo = row.Cells["JudgeStoveNo"].Value.ToString();
- string batchNo = row.Cells["BatchNo"].Value.ToString();
- string batchNoGroup = row.Cells["BatchGroudNo"].Value.ToString();
- //string plNo = row.Cells["BatchGroudNo"].Value.ToString();
- //this.getJGCutPlan(woId,zYgNo);
- this.getMatZcM(judNo, batchNo, batchNoGroup);
- this.getCoupLing(woId);
- }
- if (row == null)
- {
- numPieces.Value = "0";
- }
- else
- {
- numPieces.Value = row.Cells["PlanBlNum"].Text.ToString();
- }
- }
- /// <summary>
- /// 查询物料信息
- /// </summary>
- /// <param name="judNo"></param>
- /// <param name="batchNo"></param>
- private void getMatZcM(string judNo, string batchNo, string batchNoGroup)
- {
- DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.coup.CoupLoadingService.getMatZcMById", new object[] { judNo, batchNo, batchNoGroup }, this.ob);
- GridHelper.CopyDataToDatatable(ref dt, ref dtPipes, true);
- UltraGridColumn[] col = new UltraGridColumn[] { ultraGrid2.DisplayLayout.Bands[0].Columns["STD_NAME"]};
- GridHelper.RefreshAndAutoSizeExceptColumns(ultraGrid2, col);
-
- }
- /// <summary>
- /// 查询上料信息
- /// </summary>
- /// <param name="judNo"></param>
- /// <param name="batchNo"></param>
- private void getCoupLing(string woId)
- {
- List<CouplingLoadingResultEntity> listSource1 = EntityHelper.GetData<CouplingLoadingResultEntity>
- ("com.steering.mes.mcp.coup.CoupLoadingService.getCoupLingById", new object[] {woId }, this.ob);
- CoupLoadResultEntitybindingSource.DataSource = listSource1;
- GridHelper.RefreshAndAutoSize(ultraGridLoad);
- foreach (UltraGridRow urg in ultraGridLoad.Rows)
- {
- if (urg.Cells["Confirm"].Value.Equals("1"))
- {
- urg.Appearance.BackColor = Color.LightGreen;
- }
- }
- }
- /// <summary>
- /// 接箍切断计划详细
- /// </summary>
- /// <param name="planNO"></param>
- //private void getJGCutPlan(string woId,string planNO)
- //{
- // DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getQueryWoIdDetails", new object[] { woId, planNO }, this.ob);
- // if (dt != null && dt.Rows.Count > 0)
- // {
- // this.coupWoIdPlanControl1.Value.PlineName = dt.Rows[0]["PLINE_NAME"].ToString();
- // this.coupWoIdPlanControl1.Value.CutMachGrpNm = dt.Rows[0]["CUT_MACH_GRP_NM"].ToString();
- // this.coupWoIdPlanControl1.Value.Memo = dt.Rows[0]["MEMO"].ToString();
- // this.coupWoIdPlanControl1.Value.ZyPlanId = dt.Rows[0]["ZY_PLAN_ID"].ToString();
- // this.coupWoIdPlanControl1.Value.IfMonitorJg = dt.Rows[0]["IF_MONITOR_JG"].ToString();
- // this.coupWoIdPlanControl1.Value.LoadPieces = dt.Rows[0]["LOAD_PIECES"].ToString();
- // this.coupWoIdPlanControl1.Value.LoadWeight = dt.Rows[0]["LOAD_WEIGHT"].ToString();
- // this.coupWoIdPlanControl1.Value.ProPlanId = dt.Rows[0]["PRO_PLAN_ID"].ToString();
- // this.coupWoIdPlanControl1.Value.Steelname = dt.Rows[0]["STEELNAME"].ToString();
- // this.coupWoIdPlanControl1.Value.Gradename = dt.Rows[0]["GRADENAME"].ToString();
- // this.coupWoIdPlanControl1.Value.JglDesc = dt.Rows[0]["JGL_DESC"].ToString();
- // this.coupWoIdPlanControl1.Value.CodeJg = dt.Rows[0]["CODE_JG"].ToString();
- // this.coupWoIdPlanControl1.Value.ModelDesc = dt.Rows[0]["MODEL_DESC"].ToString();
- // this.coupWoIdPlanControl1.Value.SpecJgDesc = dt.Rows[0]["SPEC_JG_DESC"].ToString();
- // this.coupWoIdPlanControl1.Value.StyleJg = dt.Rows[0]["STYLE_JG"].ToString();
- // this.coupWoIdPlanControl1.Value.PlanJgNum = dt.Rows[0]["PLAN_JG_NUM"].ToString();
- // this.coupWoIdPlanControl1.Value.CsJgNum = dt.Rows[0]["CS_JG_NUM"].ToString();
- // this.coupWoIdPlanControl1.Value.XqJgNum = dt.Rows[0]["XQ_JG_NUM"].ToString();
- // this.coupWoIdPlanControl1.Value.InstoreNum = dt.Rows[0]["INSTORE_NUM"].ToString();
- // this.coupWoIdPlanControl1.Value.BlWlDesc = dt.Rows[0]["BL_WL_DESC"].ToString();
- // //this.coupWoIdPlanControl1.Value.LoadWeight = "";
- // this.coupWoIdPlanControl1.UpdateData();
- // }
- //}
-
- /// <summary>
- /// 上料实绩保存
- /// </summary>
- private void Save()
- {
- UltraGridRow row = ultraGridWoId.ActiveRow;
- if (row == null) { MessageUtil.ShowTips("无工单信息,请确认!"); return; }
- string woId=row.Cells["WoId"].Text.ToString();
- UltraGridRow rowMat = ultraGrid2.ActiveRow;
- if (rowMat == null) { MessageUtil.ShowTips("无物料信息,请确认!"); return; }
- string datetime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
- if (numPieces.Value.ToString() == "0")
- {
- MessageUtil.ShowTips("上料支数不能为零或空!");
- return;
- }
-
- if(Convert.ToInt32(numPieces.Value)>Convert.ToInt32(rowMat.Cells["ACT_COUNT"].Value))
- {
- MessageUtil.ShowTips("库存不足!");
- return;
- }
- else
- {
- //查询上料实绩支数总和
- DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.coup.CoupLoadingService.getLoadResult1", new object[] { row.Cells["WoId"].Value.ToString() }, this.ob);
- //VrpLoadingResultEntity result1 = new VrpLoadingResultEntity();
- //this.planExpanQuery1.Value = result;
- string pronum = "";
- if (dt.Rows.Count > 0)
- {
- pronum = dt.Rows[0]["PRO_NUM"].ToString();
- }
- else
- {
- pronum = "0";
- }
- if (Convert.ToInt32(numPieces.Value) + Convert.ToInt32(pronum) > Convert.ToInt32(row.Cells["PlanBlNum"].Value))
- {
- MessageUtil.ShowTips("计划不足!");
- return;
- }
- }
- //string woId = row.Cells["WO_ID"].Text.ToString();
- //string planNo = row.Cells["ZY_PLAN_ID"].Text.ToString();
- //DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.coup.CoupLoadingService.getCoupCountById1", new object[] { planNo,woId,txtBC.Value.ToString() }, this.ob);
- //if(!dt.Rows[0]["COUNT"].ToString().Equals("0"))
- //{
- // MessageUtil.ShowTips("该【" + woId + "】工单同一班次下已存在上料记录!");
- // return;
- //}
- if(txtBC.Value==null||txtBC.Value=="")
- {
- MessageUtil.ShowTips("班次不能为空!");
- return;
- }
- if(txtBz.Value == null||txtBz.Value=="")
- {
- MessageUtil.ShowTips("班组不能为空!");
- return;
- }
- if(Convert.ToInt32(numPieces.Value)>Convert.ToInt32(row.Cells["PlanJgNum"].Value))
- {
- MessageUtil.ShowTips("上料支数不能大于计划支数!");
- return;
- }
- ArrayList list = new ArrayList();
- list.Add(this.UserInfo.GetUserName());
- list.Add(datetime);
- list.Add(txtBC.Value.ToString());
- list.Add(txtBz.Value.ToString());
- list.Add(numPieces.Value.ToString());
- list.Add(ProTime.Value.ToString("yyyy-MM-dd"));
- list.Add(txtUser.Text.Trim());
- list.Add(txtMemo.Text.Trim());
- list.Add(txtPlace.Text.Trim());
- list.Add(txtMach.Text.Trim());
- list.Add(numFail.Text.Trim());
- if (MessageUtil.ShowYesNoAndQuestion("是否上料?") == DialogResult.No)
- {
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- try
- {
- this.Cursor = Cursors.WaitCursor; //控制鼠标的样式为等待
- if (Constant.WaitingForm == null)
- {
- Constant.WaitingForm = new WaitingForm();
- }
- Constant.WaitingForm.ShowToUser = true;
- Constant.WaitingForm.Show();
- Constant.WaitingForm.Update();
- ccp.ServerName = "com.steering.mes.mcp.coup.CoupLoadingService";
- ccp.MethodName = "saveLoadResult";
- ccp.ServerParams = new object[] { list, SlGx, woId };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- this.Cursor = Cursors.Default;
- Constant.WaitingForm.ShowToUser = false;
- Constant.WaitingForm.Close();
- Constant.WaitingForm = null;
- }
- catch (Exception ex)
- {
- this.Cursor = Cursors.Default;
- Constant.WaitingForm.ShowToUser = false;
- Constant.WaitingForm.Close();
- Constant.WaitingForm = null;
- }
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("上料成功!"))
- {
- QuerySinglePlan();
- }
- }
- /// <summary>
- /// 回库
- /// </summary>
- private void doBack()
- {
- string _strat = "";
- string backNum = "";
- ultraGridWoId.UpdateData();
- UltraGridRow row = ultraGridWoId.ActiveRow;
- if (row == null) { MessageUtil.ShowTips("无工单信息!"); return; }
- UltraGridRow rowMat = ultraGridLoad.ActiveRow;
- if (rowMat == null) { MessageUtil.ShowTips("无上料实绩记录!"); return; }
- if(rowMat.Cells["Confirm"].Value.Equals("1"))
- {
- MessageUtil.ShowTips("选中的上料实绩已经确认,不允许回库!");
- return;
- }
- string datetime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
- Oback frm = new Oback();
- frm.ShowDialog();
- backNum = frm.StrNum;
- _strat = frm.Strat;
- if (_strat.Equals("")) return;
- if (backNum.Equals("") || backNum.Equals("0")) { MessageUtil.ShowTips("回库支数不能为空!"); return; }
- ArrayList list1 = new ArrayList();
- foreach (UltraGridRow item in ultraGridLoad.Rows)
- {
- if (Convert.ToBoolean(item.Cells["CHECK"].Text) == true)
- {
- if(int.Parse(backNum)>=int.Parse(item.Cells["LoadPieces"].Value.ToString()))
- {
- MessageUtil.ShowTips("回库支数不能大于等于上料支数!");
- return;
- }
- ArrayList list = new ArrayList();
- list.Add(item.Cells["ResultNo"].Text.ToString());
- list.Add(backNum);
- list.Add(this.UserInfo.GetUserName());
- list.Add(datetime);
- list.Add(item.Cells["WoId"].Text.ToString());
- list1.Add(list);
- }
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否回库?") == DialogResult.No)
- {
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- try
- {
- this.Cursor = Cursors.WaitCursor; //控制鼠标的样式为等待
- if (Constant.WaitingForm == null)
- {
- Constant.WaitingForm = new WaitingForm();
- }
- Constant.WaitingForm.ShowToUser = true;
- Constant.WaitingForm.Show();
- Constant.WaitingForm.Update();
- ccp.ServerName = "com.steering.mes.mcp.coup.CoupLoadingService";
- ccp.MethodName = "doBackResult";
- ccp.ServerParams = new object[] { list1, SlGx };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- this.Cursor = Cursors.Default;
- Constant.WaitingForm.ShowToUser = false;
- Constant.WaitingForm.Close();
- Constant.WaitingForm = null;
- }
- catch (Exception ex)
- {
- this.Cursor = Cursors.Default;
- Constant.WaitingForm.ShowToUser = false;
- Constant.WaitingForm.Close();
- Constant.WaitingForm = null;
- }
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("回库成功!"))
- {
- QuerySinglePlan();
- }
- }
- private void CancelBack()
- {
- string _strat = "";
- string backNum = "";
- ultraGridWoId.UpdateData();
- UltraGridRow row = ultraGridWoId.ActiveRow;
- if (row == null) { MessageUtil.ShowTips("无工单信息!"); return; }
- UltraGridRow rowMat = ultraGridLoad.ActiveRow;
- if (rowMat == null) { MessageUtil.ShowTips("无上料实绩记录!"); return; }
- if (rowMat.Cells["Confirm"].Value.Equals("1"))
- {
- MessageUtil.ShowTips("选中的上料实绩已经确认,不允许撤销回库!");
- return;
- }
- int Data = 0;
- string count = "";
- //查询工单回库多少支
- DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.coup.CoupLoadingService.getCoupBackPiece", new object[] { row.Cells["WoId"].Text.ToString() }, this.ob);
- if (!dt.Rows[0]["COUNT"].ToString().Equals("0"))
- {
- count = dt.Rows[0]["COUNT"].ToString();
- }
- string datetime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
- Oback frm = new Oback();
- frm.ShowDialog();
- backNum = frm.StrNum;
- _strat = frm.Strat;
- if (_strat.Equals("")) return;
- if (backNum.Equals("") || backNum.Equals("0")) { MessageUtil.ShowTips("撤销回库支数不能为空!"); return; }
- ArrayList list1 = new ArrayList();
- foreach (UltraGridRow item in ultraGridLoad.Rows)
- {
- if (Convert.ToBoolean(item.Cells["CHECK"].Text) == true)
- {
- Data += 1;
- if (int.Parse(backNum) > int.Parse(count))
- {
- MessageUtil.ShowTips("撤销回库支数不能大于回库支数!");
- return;
- }
- ArrayList list = new ArrayList();
- list.Add(item.Cells["ResultNo"].Text.ToString());
- list.Add(backNum);
- list.Add(this.UserInfo.GetUserName());
- list.Add(datetime);
- list.Add(item.Cells["WoId"].Text.ToString());
- list1.Add(list);
- }
- }
- if (Data == 0) { MessageUtil.ShowTips("请选择回库过的上料数据!"); return; }
- if (MessageUtil.ShowYesNoAndQuestion("是否撤销回库?") == DialogResult.No)
- {
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- try
- {
- this.Cursor = Cursors.WaitCursor; //控制鼠标的样式为等待
- if (Constant.WaitingForm == null)
- {
- Constant.WaitingForm = new WaitingForm();
- }
- Constant.WaitingForm.ShowToUser = true;
- Constant.WaitingForm.Show();
- Constant.WaitingForm.Update();
- ccp.ServerName = "com.steering.mes.mcp.coup.CoupLoadingService";
- ccp.MethodName = "doCancelBackResult";
- ccp.ServerParams = new object[] { list1, SlGx };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- this.Cursor = Cursors.Default;
- Constant.WaitingForm.ShowToUser = false;
- Constant.WaitingForm.Close();
- Constant.WaitingForm = null;
- }
- catch (Exception ex)
- {
- this.Cursor = Cursors.Default;
- Constant.WaitingForm.ShowToUser = false;
- Constant.WaitingForm.Close();
- Constant.WaitingForm = null;
- }
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("撤销回库成功!"))
- {
- QuerySinglePlan();
- }
- }
- /// <summary>
- /// 上料实绩删除
- /// </summary>
- private void DoDelete()
- {
- ultraGridWoId.UpdateData();
- UltraGridRow row = ultraGridWoId.ActiveRow;
- if (row == null) { MessageUtil.ShowTips("无工单信息!"); return; }
- UltraGridRow rowMat = ultraGridLoad.ActiveRow;
- if (rowMat == null) { MessageUtil.ShowTips("无上料实绩记录!"); return; }
- if (rowMat.Cells["Confirm"].Value.Equals("1"))
- {
- MessageUtil.ShowTips("选中的上料实绩已经确认,不允许删除!");
- return;
- }
- string datetime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
- ArrayList list1 = new ArrayList();
- foreach (UltraGridRow item in ultraGridLoad.Rows)
- {
- if (Convert.ToBoolean(item.Cells["CHECK"].Text) == true)
- {
- ArrayList list = new ArrayList();
- list.Add(item.Cells["ResultNo"].Text.ToString());
- list.Add(this.UserInfo.GetUserName());
- list.Add(datetime);
- list.Add(this.UserInfo.GetUserOrder());
- list.Add(this.UserInfo.GetUserGroup());
- list.Add(row.Cells["FeedHeatNo"].Text.ToString());
- list1.Add(list);
- }
- }
-
- if (MessageUtil.ShowYesNoAndQuestion("是否撤销上料?") == DialogResult.No)
- {
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- try
- {
- this.Cursor = Cursors.WaitCursor; //控制鼠标的样式为等待
- if (Constant.WaitingForm == null)
- {
- Constant.WaitingForm = new WaitingForm();
- }
- Constant.WaitingForm.ShowToUser = true;
- Constant.WaitingForm.Show();
- Constant.WaitingForm.Update();
- ccp.ServerName = "com.steering.mes.mcp.coup.CoupLoadingService";
- ccp.MethodName = "deleteLoadResult";
- ccp.ServerParams = new object[] { list1, SlGx };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- this.Cursor = Cursors.Default;
- Constant.WaitingForm.ShowToUser = false;
- Constant.WaitingForm.Close();
- Constant.WaitingForm = null;
- }
- catch (Exception ex)
- {
- this.Cursor = Cursors.Default;
- Constant.WaitingForm.ShowToUser = false;
- Constant.WaitingForm.Close();
- Constant.WaitingForm = null;
- }
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("撤销上料成功!"))
- {
- QuerySinglePlan();
- }
- }
- /// <summary>
- /// 按回车键触发查询按钮
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ContPublic_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyCode == Keys.Enter)
- {
- QuerySinglePlan();
- }
- }
- //private void ultraGrid2_AfterRowActivate(object sender, EventArgs e)
- //{
- // UltraGridRow urg=ultraGrid2.ActiveRow;
- // if (urg == null)
- // {
- // numPieces.Value = "0";
- // }
- // else
- // {
- // numPieces.Value = urg.Cells["ACT_COUNT"].Text.ToString();
- // }
- //}
- private void chkStarts_CheckedChanged(object sender, EventArgs e)
- {
- if (chkStarts.Checked) { cmbStarts.Enabled = true; } else { cmbStarts.Enabled = false; }
- if (chkJuNo.Checked) { txtJudgeStoveNO.Enabled = true; } else { txtJudgeStoveNO.Enabled = false; }
- if (chkPlnNo.Checked) { txtPlnNo.Enabled = true; } else { txtPlnNo.Enabled = false; }
- if (chkwoId.Checked) { txtWoId.Enabled = true; } else { txtWoId.Enabled = false; }
- }
- private void ultraGridLoad_AfterRowActivate(object sender, EventArgs e)
- {
- UltraGridRow rowMat = ultraGridLoad.ActiveRow;
- if (rowMat == null) return;
- //numPieces.Value = rowMat.Cells["LoadPieces"].Text.ToString();
- //txtBC.Text = rowMat.Cells["LoadShift"].Text.ToString();
- //txtBz.Text = rowMat.Cells["LoadGroup"].Text.ToString();
- if (rowMat.Cells["ProTime"].Text.ToString().Equals(""))
- {
- ProTime.Value = DateTime.Today;
- }
- else
- {
- ProTime.Value = DateTime.Parse(rowMat.Cells["ProTime"].Text.ToString());
- }
- txtUser.Value = rowMat.Cells["LoadUser"].Text.ToString();
- //查询工单的离线支数
- DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.coup.CoupLoadingService.getQueryOfflinePiece", new object[] { rowMat.Cells["WoId"].Value }, this.ob);
- if (dt.Rows.Count > 0)
- {
- if (dt.Rows[0]["OFFLINE_NUM_BJ"].ToString() == null || dt.Rows[0]["OFFLINE_NUM_BJ"].ToString() == "")
- {
- offlinePiece.Value = 0;
- }
- else
- {
- offlinePiece.Value = Convert.ToInt64(dt.Rows[0]["OFFLINE_NUM_BJ"].ToString());
- }
- }
- }
- private void craftImg_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
- {
- //UltraGridRow row = ultraGridWoId.ActiveRow;
- //string craftPath = YdmBaseClass.getQueryCraftNoJG(row.Cells["CraftNoJg2"].Text.ToString(), row.Cells["CraftSeq2"].Text.ToString(), ob);
- //if (e.Button.Key.ToLower().Equals("select"))
- //{
- // FormFileDown down = new FormFileDown(ob, craftPath);
- // down.CtrlFileDown1.Button3.Visible = false;
- // down.ShowDialog();
-
- //}
- UltraGridRow row = ultraGridWoId.ActiveRow;
- if (row == null) return;
- string orderNo = row.Cells["OrderNoSeq"].Text.ToString();
- string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilCouplingProcess2.cpt"
- + "&ORDER_NO=" + orderNo;
- FrmRepExcel down = new FrmRepExcel(ob, strurl);
- down.Text = "接箍二级工艺";
- down.Visible = false;
- down.Size = new Size(740, this.Height);
- down.WindowState = FormWindowState.Maximized;
- down.ShowDialog();
- }
- private void numPieces_AfterEnterEditMode(object sender, EventArgs e)
- {
- this.BeginInvoke(new MethodInvoker(this.numPieces.SelectAll));
- }
- private void card_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
- {
- UltraGridRow row = ultraGridLoad.ActiveRow;
- if (row == null) return;
- string woId = row.Cells["WoId"].Text.ToString();
- string judgeNo = row.Cells["JudgeStoveNo"].Text.ToString();
- string plinCode = row.Cells["PlineCode"].Text.ToString();
- string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=CouplingDeliveryCard.cpt"
- + "&woId=" + woId + "&judgeNo=" + judgeNo + "&plineCode=" +plinCode;
- FrmRepExcel down = new FrmRepExcel(ob, strurl);
- down.Text = "接箍传递卡";
- down.Visible = false;
- down.Size = new Size(740, this.Height);
- down.WindowState = FormWindowState.Maximized;
- down.ShowDialog();
- }
-
- }
- }
|