| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849 |
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.Mcp.CollarMaterial;
- using Core.StlMes.Client.Mcp.Common;
- using Core.StlMes.Client.Mcp.Control;
- using Core.StlMes.Client.Mcp.Entity;
- 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.Mcp.Coupling
- {
- public partial class FrmOutSourPerfor : FrmBase
- {
- private string departm = "";//获取部门ID
- private string[] plineCode = null;//获取产线代码
- public FrmOutSourPerfor()
- {
- 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;
- }
- private void FrmOutSourPerfor_Load(object sender, EventArgs e)
- {
- departm = UserInfo.GetDeptid();
- plineCode = McpBaseHelper.GetPCodePline(departm, this.ob);
- //McpBaseHelper.InitPlineUnit(cmbCname, plineCode, this.ob,"H");
- EntityHelper.ShowGridCaption<CouplingComInfoEntity>(ultraGrid1.DisplayLayout.Bands[0]);
- txtBC.Value = this.UserInfo.GetUserOrder();
- txtBz.Value = this.UserInfo.GetUserGroup();
- //PipeManageClass.setUltraGridColumnInput(ultraGrid1, new string[] { "ProNum" });//支数
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "DoQuery":
- QuerySinglePlan();
- break;
- case "DoSave":
- DoSave();
- break;
- case "DoUpdate":
- DoUpdate();
- break;
- case "DoDelete":
- DoDelete();
- break;
- case "DoBeside"://结炉
- DoBeside();
- break;
- case "UndoBeside"://撤销结炉
- UndoBeside();
- break;
- case "DoClose":
- this.Close();
- break;
- }
- }
- /// <summary>
- /// 工序结炉
- /// </summary>
- private void DoBeside()
- {
- UltraGridRow uRow = this.ultraGridWoId.ActiveRow;
- if (uRow == null) return;
- UltraGridRow row = this.ultraGrid1.ActiveRow;
- if (row == null) { MessageUtil.ShowTips("无委外实绩!"); return; }
- //string zYgNo = row.Cells["WO_ID"].Value.ToString();
- //FrmOutPrce outPrce = new FrmOutPrce(this.ob, zYgNo,true);
- //outPrce.AutoSize = true;
- //outPrce.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- //outPrce.Text = "委外工序";
- //outPrce.ShowDialog();
- //QuerySinglePlan();
- ArrayList list1 = new ArrayList();
- int UpdaCount = 0;
- foreach (UltraGridRow ugr in ultraGrid1.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["WoId"].Text.ToString());
- list.Add(ugr.Cells["ZyPlanId"].Text.ToString());
- list.Add(ugr.Cells["StationCode"].Text.ToString());
- list.Add(ugr.Cells["StationDesc"].Text.ToString());
- list1.Add(list);
- }
- }
- //double PlnCount = 0;//计划个数
- //double CutCount = 0;//实际个数
- //DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.coup.PhosphateResultService.queryPlanJg", new Object[] { uRow.Cells["ZY_PLAN_ID"].Text.ToString() }, ob);
- //if (dt.Rows.Count > 0)
- //{
- // PlnCount = Double.Parse(dt.Rows[0]["PLAN_LATHE_NUM"].ToString());
- // CutCount = Double.Parse(dt.Rows[0]["LATHE_OK_NUM"].ToString());
- //}
- // + Double.Parse(numQualified.Value.ToString())
- //if (CutCount > PlnCount)
- //{
- // if (MessageUtil.ShowYesNoAndQuestion("实际车丝个数超过计划车丝个数是否结炉!") == DialogResult.Yes) { return; }
- //}
- 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.FrmOutSourPerfor";
- ccp.MethodName = "doBeside";
- ccp.ServerParams = new object[] { list1 };
- 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 UndoBeside()
- {
- UltraGridRow uRow = this.ultraGridWoId.ActiveRow;
- if (uRow == null) return;
- UltraGridRow row = this.ultraGrid1.ActiveRow;
- if (row == null) { MessageUtil.ShowTips("无委外实绩!"); return; }
- //string zYgNo = row.Cells["WO_ID"].Value.ToString();
- //FrmOutPrce outPrce = new FrmOutPrce(this.ob, zYgNo, false);
- //outPrce.AutoSize = true;
- //outPrce.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- //outPrce.Text = "委外工序";
- //outPrce.ShowDialog();
- //QuerySinglePlan();
- ArrayList list1 = new ArrayList();
- int UpdaCount = 0;
- foreach (UltraGridRow ugr in ultraGrid1.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["WoId"].Text.ToString());
- list.Add(ugr.Cells["ZyPlanId"].Text.ToString());
- list.Add(ugr.Cells["StationCode"].Text.ToString());
- list.Add(ugr.Cells["StationDesc"].Text.ToString());
- list1.Add(list);
- }
- }
- //double PlnCount = 0;//计划个数
- //double CutCount = 0;//实际个数
- //DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.coup.PhosphateResultService.queryPlanJg", new Object[] { uRow.Cells["ZY_PLAN_ID"].Text.ToString() }, ob);
- //if (dt.Rows.Count > 0)
- //{
- // PlnCount = Double.Parse(dt.Rows[0]["PLAN_LATHE_NUM"].ToString());
- // CutCount = Double.Parse(dt.Rows[0]["LATHE_OK_NUM"].ToString());
- //}
- // + Double.Parse(numQualified.Value.ToString())
- //if (CutCount > PlnCount)
- //{
- // if (MessageUtil.ShowYesNoAndQuestion("实际车丝个数超过计划车丝个数是否结炉!") == DialogResult.Yes) { return; }
- //}
- 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.FrmOutSourPerfor";
- ccp.MethodName = "undoBeside";
- ccp.ServerParams = new object[] { list1 };
- 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 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.ToString();
- }
- }
- if (chkwoId.Checked && string.IsNullOrEmpty(txtWoId.Text.Trim()))
- {
- MessageUtil.ShowTips("请输入工单号!");
- return;
- }
- else
- {
- woId = txtWoId.Text.ToString().Trim();
- }
- if (chkPlnNo.Checked && string.IsNullOrEmpty(txtPlnNo.Text.Trim()))
- {
- MessageUtil.ShowTips("请输入炉次计划号!");
- return;
- }
- else
- {
- plnNo = txtPlnNo.Text.ToString().Trim();
- }
- if (chkJuNo.Checked && string.IsNullOrEmpty(txtJudgeStoveNO.Text.Trim()))
- {
- MessageUtil.ShowTips("请输入炉号!");
- return;
- }
- else
- {
- judgeStoveNo = txtJudgeStoveNO.Text.ToString().Trim();
- }
- #endregion
- ArrayList list = new ArrayList();
- list.Add(woId);
- list.Add(plnNo);
- list.Add(judgeStoveNo);
- list.Add(starts);
- DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getQueryWoId", new object[] { list, plineCode[0].ToString() }, this.ob);
- GridHelper.CopyDataToDatatable(ref dt, ref dtProcessPlan, true);
- GridHelper.RefreshAndAutoSize(ultraGridWoId);
- DataTable dt1 = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.ulgetQueryWoId", new object[] { list, plineCode[0].ToString() }, this.ob);
- GridHelper.CopyDataToDatatable(ref dt1, ref dataTable2, true);
- GridHelper.RefreshAndAutoSize(ultraGrid3);
- }
- private void DoSave()
- {
- UltraGridRow urg = this.ultraGridWoId.ActiveRow;
- if (urg == null)
- {
- MessageUtil.ShowTips("无工单信息,不允许此操作!");
- return;
- }
- if (urg.Cells["ZY_BILL_STATUS"].Value.ToString() == "生产完成")
- {
- MessageUtil.ShowTips("此工单已生产完成,不允许此操作!");
- return;
- }
- if (cmbGx.Text.Trim() == "") { MessageUtil.ShowTips("工序点不能为空!"); return; }
- if (numQualified.Value.ToString() == "0") { MessageUtil.ShowTips("个数不能为空或为零!"); return; }
- string gx = "";
- string xh = "";
- if (cmbGx.Text.Trim().Equals("锯切")) { gx = "700302"; }
- if (cmbGx.Text.Trim().Equals("粗加工")) { gx = "700303"; }
- if (cmbGx.Text.Trim().Equals("压印")) { gx = "700304"; }
- if (cmbGx.Text.Trim().Equals("车丝")) { gx = "700305"; }
- if (cmbGx.Text.Trim().Equals("喷砂")) { gx = "700308"; }
- if (cmbGx.Text.Trim().Equals("镀铜")) { gx = "700310"; }
- if (cmbGx.Text.Trim().Equals("磷化")) { gx = "700310"; }
- if (cmbGx.Text.Trim().Equals("喷标")) { gx = "700311"; }
- if (cmbGx.Text.Trim().Equals("螺纹检验")) { gx = "700306"; }
- if (cmbGx.Text.Trim().Equals("探伤")) { gx = "700307"; }
- DataTable dt2 = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getQueryGX", new object[] { gx }, this.ob);
- if (dt2.Rows.Count > 0)
- {
- xh = dt2.Rows[0]["MEMO"].ToString();
- }
- ArrayList list = new ArrayList();
- list.Add(gx);
- list.Add(cmbGx.Text.ToString());
- list.Add(numQualified.Value.ToString());
- list.Add(txtBC.Value.ToString());
- list.Add(txtBz.Value.ToString());
- list.Add(urg.Cells["ZY_PLAN_ID"].Text.ToString());
- list.Add(this.UserInfo.GetUserName());
- list.Add(urg.Cells["PLINE_CODE"].Text.ToString());
- list.Add(urg.Cells["WO_ID"].Text.ToString());
- list.Add(xh);
- //double PlnCount = 0;//计划个数
- //double CutCount = 0;//实际个数
- //DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.coup.PhosphateResultService.queryPlanJg", new Object[] { uRow.Cells["ZY_PLAN_ID"].Text.ToString() }, ob);
- //if (dt.Rows.Count > 0)
- //{
- // PlnCount = Double.Parse(dt.Rows[0]["PLAN_LATHE_NUM"].ToString());
- // CutCount = Double.Parse(dt.Rows[0]["LATHE_OK_NUM"].ToString());
- //}
- //// + Double.Parse(numQualified.Value.ToString())
- //if (CutCount > PlnCount)
- //{
- // if (MessageUtil.ShowYesNoAndQuestion("实际车丝个数超过计划车丝个数是否结炉!") == DialogResult.Yes) { 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.FrmOutSourPerfor";
- ccp.MethodName = "addThreadingResult";
- ccp.ServerParams = new object[] { list };
- 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 DoUpdate()
- {
- ultraGridWoId.UpdateData();
- UltraGridRow uRow = this.ultraGridWoId.ActiveRow;
- if (uRow == null)
- {
- MessageUtil.ShowTips("无工单信息,不允许此操作!");
- }
- UltraGridRow row = this.ultraGrid1.ActiveRow;
- if (row == null) { MessageUtil.ShowTips("无委外数据!"); return; }
-
- ArrayList list1 = new ArrayList();
- int UpdaCount = 0;
- foreach (UltraGridRow ugr in ultraGrid1.Rows)
- {
- if (Convert.ToBoolean(ugr.Cells["CHECK"].Text) == true)
- {
- UpdaCount += 1;
- ArrayList list = new ArrayList();
- if (row.Cells["OfflineNum"].Text.ToString() != "")
- {
- //if (int.Parse(numQualified.Value.ToString()) > int.Parse(row.Cells["OfflineNum"].Value.ToString()))
- //{
- // MessageUtil.ShowTips("委外回报个数不能大于离线个数!");
- // return;
- //}
- }
- list.Add(ugr.Cells["ResultNo"].Text.ToString());
- list.Add(ugr.Cells["WoId"].Text.ToString());
- list.Add(ugr.Cells["ZyPlanId"].Text.ToString());
- list.Add(ugr.Cells["ProNum"].Text.Trim().ToString());
- list.Add(ugr.Cells["ProShift"].Value.ToString());
- list.Add(ugr.Cells["ProGroup"].Value.ToString());
- list.Add(ugr.Cells["StationCode"].Text.ToString());
- list.Add(ugr.Cells["StationDesc"].Text.ToString());
- list1.Add(list);
- }
- }
- //double PlnCount = 0;//计划个数
- //double CutCount = 0;//实际个数
- //DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.coup.PhosphateResultService.queryPlanJg", new Object[] { uRow.Cells["ZY_PLAN_ID"].Text.ToString() }, ob);
- //if (dt.Rows.Count > 0)
- //{
- // PlnCount = Double.Parse(dt.Rows[0]["PLAN_LATHE_NUM"].ToString());
- // CutCount = Double.Parse(dt.Rows[0]["LATHE_OK_NUM"].ToString());
- //}
- // + Double.Parse(numQualified.Value.ToString())
- //if (CutCount > PlnCount)
- //{
- // if (MessageUtil.ShowYesNoAndQuestion("实际车丝个数超过计划车丝个数是否结炉!") == DialogResult.Yes) { return; }
- //}
- 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.FrmOutSourPerfor";
- ccp.MethodName = "updateThreadingResult";
- ccp.ServerParams = new object[] { list1, uRow.Cells["WO_ID"].Text.ToString() };
- 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 uRow = this.ultraGridWoId.ActiveRow;
- if (uRow == null)
- {
- MessageUtil.ShowTips("无工单信息,不允许此操作!");
- }
- UltraGridRow row = this.ultraGrid1.ActiveRow;
- if (row == null) { MessageUtil.ShowTips("无委外实绩数据!"); return; }
-
- ArrayList list1 = new ArrayList();
- int UpdaCount = 0;
- foreach (UltraGridRow ugr in ultraGrid1.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["WoId"].Text.ToString());
- list.Add(ugr.Cells["ZyPlanId"].Text.ToString());
- list.Add(ugr.Cells["StationCode"].Text.ToString());
- list.Add(ugr.Cells["StationDesc"].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.FrmOutSourPerfor";
- ccp.MethodName = "deleteThreadingResult";
- ccp.ServerParams = new object[] { list1, uRow.Cells["WO_ID"].Text.ToString() };
- 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 ultraGridWoId_AfterRowActivate(object sender, EventArgs e)
- {
- UltraGridRow row = ultraGridWoId.ActiveRow;
- if (row == null) return;
- string zYgNo = row.Cells["ZY_PLAN_ID"].Value.ToString();
- string woId = row.Cells["WO_ID"].Value.ToString();
- string plNo = row.Cells["PLINE_CODE"].Value.ToString();
- this.getCoupProcessPlan(zYgNo, woId);
- getCoupThreadingResult(zYgNo, woId);
- }
- /// <summary>
- /// 委外工序实绩查询
- /// </summary>
- /// <param name="planNo"></param>
- private void getCoupThreadingResult(string planNo,string woId)
- {
- List<CouplingComInfoEntity> listSource = EntityHelper.GetData<CouplingComInfoEntity>
- ("com.steering.mes.mcp.coup.FrmOutSourPerfor.doQueryLoadResult", new object[] { planNo, woId }, this.ob);
- CouplingComInfoEntitSource.DataSource = listSource;
-
- }
- /// <summary>
- /// 接箍加工计划详情
- /// </summary>
- /// <param name="planNo"></param>
- private void getCoupProcessPlan(string planNO, string woId)
- {
- 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();
-
- if (dt.Rows[0]["IF_ALL_OUT_WORK"].ToString().Equals("是"))
- {
- cmbGx.Items.Clear();
- cmbGx.Items.Add("");
- cmbGx.Items.Add("锯切");
- if (dt.Rows[0]["IF_NEED_CJG"].ToString().Equals("是"))
- {
- cmbGx.Items.Add("粗加工");
- }
- if (dt.Rows[0]["IF_IMPRESS"].ToString().Equals("是"))
- {
- cmbGx.Items.Add("压印");
- }
- cmbGx.Items.Add("车丝");
- if (dt.Rows[0]["IF_BLAST"].ToString().Equals("是"))
- {
- cmbGx.Items.Add("喷砂");
- }
- if (dt.Rows[0]["COAT_TYPE"].ToString().Equals("镀铜"))
- {
- if (dt.Rows[0]["IF_PLATE_CU"].ToString().Equals("是"))
- {
- cmbGx.Items.Add("镀铜");
- }
- }
- else if (dt.Rows[0]["COAT_TYPE"].ToString().Equals("磷化"))
- {
- if (dt.Rows[0]["IF_PHOSPHATING"].ToString().Equals("是"))
- {
- cmbGx.Items.Add("磷化");
- }
- }
- cmbGx.Items.Add("喷标");
- cmbGx.Items.Add("螺纹检验");
- cmbGx.Items.Add("探伤");
-
- }
- else
- {
- cmbGx.Items.Clear();
- cmbGx.Items.Add("");
- if (dt.Rows[0]["IF_OUT_CUT"].ToString().Equals("是"))
- {
- cmbGx.Items.Add("锯切");
- }
- if (dt.Rows[0]["IF_NEED_CJG"].ToString().Equals("是"))
- {
- if (dt.Rows[0]["IF_OUT_CJG"].ToString().Equals("是"))
- {
- cmbGx.Items.Add("粗加工");
- }
- }
- if (dt.Rows[0]["IF_IMPRESS"].ToString().Equals("是"))
- {
- if (dt.Rows[0]["IF_OUT_IMPRESS"].ToString().Equals("是"))
- {
- cmbGx.Items.Add("压印");
- }
- }
- if (dt.Rows[0]["IF_OUT_LATHE"].ToString().Equals("是"))
- {
- cmbGx.Items.Add("车丝");
- }
- if (dt.Rows[0]["IF_BLAST"].ToString().Equals("是"))
- {
- if (dt.Rows[0]["IF_OUT_BLAST"].ToString().Equals("是"))
- {
- cmbGx.Items.Add("喷砂");
- }
- }
- if (dt.Rows[0]["COAT_TYPE"].ToString().Equals("镀铜"))
- {
- if (dt.Rows[0]["IF_PLATE_CU"].ToString().Equals("是"))
- {
- if (dt.Rows[0]["IF_OUT_COAT"].ToString().Equals("是"))
- {
- cmbGx.Items.Add("镀铜");
- }
- }
- }
- else if (dt.Rows[0]["COAT_TYPE"].ToString().Equals("磷化"))
- {
- if (dt.Rows[0]["IF_PHOSPHATING"].ToString().Equals("是"))
- {
- if (dt.Rows[0]["IF_OUT_COAT"].ToString().Equals("是"))
- {
- cmbGx.Items.Add("磷化");
- }
- }
- }
- if (dt.Rows[0]["IF_OUT_COPPER"].ToString().Equals("是"))
- {
- cmbGx.Items.Add("喷标");
- }
- if (dt.Rows[0]["IF_OUT_THREAD"].ToString().Equals("是"))
- {
- cmbGx.Items.Add("螺纹检验");
- }
- if (dt.Rows[0]["IF_OUT_DETECT"].ToString().Equals("是"))
- {
- cmbGx.Items.Add("探伤");
- }
-
- }
- PipeManageClass.SetComboItemHeight(cmbGx);
- }
- }
- private void DoRemove()
- {
- numQualified.Value = "0";
- // cmbGx.v =;
- txtBC.Value = this.UserInfo.GetUserOrder();
- txtBz.Value = this.UserInfo.GetUserGroup();
- }
- private void ultraGrid1_AfterSelectChange(object sender, AfterSelectChangeEventArgs e)
- {
- try
- {
- ultraGrid1.UpdateData();
- foreach (UltraGridRow row in ultraGridWoId.Rows)
- {
- row.Cells["CHECK"].Value = row.Selected;
- }
- }
- catch { }
- }
- 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 ContPublic_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyCode == Keys.Enter)
- {
- QuerySinglePlan();
- }
- }
- private void cmbGx_ValueChanged(object sender, EventArgs e)
- {
- if (cmbGx.Text.Trim().Equals(""))
- {
- numQualified.Enabled = false;
- }
- else
- {
- numQualified.Enabled = true;
- }
- }
- private void ultraGrid1_CellChange(object sender, CellEventArgs e)
- {
- if (e.Cell.Column.Key.Equals("ProNum"))
- {
- if (e.Cell.Row.Cells["ProNum"].Value == null)
- {
- e.Cell.Row.Cells["ProNum"].Value = "0";
- }
- else
- {
- ultraGrid1.UpdateData();
- string ProNum = e.Cell.Row.Cells["ProNum"].Value.ToString();
- if (!StringUtil.IsInt(ProNum) || ProNum == "0")
- {
- e.Cell.Row.Cells["ProNum"].Value = "0";
- }
- }
- }
- }
-
- }
- }
|