| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285 |
- 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 Infragistics.Win.UltraWinGrid;
- using Core.StlMes.Client.Mcp.Common;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Control;
- using com.steering.mes.mcp.entity;
- using Core.StlMes.Client.Mcp.CollarMaterial;
- using Core.Mes.Client.Comm.Tool;
- using System.Collections;
- using Core.StlMes.Client.Mcp.Control;
- using Core.StlMes.Client.Mcp.Entity;
- using Core.StlMes.Client.Mcp.Report;
- namespace Core.StlMes.Client.Mcp.Coupling
- {
- public partial class FrmSandBlast : FrmBase
- {
- private string departm = "";//获取部门ID
- private string[] plineCode = null;//获取产线代码
- private string PsGx = "";//喷砂工序
- private string PsName = "";//喷砂工序名称
- private string LiXian = "";
- private string StrMemo = "";//备注
- private string[] plineCodes;
- private int CutPiece = 0;
- private int sandPiece = 0;
- public FrmSandBlast()
- {
- InitializeComponent();
- }
- 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;
- }
- private void FrmSandBlast_Load(object sender, EventArgs e)
- {
- EntityHelper.ShowGridCaption<PlnZyJgWorkbillEntity>(ultraGridWoId.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<PlnZyJgWorkbillEntity>(ultraGrid1.DisplayLayout.Bands[0]);
- departm = UserInfo.GetDeptid();
- //plineCode = McpBaseHelper.GetPCodePline(departm, this.ob);
- plineCodes = comm.GetPlineCode(this.ValidDataPurviewIds, "H", ob);
- ProTime.Value = DateTime.Today;
- //获取工序
- DataTable dt2 = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getQueryGX", new object[] { "700308" }, this.ob);
- if (dt2.Rows.Count > 0)
- {
- PsGx = dt2.Rows[0]["BASECODE"].ToString();
- PsName = dt2.Rows[0]["BASENAME"].ToString();
- }
- txtBz.Value = this.UserInfo.GetUserOrder();
- txtBC.Value = this.UserInfo.GetUserGroup();
- txtUser.Text = this.UserInfo.GetUserName();
- //获取废品原因
- DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.coup.CoupCutService.getCutResultFp", new object[] { "7007" }, this.ob);
- cmbReason.DataSource = dt;
- cmbReason.ValueMember = "BASENAME";
- YdmBaseClass.SetComboItemHeight(cmbReason);
- //获取喷料
- DataTable dt1 = ServerHelper.GetData("com.steering.mes.mcp.coup.CoupCutService.getCutResultFp", new object[] { "7005" }, this.ob);
- cmbSpray.DataSource = dt1;
- cmbSpray.ValueMember = "BASENAME";
- YdmBaseClass.SetComboItemHeight(cmbSpray);
- //获取喷砂设备
- DataTable dt3 = ServerHelper.GetData("com.steering.mes.mcp.coup.CoupCutService.getCutResultFp", new object[] { "7006" }, this.ob);
- cmbEquipment.DataSource = dt3;
- cmbEquipment.ValueMember = "BASENAME";
- YdmBaseClass.SetComboItemHeight(cmbEquipment);
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "DoQuery":
- QuerySinglePlan();
- break;
- case "DoSave":
- DoSave();
- break;
- case "DoDelete":
- DoDelete();
- break;
- case "DoUpdate":
- DoUpdate();
- break;
- case "DoComplete":
- DoComplete();
- break;
- case "UnDoComplete":
- UnDoComplete();
- break;
- case "Offline"://离线
- Offline();
- break;
- case "unOffline"://撤销离线
- unOffline();
- break;
- case "Confirm":
- confirm();//确认
- break;
- case "CancelConfirm":
- cancelConfirm();
- break;
- case "DoClose":
- this.Close();
- break;
- }
- }
- ///
- /// 取消确认
- ///
- private void cancelConfirm()
- {
- ultraGrid1.UpdateData();
- UltraGridRow uRow = this.ultraGrid1.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 ultraGrid1.Rows)
- {
- if (Convert.ToBoolean(ugr.Cells["CHK"].Text) == true)
- {
- if (ugr.Cells["CONFIRM"].Value.ToString().Equals("0"))
- {
- MessageUtil.ShowTips("选中有没确认实绩,不允许取消确认!");
- return;
- }
- UpdaCount += 1;
- ArrayList list = new ArrayList();
- list.Add(ugr.Cells["RESULT_NO"].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.FrmSandBlast";
- 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()
- {
- ultraGrid1.UpdateData();
- UltraGridRow uRow = this.ultraGrid1.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 ultraGrid1.Rows)
- {
- if (Convert.ToBoolean(ugr.Cells["CHK"].Text) == true)
- {
- if (ugr.Cells["CONFIRM"].Value.ToString().Equals("1"))
- {
- MessageUtil.ShowTips("选中有已确认实绩,不允许再次确认!");
- return;
- }
- UpdaCount += 1;
- ArrayList list = new ArrayList();
- list.Add(ugr.Cells["RESULT_NO"].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.FrmSandBlast";
- 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();
- }
- }
- }
- private void Offline()
- {
- string _strat = "";
- //UltraGridRow row1 = ultraGrid1.ActiveRow;
- //if (row1 == null)
- //{
- // MessageUtil.ShowTips("没有喷砂实绩不能离线!");
- // return;
- //}
- OffLineCut frm = new OffLineCut();
- frm.ShowDialog();
- LiXian = frm.StrNum;
- _strat = frm.Strat;
- StrMemo = frm.StrMemo;
- if (_strat.Equals("2")) return;
- if (LiXian.Equals("") || LiXian.Equals("0")) { MessageUtil.ShowTips("离线支数不能为空!"); return; }
- UltraGridRow row = ultraGridWoId.ActiveRow;
- if (row == null) return;
- if (row.Cells["ZyBillStatus"].Value.ToString() == "生产完成")
- {
- MessageUtil.ShowTips("此炉次计划整体已生产完成,不允许此操作!");
- return;
- }
- string woId = row.Cells["WoId"].Value.ToString();
- //查询切断实绩支数和
- DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.coup.CoupCutService.getCutResult", new object[] { row.Cells["WoId"].Value.ToString() }, this.ob);
- //VrpLoadingResultEntity result1 = new VrpLoadingResultEntity();
- //this.planExpanQuery1.Value = result;
- string pronum = "";//锯切支数
- string cutnum = "";//锯切个数
- if (dt.Rows.Count > 0)
- {
- pronum = dt.Rows[0]["PRO_NUM"].ToString();
- cutnum = dt.Rows[0]["CUT_NUM"].ToString();
- }
- else
- {
- pronum = "0";
- cutnum = "0";
- }
- if (!row.Cells["Ifsplit"].Value.Equals("1"))
- {
- if (Convert.ToInt32(LiXian) > Convert.ToInt32(cutnum) - Convert.ToInt32(sandPiece) - Convert.ToInt32(offlinePiece.Value))
- {
- MessageUtil.ShowTips("离线个数不能大于锯切个数减去已经喷砂和离线个数的差!");
- return;
- }
- }
- offlinePiece.Value = Convert.ToInt32(LiXian) + Convert.ToInt32(offlinePiece.Value);
- //DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getQueryWoIdDetails", new object[] { woId, zYgNo }, this.ob);
- //if (dt.Rows[0]["BLAST_STATUS"].ToString().Equals("生产完成"))
- //{
- // MessageUtil.ShowTips("此工单喷砂工序点已结炉,不允许此操作!");
- // return;
- //}
- //DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getQueryCouplingcominfo", new object[] { woId, PsGx }, this.ob);
- //if (dt.Rows[0]["STATION_STATUS"].ToString().Equals("2"))
- //{
- // 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("");
- list.Add(StrMemo);
- list.Add(row.Cells["BatchGroudNo"].Value.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.CoupThreadingService";
- //ccp.MethodName = "lixianThreadingResult";
- ccp.ServerName = "com.steering.mes.mcp.coup.CoupCutService";
- ccp.MethodName = "lixianThreadingResult";
- ccp.ServerParams = new object[] { list, PsGx,PsName };
- 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();
- }
- }
- }
- //撤销离线
- private void unOffline()
- {
- ultraGrid1.UpdateData();
- UltraGridRow uRow = this.ultraGrid1.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();
- //DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getQueryWoIdDetails", new object[] { woId, zYgNo }, this.ob);
- //if (dt.Rows[0]["BLAST_STATUS"].ToString().Equals("生产完成"))
- //{
- // MessageUtil.ShowTips("此工单工序点已结炉,不允许此操作!");
- // return;
- //}
- //DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getQueryCouplingcominfo", new object[] { woId, PsGx }, this.ob);
- //if (dt.Rows[0]["STATION_STATUS"].ToString().Equals("2"))
- //{
- // MessageUtil.ShowTips("此工单工序点已结炉,不允许此操作!");
- // return;
- //}
- //if(!QueryStatusGd(row.Cells["WO_ID"].Value.ToString(), row.Cells["ZY_PLAN_ID"].Value.ToString())) return;
- ArrayList list1 = new ArrayList();
- int UpdaCount = 0;
- foreach (UltraGridRow ugr in ultraGrid1.Rows)
- {
- if (Convert.ToBoolean(ugr.Cells["CHK"].Text) == true)
- {
- UpdaCount += 1;
- ArrayList list = new ArrayList();
- list.Add(ugr.Cells["RESULT_NO"].Text.ToString());
- list.Add(ugr.Cells["OFF_NUM"].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(), PsGx };
- 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 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.getQueryWoId1", 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, plineCode[0].ToString() }, this.ob);
- // bindingSource1.DataSource = listSource1;
- // GridHelper.RefreshAndAutoSize(ultraGrid1);
-
- }
- private void ultraGridWoId_AfterRowActivate(object sender, EventArgs e)
- {
- UltraGridRow row = ultraGridWoId.ActiveRow;
- if (row == null) return;
- //string planNO = row.Cells["HeatPlanNo"].Value.ToString();
- string plinCode = row.Cells["PlineCode"].Value.ToString();
- string woId = row.Cells["WoId"].Value.ToString();
- //查询切断实绩支数和
- DataTable dtCut = ServerHelper.GetData("com.steering.mes.mcp.coup.CoupCutService.getCutResultPiece", new object[] { row.Cells["WoId"].Value.ToString() }, this.ob);
- string pronum = "";
- if (dtCut.Rows.Count > 0)
- {
- pronum = dtCut.Rows[0]["PRO_NUM"].ToString();
- }
- else
- {
- pronum = "0";
- }
- CutPiece = Convert.ToInt32(pronum);
- //查询喷砂实绩支数和
- DataTable dtThread = ServerHelper.GetData("com.steering.mes.mcp.coup.FrmSandBlast.getSandblastResult", new object[] { row.Cells["WoId"].Value.ToString() }, this.ob);
- if (dtThread.Rows.Count > 0)
- {
- sandPiece = Convert.ToInt32(dtThread.Rows[0]["PRO_NUM"].ToString());
- }
- else
- {
- sandPiece = 0;
- }
- //if (CutPiece - threadNum <= 0)
- //{
- // numPieces.Value = 0;
- // sandPiece = 0;
- //}
- //else
- //{
- // numPieces.Value = CutPiece - threadNum;
- // sandPiece = CutPiece - threadNum;
- //}
- getCoupSandBlast(woId);
- }
- /// <summary>
- /// 接箍加工计划详情
- /// </summary>
- /// <param name="planNo"></param>
- //private void getCoupProcessPlan(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>
- /// <param name="planNo"></param>
- private void getCoupSandBlast(string woId)
- {
- DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.coup.FrmSandBlast.getCoupSandBlast", new object[] { woId }, this.ob);
- GridHelper.CopyDataToDatatable(ref dt, ref dataTable1, true);
- foreach (UltraGridRow urg in ultraGrid1.Rows)
- {
- if (urg.Cells["CONFIRM"].Value.Equals("1"))
- {
- urg.Appearance.BackColor = Color.LightGreen;
- }
- }
- }
- /// <summary>
- /// 判断状态
- /// </summary>
- /// <param name="woId"></param>
- /// <param name="planNO"></param>
- private bool QueryStatusGd(string woId, string planNO)
- {
- //DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getQueryWoIdDetails", new object[] { woId, planNO }, this.ob);
- //if (dt.Rows[0]["ZY_BILL_STATUS"].ToString().Equals("生产完成"))
- //{
- // MessageUtil.ShowTips("此工单已生产完成,不允许此操作!");
- // return false;
- //}
- //if (dt.Rows[0]["BLAST_STATUS"].ToString().Equals("生产完成"))
- //{
- // MessageUtil.ShowTips("此工单喷砂工序点已结炉,不允许此操作!");
- // return false;
- //}
- return true;
- }
- /// <summary>
- /// 保存
- /// </summary>
- private void DoSave()
- {
- UltraGridRow row = this.ultraGridWoId.ActiveRow;
- if (row == null)
- {
- MessageUtil.ShowTips("无工单信息,不允许此操作!");
- return;
- }
- if (!row.Cells["zyBillStatus"].Value.ToString().Equals("生产中"))
- {
- MessageUtil.ShowTips("此工单不是生产中,不允许此操作!");
- return;
- }
- string zYgNo = row.Cells["HeatPlanNo"].Value.ToString();
- string woId = row.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]["BLAST_STATUS"].ToString().Equals("生产完成"))
- //{
- // MessageUtil.ShowTips("此工单喷砂工序点已结炉,不允许此操作!");
- // return;
- //}
- ////if(!QueryStatusGd(row.Cells["WO_ID"].Value.ToString(), row.Cells["ZY_PLAN_ID"].Value.ToString())) return;
- //if (row.Cells["IF_OUT_BLAST"].Text.ToString().Equals("无喷砂"))
- //{
- // MessageUtil.ShowTips("不需要进行此工序!");
- // return;
- //}
- if (Convert.ToInt32(numPieces.Value.ToString()) != Convert.ToInt32(numQualified.Value.ToString()) + Convert.ToInt32(numRejected.Value.ToString()))
- {
- MessageBox.Show("喷标个数=合格个数+废品总个数,请查验 ", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (txtBC.Value == null || txtBC.Value == "")
- {
- MessageUtil.ShowTips("班次不能为空!");
- return;
- }
- if (txtBz.Value == null || txtBz.Value == "")
- {
- MessageUtil.ShowTips("班组不能为空!");
- return;
- }
- if (!row.Cells["Ifsplit"].Value.Equals("1"))
- {
- if (Convert.ToInt32(numPieces.Value) > CutPiece)
- {
- MessageUtil.ShowTips("喷砂个数大于加工最大可切个数!");
- return;
- }
- }
- CouplingSandblastResultEntity sand = new CouplingSandblastResultEntity();
- sand.SprayCount = numPieces.Value.ToString();
- sand.QualiriedPcs = numQualified.Value.ToString();
- sand.RejectedPcs = numRejected.Value.ToString();
- sand.RejectedReason = cmbReason.Text.Trim();
- sand.SprayMaterial = cmbSpray.Text.ToString();
- sand.ColOperator = cmbOperator.Text.Trim();
- sand.ColShift = txtBC.Value.ToString();
- sand.ColGroup = txtBz.Value.ToString();
- sand.ColUser = txtUser.Text.ToString();
- sand.SprayThick = numLength.Value.ToString();
- sand.SprayEquipment = cmbEquipment.Text.ToString();
- sand.SprayPressure = numPressure.Value.ToString();
- sand.Memo = txtMemo.Text.ToString();
- sand.CreateTime = ProTime.Value.ToString();
- //sand.IfAllOutWork = row.Cells["IF_ALL_OUT_WORK"].Text.ToString();
- //sand.ZyPlanId = row.Cells["ZY_PLAN_ID"].Text.ToString();
- //sand.PlineCode = row.Cells["PLINE_CODE"].Text.ToString();
- //sand.WoId = row.Cells["WO_ID"].Text.ToString();
- //double PlnCount = 0;//计划个数
- //double CutCount = 0;//实际个数
- //DataTable dt1 = ServerHelper.GetData("com.steering.mes.mcp.coup.PhosphateResultService.queryPlanJg", new Object[] { row.Cells["ZY_PLAN_ID"].Text.ToString() }, ob);
- //if (dt1.Rows.Count > 0)
- //{
- // PlnCount = Double.Parse(dt1.Rows[0]["BLAST_PLN_NUM"].ToString());
- // CutCount = Double.Parse(dt1.Rows[0]["BLAST_OK_NUM"].ToString());
- //}
- //// + Double.Parse(numQualified.Value.ToString())
- //if (CutCount > PlnCount)
- //{
- // if (MessageUtil.ShowYesNoAndQuestion("实际喷砂个数超过计划喷砂个数是否新增!") == DialogResult.No) { 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.FrmSandBlast";
- ccp.MethodName = "addSandResult";
- ccp.ServerParams = new object[] { sand, PsGx, woId };
- 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 DoUpdate()
- {
- UltraGridRow row = this.ultraGridWoId.ActiveRow;
- if (row == null)
- {
- MessageUtil.ShowTips("无工单信息,不允许此操作!");
- return;
- }
- if (!row.Cells["zyBillStatus"].Value.ToString().Equals("生产中"))
- {
- MessageUtil.ShowTips("此工单不是生产中,不允许此操作!");
- return;
- }
- UltraGridRow urg = this.ultraGrid1.ActiveRow;
- if (urg == null)
- {
- MessageUtil.ShowTips("无喷砂实绩,不允许此操作!");
- return;
- }
- if(urg.Cells["IF_ALL_OUT_WORK"].Value.ToString().Equals("是"))
- {
- MessageUtil.ShowTips("此工序已经离线,不允许此操作!");
- return;
- }
- string zYgNo = row.Cells["HeatPlanNo"].Value.ToString();
- string woId = row.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]["BLAST_STATUS"].ToString().Equals("生产完成"))
- //{
- // MessageUtil.ShowTips("此工单喷砂工序点已结炉,不允许此操作!");
- // return;
- //}
- // if(!QueryStatusGd(row.Cells["WO_ID"].Value.ToString(), row.Cells["ZY_PLAN_ID"].Value.ToString())) return;
- string time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
- if (Convert.ToInt32(numPieces.Value.ToString()) != Convert.ToInt32(numQualified.Value.ToString()) + Convert.ToInt32(numRejected.Value.ToString()))
- {
- MessageBox.Show("喷标个数=合格个数+废品总个数,请查验 ", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
-
- CouplingSandblastResultEntity sand = new CouplingSandblastResultEntity();
- sand.SprayCount = numPieces.Value.ToString();
- sand.QualiriedPcs = numQualified.Value.ToString();
- sand.RejectedPcs = numRejected.Value.ToString();
- sand.RejectedReason = cmbReason.Text.Trim();
- sand.SprayMaterial = cmbSpray.Text.ToString();
- sand.ColOperator = cmbOperator.Text.Trim();
- sand.ColShift = txtBC.Value.ToString();
- sand.ColGroup = txtBz.Value.ToString();
- sand.UpdateName = this.UserInfo.GetUserName();
- sand.SprayThick = numLength.Value.ToString();
- sand.SprayEquipment = cmbEquipment.Text.ToString();
- sand.SprayPressure = numPressure.Value.ToString();
- sand.Memo = txtMemo.Text.ToString();
- sand.UpdateTime = time;
- //sand.ZyPlanId = urg.Cells["ZY_PLAN_ID"].Text.ToString();
- //sand.PlineCode = urg.Cells["PLINE_CODE"].Text.ToString();
- sand.ResultNo = urg.Cells["RESULT_NO"].Text.ToString();
- //sand.WoId = urg.Cells["WO_ID"].Text.ToString();
- //double PlnCount = 0;//计划个数
- //double CutCount = 0;//实际个数
- //DataTable dt1 = ServerHelper.GetData("com.steering.mes.mcp.coup.PhosphateResultService.queryPlanJg", new Object[] { row.Cells["ZY_PLAN_ID"].Text.ToString() }, ob);
- //if (dt1.Rows.Count > 0)
- //{
- // PlnCount = Double.Parse(dt1.Rows[0]["BLAST_PLN_NUM"].ToString());
- // CutCount = Double.Parse(dt1.Rows[0]["BLAST_OK_NUM"].ToString());
- //}
- //// + Double.Parse(numQualified.Value.ToString())
- //if (CutCount > PlnCount)
- //{
- // if (MessageUtil.ShowYesNoAndQuestion("实际喷砂个数超过计划喷砂个数是否修改!") == DialogResult.No) { 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.FrmSandBlast";
- ccp.MethodName = "updateSandResult";
- ccp.ServerParams = new object[] { sand, PsGx, woId };
- 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 DoDelete()
- {
- ultraGrid1.UpdateData();
- UltraGridRow uRow = this.ultraGrid1.ActiveRow;
- if (uRow == null) { MessageUtil.ShowTips("无喷砂实绩!"); return; }
- if (uRow.Cells["CONFIRM"].Value.ToString().Equals("1"))
- {
- MessageUtil.ShowTips("选中的喷砂实绩已经确认,不允许删除!");
- return;
- }
- UltraGridRow row = this.ultraGridWoId.ActiveRow;
- if (row == null)
- {
- MessageUtil.ShowTips("无工单信息,不允许此操作!");
- }
- if (!row.Cells["zyBillStatus"].Value.ToString().Equals("生产中"))
- {
- MessageUtil.ShowTips("此工单不是生产中,不允许此操作!");
- return;
- }
- string zYgNo = row.Cells["HeatPlanNo"].Value.ToString();
- string woId = row.Cells["WoId"].Value.ToString();
- string plinCode = row.Cells["PlineCode"].Value.ToString();
- // DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getQueryWoIdDetails", new object[] { woId, zYgNo }, this.ob);
- // if (dt.Rows[0]["BLAST_STATUS"].ToString().Equals("生产完成"))
- // {
- // MessageUtil.ShowTips("此工单喷砂工序点已结炉,不允许此操作!");
- // return;
- // }
- //// if(!QueryStatusGd(uRow.Cells["WO_ID"].Value.ToString(), uRow.Cells["ZY_PLAN_ID"].Value.ToString())) return;
- ArrayList list1 = new ArrayList();
- int UpdaCount = 0;
- foreach (UltraGridRow ugr in ultraGrid1.Rows)
- {
- if (Convert.ToBoolean(ugr.Cells["CHK"].Text) == true)
- {
- if (ugr.Cells["IF_ALL_OUT_WORK"].Value.ToString().Equals("是"))
- {
- MessageUtil.ShowTips("此工序已经离线,不允许此操作!");
- return;
- }
- if (ugr.Cells["OFF_NUM"].Text != "0" && ugr.Cells["OFF_NUM"].Text != "")
- {
- MessageUtil.ShowTips("存在离线支数,不允许此操作!");
- return;
- }
- UpdaCount += 1;
- ArrayList list = new ArrayList();
- list.Add(ugr.Cells["RESULT_NO"].Text.ToString());
- list.Add(ugr.Cells["REJECTED_PCS"].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.FrmSandBlast";
- ccp.MethodName = "deleteSandResult";
- ccp.ServerParams = new object[] { list1, PsGx, woId ,plinCode};
- 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)
- {
- if (ccp.ReturnInfo.Equals("删除成功!"))
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- QuerySinglePlan();
- DoClean();
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 结炉
- /// </summary>
- private void DoComplete()
- {
- 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]["BLAST_STATUS"].ToString().Equals("生产完成"))
- //{
- // MessageUtil.ShowTips("此工单喷砂工序点已结炉,不允许此操作!");
- // return;
- //}
- //if (dt.Rows[0]["ZY_BILL_STATUS"].ToString().Equals("生产完成"))
- //{
- // MessageUtil.ShowTips("此工单状态已生产完成,不允许此操作!");
- // return;
- //}
- //ArrayList list = new ArrayList();
- //list.Add(zYgNo);
- //list.Add(PsGx);
- //list.Add(woId);
- if (MessageUtil.ShowYesNoAndQuestion("是否结炉?") == DialogResult.No)
- {
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.mcp.coup.FrmSandBlast";
- ccp.MethodName = "doBeside";
- ccp.ServerParams = new object[] { PsGx,woId };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("结炉成功!"))
- {
- QuerySinglePlan();
- }
- }
- }
- /// <summary>
- /// 撤销结炉
- /// </summary>
- private void UnDoComplete()
- {
- 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]["BLAST_STATUS"].ToString().Equals("生产完成"))
- //{
- // MessageUtil.ShowTips("此工单喷砂工序点未结炉,不允许此操作!");
- // return;
- //} if (dt.Rows[0]["ZY_BILL_STATUS"].ToString().Equals("生产完成"))
- //{
- // MessageUtil.ShowTips("此工单状态已生产完成,不允许此操作!");
- // return;
- //}
- //ArrayList list = new ArrayList();
- //list.Add(zYgNo);
- //list.Add(PsGx);
- //list.Add(woId);
- if (MessageUtil.ShowYesNoAndQuestion("是否撤销结炉?") == DialogResult.No)
- {
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.mcp.coup.FrmSandBlast";
- ccp.MethodName = "undoBeside";
- ccp.ServerParams = new object[] { PsGx,woId };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- { MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("撤销结炉成功!"))
- {
- QuerySinglePlan();
- }
- }
- }
- /// <summary>
- /// 清空
- /// </summary>
- private void DoClean()
- {
- numPieces.Value =0;
- numQualified.Value = 0;
- numRejected.Value = 0;
- cmbReason.Text ="";
- cmbSpray.Text ="";
- cmbOperator.Text = "";
- txtBz.Value = this.UserInfo.GetUserOrder();
- txtBC.Value = this.UserInfo.GetUserGroup();
- txtUser.Text = this.UserInfo.GetUserName();
- numLength.Value = 0;
- cmbEquipment.Text ="";
- numPressure.Value = 0;
- txtMemo.Text = "";
- }
- private void numRejected_ValueChanged(object sender, EventArgs e)
- {
- if (numRejected.Value==null||numRejected.Value.ToString().Equals("0"))
- {
- cmbReason.Enabled = false;
- }
- else
- {
- cmbReason.Enabled = true;
- }
- }
- private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
- {
- UltraGridRow ugr = this.ultraGrid1.ActiveRow;
- if (ugr == null) return;
- //if (ugr.Cells["IF_ALL_OUT_WORK"].Value.ToString().Equals("否"))
- //{
- //numPieces.Value = ugr.Cells["SPRAY_COUNT"].Text.ToString();
- //numQualified.Value = ugr.Cells["QUALIRIED_PCS"].Text.ToString();
- //numRejected.Value = ugr.Cells["REJECTED_PCS"].Text.ToString();
- //cmbReason.Text = ugr.Cells["REJECTED_REASON"].Text.ToString();
- //cmbSpray.Text = ugr.Cells["SPRAY_MATERIAL"].Text.ToString();
- //cmbOperator.Text = ugr.Cells["COL_OPERATOR"].Text.ToString();
- //txtBC.Text = ugr.Cells["COL_SHIFT"].Text.ToString();
- //txtBz.Text = ugr.Cells["COL_GROUP"].Text.ToString();
- //txtUser.Text = ugr.Cells["COL_USER"].Text.ToString();
- //numLength.Value = ugr.Cells["SPRAY_THICK"].Text.ToString();
- //cmbEquipment.Text = ugr.Cells["SPRAY_EQUIPMENT"].Text.ToString();
- //numPressure.Value = ugr.Cells["SPRAY_PRESSURE"].Text.ToString();
- //txtMemo.Text = ugr.Cells["MEMO"].Text.ToString();
-
- //}
- //else
- //{
- // DoClean();
- //}
-
- }
- /// <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 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 craftImg_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
- {
- 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 ultraGrid1_CellChange(object sender, CellEventArgs e)
- {
- UltraGridRow ugr = this.ultraGrid1.ActiveRow;
- if (ugr == null) return;
- numPieces.Value = ugr.Cells["SPRAY_COUNT"].Text.ToString();
- numQualified.Value = ugr.Cells["QUALIRIED_PCS"].Text.ToString();
- numRejected.Value = ugr.Cells["REJECTED_PCS"].Text.ToString();
- cmbReason.Text = ugr.Cells["REJECTED_REASON"].Text.ToString();
- cmbSpray.Text = ugr.Cells["SPRAY_MATERIAL"].Text.ToString();
- cmbOperator.Text = ugr.Cells["COL_OPERATOR"].Text.ToString();
- txtBC.Text = ugr.Cells["COL_SHIFT"].Text.ToString();
- txtBz.Text = ugr.Cells["COL_GROUP"].Text.ToString();
- txtUser.Text = ugr.Cells["COL_USER"].Text.ToString();
- numLength.Value = ugr.Cells["SPRAY_THICK"].Text.ToString();
- cmbEquipment.Text = ugr.Cells["SPRAY_EQUIPMENT"].Text.ToString();
- numPressure.Value = ugr.Cells["SPRAY_PRESSURE"].Text.ToString();
- txtMemo.Text = ugr.Cells["MEMO"].Text.ToString();
- }
- private void numRejected_Click(object sender, EventArgs e)
- {
- if(numRejected.Value.Equals("0"))
- {
- numRejected.Value = null;
- }
- }
- private void numPieces_AfterEnterEditMode(object sender, EventArgs e)
- {
- this.BeginInvoke(new MethodInvoker(this.numPieces.SelectAll));
-
- }
- private void numQualified_AfterEnterEditMode(object sender, EventArgs e)
- {
- this.BeginInvoke(new MethodInvoker(this.numQualified.SelectAll));
- }
- private void numRejected_AfterEnterEditMode(object sender, EventArgs e)
- {
- this.BeginInvoke(new MethodInvoker(this.numRejected.SelectAll));
- }
- private void numLength_AfterEnterEditMode(object sender, EventArgs e)
- {
- this.BeginInvoke(new MethodInvoker(this.numLength.SelectAll));
- }
- private void numPressure_AfterEnterEditMode(object sender, EventArgs e)
- {
- this.BeginInvoke(new MethodInvoker(this.numPressure.SelectAll));
- }
- }
- }
|