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(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; } } /// /// 工序结炉 /// 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(); } } /// /// 撤销结炉 /// 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(); } } /// /// 简单查询 /// 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(); } } } /// /// 修改 /// 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(); } } /// /// 删除 /// 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); } /// /// 委外工序实绩查询 /// /// private void getCoupThreadingResult(string planNo,string woId) { List listSource = EntityHelper.GetData ("com.steering.mes.mcp.coup.FrmOutSourPerfor.doQueryLoadResult", new object[] { planNo, woId }, this.ob); CouplingComInfoEntitSource.DataSource = listSource; } /// /// 接箍加工计划详情 /// /// 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"; } } } } } }