using Core.Mes.Client.Comm.Control; using Core.Mes.Client.Comm.Format; using Core.Mes.Client.Comm.Tool; using Core.StlMes.Client.Lims.Port.数据管理.实体类; using CoreFS.CA06; using Infragistics.Win; 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.Lims.Port { public partial class FrmMchBatchSampleNew : FrmBase { public FrmMchBatchSampleNew() { InitializeComponent(); } private string plineCode = "";//产线 List dtPlanM = null;//检验计划主信息 List dtPlanDetial = null;//检验计划从信息 List dtPlanM1 = null;//分批详细方案 int minBatchNum = 0;//最小分批数量 private Color color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192))))); private Color color2 = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(224)))), ((int)(((byte)(192))))); private string batchNoZ = "";//性能批号产线标识 private void FrmMilBatchSampleNew_Load(object sender, EventArgs e) { DateTime now = DateTime.Now; DateTime dt1 = new DateTime(now.Year, now.Month, 1);//当月第一天 DateTime dt2 = dt1.AddMonths(1).AddDays(-1);//当月最后一天 this.RegStartTime.Value = DateTime.Parse(dt1.ToString("yyyy-MM-dd") + " 00:00:00"); this.RegEndTime.Value = DateTime.Parse(dt2.ToString("yyyy-MM-dd") + " 23:59:59"); EntityHelper.ShowGridCaption(this.ultraGrid1.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(this.ultraGrid2.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(this.ultraGrid3.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(this.ultraGrid8.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(this.ultraGrid5.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(this.ultraGrid6.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(this.ultraGrid7.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(this.ultraGrid9.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(this.ultraGrid10.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(this.ultraGrid12.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(this.ultraGrid13.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(this.ultraGrid15.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(this.ultraGrid16.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(this.ultraGrid17.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(this.ultraGrid19.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(this.ultraGrid20.DisplayLayout.Bands[0]); plineCode = PublicPort.GetPCode(this.ValidDataPurviewIds, ob); cmbSampleType.SelectedIndex = 0; initPostion(); } /// /// 加载基础取样位置 /// private void initPostion() { DataTable ds = PublicServer.GetData("com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryPostion", new object[] { }, ob); if (ds != null && ds.Rows.Count > 0) { cmbPostion.DataSource = ds; cmbPostion.ValueMember = "BASECODE"; cmbPostion1.DataSource = ds; cmbPostion1.ValueMember = "BASECODE"; cmbPiecePostion.DataSource = ds; cmbPiecePostion.ValueMember = "BASECODE"; } } /// /// 重写基类方法 /// /// /// public override void ToolBar_Click(object sender, string ToolbarKey) { switch (ToolbarKey) { case "Query": doQueryPlan(); break; case "QueryRepeate": doQueryRepeate(); break; case "GetSample": getSample(); break; case"ComfrimComplete": comfrimComplete(); break; case "CancelGetSample": cancelGetSample(); break; case "Confirm": confirm(); break; case "CancelConfirm": cancelConfirm(); break; case "ReGetSample": reGetSample(); break; case "CancelReGetSample": cancelReGetSample(); break; case "RepeateFrim": repeateFrim(); break; case "CancelRepeateFrim": cancelRepeateFrim(); break; case "Print": printTrust(); break; case "PrintLable": printLable(); break; case "PrintReLable": printReLable(); break; case "PrintRe": printReTrust(); break; case "Close": close(); break; } } /// /// 撤销复取样 /// private void cancelReGetSample() { this.ultraGrid15.UpdateData(); this.ultraGrid17.UpdateData(); UltraGridRow uRow = this.ultraGrid15.ActiveRow; List lists = portMchBatchSampleResultEntityBindingSource2.DataSource as List; if (uRow == null || lists.Count <= 0) { return; } PipeCheckconsignNoqualifiedEntity milPlans = (PipeCheckconsignNoqualifiedEntity)uRow.ListObject; string milPlanEntity = JSONFormat.Format(milPlans); List portMilEntity = lists.Where(p => p.ResamplePipeLenA != "" || p.ResamplePipeLenB != "" || p.ResamplePipeLenC != "" || p.ResamplePipeLenD != "" || p.ResamplePipeLenM != "" || p.ResamplePipeLenE != "" || p.ResamplePipeLenF != "" || p.ResamplePipeLenP != "" || p.ResamplePipeLenQ != "").Select(JSONFormat.Format).ToList(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.mes.port.vrp.FrmMchBatchSampleNew"; ccp.MethodName = "cancelReGetSample"; ccp.ServerParams = new object[] { milPlanEntity, portMilEntity }; ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("撤销成功!")) { doQueryRepeate(); MessageUtil.ShowTips(ccp.ReturnInfo); } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } } /// /// 复取样 /// private void reGetSample() { this.ultraGrid15.UpdateData(); this.ultraGrid17.UpdateData(); UltraGridRow uRow = this.ultraGrid15.ActiveRow; List lists = portMchBatchSampleResultEntityBindingSource2.DataSource as List; if (uRow == null || lists.Count <= 0) { return; } if (lists.Any(p => p.Chk == true && p.ResamplePipeLenA == "" && p.ResamplePipeLenB == "" && p.ResamplePipeLenC == "" && p.ResamplePipeLenD == "" && p.ResamplePipeLenE == "" && p.ResamplePipeLenF == "" && p.ResamplePipeLenP == "" && p.ResamplePipeLenQ == "" && p.ResamplePipeLenM == "")) { MessageUtil.ShowTips("还有已选做样管未输入样管长度的管材,不允许进行复取样完成!"); return; } if (lists.Any(p => p.Chk == true && !StringUtil.IsInt32(p.ResamplePipeLenA) && !StringUtil.IsInt32(p.ResamplePipeLenB) && !StringUtil.IsInt32(p.ResamplePipeLenC) && !StringUtil.IsInt32(p.ResamplePipeLenD) && !StringUtil.IsInt32(p.ResamplePipeLenE) && !StringUtil.IsInt32(p.ResamplePipeLenF) && !StringUtil.IsInt32(p.ResamplePipeLenP) && !StringUtil.IsInt32(p.ResamplePipeLenQ)&& !StringUtil.IsInt32(p.ResamplePipeLenM))) { MessageUtil.ShowTips("样管长度单位为毫米,请输入整数!"); return; } PipeCheckconsignNoqualifiedEntity milPlans = (PipeCheckconsignNoqualifiedEntity)uRow.ListObject; string milPlanEntity = JSONFormat.Format(milPlans); List portMilEntity = lists.Where(p => p.Chk).Select(JSONFormat.Format).ToList(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.mes.port.vrp.FrmMchBatchSampleNew"; ccp.MethodName = "reGetSample"; ccp.ServerParams = new object[] { milPlanEntity, portMilEntity, UserInfo.GetUserName(), UserInfo.GetUserGroup(), UserInfo.GetUserOrder() }; ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("复取样完成!")) { doQueryRepeate(); MessageUtil.ShowTips(ccp.ReturnInfo); } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } } /// /// 委托完成 /// private void comfrimComplete() { this.ultraGrid1.UpdateData(); UltraGridRow row = this.ultraGrid1.ActiveRow; if (row == null) return; PlnZyJgxMEntity planEntity = (PlnZyJgxMEntity)row.ListObject; string planTity = JSONFormat.Format(planEntity); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.mes.port.vrp.FrmMchBatchSampleNew"; ccp.MethodName = "comfrimComplete"; ccp.ServerParams = new object[] { planTity }; ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("委托完成!")) { doQueryPlan(); MessageUtil.ShowTips(ccp.ReturnInfo); } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } } /// /// 查询复取样信息 /// private void doQueryRepeate() { string startTime = ""; string endTim = ""; string lotNo = ""; string judgeNo = ""; if (this.chkRegTime.Checked) { startTime = this.RegStartTime.Value.ToString(); endTim = this.RegEndTime.Value.ToString(); } if (chkLotNo.Checked && this.txtLotNo.Text.Trim() != "") { lotNo = this.txtLotNo.Text; } if (chkJudgeNo.Checked && this.txtJudgeNo.Text.Trim() != "") { judgeNo = this.txtJudgeNo.Text; } ArrayList parm = new ArrayList(); parm.Add(startTime); parm.Add(endTim); parm.Add(lotNo); parm.Add(judgeNo); if (ultraTabControl1.SelectedTab.Key == "4") { parm.Add("0"); } else if (ultraTabControl1.SelectedTab.Key == "5") { parm.Add("1"); } List listSource = EntityHelper.GetData( "com.steering.mes.port.mil.FrmMilBatchSampleNew.doQueryRepeate", new object[] { parm, plineCode }, this.ob); if (ultraTabControl1.SelectedTab.Key == "4") { pipeCheckconsignNoqualifiedEntityBindingSource.DataSource = listSource; } else if (ultraTabControl1.SelectedTab.Key == "5") { pipeCheckconsignNoqualifiedEntityBindingSource3.DataSource = listSource; } } /// /// 复取样委托 /// private void repeateFrim() { this.ultraGrid19.UpdateData(); this.ultraGrid20.UpdateData(); UltraGridRow uRow = this.ultraGrid19.ActiveRow; if (uRow == null) return; PipeCheckconsignNoqualifiedEntity pipeCheckEntity = (PipeCheckconsignNoqualifiedEntity)uRow.ListObject; string pipeTity = JSONFormat.Format(pipeCheckEntity); List> parmList = new List>(); foreach (UltraGridRow row in this.ultraGrid21.Rows) { List list = new List(); list.Add(row.Cells["PHY_BATCH_NO"].Text); list.Add(row.Cells["MAT_NO"].Text); list.Add(row.Cells["SAMPLE_PIPE_LEN"].Text); list.Add(row.Cells["SAMPLE_POSTION"].Text); for (int j = 5; j < dataTable5.Columns.Count; j++) { if (row.Cells[j].Value == "√") { list.Add(row.Cells[j].Column.Key); } } parmList.Add(list); } List> batchList = parmList.GroupBy(p => p[0]).Select(p => p.FirstOrDefault() ).ToList(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.mes.port.vrp.FrmMchBatchSampleNew"; ccp.MethodName = "repeateFrim"; ccp.ServerParams = new object[] { pipeTity, parmList, batchList, UserInfo.GetUserName(), UserInfo.GetDepartment() }; ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("复取样委托成功!")) { doQueryRepeate(); MessageUtil.ShowTips(ccp.ReturnInfo); } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } } /// /// 撤销复取样委托 /// private void cancelRepeateFrim() { this.ultraGrid19.UpdateData(); UltraGridRow uRow = this.ultraGrid19.ActiveRow; if (uRow == null) return; PipeCheckconsignNoqualifiedEntity pipeNoTity = (PipeCheckconsignNoqualifiedEntity)uRow.ListObject; string pipeNoEntity = JSONFormat.Format(pipeNoTity); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.mes.port.vrp.FrmMchBatchSampleNew"; ccp.MethodName = "cancelRepeateFrim"; ccp.ServerParams = new object[] { pipeNoEntity }; ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("撤销复取样委托成功!")) { doQueryRepeate(); MessageUtil.ShowTips(ccp.ReturnInfo); } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } } /// /// 打印复样标签 /// private void printReLable() { this.ultraGrid19.UpdateData(); UltraGridRow uRow = this.ultraGrid19.ActiveRow; if (uRow == null) return; string checkNo = "F" + uRow.Cells["CheckNo"].Text.Trim(); string strurl = ""; strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepEntrustLabel.cpt" + "&CHECK_NO=" + checkNo; FrmRepExcel fBug = new FrmRepExcel(ob, strurl); fBug.AutoSize = true; fBug.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height); fBug.WindowState = FormWindowState.Maximized; fBug.Text = "样管号标签"; fBug.Show(); } /// /// 标签 /// private void printLable() { this.ultraGrid12.UpdateData(); UltraGridRow uRow = this.ultraGrid12.ActiveRow; if (uRow == null) return; string checkNo = uRow.Cells["CheckNo"].Text.Trim(); string strurl = ""; strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepEntrustLabel.cpt&&format=pdf&__embed__=true" + "&CHECK_NO=" + checkNo + "&JUDGE_STOVE_NO=" + uRow.Cells["HeatNo"].Text.Trim() + "&PROCESS_CODE=F"; FrmRepExcel fBug = new FrmRepExcel(ob, strurl); fBug.AutoSize = true; fBug.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height); fBug.WindowState = FormWindowState.Maximized; fBug.Text = "样管号标签"; fBug.Show(); } /// /// 打印 /// private void printTrust() { this.ultraGrid12.UpdateData(); UltraGridRow uRow = this.ultraGrid12.ActiveRow; if (uRow == null) return; this.ultraGrid13.UpdateData(); UltraGridRow uRow2 = this.ultraGrid13.ActiveRow; if (uRow2 == null) return; string checkNo = uRow.Cells["CheckNo"].Text.Trim(); string orderNo = uRow2.Cells["OrderNo"].Text.Trim(); string strurl = ""; strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepLimsPortCheckConsignOrder.cpt&&format=pdf&__embed__=true" + "&CHECK_NO=" + checkNo + "&orderNo=" + orderNo; FrmRepExcel fBug = new FrmRepExcel(ob, strurl); fBug.AutoSize = true; fBug.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height); fBug.WindowState = FormWindowState.Maximized; fBug.Text = "检验委托单"; fBug.Show(); } /// /// 打印复样委托单 /// private void printReTrust() { this.ultraGrid19.UpdateData(); UltraGridRow uRow = this.ultraGrid19.ActiveRow; if (uRow == null) return; this.ultraGrid20.UpdateData(); UltraGridRow uRow2 = this.ultraGrid20.ActiveRow; if (uRow2 == null) return; string checkNo = "F" + uRow.Cells["CheckNo"].Text.Trim(); string strurl = ""; strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepLimsPortCheckConsignOrder.cpt&&format=pdf&__embed__=true" + "&CHECK_NO=" + checkNo ; FrmRepExcel fBug = new FrmRepExcel(ob, strurl); fBug.AutoSize = true; fBug.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height); fBug.WindowState = FormWindowState.Maximized; fBug.Text = "检验委托单"; fBug.Show(); } private void close() { this.Close(); } /// /// 取样完成 /// private void getSample() { this.ultraGrid1.UpdateData(); this.ultraGrid3.UpdateData(); UltraGridRow uRow = this.ultraGrid1.ActiveRow; List lists = portMchBatchSampleResultEntityBindingSource.DataSource as List; if (uRow == null || lists.Count <= 0) { return; } if (lists.Any(p => p.Chk == true && p.SamplePipeLenA == "" && p.SamplePipeLenB == "" && p.SamplePipeLenC == "" && p.SamplePipeLenD == "" && p.SamplePipeLenM == "" && p.SamplePipeLenE == "" && p.SamplePipeLenF == "" && p.SamplePipeLenP == "" && p.SamplePipeLenQ == "")) { MessageUtil.ShowTips("还有已选做样管未输入样管长度的管材,不允许进行取样完成!"); return; } if (lists.Any(p => p.Chk == true && !StringUtil.IsInt32(p.SamplePipeLenA) && !StringUtil.IsInt32(p.SamplePipeLenB) && !StringUtil.IsInt32(p.SamplePipeLenC) && !StringUtil.IsInt32(p.SamplePipeLenD) && !StringUtil.IsInt32(p.SamplePipeLenM) && !StringUtil.IsInt32(p.SamplePipeLenE) && !StringUtil.IsInt32(p.SamplePipeLenF) && !StringUtil.IsInt32(p.SamplePipeLenP) && !StringUtil.IsInt32(p.SamplePipeLenQ))) { MessageUtil.ShowTips("样管长度单位为毫米,请输入整数!"); return; } PlnZyJgxMEntity milPlans = (PlnZyJgxMEntity)uRow.ListObject; string milPlanEntity = JSONFormat.Format(milPlans); List portMilEntity = lists.Where(p => p.Chk).Select(JSONFormat.Format).ToList(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.mes.port.vrp.FrmMchBatchSampleNew"; ccp.MethodName = "getSample"; ccp.ServerParams = new object[] { milPlanEntity, portMilEntity, UserInfo.GetUserName(), UserInfo.GetUserGroup(), UserInfo.GetUserOrder(), this.cmbSampleType.Value.ToString() }; ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("取样完成!")) { doQueryPlan(); MessageUtil.ShowTips(ccp.ReturnInfo); } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } } /// /// 撤销取样完成 /// private void cancelGetSample() { this.ultraGrid5.UpdateData(); UltraGridRow uRow = this.ultraGrid5.ActiveRow; UltraGridRow row = this.ultraGrid8.ActiveRow; if (uRow == null || row == null) return; PlnZyJgxMEntity milPlans = (PlnZyJgxMEntity)uRow.ListObject; string milPlanEntity = JSONFormat.Format(milPlans); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.mes.port.vrp.FrmMchBatchSampleNew"; ccp.MethodName = "cancelGetSample"; ccp.ServerParams = new object[] { milPlanEntity,row.Cells["PHY_BATCH_NO"].Text }; ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("撤销成功!")) { doQueryPlan(); MessageUtil.ShowTips(ccp.ReturnInfo); } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } } /// /// 确认委托 /// private void confirm() { this.ultraGrid9.UpdateData(); this.ultraGrid10.UpdateData(); this.ultraGrid11.UpdateData(); this.ultraGrid18.UpdateData(); UltraGrid ug = null; DataTable dataTable = null; string craftSource = ""; if (ultraTabControl3.SelectedTab.Key == "0") { ug = ultraGrid11; dataTable = dataTable3; craftSource = "0"; } else if (ultraTabControl3.SelectedTab.Key == "1") { ug = ultraGrid18; dataTable = dataTable5; craftSource = "1"; } else if (ultraTabControl3.SelectedTab.Key == "2") { ug = ultraGrid23; dataTable = dataTable7; craftSource = "2"; } UltraGridRow uRow = ultraGrid9.ActiveRow; if (uRow == null) return; // List chemSource = EntityHelper.GetData( //"com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryChem", new object[] { uRow.Cells["ProPlanId"].Text, uRow.Cells["GxPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text.Substring(0, 6) }, this.ob);//查询成分详细信息 // List phySource = EntityHelper.GetData( //"com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryPhy", new object[] { uRow.Cells["ProPlanId"].Text, uRow.Cells["GxPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text.Substring(0, 6) }, this.ob);//查询理化详细信息 PlnZyJgxMEntity milTity = (PlnZyJgxMEntity)uRow.ListObject; milTity.CraftSource = craftSource; string milEntity = JSONFormat.Format(milTity); List> parmList = new List>(); foreach(UltraGridRow row in ug.Rows) { int m = 0; List list = new List(); list.Add(row.Cells["PHY_BATCH_NO"].Text); list.Add(row.Cells["MAT_NO"].Text); list.Add(row.Cells["SAMPLE_PIPE_LEN"].Text); list.Add(row.Cells["SAMPLE_POSTION"].Text); for (int j = 5; j < dataTable.Columns.Count; j++) { if (row.Cells[j].Value == "√") { list.Add(row.Cells[j].Column.Key); m = m + 1; } } if (m > 0) { parmList.Add(list); } } List> batchList = parmList.GroupBy(p => p[0]).Select(p => p.FirstOrDefault() ).ToList(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.mes.port.vrp.FrmMchBatchSampleNew"; ccp.MethodName = "confirm"; ccp.ServerParams = new object[] { milEntity, parmList, batchList, UserInfo.GetUserName(), UserInfo.GetDepartment() }; ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("委托成功!")) { doQueryPlan(); MessageUtil.ShowTips(ccp.ReturnInfo); } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } } /// /// 取消确认 /// private void cancelConfirm() { this.ultraGrid14.UpdateData(); UltraGridRow uRow = this.ultraGrid12.ActiveRow; if (uRow == null) return; PipeCheckconsignBaseinfoEntity milTity = (PipeCheckconsignBaseinfoEntity)uRow.ListObject; string milPlanEntity = JSONFormat.Format(milTity); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.mes.port.vrp.FrmMchBatchSampleNew"; ccp.MethodName = "cancelConfirm"; ccp.ServerParams = new object[] { milPlanEntity }; ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("撤销委托成功!")) { doQueryPlan(); MessageUtil.ShowTips(ccp.ReturnInfo); } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } } /// /// 查询炉计划 /// private void doQueryPlan() { string startTime = ""; string endTim = ""; string lotNo = ""; string judgeNo = ""; List listSource = null; List listSource1 = null; if (this.chkRegTime.Checked) { startTime = this.RegStartTime.Value.ToString(); endTim = this.RegEndTime.Value.ToString(); } if (chkLotNo.Checked && this.txtLotNo.Text.Trim() != "") { lotNo = this.txtLotNo.Text; } if (chkJudgeNo.Checked && this.txtJudgeNo.Text.Trim() != "") { judgeNo = this.txtJudgeNo.Text; } ArrayList parm = new ArrayList(); parm.Add(startTime); parm.Add(endTim); parm.Add(lotNo); parm.Add(judgeNo); if (this.ultraTabControl1.SelectedTab.Key == "0") { parm.Add("0"); listSource = EntityHelper.GetData( "com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQueryPlan", new object[] { parm, plineCode }, this.ob); } else if (this.ultraTabControl1.SelectedTab.Key == "1") { parm.Add("2"); listSource = EntityHelper.GetData( "com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQueryPlan", new object[] { parm, plineCode }, this.ob); } else if (this.ultraTabControl1.SelectedTab.Key == "2") { parm.Add("2"); listSource = EntityHelper.GetData( "com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQueryPlan", new object[] { parm, plineCode }, this.ob); } else if (this.ultraTabControl1.SelectedTab.Key == "3") { parm.Add("3"); listSource1= EntityHelper.GetData( "com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQueryPipeBaseInfo", new object[] { parm, plineCode }, this.ob); } if (this.ultraTabControl1.SelectedTab.Key == "0") { plnZyJgxMEntityBindingSource1.Clear(); portMchBatchSampleResultEntityBindingSource.Clear(); plnZyJgxMEntityBindingSource.DataSource = listSource; } else if (this.ultraTabControl1.SelectedTab.Key == "1") { plnZyJgxMEntityBindingSource3.Clear(); portMchBatchSampleResultEntityBindingSource1.Clear(); dataTable2.Clear(); plnZyJgxMEntityBindingSource2.DataSource = listSource; } else if (this.ultraTabControl1.SelectedTab.Key == "2") { plnZyJgxMEntityBindingSource5.Clear(); dataTable3.Clear(); plnZyJgxMEntityBindingSource4.DataSource = listSource; } else if (this.ultraTabControl1.SelectedTab.Key == "3") { plnZyJgxMEntityBindingSource6.Clear(); dataTable4.Clear(); pipeCheckconsignBaseinfoEntityBindingSource.DataSource = listSource1; } } private void chkRegTime_CheckedChanged(object sender, EventArgs e) { this.RegStartTime.Enabled = this.RegEndTime.Enabled = this.chkRegTime.Checked; } private void chkLotNo_CheckedChanged(object sender, EventArgs e) { this.txtLotNo.Enabled = this.chkLotNo.Checked; } private void chkJudgeNo_CheckedChanged(object sender, EventArgs e) { this.txtJudgeNo.Enabled = this.chkJudgeNo.Checked; } private void ultraGrid1_AfterRowActivate(object sender, EventArgs e) { this.ultraGrid1.UpdateData(); UltraGridRow uRow = this.ultraGrid1.ActiveRow; doQueryBasePlan(uRow); doQueryRack(uRow); } private void initBindTable(UltraGridRow row) { List lists = portMchBatchSampleResultEntityBindingSource1.DataSource as List; DataTable ds = PublicServer.GetData("com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQueryHeadNum", new object[] { row.Cells["HeatPlanNo"].Text, row.Cells["JudgeStoveNo"].Text }, ob); dataTable2.Rows.Clear(); if (lists == null || lists.Count() <= 0) return; foreach (var list in lists.Where(p => p.PhyBatchNo != "").GroupBy(p => p.PhyBatchNo)) { DataRow newRow; newRow = dataTable2.NewRow(); newRow["PHY_BATCH_NO"] = list.Key; newRow["START_SEQ"] = list.Min(p => int.Parse(p.Seq)); newRow["END_SEQ"] = list.Max(p => int.Parse(p.Seq)); newRow["NUM"] = list.Count(); newRow["SAMPLE_NUM"] = list.Count(p => p.SamplePipeLenA != "" || p.SamplePipeLenB != "" || p.SamplePipeLenC != "" || p.SamplePipeLenD != "" || p.SamplePipeLenM != "" || p.SamplePipeLenE != "" || p.SamplePipeLenF != "" || p.SamplePipeLenP != "" || p.SamplePipeLenQ != ""); if (ds.Rows.Count > 0) { for (int i = 0; i < ds.Rows.Count; i++) { if (ds.Rows[i]["BATCH_NO"].ToString() == list.Key) { newRow["HEAD_NUM"] = ds.Rows[i]["ACOUNT"].ToString(); } } } dataTable2.Rows.Add(newRow); } ultraGrid8.Update(); } /// /// 查询炉计划基础信息 /// /// private void doQueryBasePlan(UltraGridRow row) { List listSource = null; if (this.ultraTabControl1.SelectedTab.Key == "0") { listSource = EntityHelper.GetData( "com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQueryBasePlan", new object[] { row.Cells["HeatPlanNo"].Text, row.Cells["ZyBatchId"].Text, row.Cells["JudgeStoveNo"].Text }, this.ob); plnZyJgxMEntityBindingSource1.DataSource = listSource; } else if (this.ultraTabControl1.SelectedTab.Key == "1") { listSource = EntityHelper.GetData( "com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQueryBasePlan", new object[] { row.Cells["HeatPlanNo"].Text, row.Cells["ZyBatchId"].Text, row.Cells["JudgeStoveNo"].Text }, this.ob); plnZyJgxMEntityBindingSource3.DataSource = listSource; } else if (this.ultraTabControl1.SelectedTab.Key == "2") { listSource = EntityHelper.GetData( "com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQueryBasePlan", new object[] { row.Cells["HeatPlanNo"].Text, row.Cells["ZyBatchId"].Text, row.Cells["JudgeStoveNo"].Text }, this.ob); plnZyJgxMEntityBindingSource5.DataSource = listSource; }else if(this.ultraTabControl1.SelectedTab.Key == "3") { listSource = EntityHelper.GetData( "com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQueryBasePlan", new object[] { row.Cells["HeatPlanNo"].Text, row.Cells["LotNo"].Text, row.Cells["HeatNo"].Text }, this.ob); plnZyJgxMEntityBindingSource6.DataSource = listSource; } } /// /// 查询管号队列 /// /// private void doQueryRack(UltraGridRow row) { List listSource = null; if (this.ultraTabControl1.SelectedTab.Key == "0") { listSource = EntityHelper.GetData( "com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQueryRackQ", new object[] { row.Cells["HeatPlanNo"].Text, row.Cells["JudgeStoveNo"].Text }, this.ob); portMchBatchSampleResultEntityBindingSource.DataSource = listSource; } else if (this.ultraTabControl1.SelectedTab.Key == "1") { listSource = EntityHelper.GetData( "com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQueryRack", new object[] { row.Cells["HeatPlanNo"].Text, row.Cells["JudgeStoveNo"].Text }, this.ob); List lists = listSource as List; lists.Where(p => p.IsSamplePipe == "1").ToList().ForEach(p => p.Chk = true); portMchBatchSampleResultEntityBindingSource1.DataSource = lists; initBindTable(row); } } private void ultraGrid3_CellChange(object sender, CellEventArgs e) { this.ultraGrid3.UpdateData(); dataTable1.Rows.Clear(); ultraGrid3.Update(); ultraGrid3.UpdateData(); List lists = portMchBatchSampleResultEntityBindingSource.DataSource as List; if (lists == null || lists.Count() <= 0) return; //foreach (var list in lists.Where(p => p.PhyBatchNo != "").GroupBy(p => p.PhyBatchNo)) //{ // DataRow newRow; // newRow = dataTable1.NewRow(); // newRow["PHY_BATCH_NO"] = list.Key; // newRow["START_SEQ"] = list.Min(p => int.Parse(p.Seq)); // newRow["END_SEQ"] = list.Max(p => int.Parse(p.Seq)); // newRow["NUM"] = list.Count(); // newRow["SAMPLE_NUM"] = list.Count(p => p.SamplePipeLenA != "" || p.SamplePipeLenB != "" || p.SamplePipeLenC != "" || p.SamplePipeLenD != "" || p.SamplePipeLenM != "" || p.SamplePipeLenE != "" || p.SamplePipeLenF != "" || p.SamplePipeLenP != "" || p.SamplePipeLenQ != ""); // newRow["HEAD_NUM"] = list.Sum(p => (p.SamplePipeLenA == "" ? 0 : 1) + (p.SamplePipeLenB == "" ? 0 : 1) + (p.SamplePipeLenC == "" ? 0 : 1) + (p.SamplePipeLenD == "" ? 0 : 1) + (p.SamplePipeLenM == "" ? 0 : 1) + (p.SamplePipeLenE == "" ? 0 : 1) + (p.SamplePipeLenF == "" ? 0 : 1) + (p.SamplePipeLenP == "" ? 0 : 1) + (p.SamplePipeLenQ == "" ? 0 : 1)); // dataTable1.Rows.Add(newRow); //} //ultraGrid4.Update(); if (e != null && (e.Cell.Column.Key == "SamplePipeLenA" || e.Cell.Column.Key == "SamplePipeLenB" || e.Cell.Column.Key == "SamplePipeLenC" || e.Cell.Column.Key == "SamplePipeLenD" || e.Cell.Column.Key == "SamplePipeLenM")) { if (e.Cell.Row.Cells["Chk"].Value.ToString() == "False") { MessageUtil.ShowTips("输入长度前,请勾选样管!"); return; } } if (e != null && e.Cell.Column.Key == "Chk") { if (e.Cell.Value.ToString() == "True") { e.Cell.Row.RowSelectorAppearance.BackColor = Color.Red; txtMatNo.Text = e.Cell.Row.Cells["MatNo"].Text; } else { e.Cell.Row.RowSelectorAppearance.BackColor = Color.Empty; } } } private void ultraGrid5_AfterRowActivate(object sender, EventArgs e) { this.ultraGrid5.UpdateData(); UltraGridRow uRow = this.ultraGrid5.ActiveRow; if (uRow == null) return; doQueryRack(uRow); doQueryBasePlan(uRow); } DataTable dtChem = new DataTable(); DataTable dtPhy = new DataTable(); private void ultraGrid9_AfterRowActivate(object sender, EventArgs e) { this.ultraGrid9.UpdateData(); UltraGridRow uRow = this.ultraGrid9.ActiveRow; if (uRow == null) return; doQuerySampleRack(uRow,"0");//查询正常样管信息 doQuerySampleRack(uRow,"1");//查询首日检样管信息 doQuerySampleRack(uRow, "2");//查询生产加样样管信息 doQueryBasePlan(uRow); doQueryPhyChem(uRow,"0");//查询正常样成分、理化项目明细 doQueryPhyChem(uRow,"1");//查询首日检成分、理化项目明细 doQueryPhyChem(uRow, "2");//查询生产加样成分、理化项目明细 //initBaseInfo(uRow);//加载已委托检验单 } private void initBaseInfo(UltraGridRow row) { DataTable ds = PublicServer.GetData("com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.initBaseInfo", new object[] { row.Cells["JudgeStoveNo"].Text, "F" }, ob); if (ds != null && ds.Rows.Count > 0) { //cmbCheckNo.DataSource = ds; //cmbCheckNo.ValueMember = "CHECK_NO_VALUE"; } } private void ultraGrid12_AfterRowActivate(object sender, EventArgs e) { this.ultraGrid12.UpdateData(); UltraGridRow uRow = this.ultraGrid12.ActiveRow; if (uRow == null) return; doQueryBasePlan(uRow); doQuerySampleNo(uRow);//查询试样号信息 } /// /// 查询试样号信息 /// /// private void doQuerySampleNo(UltraGridRow uRow) { while (dataTable4.Columns.Count > 5) { dataTable4.Columns.RemoveAt(5); } DataTable dtSample = PublicServer.GetData("com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQueryDetialSampleNo", new Object[] { uRow.Cells["CheckNo"].Text }, ob); dataTable4.Rows.Clear(); dtSample.AsEnumerable().GroupBy(p => new { BatchNo = p["BATCH_NO"].ToString(), Sample = p["HEAD_MAT_NO"].ToString(),MatNo = p["MAT_NO"].ToString(),CheckNo = p["CHECK_NO"].ToString() }).ToList() .ForEach(p => { foreach (DataRow row in p) { if (!dataTable4.Columns.Contains(row["PHY_CODE_MAX"].ToString())) { DataColumn phyCloum = new DataColumn(); phyCloum.ColumnName = row["PHY_CODE_MAX"].ToString(); phyCloum.Caption = row["PHY_NAME_MAX"].ToString(); dataTable4.Columns.Add(phyCloum); } } DataRow dr = dataTable4.NewRow(); dr["PHY_BATCH_NO"] = p.Key.BatchNo; dr["HEAD_MAT_NO"] = p.Key.Sample; dr["SAMPLE_LEN"] = p.Max(q => q["SAMPLE_LEN"]); dr["MAT_NO"] = p.Key.MatNo; dr["CHECK_NO"] = p.Key.CheckNo; foreach (DataRow row in p) { dr[row["PHY_CODE_MAX"].ToString()] = row["SAMPLE_COUNT"].ToString(); } dataTable4.Rows.Add(dr); }); ultraGrid14.DataBind(); GridHelper.RefreshAndAutoSize(ultraGrid14); } /// /// 查询成分理化项目明细 /// /// private void doQueryPhyChem(UltraGridRow uRow,string sampleType) { DataTable dataTable = null; UltraGrid ug = null; string craftSource = ""; if (sampleType == "0") { dataTable = dataTable3; ug = ultraGrid11; craftSource = "0"; } else if (sampleType == "1") { dataTable = dataTable5; ug = ultraGrid18; craftSource = "2"; ultraLabel1.Text = ""; } else if (sampleType == "2") { dataTable = dataTable7; ug = ultraGrid23; craftSource = "0"; } while (dataTable.Columns.Count > 5) { dataTable.Columns.RemoveAt(5); } dtChem = PublicServer.GetData("com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQueryChem", new Object[] { uRow.Cells["ProPlanId"].Text, uRow.Cells["GxPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text.Substring(0, 6), craftSource }, ob);//查询成分明细 if (dtChem.Rows.Count > 0) { DataColumn hxCloum = new DataColumn(); hxCloum.ColumnName = "HX"; hxCloum.Caption = "化学"; dataTable.Columns.Add(hxCloum); } dtPhy = PublicServer.GetData("com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQueryPhy", new Object[] { uRow.Cells["ProPlanId"].Text, uRow.Cells["GxPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text.Substring(0, 6), craftSource }, ob);//查询理化明细 string[] phyMaxCode = null; ultraLabel4.Text = ""; List list = new List(); if (dtPhy.Rows.Count > 0) { dtPhy.AsEnumerable().Select(p => new { Code = p["PHY_CODE_MIN"].ToString(), Name = p["PHY_NAME_MIN"].ToString(), rate = p["RATE"].ToString(), rateName = p["DESC_RATE"].ToString(), common = p["COMMON"].ToString() }).Distinct().ToList() .ForEach(p => { DataColumn phyCloum = new DataColumn(); phyCloum.ColumnName = p.Code; phyCloum.Caption = p.Name; dataTable.Columns.Add(phyCloum); if (p.rate.Equals("408601") || p.rate.Equals("408608")) { ultraLabel4.Text = ultraLabel4.Text + p.Name + " 取样频次:" + p.rateName; list.Add(p.Code); } if (sampleType == "1") { if (p.common.Equals("1")) { ultraLabel1.Text = ultraLabel1.Text + p.Name + " (共样) "; } } }); } foreach (DataRow dr in dataTable.Rows) { string[] phyCodeGroup = dr["PHY_CODE_GROUP"].ToString().Split(','); for (int i = 5; i < dataTable.Columns.Count; i++) { if (phyCodeGroup.Contains(dataTable.Columns[i].ColumnName)) { dr[i] = "√"; } } } phyMaxCode = list.ToArray(); ug.DataBind(); GridHelper.RefreshAndAutoSize(ug); ultraLabel4.ForeColor = Color.Red; ultraLabel1.ForeColor = Color.Red; } private void doQueryPhyCodeMax(string[] phyMaxCode, string lotNo) { List listSource = EntityHelper.GetData( "com.steering.mes.port.mil.FrmMilBatchSampleNew.doQueryPhyCodeMax", new object[] { lotNo, phyMaxCode }, this.ob); pipeCheckconsignDetailEntityBindingSource.DataSource = listSource; } /// /// 查询正常样管信息 /// private void doQuerySampleRack(UltraGridRow uRow, string sampleType) { DataTable dtBatchNo = null; if (sampleType == "0") { dtBatchNo = PublicServer.GetData("com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQuerySampleInfo", new Object[] { uRow.Cells["HeatPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text, sampleType }, ob); }else if(sampleType == "1") { dtBatchNo = PublicServer.GetData("com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQuerySampleInfo", new Object[] { uRow.Cells["HeatPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text, "1" }, ob); } else if (sampleType == "2") { dtBatchNo = PublicServer.GetData("com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQuerySampleInfo", new Object[] { uRow.Cells["HeatPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text, "2" }, ob); } if (sampleType == "0") { GridHelper.CopyDataToDatatable(dtBatchNo, dataTable3, true); } else if (sampleType == "1") { GridHelper.CopyDataToDatatable(dtBatchNo, dataTable5, true); } else if (sampleType == "2") { GridHelper.CopyDataToDatatable(dtBatchNo, dataTable7, true); } } private void ultraGrid11_ClickCell(object sender, ClickCellEventArgs e) { this.ultraGrid9.UpdateData(); UltraGridRow uRow = this.ultraGrid9.ActiveRow; if (uRow == null) return; string craftSource = ""; if (ultraTabControl3.SelectedTab.Key == "0") { craftSource = "0"; } else if (ultraTabControl3.SelectedTab.Key == "1") { craftSource = "2"; } else { craftSource = "0"; } if (e.Cell.Column.Key != "PHY_BATCH_NO" && e.Cell.Column.Key != "MAT_NO" && e.Cell.Column.Key != "SAMPLE_PIPE_LEN" && e.Cell.Column.Key != "SAMPLE_POSTION") { if (e.Cell.Text.Trim() == "") { DataTable ds = new DataTable(); if (e.Cell.Column.Key == "C0004" || e.Cell.Column.Key == "C0100" || e.Cell.Column.Key == "C0103" || e.Cell.Column.Key == "C0107") { if(ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0030")){ ds = PublicServer.GetData("com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQueryS", new object[] { craftSource, uRow.Cells["ProPlanId"].Text, uRow.Cells["GxPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text, "C0030" }, ob); if (ds.Rows[0]["SSC_CONDITION"].ToString().Equals("409902")) { e.Cell.Row.Cells["C0030"].Value = "√"; } } if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0033")) { ds = PublicServer.GetData("com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQueryS", new object[] { craftSource, uRow.Cells["ProPlanId"].Text, uRow.Cells["GxPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text, "C0033" }, ob); if (ds.Rows[0]["SSC_CONDITION"].ToString().Equals("409902")) { e.Cell.Row.Cells["C0033"].Value = "√"; } } } else if (e.Cell.Column.Key == "C0030") { ds = PublicServer.GetData("com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQueryS", new object[] { craftSource, uRow.Cells["ProPlanId"].Text, uRow.Cells["GxPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text, "C0030" }, ob); if (ds.Rows[0]["SSC_CONDITION"].ToString().Equals("409902")) { if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0107")) { e.Cell.Row.Cells["C0107"].Value = "√"; } else if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0103")) { e.Cell.Row.Cells["C0103"].Value = "√"; } else if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0100")) { e.Cell.Row.Cells["C0100"].Value = "√"; } else if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0004")) { e.Cell.Row.Cells["C0004"].Value = "√"; } } } else if (e.Cell.Column.Key == "C0033") { ds = PublicServer.GetData("com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQueryS", new object[] { craftSource, uRow.Cells["ProPlanId"].Text, uRow.Cells["GxPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text, "C0033" }, ob); if (ds.Rows[0]["SSC_CONDITION"].ToString().Equals("409902")) { if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0107")) { e.Cell.Row.Cells["C0107"].Value = "√"; } else if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0103")) { e.Cell.Row.Cells["C0103"].Value = "√"; } else if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0100")) { e.Cell.Row.Cells["C0100"].Value = "√"; } else if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0004")) { e.Cell.Row.Cells["C0004"].Value = "√"; } } } e.Cell.Value = "√"; } else { e.Cell.Value = ""; } } } private void FrmMilBatchSampleNew_Shown(object sender, EventArgs e) { if (toolMenu == null || toolMenu.Toolbars == null) return; if (toolMenu.Toolbars[0].Tools.Exists("Confirm")) { toolMenu.Toolbars[0].Tools["Confirm"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("CancelConfirm")) { toolMenu.Toolbars[0].Tools["CancelConfirm"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("Print")) { toolMenu.Toolbars[0].Tools["Print"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("PrintLable")) { toolMenu.Toolbars[0].Tools["PrintLable"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("CancelGetSample")) { toolMenu.Toolbars[0].Tools["CancelGetSample"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("QueryRepeate")) { toolMenu.Toolbars[0].Tools["QueryRepeate"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("ReGetSample")) { toolMenu.Toolbars[0].Tools["ReGetSample"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("CancelReGetSample")) { toolMenu.Toolbars[0].Tools["CancelReGetSample"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("RepeateFrim")) { toolMenu.Toolbars[0].Tools["RepeateFrim"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("CancelRepeateFrim")) { toolMenu.Toolbars[0].Tools["CancelRepeateFrim"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("PrintRe")) { toolMenu.Toolbars[0].Tools["PrintRe"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("PrintReLable")) { toolMenu.Toolbars[0].Tools["PrintReLable"].InstanceProps.Visible = DefaultableBoolean.False; } } private void ultraTabControl1_SelectedTabChanged(object sender, Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventArgs e) { if (toolMenu == null || toolMenu.Toolbars == null) return; if (toolMenu.Toolbars[0].Tools.Exists("Query")) { toolMenu.Toolbars[0].Tools["Query"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 4 || this.ultraTabControl1.SelectedTab.Index == 5 ? DefaultableBoolean.False : DefaultableBoolean.True; } if (toolMenu.Toolbars[0].Tools.Exists("GetSample")) { toolMenu.Toolbars[0].Tools["GetSample"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 0 ? DefaultableBoolean.True : DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("ComfrimComplete")) { toolMenu.Toolbars[0].Tools["ComfrimComplete"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 0 ? DefaultableBoolean.True : DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("CancelGetSample")) { toolMenu.Toolbars[0].Tools["CancelGetSample"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 1 ? DefaultableBoolean.True : DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("Confirm")) { toolMenu.Toolbars[0].Tools["Confirm"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 2 ? DefaultableBoolean.True : DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("CancelConfirm")) { toolMenu.Toolbars[0].Tools["CancelConfirm"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 3 ? DefaultableBoolean.True : DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("Print")) { toolMenu.Toolbars[0].Tools["Print"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 3 ? DefaultableBoolean.True : DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("PrintLable")) { toolMenu.Toolbars[0].Tools["PrintLable"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 3 ? DefaultableBoolean.True : DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("ReGetSample")) { toolMenu.Toolbars[0].Tools["ReGetSample"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 4 ? DefaultableBoolean.True : DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("CancelReGetSample")) { toolMenu.Toolbars[0].Tools["CancelReGetSample"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 4 ? DefaultableBoolean.True : DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("QueryRepeate")) { toolMenu.Toolbars[0].Tools["QueryRepeate"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 4 || this.ultraTabControl1.SelectedTab.Index == 5 ? DefaultableBoolean.True : DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("RepeateFrim")) { toolMenu.Toolbars[0].Tools["RepeateFrim"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 5 ? DefaultableBoolean.True : DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("CancelRepeateFrim")) { toolMenu.Toolbars[0].Tools["CancelRepeateFrim"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 5 ? DefaultableBoolean.True : DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("PrintRe")) { toolMenu.Toolbars[0].Tools["PrintRe"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 5 ? DefaultableBoolean.True : DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("PrintReLable")) { toolMenu.Toolbars[0].Tools["PrintReLable"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 5 ? DefaultableBoolean.True : DefaultableBoolean.False; } } /// /// 逐支取样 /// /// /// private void pipeceButtonStd_Click(object sender, EventArgs e) { this.ultraGrid1.UpdateData(); this.ultraGrid3.UpdateData(); UltraGridRow uRow = this.ultraGrid1.ActiveRow; if (uRow == null) return; string len = ""; List lists = portMchBatchSampleResultEntityBindingSource.DataSource as List; var m = lists.Where(p => p.PhyBatchNo != "").ToList();//判断是否还未分配性能批号集合数据 if (m.Count == 0) { return; } if (this.txtPieceLen.Text == "") { MessageUtil.ShowTips("请输入逐支取样长度!"); return; } if (!StringUtil.IsInt(this.txtPieceLen.Text.Trim().ToString3())) { MessageUtil.ShowTips("逐支取样长度需输入正整数!"); return; } len = this.txtPieceLen.Text.Trim(); DataTable ds = PublicServer.GetData("com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQueryPhyMaxPipece", new object[] { uRow.Cells["ProPlanId"].Text, uRow.Cells["GxPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text, this.cmbSampleType.Value.ToString() }, ob); if (ds.Rows.Count == 0) { MessageUtil.ShowTips("无逐支取样试样组,不允许一键取样!"); return; } var status = new List { }; status = this.cmbPiecePostion.CheckedItems.Select(p => p.DataValue.ToString()).ToList(); if (!status.Any()) status = new List { "401201", "401202", "401217", "401218", "401219", "401220", "401221", "401222", "401223" }; List listS = EntityHelper.GetData( "com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQuerySampleMatNo", new object[] { uRow.Cells["JudgeStoveNo"].Text, this.cmbSampleType.Value.ToString() }, this.ob); for (int i = 0; i < lists.Count; i++) { var p = lists[i]; if (status.ToArray().Length == 1) { var listD = listS.Where(q => q.MatNo == p.MatNo).ToList(); if (listD.Any()) return; if (status.Contains("401201") || status.Contains("401202")) { if (i == 0) { p.SamplePipeLenA = len; } else { var LastlistD = listS.Where(q => q.MatNo == lists[i - 1].MatNo).ToList(); if (LastlistD.Any()) { if (LastlistD[0].Postion == "A") { p.SamplePipeLenB = len; } else { p.SamplePipeLenA = len; } } else { if (lists[i - 1].SamplePipeLenA == "") { p.SamplePipeLenA = len; } else { p.SamplePipeLenB = len; } } } } if (status.Contains("401217")) { p.SamplePipeLenC = len; } if (status.Contains("401218")) { p.SamplePipeLenD = len; } if (status.Contains("401219")) { p.SamplePipeLenM = len; } if (status.Contains("401220")) { p.SamplePipeLenE = len; } if (status.Contains("401221")) { p.SamplePipeLenF = len; } if (status.Contains("401222")) { p.SamplePipeLenP = len; } if (status.Contains("401223")) { p.SamplePipeLenQ = len; } } else { var listD = listS.Where(q => q.MatNo == p.MatNo).ToList(); if (listD.Any()) return; if (status.Contains("401201")) { p.SamplePipeLenA = len; } if (status.Contains("401202")) { p.SamplePipeLenB = len; } if (status.Contains("401217")) { p.SamplePipeLenC = len; } if (status.Contains("401218")) { p.SamplePipeLenD = len; } if (status.Contains("401219")) { p.SamplePipeLenM = len; } if (status.Contains("401220")) { p.SamplePipeLenE = len; } if (status.Contains("401221")) { p.SamplePipeLenF = len; } if (status.Contains("401222")) { p.SamplePipeLenP = len; } if (status.Contains("401223")) { p.SamplePipeLenQ = len; } } //p.ChemResultCode = "1"; p.Chk = true; } ultraGrid3.Update(); ultraGrid3.DataBind(); ultraGrid3_CellChange(null, null); } private void ultraGrid3_InitializeRow(object sender, InitializeRowEventArgs e) { PortMchBatchSampleResultEntity portHttBatchSampleResultEntity = e.Row.ListObject as PortMchBatchSampleResultEntity; if (portHttBatchSampleResultEntity.PhyBatchNo == "") return; if (portHttBatchSampleResultEntity.IsSamplePipe == "1") { ultraGrid3.Rows[e.Row.Index].RowSelectorAppearance.BackColor = Color.Red; } if (e.Row.Index == 0) { e.Row.Appearance.BackColor = color1; } else { PortMchBatchSampleResultEntity lastList = ultraGrid3.Rows[e.Row.Index - 1].ListObject as PortMchBatchSampleResultEntity; if (portHttBatchSampleResultEntity.PhyBatchNo == lastList.PhyBatchNo) { e.Row.Appearance.BackColor = ultraGrid3.Rows[e.Row.Index - 1].Appearance.BackColor; } else { e.Row.Appearance.BackColor = ultraGrid3.Rows[e.Row.Index - 1].Appearance.BackColor == color1 ? color2 : color1; } } } private void txtLen_ValueChanged(object sender, EventArgs e) { if (!StringUtil.IsInt(this.txtLen.Text)) return; List list1 = null; list1 = portMchBatchSampleResultEntityBindingSource.DataSource as List; if (list1.Any()) { if (this.cmbPostion.Value.ToString().Equals("401201"))//A端 { list1.Where(p => p.MatNo == txtMatNo.Text).ToList().ForEach(p => p.SamplePipeLenA = txtLen.Text); } else if (this.cmbPostion.Value.ToString().Equals("401202")) { list1.Where(p => p.MatNo == txtMatNo.Text).ToList().ForEach(p => p.SamplePipeLenB = txtLen.Text); } else if (this.cmbPostion.Value.ToString().Equals("401217")) { list1.Where(p => p.MatNo == txtMatNo.Text).ToList().ForEach(p => p.SamplePipeLenC = txtLen.Text); } else if (this.cmbPostion.Value.ToString().Equals("401218")) { list1.Where(p => p.MatNo == txtMatNo.Text).ToList().ForEach(p => p.SamplePipeLenD = txtLen.Text); } else if (this.cmbPostion.Value.ToString().Equals("401219")) { list1.Where(p => p.MatNo == txtMatNo.Text).ToList().ForEach(p => p.SamplePipeLenM = txtLen.Text); } else if (this.cmbPostion.Value.ToString().Equals("401220")) { list1.Where(p => p.MatNo == txtMatNo.Text).ToList().ForEach(p => p.SamplePipeLenE = txtLen.Text); } else if (this.cmbPostion.Value.ToString().Equals("401221")) { list1.Where(p => p.MatNo == txtMatNo.Text).ToList().ForEach(p => p.SamplePipeLenF = txtLen.Text); } else if (this.cmbPostion.Value.ToString().Equals("401222")) { list1.Where(p => p.MatNo == txtMatNo.Text).ToList().ForEach(p => p.SamplePipeLenP = txtLen.Text); } else if (this.cmbPostion.Value.ToString().Equals("401223")) { list1.Where(p => p.MatNo == txtMatNo.Text).ToList().ForEach(p => p.SamplePipeLenQ = txtLen.Text); } } ultraGrid3_CellChange(null, null); GridHelper.RefreshAndAutoSize(ultraGrid3); } private void ultraGrid15_AfterRowActivate(object sender, EventArgs e) { this.ultraGrid15.UpdateData(); UltraGridRow uRow = this.ultraGrid15.ActiveRow; if (uRow == null) return; List listSource = EntityHelper.GetData( "com.steering.mes.port.mil.FrmMilBatchSampleNew.doQueryRepeateInformation", new object[] { uRow.Cells["CheckNo"].Text, uRow.Cells["JudgeStoveNo"].Text }, this.ob); pipeCheckconsignNoqualifiedEntityBindingSource2.DataSource = listSource; List listSource1 = EntityHelper.GetData( "com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryRepeatRack", new object[] { uRow.Cells["JudgeStoveNo"].Text }, this.ob); portMchBatchSampleResultEntityBindingSource2.DataSource = listSource1; foreach (UltraGridRow row in this.ultraGrid17.Rows) { if (row.Cells["IsSamplePipe"].Text == "1") { row.RowSelectorAppearance.BackColor = Color.Red; } } } private void ultraGrid19_AfterRowActivate(object sender, EventArgs e) { UltraGridRow uRow = this.ultraGrid19.ActiveRow; if (uRow == null) return; List listSource = EntityHelper.GetData( "com.steering.mes.port.mil.FrmMilBatchSampleNew.doQueryRepeateInformation", new object[] { uRow.Cells["CheckNo"].Text, uRow.Cells["JudgeStoveNo"].Text }, this.ob); pipeCheckconsignNoqualifiedEntityBindingSource4.DataSource = listSource; doQueryResampleRck(uRow); doQueryChemPhy(uRow); doQueryResampleNo(uRow);//复取样委托信息 } private void doQueryResampleNo(UltraGridRow uRow) { while (dataTable6.Columns.Count > 3) { dataTable6.Columns.RemoveAt(3); } DataTable dtSample = PublicServer.GetData("com.steering.mes.port.mil.FrmMilBatchSampleNew.doQueryReDetialSampleNo", new Object[] { uRow.Cells["CheckNo"].Text, "2", "F" }, ob); dataTable6.Rows.Clear(); dtSample.AsEnumerable().GroupBy(p => new { BatchNo = p["BATCH_NO"].ToString(), Sample = p["HEAD_MAT_NO"].ToString() }).ToList() .ForEach(p => { foreach (DataRow row in p) { if (!dataTable6.Columns.Contains(row["PHY_CODE_MAX"].ToString())) { DataColumn phyCloum = new DataColumn(); phyCloum.ColumnName = row["PHY_CODE_MAX"].ToString(); phyCloum.Caption = row["PHY_NAME_MAX"].ToString(); dataTable6.Columns.Add(phyCloum); } } DataRow dr = dataTable6.NewRow(); dr["PHY_BATCH_NO"] = p.Key.BatchNo; dr["HEAD_MAT_NO"] = p.Key.Sample; dr["SAMPLE_LEN"] = p.Max(q => q["SAMPLE_LEN"]); foreach (DataRow row in p) { dr[row["PHY_CODE_MAX"].ToString()] = row["SAMPLE_COUNT"].ToString(); } dataTable6.Rows.Add(dr); }); ultraGrid21.DataBind(); GridHelper.RefreshAndAutoSize(ultraGrid21); } private void doQueryChemPhy(UltraGridRow uRow) { while (dataTable5.Columns.Count > 5) { dataTable5.Columns.RemoveAt(5); } dtPhy = PublicServer.GetData("com.steering.mes.port.mil.FrmMilBatchSampleNew.doQueryReChemPhy", new Object[] { uRow.Cells["LotNo"].Text, uRow.Cells["JudgeStoveNo"].Text, uRow.Cells["CheckNo"].Text }, ob);//查询复取样试样组 List list = new List(); if (dtPhy.Rows.Count > 0) { dtPhy.AsEnumerable().Select(p => new { Code = p["PHY_CODE_MAX"].ToString(), Name = p["PHY_NAME_MAX"].ToString() }).Distinct().ToList() .ForEach(p => { DataColumn phyCloum = new DataColumn(); phyCloum.ColumnName = p.Code; phyCloum.Caption = p.Name; dataTable5.Columns.Add(phyCloum); }); } ultraGrid20.DataBind(); GridHelper.RefreshAndAutoSize(ultraGrid20); } private void doQueryResampleRck(UltraGridRow uRow) { DataTable dtBatchNo = PublicServer.GetData("com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryResampleInfo", new Object[] { uRow.Cells["JudgeStoveNo"].Text, "F" + uRow.Cells["CheckNo"].Text }, ob); dataTable5.Rows.Clear(); foreach (DataRow row in dtBatchNo.Rows) { if (row["RESAMPLE_PIPE_LEN_A"] != null && row["RESAMPLE_PIPE_LEN_A"].ToString() != "") { DataRow newRowA = dataTable5.NewRow(); newRowA["PHY_BATCH_NO"] = row["PHY_BATCH_NO"].ToString(); newRowA["MAT_NO"] = row["MAT_NO"].ToString(); newRowA["SAMPLE_PIPE_LEN"] = row["RESAMPLE_PIPE_LEN_A"].ToString(); newRowA["SAMPLE_POSTION"] = "A端"; newRowA["PHY_CODE_GROUP"] = ""; dataTable5.Rows.Add(newRowA); } if (row["RESAMPLE_PIPE_LEN_B"] != null && row["RESAMPLE_PIPE_LEN_B"].ToString() != "") { DataRow newRowA = dataTable5.NewRow(); newRowA["PHY_BATCH_NO"] = row["PHY_BATCH_NO"].ToString(); newRowA["MAT_NO"] = row["MAT_NO"].ToString(); newRowA["SAMPLE_PIPE_LEN"] = row["RESAMPLE_PIPE_LEN_B"].ToString(); newRowA["SAMPLE_POSTION"] = "B端"; newRowA["PHY_CODE_GROUP"] = ""; dataTable5.Rows.Add(newRowA); } if (row["RESAMPLE_PIPE_LEN_C"] != null && row["RESAMPLE_PIPE_LEN_C"].ToString() != "") { DataRow newRowA = dataTable5.NewRow(); newRowA["PHY_BATCH_NO"] = row["PHY_BATCH_NO"].ToString(); newRowA["MAT_NO"] = row["MAT_NO"].ToString(); newRowA["SAMPLE_PIPE_LEN"] = row["RESAMPLE_PIPE_LEN_C"].ToString(); newRowA["SAMPLE_POSTION"] = "C端"; newRowA["PHY_CODE_GROUP"] = ""; dataTable5.Rows.Add(newRowA); } if (row["RESAMPLE_PIPE_LEN_D"] != null && row["RESAMPLE_PIPE_LEN_D"].ToString() != "") { DataRow newRowA = dataTable5.NewRow(); newRowA["PHY_BATCH_NO"] = row["PHY_BATCH_NO"].ToString(); newRowA["MAT_NO"] = row["MAT_NO"].ToString(); newRowA["SAMPLE_PIPE_LEN"] = row["RESAMPLE_PIPE_LEN_D"].ToString(); newRowA["SAMPLE_POSTION"] = "D端"; newRowA["PHY_CODE_GROUP"] = ""; dataTable5.Rows.Add(newRowA); } if (row["RESAMPLE_PIPE_LEN_E"] != null && row["RESAMPLE_PIPE_LEN_E"].ToString() != "") { DataRow newRowA = dataTable5.NewRow(); newRowA["PHY_BATCH_NO"] = row["PHY_BATCH_NO"].ToString(); newRowA["MAT_NO"] = row["MAT_NO"].ToString(); newRowA["SAMPLE_PIPE_LEN"] = row["RESAMPLE_PIPE_LEN_E"].ToString(); newRowA["SAMPLE_POSTION"] = "E端"; newRowA["PHY_CODE_GROUP"] = ""; dataTable5.Rows.Add(newRowA); } if (row["RESAMPLE_PIPE_LEN_F"] != null && row["RESAMPLE_PIPE_LEN_F"].ToString() != "") { DataRow newRowA = dataTable5.NewRow(); newRowA["PHY_BATCH_NO"] = row["PHY_BATCH_NO"].ToString(); newRowA["MAT_NO"] = row["MAT_NO"].ToString(); newRowA["SAMPLE_PIPE_LEN"] = row["RESAMPLE_PIPE_LEN_F"].ToString(); newRowA["SAMPLE_POSTION"] = "F端"; newRowA["PHY_CODE_GROUP"] = ""; dataTable5.Rows.Add(newRowA); } if (row["RESAMPLE_PIPE_LEN_P"] != null && row["RESAMPLE_PIPE_LEN_P"].ToString() != "") { DataRow newRowA = dataTable5.NewRow(); newRowA["PHY_BATCH_NO"] = row["PHY_BATCH_NO"].ToString(); newRowA["MAT_NO"] = row["MAT_NO"].ToString(); newRowA["SAMPLE_PIPE_LEN"] = row["RESAMPLE_PIPE_LEN_P"].ToString(); newRowA["SAMPLE_POSTION"] = "P端"; newRowA["PHY_CODE_GROUP"] = ""; dataTable5.Rows.Add(newRowA); } if (row["RESAMPLE_PIPE_LEN_Q"] != null && row["RESAMPLE_PIPE_LEN_Q"].ToString() != "") { DataRow newRowA = dataTable5.NewRow(); newRowA["PHY_BATCH_NO"] = row["PHY_BATCH_NO"].ToString(); newRowA["MAT_NO"] = row["MAT_NO"].ToString(); newRowA["SAMPLE_PIPE_LEN"] = row["RESAMPLE_PIPE_LEN_Q"].ToString(); newRowA["SAMPLE_POSTION"] = "Q端"; newRowA["PHY_CODE_GROUP"] = ""; dataTable5.Rows.Add(newRowA); } } GridHelper.RefreshAndAutoSize(ultraGrid20); } private void ultraGrid17_CellChange(object sender, CellEventArgs e) { this.ultraGrid17.UpdateData(); ultraGrid17.Update(); if (e.Cell.Column.Key == "Chk") { if (e.Cell.Value.ToString() == "True") { e.Cell.Row.RowSelectorAppearance.BackColor = Color.Red; txtMatNo1.Text = e.Cell.Row.Cells["MatNo"].Text; } else { e.Cell.Row.RowSelectorAppearance.BackColor = Color.Empty; } } } private void txtLen1_ValueChanged(object sender, EventArgs e) { if (!StringUtil.IsInt(this.txtLen1.Text)) return; List list1 = null; list1 = portMchBatchSampleResultEntityBindingSource2.DataSource as List; if (list1.Any()) { if (this.cmbPostion1.Value.ToString().Equals("401201"))//A端 { list1.Where(p => p.MatNo == txtMatNo1.Text).ToList().ForEach(p => p.ResamplePipeLenA = txtLen1.Text); } else if (this.cmbPostion1.Value.ToString().Equals("401202")) { list1.Where(p => p.MatNo == txtMatNo1.Text).ToList().ForEach(p => p.ResamplePipeLenB = txtLen1.Text); } else if (this.cmbPostion1.Value.ToString().Equals("401217")) { list1.Where(p => p.MatNo == txtMatNo1.Text).ToList().ForEach(p => p.ResamplePipeLenC = txtLen1.Text); } else if (this.cmbPostion1.Value.ToString().Equals("401218")) { list1.Where(p => p.MatNo == txtMatNo1.Text).ToList().ForEach(p => p.ResamplePipeLenD = txtLen1.Text); } else if (this.cmbPostion1.Value.ToString().Equals("401219")) { list1.Where(p => p.MatNo == txtMatNo1.Text).ToList().ForEach(p => p.ResamplePipeLenM = txtLen1.Text); } else if (this.cmbPostion1.Value.ToString().Equals("401220")) { list1.Where(p => p.MatNo == txtMatNo1.Text).ToList().ForEach(p => p.ResamplePipeLenE = txtLen1.Text); } else if (this.cmbPostion1.Value.ToString().Equals("401221")) { list1.Where(p => p.MatNo == txtMatNo1.Text).ToList().ForEach(p => p.ResamplePipeLenF = txtLen1.Text); } else if (this.cmbPostion1.Value.ToString().Equals("401222")) { list1.Where(p => p.MatNo == txtMatNo1.Text).ToList().ForEach(p => p.ResamplePipeLenP = txtLen1.Text); } else if (this.cmbPostion1.Value.ToString().Equals("401223")) { list1.Where(p => p.MatNo == txtMatNo1.Text).ToList().ForEach(p => p.ResamplePipeLenQ = txtLen1.Text); } } GridHelper.RefreshAndAutoSize(ultraGrid17); } private void ultraGrid21_ClickCell(object sender, ClickCellEventArgs e) { if (e.Cell.Column.Key != "PHY_BATCH_NO" && e.Cell.Column.Key != "MAT_NO" && e.Cell.Column.Key != "SAMPLE_PIPE_LEN" && e.Cell.Column.Key != "SAMPLE_POSTION") { if (e.Cell.Text.Trim() == "") { e.Cell.Value = "√"; } else { e.Cell.Value = ""; } } } private void ultraGrid18_ClickCell(object sender, ClickCellEventArgs e) { if (e.Cell.Column.Key != "PHY_BATCH_NO" && e.Cell.Column.Key != "MAT_NO" && e.Cell.Column.Key != "SAMPLE_PIPE_LEN" && e.Cell.Column.Key != "SAMPLE_POSTION") { if (e.Cell.Text.Trim() == "") { e.Cell.Value = "√"; } else { e.Cell.Value = ""; } } } private void ultraGrid8_AfterRowActivate(object sender, EventArgs e) { this.ultraGrid5.UpdateData(); this.ultraGrid8.UpdateData(); UltraGridRow uRow = this.ultraGrid5.ActiveRow; UltraGridRow row = this.ultraGrid8.ActiveRow; doQueryBatchRack(uRow,row); } /// /// 按批查管号队列 /// /// /// private void doQueryBatchRack(UltraGridRow uRow, UltraGridRow row) { List listSource = EntityHelper.GetData( "com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQueryBatchRack", new object[] { uRow.Cells["HeatPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text, row.Cells["PHY_BATCH_NO"].Text }, this.ob); portMchBatchSampleResultEntityBindingSource1.DataSource = listSource; } private void ultraGrid23_ClickCell(object sender, ClickCellEventArgs e) { if (e.Cell.Column.Key != "PHY_BATCH_NO" && e.Cell.Column.Key != "MAT_NO" && e.Cell.Column.Key != "SAMPLE_PIPE_LEN" && e.Cell.Column.Key != "SAMPLE_POSTION") { if (e.Cell.Text.Trim() == "") { e.Cell.Value = "√"; } else { e.Cell.Value = ""; } } } } }