using Core.Mes.Client.Comm.Control; using Core.Mes.Client.Comm.Format; using Core.Mes.Client.Comm.Server; using Core.Mes.Client.Comm.Tool; 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.IO; using System.Linq; using System.Net; using System.Text; using System.Windows.Forms; namespace Core.StlMes.Client.Lims.Data.PipeAndOutdec { public partial class FrmOutdecLabMecDataCJAuditNew : FrmBase { public FrmOutdecLabMecDataCJAuditNew() { InitializeComponent(); } private string[] arrId;//数据权限 private void FrmOutdecLabMecDataCJAuditNew_Load(object sender, EventArgs e) { arrId = new string[] { "002001007009" };//力学项目 EntityHelper.ShowGridCaption(ultraGrid1.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid2.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid3.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid4.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid5.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid6.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid7.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid8.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid9.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid10.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid11.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid12.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid13.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid53.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid14.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid15.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid16.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid17.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid18.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid19.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid20.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid21.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid22.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid23.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid24.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid25.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid26.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid55.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid27.DisplayLayout.Bands[0]); //EntityHelper.ShowGridCaption(ultraGrid27.DisplayLayout.Bands[1]); EntityHelper.ShowGridCaption(ultraGrid28.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid29.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid30.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid31.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid32.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid33.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid34.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid35.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid36.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid37.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid38.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid39.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid56.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid40.DisplayLayout.Bands[0]); //EntityHelper.ShowGridCaption(ultraGrid40.DisplayLayout.Bands[1]); EntityHelper.ShowGridCaption(ultraGrid41.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid42.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid43.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid44.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid45.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid46.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid47.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid48.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid49.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid50.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid51.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid52.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid54.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid57.DisplayLayout.Bands[0]); 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"); //initCheckEqiupment(); } /// /// 重写基类方法 /// /// /// public override void ToolBar_Click(object sender, string ToolbarKey) { //查询、确认、退出 switch (ToolbarKey) { case "Query": if (ultraTabControl1.SelectedTab.Index == 0) { QueryCheckConsignBaseDetail("2"); } else if (ultraTabControl1.SelectedTab.Index == 1) { QueryCheckConsignBaseDetail("3"); } else if (ultraTabControl1.SelectedTab.Index == 2) { QueryCheckConsignBaseDetailNoFrim("3"); } else if (ultraTabControl1.SelectedTab.Index == 3) { QueryCheckConsignBaseDetailYesFrim("4"); } break; case "Add": AddPhyData(); break; case "Update": UpdateCheckConsignProcessResult(); break; case "Delete": DeleteCheckConsignProcessResult(); break; case "Audit": auditCheckConsignDetail(); break; case "CancelAudit": cancelAuditCheckConsignDetail(); break; case "PrintMechanics": printMechanics(); break; case"PrintPicture": printPicture(); break; case "UpFile": UpFile(); break; case"UpPicture": upPicture(); break; case "Close": this.Close(); break; } } private string fileName = "";//路径 /// /// 上传图片 /// private void upPicture() { this.ultraGrid40.UpdateData(); UltraGridRow row = ultraGrid40.ActiveRow; string checkNo = row.Cells["CheckNo"].Value.ToString(); string filePath = "Lims/pipe/caili2/" + checkNo + "/"; if (checkNo.Equals("")) { MessageUtil.ShowTips("没有用户不允许上传!"); return; } FormFileDown down = new FormFileDown(this.ob, filePath); down.CtrlFileDown1.FilePath = filePath; List list = new List(); FileBean bean = new FileBean(); OpenFileDialog file = new OpenFileDialog(); file.Multiselect = false; DialogResult drStat; drStat = file.ShowDialog(); if (drStat == DialogResult.OK) { fileName = file.FileName; FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read); string filena = System.IO.Path.GetFileName(fileName); bean = new FileBean(); bean.setFileName(filena); bean.setPathName(filePath); bean.setFile(FileHelper.FileToArray(fileName)); list.Add(bean); bool isSuccess = Core.Mes.Client.Comm.Server.FileHelper.Upload(list); if (isSuccess) { CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.lims.data.pipe.FrmLabDateParm"; ccp.MethodName = "updatePipeReport"; ccp.ServerParams = new object[] { checkNo, "", "", "CAILI_PATH_FUJIAN", filePath }; ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("上传成功!")) { MessageUtil.ShowTips(ccp.ReturnInfo); SelectFile(filePath); } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } } else { MessageBox.Show("上传失败", "提示", MessageBoxButtons.OK, MessageBoxIcon.Question); } //ultraGrid1.ActiveCell.Value = filena; //ultraGrid1.ActiveRow.Cells["SignaturePath"].Value = filePath + filena; } } //打印 private void printMechanics() { this.ultraGrid40.UpdateData(); IQueryable checkMagRows = this.ultraGrid40.Rows.AsQueryable().Where(" CHK = 'True'"); string version = ""; if (this.chkPrintK.Checked) { if (this.cmbPrintK.Text == "") { MessageUtil.ShowTips("请选择报告类型!"); return; } else { version = this.cmbPrintK.Value.ToString(); } } else { version = "MPA"; } string checkNo = this.ultraGrid40.ActiveRow.Cells["CheckNo"].Text; DataTable ds = PublicServer.GetData("com.steering.lims.data.outdec.FrmOutdecDataCJBase.doQueryIsAudit", new object[] { checkNo,arrId }, ob); if(int.Parse(ds.Rows[0][0].ToString()) > 0) { MessageUtil.ShowTips("还有未审核试样组,不允许打印报告!"); return; } string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepLimsPipeLX.cpt&bypagesize=false" + "&CHECK_NO=" + checkNo + "&version=" + version; //if (this.cmbPrint.Value.ToString2().Equals("0")) //{ // strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepLimsPipeMetallographicPG.cpt&bypagesize=false" + "&CHECK_NO=" + checkNo; //} //else if (this.cmbPrint.Value.ToString2().Equals("1")) //{ // strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepLimsPipeMetallographicZYG.cpt&bypagesize=false" + "&CHECK_NO=" + checkNo; //} //else if (this.cmbPrint.Value.ToString2().Equals("2")) //{ // strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepLimsPipeHardness.cpt&bypagesize=false" + "&CHECK_NO=" + checkNo; //} FrmRepExcel fre = new FrmRepExcel(this.ob, strurl); fre.AutoSize = true; fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height); fre.WindowState = FormWindowState.Maximized; fre.Show(); } /// /// 打印附件 /// private void printPicture() { this.ultraGrid40.UpdateData(); string checkNo = this.ultraGrid40.ActiveRow.Cells["CheckNo"].Text; string filePath = "Lims/pipe/caili2/" + checkNo + "/"; DataTable ds = PublicServer.GetData("com.steering.lims.data.outdec.FrmOutdecDataCJBase.doQueryIsAudit", new object[] { checkNo, arrId }, ob); if (int.Parse(ds.Rows[0][0].ToString()) > 0) { MessageUtil.ShowTips("还有未审核试样组,不允许打印报告!"); return; } string strurl = filePath; dlgOrderAskDown down = new dlgOrderAskDown(this.ob, filePath); down.ShowDialog(); } //查询上传的PDF文件 /// /// 查询上传的PDF文件 /// private void SelectFile(string filePathNew) { dlgOrderAskDown down = new dlgOrderAskDown(this.ob, filePathNew); down.DeleteButton.Visible = false; down.ShowDialog(); } //上传 /// /// 上传 /// private void UpFile() { this.ultraGrid40.UpdateData(); IQueryable checkMagRows = this.ultraGrid40.Rows.AsQueryable().Where(" CHK = 'True'"); WebClient webClient = new WebClient(); List listPdf = new List(); string date = DateTime.Now.ToString("yyyyMMdd"); string url = ""; string filePathNew = ""; //报告目录 string reportNo = ""; //报告编号 string version = ""; if (this.chkPrintK.Checked) { if (this.cmbPrintK.Text == "") { MessageUtil.ShowTips("请选择报告类型!"); return; } else { version = this.cmbPrintK.Value.ToString(); } } else { version = "MPA"; } string checkNo = this.ultraGrid40.ActiveRow.Cells["CheckNo"].Text; DataTable ds = PublicServer.GetData("com.steering.lims.data.outdec.FrmOutdecDataCJBase.doQueryIsAudit", new object[] { checkNo, arrId }, ob); if (int.Parse(ds.Rows[0][0].ToString()) > 0) { MessageUtil.ShowTips("还有未审核试样组,不允许上传报告!"); return; } string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepLimsPipeLX.cpt&format=pdf" + "&CHECK_NO=" + checkNo + "&version=" + version; reportNo = checkNo; //if (this.cmbPrint.Value.ToString2().Equals("0")) //{ // strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepLimsPipeMetallographicPG.cpt&format=pdf" + "&CHECK_NO=" + checkNo; // reportNo = checkNo + "PG"; //} //else if (this.cmbPrint.Value.ToString2().Equals("1")) //{ // strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepLimsPipeMetallographicZYG.cpt&format=pdf" + "&CHECK_NO=" + checkNo; // reportNo = checkNo + "ZYG"; //} //else if (this.cmbPrint.Value.ToString2().Equals("2")) //{ // strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepLimsPipeHardness.cpt&format=pdf" + "&CHECK_NO=" + checkNo; // reportNo = checkNo + "Hardness"; //} if (strurl == "") { MessageUtil.ShowTips("请先选择上传报告的模版!"); return; } filePathNew = "Lims/pipe/caili/" + checkNo + "/"; byte[] pdf = webClient.DownloadData(strurl); FileBean fileBean = new FileBean(); fileBean.setFile(pdf); fileBean.setFileName(reportNo + ".pdf"); fileBean.setPathName(filePathNew); listPdf.Add(fileBean); webClient.Dispose(); bool a = FileHelper.Upload(listPdf); if (a) { CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.lims.data.pipe.FrmLabDateParm"; ccp.MethodName = "updatePipeReport"; ccp.ServerParams = new object[] { checkNo, "", "", "CAILI_PATH", filePathNew }; ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("上传成功!")) { MessageUtil.ShowTips(ccp.ReturnInfo); SelectFile(filePathNew); } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } } else { MessageUtil.ShowError("系统生成PDF失败,请稍后再试!"); return; } } //上传 /// /// 上传 /// private bool UpFile(string checkNo) { WebClient webClient = new WebClient(); List listPdf = new List(); string date = DateTime.Now.ToString("yyyyMMdd"); string filePathNew = ""; //报告目录 string reportNo = ""; //报告编号 string strurl = ""; //DataTable ds = PublicServer.GetData("com.steering.lims.data.outdec.FrmOutdecDataCJBase.doQueryIsAudit", new object[] { checkNo, arrId }, ob); //if(int.Parse(ds.Rows[0][0].ToString()) >0) //{ // return false; //} strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepLimsPipeLX.cpt&format=pdf" + "&CHECK_NO=" + checkNo + "&version=" + "MPA"; reportNo = checkNo; filePathNew = "Lims/pipe/caili/" + checkNo + "/"; byte[] pdf = webClient.DownloadData(strurl); FileBean fileBean = new FileBean(); fileBean.setFile(pdf); fileBean.setFileName(reportNo + ".pdf"); fileBean.setPathName(filePathNew); listPdf.Add(fileBean); webClient.Dispose(); bool a = FileHelper.Upload(listPdf); if (a) { CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.lims.data.pipe.FrmLabDateParm"; ccp.MethodName = "updatePipeReport"; ccp.ServerParams = new object[] { checkNo, "", "", "CAILI_PATH", filePathNew }; ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("上传成功!")) { return true; } else { MessageUtil.ShowTips(ccp.ReturnInfo); return false; } } return true; } else { MessageUtil.ShowError("系统生成PDF失败,请稍后再试!"); return false; } } /// /// 审核 /// private void auditCheckConsignDetail() { this.ultraGrid27.UpdateData(); this.ultraGrid28.UpdateData(); UltraGridRow uRow = this.ultraGrid27.ActiveRow; if (uRow == null) return; IQueryable checkMagRows = this.ultraGrid28.Rows.AsQueryable().Where(a => a.GetValue("CHK") == "True"); if (checkMagRows.Count() == 0) { return; } //if (cmbPrint.Text == "") //{ // MessageUtil.ShowTips("请先选择上传报告的模版!"); // return; //} ArrayList parmList = new ArrayList(); foreach (UltraGridRow row in checkMagRows) { PipeCheckconsignDetailEntity pipeCheckDetialTity = (PipeCheckconsignDetailEntity)row.ListObject; pipeCheckDetialTity.AuditName = UserInfo.GetUserName(); pipeCheckDetialTity.Flag = "4"; string pipeDetailEntity = JSONFormat.Format(pipeCheckDetialTity); parmList.Add(pipeDetailEntity); } if (MessageUtil.ShowYesNoAndQuestion("是否确认审核?") == DialogResult.No) { return; } //if (!UpFile(uRow.Cells["CheckNo"].Text)) //{ // return; //} CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.lims.data.outdec.FrmOutdecDataCJBase"; ccp.MethodName = "auditPhyDetial"; ccp.ServerParams = new object[] { parmList,UserInfo.GetUserName() }; ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("审核成功!")) { if (!UpFile(uRow.Cells["CheckNo"].Text)) { MessageUtil.ShowTips("自动上传失败,请手动上传!"); } QueryCheckConsignBaseDetailNoFrim("3"); MessageUtil.ShowTips(ccp.ReturnInfo); } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } } /// /// 取消审核 /// private void cancelAuditCheckConsignDetail() { this.ultraGrid41.UpdateData(); IQueryable checkMagRows = this.ultraGrid41.Rows.AsQueryable().Where(" CHK = 'True'"); if (checkMagRows.Count() == 0) { return; } ArrayList parmList = new ArrayList(); foreach (UltraGridRow row in checkMagRows) { PipeCheckconsignDetailEntity pipeCheckDetialTity = (PipeCheckconsignDetailEntity)row.ListObject; string pipeDetailEntity = JSONFormat.Format(pipeCheckDetialTity); parmList.Add(pipeDetailEntity); } if (MessageUtil.ShowYesNoAndQuestion("是否取消审核?") == DialogResult.No) { return; } CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.lims.data.outdec.FrmOutdecDataCJBase"; ccp.MethodName = "cancelAuditPhyDetial"; ccp.ServerParams = new object[] { parmList }; ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("取消审核成功!")) { QueryCheckConsignBaseDetailYesFrim("4"); MessageUtil.ShowTips(ccp.ReturnInfo); } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } } /// /// 删除检验结果 /// private void DeleteCheckConsignProcessResult() { ultraGrid16.UpdateData(); ultraGrid17.UpdateData(); ultraGrid18.UpdateData(); ultraGrid19.UpdateData(); ultraGrid20.UpdateData(); ultraGrid21.UpdateData(); ultraGrid22.UpdateData(); ultraGrid23.UpdateData(); ultraGrid55.UpdateData(); UltraGridRow uRow = this.ultraGrid15.ActiveRow; RowsCollection uRow1 = null; if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0001")) { uRow1 = this.ultraGrid16.Rows; } else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0002")) { uRow1 = this.ultraGrid17.Rows; } else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0003")) { uRow1 = this.ultraGrid20.Rows; } else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0004") || uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0018")) { uRow1 = this.ultraGrid18.Rows; } else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0005")) { uRow1 = this.ultraGrid19.Rows; } else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0012")) { uRow1 = this.ultraGrid21.Rows; } else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0013")) { uRow1 = this.ultraGrid22.Rows; } else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0014") || uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0016")) { uRow1 = this.ultraGrid23.Rows; } else if (uRow.Cells["PhyCodeMax"].Value.Equals("C0009")) { uRow1 = this.ultraGrid24.Rows; } else if (uRow.Cells["PhyCodeMax"].Value.Equals("C0027") || uRow.Cells["PhyCodeMax"].Value.Equals("C0038") || uRow.Cells["PhyCodeMax"].Value.Equals("C0082") || uRow.Cells["PhyCodeMax"].Value.Equals("C0083") || uRow.Cells["PhyCodeMax"].Value.Equals("C0098")) { uRow1 = this.ultraGrid25.Rows; } else if (uRow.Cells["PhyCodeMax"].Value.Equals("C0026") || uRow.Cells["PhyCodeMax"].Value.Equals("C0039") || uRow.Cells["PhyCodeMax"].Value.Equals("C0040") || uRow.Cells["PhyCodeMax"].Value.Equals("C0041")) { uRow1 = this.ultraGrid26.Rows; } else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0050")) { uRow1 = this.ultraGrid55.Rows; } ArrayList parmList = new ArrayList(); foreach (UltraGridRow row in uRow1) { PipeCheckconsignPhydetailEntity pipeCheckTity = (PipeCheckconsignPhydetailEntity)row.ListObject; pipeCheckTity.CheckNo = uRow.Cells["CheckNo"].Text; pipeCheckTity.SampleNo = uRow.Cells["SampleNo"].Text; pipeCheckTity.PhyCodeMin = uRow.Cells["PhyCodeMin"].Text;//试样组 pipeCheckTity.PhyNameMin = uRow.Cells["PhyNameMin"].Text; string phyEntity = JSONFormat.Format(pipeCheckTity); parmList.Add(phyEntity); } PipeCheckconsignDetailEntity pipeDetailTity = (PipeCheckconsignDetailEntity)uRow.ListObject; string pipeDetailEntity = JSONFormat.Format(pipeDetailTity); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.lims.data.outdec.FrmOutdecDataCJBase"; ccp.MethodName = "deletePhyDetial"; ccp.ServerParams = new object[] { pipeDetailEntity, parmList }; ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("删除成功!")) { QueryCheckConsignBaseDetail("3"); MessageUtil.ShowTips(ccp.ReturnInfo); } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } } /// /// 修改检验结果 /// private void UpdateCheckConsignProcessResult() { ultraGrid16.UpdateData(); ultraGrid17.UpdateData(); ultraGrid18.UpdateData(); ultraGrid19.UpdateData(); ultraGrid20.UpdateData(); ultraGrid21.UpdateData(); ultraGrid22.UpdateData(); ultraGrid23.UpdateData(); ultraGrid55.UpdateData(); UltraGridRow uRow = this.ultraGrid15.ActiveRow; RowsCollection uRow1 = null; if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0001")) { uRow1 = this.ultraGrid16.Rows; } else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0002")) { uRow1 = this.ultraGrid17.Rows; } else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0003")) { uRow1 = this.ultraGrid20.Rows; } else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0004") || uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0018")) { uRow1 = this.ultraGrid18.Rows; } else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0005")) { uRow1 = this.ultraGrid19.Rows; } else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0012")) { uRow1 = this.ultraGrid21.Rows; } else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0013")) { uRow1 = this.ultraGrid22.Rows; } else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0014") || uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0016")) { uRow1 = this.ultraGrid23.Rows; } else if (uRow.Cells["PhyCodeMax"].Value.Equals("C0009")) { uRow1 = this.ultraGrid24.Rows; } else if (uRow.Cells["PhyCodeMax"].Value.Equals("C0027") || uRow.Cells["PhyCodeMax"].Value.Equals("C0038") || uRow.Cells["PhyCodeMax"].Value.Equals("C0082") || uRow.Cells["PhyCodeMax"].Value.Equals("C0083") || uRow.Cells["PhyCodeMax"].Value.Equals("C0098")) { uRow1 = this.ultraGrid25.Rows; } else if (uRow.Cells["PhyCodeMax"].Value.Equals("C0026") || uRow.Cells["PhyCodeMax"].Value.Equals("C0039") || uRow.Cells["PhyCodeMax"].Value.Equals("C0040") || uRow.Cells["PhyCodeMax"].Value.Equals("C0041")) { uRow1 = this.ultraGrid26.Rows; } else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0050")) { uRow1 = this.ultraGrid55.Rows; } PipeCheckconsignDetailEntity pipeDetailTity = new PipeCheckconsignDetailEntity(); ArrayList parmList = new ArrayList(); foreach (UltraGridRow row in uRow1) { PipeCheckconsignPhydetailEntity pipeCheckTity = (PipeCheckconsignPhydetailEntity)row.ListObject; pipeCheckTity.Value1.Replace('<', '-'); pipeCheckTity.Value2.Replace('<', '-'); pipeCheckTity.Value3.Replace('<', '-'); pipeCheckTity.Value4.Replace('<', '-'); pipeCheckTity.AverageValue.Replace('<', '-'); pipeCheckTity.CheckNo = uRow.Cells["CheckNo"].Text; pipeCheckTity.SampleNo = uRow.Cells["SampleNo"].Text; pipeCheckTity.PhyCodeMin = uRow.Cells["PhyCodeMin"].Text;//试样组 pipeCheckTity.PhyNameMin = uRow.Cells["PhyNameMin"].Text; if (uRow.Cells["PhyCodeMax"].Value.Equals("C0009"))//压扁试验 { pipeCheckTity.Value8 = this.ultraTxtYbSpac.Text.Trim(); pipeCheckTity.IsGood = this.ultraTxtYbQualfiled.Value.ToString2(); pipeCheckTity.IsDefect = this.ultraTxtYbDefect.Value.ToString2(); pipeCheckTity.Remark = this.ultraTxtYbMemo.Text.Trim(); } else if (uRow.Cells["PhyCodeMax"].Value.Equals("C0027") || uRow.Cells["PhyCodeMax"].Value.Equals("C0038") || uRow.Cells["PhyCodeMax"].Value.Equals("C0082") || uRow.Cells["PhyCodeMax"].Value.Equals("C0083") || uRow.Cells["PhyCodeMax"].Value.Equals("C0098"))//弯曲试验 { pipeCheckTity.Value9 = this.ultraTxtWqDiameter.Text.Trim(); pipeCheckTity.Value10 = this.ultraTxtWqAngle.Text.Trim(); pipeCheckTity.IsGood = this.ultraTxtWqQualfiled.Value.ToString2(); pipeCheckTity.Remark = this.ultraTxtWqMemo.Text.Trim(); } else if (uRow.Cells["PhyCodeMax"].Value.Equals("C0026") || uRow.Cells["PhyCodeMax"].Value.Equals("C0039") || uRow.Cells["PhyCodeMax"].Value.Equals("C0040") || uRow.Cells["PhyCodeMax"].Value.Equals("C0041"))//扩口试验 { pipeCheckTity.Value11 = this.ultraTxtKkTop.Text.Trim(); pipeCheckTity.Value12 = this.ultraTxtKkFlarRate.Text.Trim(); pipeCheckTity.IsGood = this.ultraTxtKkGood.Value.ToString2(); pipeCheckTity.Remark = this.ultraTxtKkMemo.Text.Trim(); } string phyEntity = JSONFormat.Format(pipeCheckTity); parmList.Add(phyEntity); } pipeDetailTity.CheckNo = uRow.Cells["CheckNo"].Text; pipeDetailTity.SampleNo = uRow.Cells["SampleNo"].Text; pipeDetailTity.PhyCodeMin = uRow.Cells["PhyCodeMin"].Text;//检验大项 pipeDetailTity.PhyCodeMax = uRow.Cells["PhyCodeMax"].Text;//试样组 pipeDetailTity.CheckTemp = this.txtCHECK_TEMP1.Text.Trim(); pipeDetailTity.DeviceNo = this.ultraDEVICE_NAME1.Value.ToString2(); pipeDetailTity.DeviceName = this.ultraDEVICE_NAME1.Text.Trim(); pipeDetailTity.FormualNo = this.ultraComMethod1.Value.ToString2(); pipeDetailTity.FormualName = this.ultraComMethod1.Text.Trim(); pipeDetailTity.CheckName = this.UserInfo.GetUserName(); pipeDetailTity.CheckShift = this.UserInfo.GetUserOrder(); pipeDetailTity.CheckClass = this.UserInfo.GetUserGroup(); pipeDetailTity.Remark = this.txtREMARK1.Text; pipeDetailTity.HardnessType = this.ultraComFormual1.Text; pipeDetailTity.StdSteelNo = this.txtStdSteelNo1.Text.Trim(); pipeDetailTity.StdSteelType = this.cmbStdSteelType1.Text; pipeDetailTity.StdSteelValue = txtStdSteelValue1.Text.Trim(); pipeDetailTity.ActualValue = txtActualValue1.Text.Trim(); string pipeDetailEntity = JSONFormat.Format(pipeDetailTity); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.lims.data.outdec.FrmOutdecDataCJBase"; ccp.MethodName = "updatePhyDetial"; ccp.ServerParams = new object[] { pipeDetailEntity,parmList,UserInfo.GetUserName() }; ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("修改成功!")) { QueryCheckConsignBaseDetail("3"); MessageUtil.ShowTips(ccp.ReturnInfo); } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } } /// ///保存理化录入值 /// private void AddPhyData() { this.ultraGrid3.UpdateData(); this.ultraGrid4.UpdateData(); this.ultraGrid5.UpdateData(); this.ultraGrid6.UpdateData(); this.ultraGrid7.UpdateData(); this.ultraGrid8.UpdateData(); this.ultraGrid9.UpdateData(); this.ultraGrid10.UpdateData(); this.ultraGrid53.UpdateData(); UltraGridRow uRow = this.ultraGrid2.ActiveRow; RowsCollection uRow1 = null; if(uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0001")) { uRow1 = this.ultraGrid3.Rows; } else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0002")) { uRow1 = this.ultraGrid4.Rows; } else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0003")) { uRow1 = this.ultraGrid6.Rows; } else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0004") || uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0018")) { uRow1 = this.ultraGrid5.Rows; } else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0005")) { uRow1 = this.ultraGrid7.Rows; } else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0012")) { uRow1 = this.ultraGrid8.Rows; } else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0013")) { uRow1 = this.ultraGrid10.Rows; } else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0014") || uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0016")) { uRow1 = this.ultraGrid9.Rows; } else if (uRow.Cells["PhyCodeMax"].Value.Equals("C0009")) { uRow1 = this.ultraGrid13.Rows; } else if (uRow.Cells["PhyCodeMax"].Value.Equals("C0027") || uRow.Cells["PhyCodeMax"].Value.Equals("C0038") || uRow.Cells["PhyCodeMax"].Value.Equals("C0082") || uRow.Cells["PhyCodeMax"].Value.Equals("C0083") || uRow.Cells["PhyCodeMax"].Value.Equals("C0098")) { uRow1 = this.ultraGrid11.Rows; } else if (uRow.Cells["PhyCodeMax"].Value.Equals("C0026") || uRow.Cells["PhyCodeMax"].Value.Equals("C0039") || uRow.Cells["PhyCodeMax"].Value.Equals("C0040") || uRow.Cells["PhyCodeMax"].Value.Equals("C0041")) { uRow1 = this.ultraGrid12.Rows; } else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0050")) { uRow1 = this.ultraGrid53.Rows; } if (!checkData()) { return; } ArrayList parmList = new ArrayList(); PipeCheckconsignDetailEntity pipeDetailTity = new PipeCheckconsignDetailEntity(); //ArrayList tempList = new ArrayList(); foreach (UltraGridRow row in uRow1) { PipeCheckconsignPhydetailEntity pipeCheckTity = (PipeCheckconsignPhydetailEntity)row.ListObject; pipeCheckTity.CheckNo = uRow.Cells["CheckNo"].Text; pipeCheckTity.SampleNo = uRow.Cells["SampleNo"].Text; pipeCheckTity.PhyCodeMin = uRow.Cells["PhyCodeMax"].Text;//试样组 pipeCheckTity.PhyNameMin = uRow.Cells["PhyNameMax"].Text; if (uRow.Cells["PhyCodeMax"].Value.Equals("C0009"))//压扁试验 { pipeCheckTity.Value8 = this.TxtYbSpac.Text.Trim(); pipeCheckTity.Value7 = this.TxtYbC.Text.Trim(); pipeCheckTity.IsGood = this.TxtYbQualfiled.Value.ToString2(); pipeCheckTity.IsDefect = this.TxtYbDefect.Value.ToString2(); pipeCheckTity.CalculationFormula = this.TxtYbEuestion.Text; pipeCheckTity.Remark = this.TxtYbMemo.Text.Trim(); } else if (uRow.Cells["PhyCodeMax"].Value.Equals("C0027") || uRow.Cells["PhyCodeMax"].Value.Equals("C0038") || uRow.Cells["PhyCodeMax"].Value.Equals("C0082") || uRow.Cells["PhyCodeMax"].Value.Equals("C0083") || uRow.Cells["PhyCodeMax"].Value.Equals("C0098"))//弯曲试验 { pipeCheckTity.Value9 = this.TxtWqDiameter.Text.Trim(); pipeCheckTity.Value10 = this.TxtWqAngle.Text.Trim(); pipeCheckTity.IsGood = this.TxtWqQualfiled.Value.ToString2(); pipeCheckTity.Remark = this.TxtWqMemo.Text.Trim(); } else if (uRow.Cells["PhyCodeMax"].Value.Equals("C0026") || uRow.Cells["PhyCodeMax"].Value.Equals("C0039") || uRow.Cells["PhyCodeMax"].Value.Equals("C0040") || uRow.Cells["PhyCodeMax"].Value.Equals("C0041"))//扩口试验 { pipeCheckTity.Value11 = this.TxtKkTop.Text.Trim(); pipeCheckTity.Value12 = this.TxtKkFlarRate.Text.Trim(); pipeCheckTity.IsGood = this.TxtKkGood.Value.ToString2(); pipeCheckTity.Remark = this.TxtKkMemo.Text.Trim(); } string phyEntity = JSONFormat.Format(pipeCheckTity); parmList.Add(phyEntity); } pipeDetailTity.CheckNo = uRow.Cells["CheckNo"].Text; pipeDetailTity.SampleNo = uRow.Cells["SampleNo"].Text; pipeDetailTity.PhyCodeMin = uRow.Cells["PhyCodeMin"].Text;//检验大项 pipeDetailTity.PhyCodeMax = uRow.Cells["PhyCodeMax"].Text;//试样组 pipeDetailTity.CheckTemp = this.txtCHECK_TEMP.Text.Trim(); pipeDetailTity.DeviceNo = this.ultraDEVICE_NAME.Value.ToString2(); pipeDetailTity.DeviceName = this.ultraDEVICE_NAME.Text.Trim(); pipeDetailTity.FormualNo = this.ultraComMethod.Value.ToString2(); pipeDetailTity.FormualName = this.ultraComMethod.Text.Trim(); pipeDetailTity.CheckName = this.txtChemUser.Text.Trim(); pipeDetailTity.CheckShift = this.cmbChemOrder.Value.ToString2(); pipeDetailTity.CheckClass = this.cmbChemGroup.Value.ToString2(); pipeDetailTity.StdSteelNo = this.txtStdSteelNo.Text.Trim(); pipeDetailTity.StdSteelType = this.cmbStdSteelType.Text.Trim(); pipeDetailTity.StdSteelValue = this.txtStdSteelValue.Text.Trim(); pipeDetailTity.ActualValue = this.txtActualValue.Text.Trim(); pipeDetailTity.HardnessType = this.ultraComFormual.Text.Trim(); pipeDetailTity.Flag = "3";//录入状态 string pipeDetailEntity = JSONFormat.Format(pipeDetailTity); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.lims.data.outdec.FrmOutdecDataCJBase"; ccp.MethodName = "addPhyDataNew"; ccp.ServerParams = new object[] { pipeDetailEntity, parmList }; ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("保存成功!")) { this.txtStdSteelNo.Text = ""; this.cmbStdSteelType.Text = ""; this.txtStdSteelValue.Text = ""; this.txtActualValue.Text = ""; QueryCheckConsignBaseDetail("2"); MessageUtil.ShowTips(ccp.ReturnInfo); } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } } /// /// 数据验证 /// /// private bool checkData() { UltraGridRow uRow = this.ultraGrid2.ActiveRow; if (this.txtCHECK_TEMP.Text.Trim() == "") { MessageUtil.ShowTips("试验温度不允许为空!"); return false; } if (this.ultraDEVICE_NAME.Text.Trim() == "") { MessageUtil.ShowTips("试验设备不允许为空!"); return false; } if (this.ultraComMethod.Text.Trim() == "") { MessageUtil.ShowTips("试验方法不允许为空!"); return false; } if (this.cmbChemOrder.Text == "" || this.cmbChemGroup.Text == "") { MessageUtil.ShowTips("班次班组不允许为空!"); return false; } if (txtChemUser.Text.Trim() == "") { MessageUtil.ShowTips("试验人不允许为空!"); return false; } if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0001"))//拉伸试验 { foreach(UltraGridRow row in this.ultraGrid3.Rows) { if(row.Cells["Value1"].Text.ToString() == "") { MessageUtil.ShowTips("黄色区域有数据未录入,请核实!"); return false; } } } else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0002"))//夏比冲击试验 { foreach (UltraGridRow row in this.ultraGrid4.Rows) { if (row.Cells["Value1"].Text.ToString() == "" || row.Cells["Value2"].Text.ToString() == "" || row.Cells["Value3"].Text.ToString() == "") { MessageUtil.ShowTips("黄色区域有数据未录入,请核实!"); return false; } } } else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0004"))//洛氏硬度 { //if (ultraComFormual.Text == "") //{ // MessageUtil.ShowTips("硬度类型不能为空!"); // return false; //} if (txtStdSteelNo.Text.Trim() == "") { MessageUtil.ShowTips("标钢编号不能为空!"); return false; } if (cmbStdSteelType.Text.Trim() == "") { MessageUtil.ShowTips("标钢类型不能为空!"); return false; } if (txtStdSteelValue.Text.Trim() == "") { MessageUtil.ShowTips("标钢标准值不能为空!"); return false; } if (txtActualValue.Text.Trim() == "") { MessageUtil.ShowTips("标钢实测值不能为空!"); return false; } foreach (UltraGridRow row in this.ultraGrid5.Rows) { if (row.Cells["Value1"].Text.ToString() == "" || row.Cells["Value2"].Text.ToString() == "" || row.Cells["Value3"].Text.ToString() == "") { MessageUtil.ShowTips("黄色区域有数据未录入,请核实!"); return false; } } } else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0005"))//维氏硬度 { if (ultraComFormual.Text == "") { MessageUtil.ShowTips("硬度类型不能为空!"); return false; } if (txtStdSteelNo.Text.Trim() == "") { MessageUtil.ShowTips("标钢编号不能为空!"); return false; } if (cmbStdSteelType.Text.Trim() == "") { MessageUtil.ShowTips("标钢类型不能为空!"); return false; } if (txtStdSteelValue.Text.Trim() == "") { MessageUtil.ShowTips("标钢标准值不能为空!"); return false; } if (txtActualValue.Text.Trim() == "") { MessageUtil.ShowTips("标钢实测值不能为空!"); return false; } foreach (UltraGridRow row in this.ultraGrid7.Rows) { if (row.Cells["Value1"].Text.ToString() == "" || row.Cells["Value2"].Text.ToString() == "" || row.Cells["Value3"].Text.ToString() == ""||row.Cells["Value4"].Text.ToString()== "") { MessageUtil.ShowTips("黄色区域有数据未录入,请核实!"); return false; } } } else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0003"))//布氏硬度 { if (ultraComFormual.Text == "") { MessageUtil.ShowTips("硬度类型不能为空!"); return false; } if (txtStdSteelNo.Text.Trim() == "") { MessageUtil.ShowTips("标钢编号不能为空!"); return false; } if (cmbStdSteelType.Text.Trim() == "") { MessageUtil.ShowTips("标钢类型不能为空!"); return false; } if (txtStdSteelValue.Text.Trim() == "") { MessageUtil.ShowTips("标钢标准值不能为空!"); return false; } if (txtActualValue.Text.Trim() == "") { MessageUtil.ShowTips("标钢实测值不能为空!"); return false; } foreach (UltraGridRow row in this.ultraGrid6.Rows) { if (row.Cells["Value1"].Text.ToString() == "" || row.Cells["Value2"].Text.ToString() == "" || row.Cells["Value3"].Text.ToString() == "") { MessageUtil.ShowTips("黄色区域有数据未录入,请核实!"); return false; } } } else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0012"))//夹杂物 { foreach (UltraGridRow row in this.ultraGrid8.Rows) { if (uRow.Cells["PhyCodeMax"].Value.ToString().Equals("C0011")) { if (row.Cells["Value1"].Text.ToString() == "") { MessageUtil.ShowTips("黄色区域有数据未录入,请核实!"); return false; } } else if (uRow.Cells["PhyCodeMax"].Value.ToString().Equals("C0115")) { if (row.Cells["Value1"].Text.ToString() == "" || row.Cells["Value2"].Text.ToString()== "" || row.Cells["Value3"].Text.ToString() == "" ||row.Cells["Value4"].Text.ToString() == "") { MessageUtil.ShowTips("黄色区域有数据未录入,请核实!"); return false; } } } } else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0013"))//晶粒度 { foreach (UltraGridRow row in this.ultraGrid10.Rows) { if (row.Cells["Value1"].Text.ToString() == "") { MessageUtil.ShowTips("黄色区域有数据未录入,请核实!"); return false; } } } else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0014"))//组织 { foreach (UltraGridRow row in this.ultraGrid9.Rows) { if (row.Cells["Value1"].Text.ToString() == "") { MessageUtil.ShowTips("黄色区域有数据未录入,请核实!"); return false; } } } else if (uRow.Cells["PhyCodeMax"].Value.Equals("C0009")) { ultraGrid13.UpdateData(); if (this.ultraGrid13.ActiveRow.Cells["PhyCode"].Text.Equals("P0330")) { if (this.TxtYbSpac.Text.Trim() == "" || this.TxtYbQualfiled.Value.ToString2() == "" || this.TxtYbDefect.Value.ToString2() == "") { MessageUtil.ShowTips("压扁试验时压扁间距以及是否完好、是否缺陷不能为空!"); return false; } } else { if (this.TxtYbSpac.Text.Trim() == "" || this.TxtYbQualfiled.Value.ToString2() == "") { MessageUtil.ShowTips("压扁试验时压扁间距以及是否完好、是否缺陷不能为空!"); return false; } } } else if (uRow.Cells["PhyCodeMax"].Value.Equals("C0027") || uRow.Cells["PhyCodeMax"].Value.Equals("C0038") || uRow.Cells["PhyCodeMax"].Value.Equals("C0082") || uRow.Cells["PhyCodeMax"].Value.Equals("C0083") || uRow.Cells["PhyCodeMax"].Value.Equals("C0098")) { if (this.TxtWqDiameter.Text.Trim() == "" || this.TxtWqAngle.Value.ToString2() == "" || this.TxtWqQualfiled.Value.ToString2() == "") { MessageUtil.ShowTips("弯曲试验时弯曲直径、弯曲角度、是否完好不能为空!"); return false; } } else if (uRow.Cells["PhyCodeMax"].Value.Equals("C0026") || uRow.Cells["PhyCodeMax"].Value.Equals("C0039") || uRow.Cells["PhyCodeMax"].Value.Equals("C0040") || uRow.Cells["PhyCodeMax"].Value.Equals("C0041")) { if (this.TxtKkTop.Text.Trim() == "" || this.TxtKkFlarRate.Text.Trim() == "" || this.TxtKkGood.Value.ToString2() == "") { MessageUtil.ShowTips("扩口试验时顶芯角度、扩口率、是否完好不能为空!"); return false; } } else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0050")) { foreach (UltraGridRow row in this.ultraGrid53.Rows) { if (row.Cells["Value1"].Text.ToString() == "" || row.Cells["Value2"].Text.ToString() == "" || row.Cells["Value3"].Text.ToString() == "") { MessageUtil.ShowTips("黄色区域有数据未录入,请核实!"); return false; } } } return true; } //查询 private void QueryCheckConsignBaseDetail(string flag) { string startTim = ""; string endTim = ""; string checkNo = ""; string judgeNo = ""; string sampleNo = ""; string steelName = ""; string specName = ""; string orderNo = ""; string checkPhy = ""; string txtGroup = ""; string ispodutor = ""; var status = new List { }; if (chkType.Checked) { status = cmbType.CheckedItems.Select(p => p.DataValue.ToString()).ToList(); if (!status.Any()) status = new List { "0", "1", "2", "3", "4", "5" }; } ArrayList parmList = new ArrayList(); if(chkRegTime.Checked) { startTim = this.RegStartTime.Value.ToString("yyyy-MM-dd HH:mm:ss"); endTim = this.RegEndTime.Value.ToString("yyyy-MM-dd HH:mm:ss"); } if(chkCheckNo.Checked && this.txtCheckNo.Text.Trim() != "") { checkNo = this.txtCheckNo.Text.Trim(); } if(chkJudgeNo.Checked && this.txtJudgeNo.Text != "") { judgeNo = this.txtJudgeNo.Text.Trim(); } if(chkSampleNo.Checked && this.txtSampleNo.Text.Trim() != "") { sampleNo = txtSampleNo.Text.Trim(); } if(chkOrderNo.Checked && this.txtOrderNo.Text != "") { orderNo = txtOrderNo.Text.Trim(); } if(chkSteel.Checked && this.txtSteel.Text.Trim() != "") { steelName = this.txtSteel.Text.Trim(); } if(chkSpec.Checked && this.txtSpec.Text.Trim() != "") { specName = this.txtSpec.Text.Trim(); } if(chkGroup.Checked && this.cmbGroup.Text != "") { txtGroup = this.cmbGroup.Value.ToString2(); } if (chkIsProuctor.Checked && this.cmbIsProductor.Text != "") { ispodutor = this.cmbIsProductor.Value.ToString2(); } checkPhy = ultraOptionSet1.CheckedItem.DataValue.ToString(); parmList.Add(startTim); parmList.Add(endTim); parmList.Add(checkNo); parmList.Add(judgeNo); parmList.Add(sampleNo); parmList.Add(orderNo); parmList.Add(steelName); parmList.Add(specName); parmList.Add(txtGroup); parmList.Add(ispodutor); parmList.Add(checkPhy); if (flag.Equals("2")) { PipeCheckconsignDetailEntitybindingSource1.Clear(); List listSource = EntityHelper.GetData( "com.steering.lims.data.outdec.FrmOutdecDataCJBase.queryCheckConsignBaseDetail", new object[] { parmList, arrId, "2", status.ToArray() }, this.ob); PipeCheckconsignDetailEntitybindingSource.DataSource = listSource; } else if (flag.Equals("3")) { PipeCheckconsignDetailEntitybindingSource4.Clear(); List listSource = EntityHelper.GetData( "com.steering.lims.data.outdec.FrmOutdecDataCJBase.queryCheckConsignBaseDetail", new object[] { parmList, arrId, "3", status.ToArray() }, this.ob); RecordedSource.DataSource = listSource; } } /// /// 查询未审核数据 /// /// private void QueryCheckConsignBaseDetailNoFrim(string flag) { string startTim = ""; string endTim = ""; string checkNo = ""; string judgeNo = ""; string sampleNo = ""; string steelName = ""; string specName = ""; string orderNo = ""; string txtGroup = ""; string ispodutor = ""; string checkPhy = ""; ArrayList parmList = new ArrayList(); var status = new List { }; if (chkType.Checked) { status = cmbType.CheckedItems.Select(p => p.DataValue.ToString()).ToList(); if (!status.Any()) status = new List { "0", "1", "2", "3", "4", "5" }; } if (chkRegTime.Checked) { startTim = this.RegStartTime.Value.ToString("yyyy-MM-dd HH:mm:ss"); endTim = this.RegEndTime.Value.ToString("yyyy-MM-dd HH:mm:ss"); } if (chkCheckNo.Checked && this.txtCheckNo.Text.Trim() != "") { checkNo = this.txtCheckNo.Text.Trim(); } if (chkJudgeNo.Checked && this.txtJudgeNo.Text != "") { judgeNo = this.txtJudgeNo.Text.Trim(); } if (chkSampleNo.Checked && this.txtSampleNo.Text.Trim() != "") { sampleNo = txtSampleNo.Text.Trim(); } if (chkOrderNo.Checked && this.txtOrderNo.Text != "") { orderNo = txtOrderNo.Text.Trim(); } if (chkSteel.Checked && this.txtSteel.Text.Trim() != "") { steelName = this.txtSteel.Text.Trim(); } if (chkSpec.Checked && this.txtSpec.Text.Trim() != "") { specName = this.txtSpec.Text.Trim(); } if (chkGroup.Checked && this.cmbGroup.Text != "") { txtGroup = this.cmbGroup.Value.ToString2(); } if (chkIsProuctor.Checked && this.cmbIsProductor.Text != "") { ispodutor = this.cmbIsProductor.Value.ToString2(); } checkPhy = ultraOptionSet1.CheckedItem.DataValue.ToString(); parmList.Add(startTim); parmList.Add(endTim); parmList.Add(checkNo); parmList.Add(judgeNo); parmList.Add(sampleNo); parmList.Add(orderNo); parmList.Add(steelName); parmList.Add(specName); parmList.Add(txtGroup); parmList.Add(ispodutor); parmList.Add(checkPhy); PipeCheckconsignDetailEntitybindingSource2.Clear(); List listSource = EntityHelper.GetData( "com.steering.lims.data.outdec.FrmOutdecDataCJBase.queryCheckConsignBaseDetailNoFrim", new object[] { parmList, arrId, status.ToArray() }, this.ob); pipeCheckconsignDetailEntityBindingSource5.DataSource = listSource; } /// /// 查询已审核数据 /// /// private void QueryCheckConsignBaseDetailYesFrim(string flag) { string startTim = ""; string endTim = ""; string checkNo = ""; string judgeNo = ""; string sampleNo = ""; string steelName = ""; string specName = ""; string orderNo = ""; string txtGroup = ""; string ispodutor = ""; string checkPhy = ""; ArrayList parmList = new ArrayList(); var status = new List { }; if (chkType.Checked) { status = cmbType.CheckedItems.Select(p => p.DataValue.ToString()).ToList(); if (!status.Any()) status = new List { "0", "1", "2", "3", "4", "5" }; } if (chkRegTime.Checked) { startTim = this.RegStartTime.Value.ToString("yyyy-MM-dd HH:mm:ss"); endTim = this.RegEndTime.Value.ToString("yyyy-MM-dd HH:mm:ss"); } if (chkCheckNo.Checked && this.txtCheckNo.Text.Trim() != "") { checkNo = this.txtCheckNo.Text.Trim(); } if (chkJudgeNo.Checked && this.txtJudgeNo.Text != "") { judgeNo = this.txtJudgeNo.Text.Trim(); } if (chkSampleNo.Checked && this.txtSampleNo.Text.Trim() != "") { sampleNo = txtSampleNo.Text.Trim(); } if (chkOrderNo.Checked && this.txtOrderNo.Text != "") { orderNo = txtOrderNo.Text.Trim(); } if (chkSteel.Checked && this.txtSteel.Text.Trim() != "") { steelName = this.txtSteel.Text.Trim(); } if (chkSpec.Checked && this.txtSpec.Text.Trim() != "") { specName = this.txtSpec.Text.Trim(); } if (chkGroup.Checked && this.cmbGroup.Text != "") { txtGroup = this.cmbGroup.Value.ToString2(); } if (chkIsProuctor.Checked && this.cmbIsProductor.Text != "") { ispodutor = this.cmbIsProductor.Value.ToString2(); } checkPhy = ultraOptionSet1.CheckedItem.DataValue.ToString(); parmList.Add(startTim); parmList.Add(endTim); parmList.Add(checkNo); parmList.Add(judgeNo); parmList.Add(sampleNo); parmList.Add(orderNo); parmList.Add(steelName); parmList.Add(specName); parmList.Add(txtGroup); parmList.Add(ispodutor); parmList.Add(checkPhy); PipeCheckconsignDetailEntitybindingSource3.Clear(); List listSource = EntityHelper.GetData( "com.steering.lims.data.outdec.FrmOutdecDataCJBase.queryCheckConsignBaseDetailFrim", new object[] { parmList, arrId, status.ToArray() }, this.ob); pipeCheckconsignDetailEntityBindingSource6.DataSource = listSource; foreach (UltraGridRow row in ultraGrid40.Rows) { if (int.Parse(row.Cells["Remark"].Text.ToString3()) > 0) { row.RowSelectorAppearance.BackColor = Color.GreenYellow; ; } } } private void ultraGrid1_AfterRowActivate(object sender, EventArgs e) { UltraGridRow uRow = this.ultraGrid1.ActiveRow; List listSource = EntityHelper.GetData( "com.steering.lims.data.outdec.FrmOutdecDataCJBase.queryCheckConsignBaseDetailPHY", new object[] { uRow.Cells["CheckNo"].Value.ToString(), uRow.Cells["SampleNo"].Value.ToString(), "2", arrId, ultraOptionSet1.CheckedItem.DataValue.ToString2()}, this.ob); PipeCheckconsignDetailEntitybindingSource1.DataSource = listSource; } /// /// 加载试验设备 /// /// private void initCheckEqiupment(string phyCodeMax) { DataTable dt = PublicServer.GetData("com.steering.lims.data.pipe.FrmDataCJBase.initCheckEquipment", new object[] { arrId, phyCodeMax }, ob); if (dt != null && dt.Rows.Count > 0) { if (ultraTabControl1.SelectedTab.Key == "0") { ultraDEVICE_NAME.DataSource = dt; ultraDEVICE_NAME.ValueMember = "DEVICE_NO"; } else if (ultraTabControl1.SelectedTab.Key == "1") { ultraDEVICE_NAME1.DataSource = dt; ultraDEVICE_NAME1.ValueMember = "DEVICE_NO"; } } this.cmbChemOrder.Value = UserInfo.GetUserOrder(); this.cmbChemGroup.Value = UserInfo.GetUserGroup(); this.txtChemUser.Text = UserInfo.GetUserName(); } /// /// 加载试验方法 /// /// private void initCheckMethod(string phyCode) { ultraComMethod.DataSource = null; ultraComMethod1.DataSource = null; DataTable dt = PublicServer.GetData("com.steering.lims.data.pipe.FrmDataCJBase.initCheckMethod", new object[] { phyCode }, ob); if (dt != null && dt.Rows.Count > 0) { if (ultraTabControl1.SelectedTab.Key == "0") { ultraComMethod.DataSource = dt; ultraComMethod.ValueMember = "CHECK_METHOD_NO"; } else if (ultraTabControl1.SelectedTab.Key == "1") { ultraComMethod1.DataSource = dt; ultraComMethod1.ValueMember = "CHECK_METHOD_NO"; } } } private void ultraGrid2_AfterRowActivate(object sender, EventArgs e) { ultraTabControl2.Visible = true; ultraTabControl3.Visible = false; ultraTabControl4.Visible = false; ultraTabControl5.Visible = false; UltraGridRow row = this.ultraGrid2.ActiveRow; initCheckMethod(row.Cells["PhyCodeMax"].Value.ToString());//根据试样组加载试验方法 initCheckEqiupment(row.Cells["PhyCodeMax"].Value.ToString());//根据试样组加载试验设备 List listSource = EntityHelper.GetData( "com.steering.lims.data.outdec.FrmOutdecDataCJBase.queryCheckConsignBaseDetailPhyItem", new object[] { row.Cells["CheckNo"].Value.ToString(), row.Cells["SampleNo"].Value.ToString(), row.Cells["PhyCodeMax"].Value.ToString() }, this.ob); if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0001"))//拉伸 { PipeCheckconsignPhydetailEntitybindingSource.DataSource = listSource; ultraTabControl2.Tabs["0"].Selected = true; ultraTabControl2.Tabs["0"].Visible = true; ultraTabControl2.Tabs["1"].Visible = false; ultraTabControl2.Tabs["2"].Visible = false; ultraTabControl2.Tabs["3"].Visible = false; ultraTabControl2.Tabs["4"].Visible = false; ultraTabControl2.Tabs["5"].Visible = false; ultraTabControl2.Tabs["6"].Visible = false; ultraTabControl2.Tabs["7"].Visible = false; ultraTabControl2.Tabs["8"].Visible = false; ultraTabControl2.Tabs["9"].Visible = false; ultraTabControl2.Tabs["10"].Visible = false; ultraTabControl2.Tabs["11"].Visible = false; this.ultraLabel36.Visible = false; this.ultraComFormual.Visible = false; this.cmbStdSteelType.Visible = false; this.txtStdSteelNo.Visible = false; this.txtStdSteelValue.Visible = false; this.txtActualValue.Visible = false; ultraLabel46.Visible = false; ultraLabel48.Visible = false; ultraLabel47.Visible = false; ultraLabel49.Visible = false; } else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0002"))//冲击 { //if (listSource.Count<3) //{ // listSource.Add(new PipeCheckconsignPhydetailEntity() { PhyName = "剪切面积百分比" }); // listSource.Add(new PipeCheckconsignPhydetailEntity() { PhyName = "ak" }); // listSource.Add(new PipeCheckconsignPhydetailEntity() { PhyName = "膨胀量" }); //} PipeCheckconsignPhydetailEntityCjbindingSource.DataSource = listSource; ultraTabControl2.Tabs["1"].Selected = true; ultraTabControl2.Tabs["0"].Visible = false; ultraTabControl2.Tabs["1"].Visible = true; ultraTabControl2.Tabs["2"].Visible = false; ultraTabControl2.Tabs["3"].Visible = false; ultraTabControl2.Tabs["4"].Visible = false; ultraTabControl2.Tabs["5"].Visible = false; ultraTabControl2.Tabs["6"].Visible = false; ultraTabControl2.Tabs["7"].Visible = false; ultraTabControl2.Tabs["8"].Visible = false; ultraTabControl2.Tabs["9"].Visible = false; ultraTabControl2.Tabs["10"].Visible = false; ultraTabControl2.Tabs["11"].Visible = false; this.ultraLabel36.Visible = false; this.ultraComFormual.Visible = false; this.cmbStdSteelType.Visible = false; this.txtStdSteelNo.Visible = false; this.txtStdSteelValue.Visible = false; this.txtActualValue.Visible = false; ultraLabel46.Visible = false; ultraLabel48.Visible = false; ultraLabel47.Visible = false; ultraLabel49.Visible = false; } else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0003"))//布氏 { cmbStdSteelType.Items.Clear(); ultraComFormual.Items.Clear(); PipeCheckconsignPhydetailEntityBSbindingSource.DataSource = listSource; MergedCell(ultraGrid6, new string[] { "PhyName" }); ultraTabControl2.Tabs["4"].Selected = true; ultraTabControl2.Tabs["0"].Visible = false; ultraTabControl2.Tabs["1"].Visible = false; ultraTabControl2.Tabs["2"].Visible = false; ultraTabControl2.Tabs["3"].Visible = false; ultraTabControl2.Tabs["4"].Visible = true; ultraTabControl2.Tabs["5"].Visible = false; ultraTabControl2.Tabs["6"].Visible = false; ultraTabControl2.Tabs["7"].Visible = false; ultraTabControl2.Tabs["8"].Visible = false; ultraTabControl2.Tabs["9"].Visible = false; ultraTabControl2.Tabs["10"].Visible = false; ultraTabControl2.Tabs["11"].Visible = false; this.ultraLabel36.Visible = true; this.ultraComFormual.Visible = true; this.cmbStdSteelType.Visible = true; this.txtStdSteelNo.Visible = true; this.txtStdSteelValue.Visible = true; this.txtActualValue.Visible = true; ultraLabel46.Visible = true; ultraLabel48.Visible = true; ultraLabel47.Visible = true; ultraLabel49.Visible = true; ultraComFormual.Items.Add("HBW2.5"); ultraComFormual.Items.Add("HBW5"); ultraComFormual.Items.Add("HBW10"); cmbStdSteelType.Items.Add("HBW2.5/187.5"); cmbStdSteelType.Items.Add("HBW 5/750"); cmbStdSteelType.Items.Add("HBW 10/1000"); } else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0004") || row.Cells["PhyCodeMin"].Value.ToString().Equals("R0018"))//洛氏 { cmbStdSteelType.Items.Clear(); PipeCheckconsignPhydetailEntityLSbindingSource.DataSource = listSource; MergedCell(ultraGrid5, new string[] { "PhyName" }); ultraTabControl2.Tabs["2"].Selected = true; ultraTabControl2.Tabs["0"].Visible = false; ultraTabControl2.Tabs["1"].Visible = false; ultraTabControl2.Tabs["2"].Visible = true; ultraTabControl2.Tabs["3"].Visible = false; ultraTabControl2.Tabs["4"].Visible = false; ultraTabControl2.Tabs["5"].Visible = false; ultraTabControl2.Tabs["6"].Visible = false; ultraTabControl2.Tabs["7"].Visible = false; ultraTabControl2.Tabs["8"].Visible = false; ultraTabControl2.Tabs["9"].Visible = false; ultraTabControl2.Tabs["10"].Visible = false; ultraTabControl2.Tabs["11"].Visible = false; this.ultraLabel36.Visible = false; this.ultraComFormual.Visible = false; this.cmbStdSteelType.Visible = true; this.txtStdSteelNo.Visible = true; this.txtStdSteelValue.Visible = true; this.txtActualValue.Visible = true; ultraLabel46.Visible = true; ultraLabel48.Visible = true; ultraLabel47.Visible = true; ultraLabel49.Visible = true; cmbStdSteelType.Items.Add("HRA"); cmbStdSteelType.Items.Add("HRB"); cmbStdSteelType.Items.Add("HRC"); } else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0005"))//维氏 { ultraComFormual.Items.Clear(); cmbStdSteelType.Items.Clear(); PipeCheckconsignPhydetailEntityWSbindingSource.DataSource = listSource; MergedCell(ultraGrid5, new string[] { "PhyName" }); ultraTabControl2.Tabs["3"].Selected = true; ultraTabControl2.Tabs["0"].Visible = false; ultraTabControl2.Tabs["1"].Visible = false; ultraTabControl2.Tabs["2"].Visible = false; ultraTabControl2.Tabs["3"].Visible = true; ultraTabControl2.Tabs["4"].Visible = false; ultraTabControl2.Tabs["5"].Visible = false; ultraTabControl2.Tabs["6"].Visible = false; ultraTabControl2.Tabs["7"].Visible = false; ultraTabControl2.Tabs["8"].Visible = false; ultraTabControl2.Tabs["9"].Visible = false; ultraTabControl2.Tabs["10"].Visible = false; ultraTabControl2.Tabs["11"].Visible = false; this.ultraLabel36.Visible = true; this.ultraComFormual.Visible = true; this.cmbStdSteelType.Visible = true; this.txtStdSteelNo.Visible = true; this.txtStdSteelValue.Visible = true; this.txtActualValue.Visible = true; ultraLabel46.Visible = true; ultraLabel48.Visible = true; ultraLabel47.Visible = true; ultraLabel49.Visible = true; ultraComFormual.Items.Add("HV5"); ultraComFormual.Items.Add("HV10"); cmbStdSteelType.Items.Add("HV5"); cmbStdSteelType.Items.Add("HV10"); cmbStdSteelType.Items.Add("HV0.2"); } else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0014") || row.Cells["PhyCodeMin"].Value.ToString().Equals("R0016") || row.Cells["PhyCodeMin"].Value.ToString().Equals("R0031"))//组织 { PipeCheckconsignPhydetailEntityZZbindingSource.DataSource = listSource; ultraTabControl2.Tabs["7"].Selected = true; ultraTabControl2.Tabs["0"].Visible = false; ultraTabControl2.Tabs["1"].Visible = false; ultraTabControl2.Tabs["2"].Visible = false; ultraTabControl2.Tabs["3"].Visible = false; ultraTabControl2.Tabs["4"].Visible = false; ultraTabControl2.Tabs["5"].Visible = false; ultraTabControl2.Tabs["6"].Visible = false; ultraTabControl2.Tabs["7"].Visible = true; ultraTabControl2.Tabs["8"].Visible = false; ultraTabControl2.Tabs["9"].Visible = false; ultraTabControl2.Tabs["10"].Visible = false; ultraTabControl2.Tabs["11"].Visible = false; this.ultraLabel36.Visible = false; this.ultraComFormual.Visible = false; this.cmbStdSteelType.Visible = false; this.txtStdSteelNo.Visible = false; this.txtStdSteelValue.Visible = false; this.txtActualValue.Visible = false; ultraLabel46.Visible = false; ultraLabel48.Visible = false; ultraLabel47.Visible = false; ultraLabel49.Visible = false; } else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0013"))//晶粒度 { PipeCheckconsignPhydetailEntityJLDbindingSource.DataSource = listSource; ultraTabControl2.Tabs["6"].Selected = true; ultraTabControl2.Tabs["0"].Visible = false; ultraTabControl2.Tabs["1"].Visible = false; ultraTabControl2.Tabs["2"].Visible = false; ultraTabControl2.Tabs["3"].Visible = false; ultraTabControl2.Tabs["4"].Visible = false; ultraTabControl2.Tabs["5"].Visible = false; ultraTabControl2.Tabs["6"].Visible = true; ultraTabControl2.Tabs["7"].Visible = false; ultraTabControl2.Tabs["8"].Visible = false; ultraTabControl2.Tabs["9"].Visible = false; ultraTabControl2.Tabs["10"].Visible = false; ultraTabControl2.Tabs["11"].Visible = false; this.ultraLabel36.Visible = false; this.ultraComFormual.Visible = false; this.cmbStdSteelType.Visible = false; this.txtStdSteelNo.Visible = false; this.txtStdSteelValue.Visible = false; this.txtActualValue.Visible = false; ultraLabel46.Visible = false; ultraLabel48.Visible = false; ultraLabel47.Visible = false; ultraLabel49.Visible = false; } else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0012"))//夹杂 { PipeCheckconsignPhydetailEntityJZWbindingSource.DataSource = listSource; ultraTabControl2.Tabs["5"].Selected = true; ultraTabControl2.Tabs["0"].Visible = false; ultraTabControl2.Tabs["1"].Visible = false; ultraTabControl2.Tabs["2"].Visible = false; ultraTabControl2.Tabs["3"].Visible = false; ultraTabControl2.Tabs["4"].Visible = false; ultraTabControl2.Tabs["5"].Visible = true; ultraTabControl2.Tabs["6"].Visible = false; ultraTabControl2.Tabs["7"].Visible = false; ultraTabControl2.Tabs["8"].Visible = false; ultraTabControl2.Tabs["9"].Visible = false; ultraTabControl2.Tabs["10"].Visible = false; ultraTabControl2.Tabs["11"].Visible = false; this.ultraLabel36.Visible = false; this.ultraComFormual.Visible = false; this.cmbStdSteelType.Visible = false; this.txtStdSteelNo.Visible = false; this.txtStdSteelValue.Visible = false; this.txtActualValue.Visible = false; ultraLabel46.Visible = false; ultraLabel48.Visible = false; ultraLabel47.Visible = false; ultraLabel49.Visible = false; ultraGrid8.DisplayLayout.Bands[0].Columns["Value1"].Header.Caption = "一象限"; ultraGrid8.DisplayLayout.Bands[0].Columns["Value2"].Header.Caption = "二象限"; ultraGrid8.DisplayLayout.Bands[0].Columns["Value3"].Header.Caption = "三象限"; ultraGrid8.DisplayLayout.Bands[0].Columns["Value4"].Header.Caption = "四象限"; if (row.Cells["PhyCodeMax"].Value.ToString().Equals("C0115")) { ultraGrid8.DisplayLayout.Bands[0].Columns["Value2"].Hidden = false; ultraGrid8.DisplayLayout.Bands[0].Columns["Value3"].Hidden = false; ultraGrid8.DisplayLayout.Bands[0].Columns["Value4"].Hidden = false; } else { ultraGrid8.DisplayLayout.Bands[0].Columns["Value2"].Hidden = true; ultraGrid8.DisplayLayout.Bands[0].Columns["Value3"].Hidden = true; ultraGrid8.DisplayLayout.Bands[0].Columns["Value4"].Hidden = true; } } else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0010"))//工艺 { if (row.Cells["PhyCodeMax"].Value.ToString().Equals("C0027") || row.Cells["PhyCodeMax"].Value.ToString().Equals("C0038") || row.Cells["PhyCodeMax"].Value.ToString().Equals("C0082") || row.Cells["PhyCodeMax"].Value.ToString().Equals("C0083") || row.Cells["PhyCodeMax"].Value.ToString().Equals("C0098"))//弯曲 { PipeCheckconsignPhydetailEntityWQbindingSource.DataSource = listSource; ultraTabControl2.Tabs["9"].Selected = true; ultraTabControl2.Tabs["0"].Visible = false; ultraTabControl2.Tabs["1"].Visible = false; ultraTabControl2.Tabs["2"].Visible = false; ultraTabControl2.Tabs["3"].Visible = false; ultraTabControl2.Tabs["4"].Visible = false; ultraTabControl2.Tabs["5"].Visible = false; ultraTabControl2.Tabs["6"].Visible = false; ultraTabControl2.Tabs["7"].Visible = false; ultraTabControl2.Tabs["8"].Visible = false; ultraTabControl2.Tabs["9"].Visible = true; ultraTabControl2.Tabs["10"].Visible = false; ultraTabControl2.Tabs["11"].Visible = false; this.ultraLabel36.Visible = false; this.ultraComFormual.Visible = false; this.cmbStdSteelType.Visible = false; this.txtStdSteelNo.Visible = false; this.txtStdSteelValue.Visible = false; this.txtActualValue.Visible = false; ultraLabel46.Visible = false; ultraLabel48.Visible = false; ultraLabel47.Visible = false; ultraLabel49.Visible = false; } else if (row.Cells["PhyCodeMax"].Value.ToString().Equals("C0009"))//压扁 { TxtYbEuestion.Text = ""; TxtYbD.Text = ""; TxtYbS.Text = ""; TxtYbC.Text = ""; TxtYbSpac.Text = ""; TxtYbQualfiled.Text = ""; TxtYbDefect.Text = ""; TxtYbMemo.Text = ""; PipeCheckconsignPhydetailEntityYBbindingSource.DataSource = listSource; ultraTabControl2.Tabs["8"].Selected = true; ultraTabControl2.Tabs["0"].Visible = false; ultraTabControl2.Tabs["1"].Visible = false; ultraTabControl2.Tabs["2"].Visible = false; ultraTabControl2.Tabs["3"].Visible = false; ultraTabControl2.Tabs["4"].Visible = false; ultraTabControl2.Tabs["5"].Visible = false; ultraTabControl2.Tabs["6"].Visible = false; ultraTabControl2.Tabs["7"].Visible = false; ultraTabControl2.Tabs["8"].Visible = true; ultraTabControl2.Tabs["9"].Visible = false; ultraTabControl2.Tabs["10"].Visible = false; ultraTabControl2.Tabs["11"].Visible = false; this.ultraLabel36.Visible = false; this.ultraComFormual.Visible = false; this.cmbStdSteelType.Visible = false; this.txtStdSteelNo.Visible = false; this.txtStdSteelValue.Visible = false; this.txtActualValue.Visible = false; ultraLabel46.Visible = false; ultraLabel48.Visible = false; ultraLabel47.Visible = false; ultraLabel49.Visible = false; int x = row.Cells["SpecName"].Text.IndexOf('x'); TxtYbD.Text = row.Cells["SpecName"].Text.Substring(0,x); TxtYbS.Text = row.Cells["SpecName"].Text.Substring(x + 1); ultraGrid13.DisplayLayout.Bands[0].Columns["IsGood"].Header.Caption = "试验结果(一次)"; ultraGrid13.DisplayLayout.Bands[0].Columns["IsDefect"].Header.Caption = "试验结果(二次)"; } else if (row.Cells["PhyCodeMax"].Value.ToString().Equals("C0026"))//扩口 { PipeCheckconsignPhydetailEntityKKbindingSource.DataSource = listSource; ultraTabControl2.Tabs["10"].Selected = true; ultraTabControl2.Tabs["0"].Visible = false; ultraTabControl2.Tabs["1"].Visible = false; ultraTabControl2.Tabs["2"].Visible = false; ultraTabControl2.Tabs["3"].Visible = false; ultraTabControl2.Tabs["4"].Visible = false; ultraTabControl2.Tabs["5"].Visible = false; ultraTabControl2.Tabs["6"].Visible = false; ultraTabControl2.Tabs["7"].Visible = false; ultraTabControl2.Tabs["8"].Visible = false; ultraTabControl2.Tabs["9"].Visible = false; ultraTabControl2.Tabs["10"].Visible = true; ultraTabControl2.Tabs["11"].Visible = false; this.ultraLabel36.Visible = false; this.ultraComFormual.Visible = false; this.cmbStdSteelType.Visible = false; this.txtStdSteelNo.Visible = false; this.txtStdSteelValue.Visible = false; this.txtActualValue.Visible = false; ultraLabel46.Visible = false; ultraLabel48.Visible = false; ultraLabel47.Visible = false; ultraLabel49.Visible = false; } } else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0050"))//断裂力学试验 { pipeCheckconsignPhydetailEntityQTBindingSource.DataSource = listSource; ultraTabControl2.Tabs["11"].Selected = true; ultraTabControl2.Tabs["0"].Visible = false; ultraTabControl2.Tabs["1"].Visible = false; ultraTabControl2.Tabs["2"].Visible = false; ultraTabControl2.Tabs["3"].Visible = false; ultraTabControl2.Tabs["4"].Visible = false; ultraTabControl2.Tabs["5"].Visible = false; ultraTabControl2.Tabs["6"].Visible = false; ultraTabControl2.Tabs["7"].Visible = false; ultraTabControl2.Tabs["8"].Visible = false; ultraTabControl2.Tabs["9"].Visible = false; ultraTabControl2.Tabs["10"].Visible = false; ultraTabControl2.Tabs["11"].Visible = true; ultraGrid53.DisplayLayout.Bands[0].Columns["AverageValue"].Header.Caption = "最小值"; this.ultraLabel36.Visible = false; this.ultraComFormual.Visible = false; this.cmbStdSteelType.Visible = false; this.txtStdSteelNo.Visible = false; this.txtStdSteelValue.Visible = false; this.txtActualValue.Visible = false; ultraLabel46.Visible = false; ultraLabel48.Visible = false; ultraLabel47.Visible = false; ultraLabel49.Visible = false; } } /// /// 合并单元格 /// /// /// private void MergedCell(UltraGrid ug, string[] columnKeys) { if (columnKeys.Length == 0) { return; } ug.DisplayLayout.Override.MergedCellStyle = MergedCellStyle.Never; for (int i = 0; i < columnKeys.Length; i++) { ug.DisplayLayout.Bands[0].Columns[columnKeys[i]].MergedCellStyle = MergedCellStyle.Always; } } private void ultraTabControl1_SelectedTabChanged(object sender, Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventArgs e) { if (toolMenu == null) return; if (ultraTabControl1.SelectedTab.Index == 0) { if (toolMenu.Toolbars[0].Tools.Exists("Query")) { toolMenu.Toolbars[0].Tools["Query"].InstanceProps.Visible = DefaultableBoolean.True; } if (toolMenu.Toolbars[0].Tools.Exists("Add")) { this.toolMenu.Toolbars[0].Tools["Add"].InstanceProps.Visible = DefaultableBoolean.True; } if (toolMenu.Toolbars[0].Tools.Exists("Update")) { toolMenu.Toolbars[0].Tools["Update"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("Delete")) { toolMenu.Toolbars[0].Tools["Delete"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("Audit")) { toolMenu.Toolbars[0].Tools["Audit"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("CancelAudit")) { toolMenu.Toolbars[0].Tools["CancelAudit"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("SingleAudit")) { toolMenu.Toolbars[0].Tools["SingleAudit"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("CancelSingleAudit")) { toolMenu.Toolbars[0].Tools["CancelSingleAudit"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("PrintMechanics")) { toolMenu.Toolbars[0].Tools["PrintMechanics"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("UpFile")) { toolMenu.Toolbars[0].Tools["UpFile"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("UpPicture")) { toolMenu.Toolbars[0].Tools["UpPicture"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("PrintPicture")) { toolMenu.Toolbars[0].Tools["PrintPicture"].InstanceProps.Visible = DefaultableBoolean.False; } ultraOptionSet1.Visible = true; chkRegTime.Text = "收样日期"; this.chkPrintK.Visible = true; this.cmbPrintK.Visible = true; } else if (ultraTabControl1.SelectedTab.Index == 1) { if (toolMenu.Toolbars[0].Tools.Exists("Query")) { toolMenu.Toolbars[0].Tools["Query"].InstanceProps.Visible = DefaultableBoolean.True; } if (toolMenu.Toolbars[0].Tools.Exists("Add")) { this.toolMenu.Toolbars[0].Tools["Add"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("Update")) { toolMenu.Toolbars[0].Tools["Update"].InstanceProps.Visible = DefaultableBoolean.True; } if (toolMenu.Toolbars[0].Tools.Exists("Delete")) { toolMenu.Toolbars[0].Tools["Delete"].InstanceProps.Visible = DefaultableBoolean.True; } if (toolMenu.Toolbars[0].Tools.Exists("Audit")) { toolMenu.Toolbars[0].Tools["Audit"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("CancelAudit")) { toolMenu.Toolbars[0].Tools["CancelAudit"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("SingleAudit")) { toolMenu.Toolbars[0].Tools["SingleAudit"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("CancelSingleAudit")) { toolMenu.Toolbars[0].Tools["CancelSingleAudit"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("PrintMechanics")) { toolMenu.Toolbars[0].Tools["PrintMechanics"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("UpFile")) { toolMenu.Toolbars[0].Tools["UpFile"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("UpPicture")) { toolMenu.Toolbars[0].Tools["UpPicture"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("PrintPicture")) { toolMenu.Toolbars[0].Tools["PrintPicture"].InstanceProps.Visible = DefaultableBoolean.False; } ultraOptionSet1.Visible = true; chkRegTime.Text = "收样日期"; this.chkPrintK.Visible = true; this.cmbPrintK.Visible = true; } else if (ultraTabControl1.SelectedTab.Index == 2) { if (toolMenu.Toolbars[0].Tools.Exists("Query")) { toolMenu.Toolbars[0].Tools["Query"].InstanceProps.Visible = DefaultableBoolean.True; } if (toolMenu.Toolbars[0].Tools.Exists("Add")) { this.toolMenu.Toolbars[0].Tools["Add"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("Update")) { toolMenu.Toolbars[0].Tools["Update"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("Delete")) { toolMenu.Toolbars[0].Tools["Delete"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("Audit")) { toolMenu.Toolbars[0].Tools["Audit"].InstanceProps.Visible = DefaultableBoolean.True; } if (toolMenu.Toolbars[0].Tools.Exists("CancelAudit")) { toolMenu.Toolbars[0].Tools["CancelAudit"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("SingleAudit")) { toolMenu.Toolbars[0].Tools["SingleAudit"].InstanceProps.Visible = DefaultableBoolean.True; } if (toolMenu.Toolbars[0].Tools.Exists("CancelSingleAudit")) { toolMenu.Toolbars[0].Tools["CancelSingleAudit"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("PrintMechanics")) { toolMenu.Toolbars[0].Tools["PrintMechanics"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("UpFile")) { toolMenu.Toolbars[0].Tools["UpFile"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("UpPicture")) { toolMenu.Toolbars[0].Tools["UpPicture"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("PrintPicture")) { toolMenu.Toolbars[0].Tools["PrintPicture"].InstanceProps.Visible = DefaultableBoolean.False; } this.chkPrintK.Visible = false; this.cmbPrintK.Visible = false; //ultraOptionSet1.Visible = false; chkRegTime.Text = "录入日期"; } else if (ultraTabControl1.SelectedTab.Index == 3) { if (toolMenu.Toolbars[0].Tools.Exists("Query")) { toolMenu.Toolbars[0].Tools["Query"].InstanceProps.Visible = DefaultableBoolean.True; } if (toolMenu.Toolbars[0].Tools.Exists("Add")) { this.toolMenu.Toolbars[0].Tools["Add"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("Update")) { toolMenu.Toolbars[0].Tools["Update"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("Delete")) { toolMenu.Toolbars[0].Tools["Delete"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("Audit")) { toolMenu.Toolbars[0].Tools["Audit"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("CancelAudit")) { toolMenu.Toolbars[0].Tools["CancelAudit"].InstanceProps.Visible = DefaultableBoolean.True; } if (toolMenu.Toolbars[0].Tools.Exists("SingleAudit")) { toolMenu.Toolbars[0].Tools["SingleAudit"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("CancelSingleAudit")) { toolMenu.Toolbars[0].Tools["CancelSingleAudit"].InstanceProps.Visible = DefaultableBoolean.True; } if (toolMenu.Toolbars[0].Tools.Exists("PrintMechanics")) { toolMenu.Toolbars[0].Tools["PrintMechanics"].InstanceProps.Visible = DefaultableBoolean.True; } if (toolMenu.Toolbars[0].Tools.Exists("UpFile")) { toolMenu.Toolbars[0].Tools["UpFile"].InstanceProps.Visible = DefaultableBoolean.True; } if (toolMenu.Toolbars[0].Tools.Exists("UpPicture")) { toolMenu.Toolbars[0].Tools["UpPicture"].InstanceProps.Visible = DefaultableBoolean.True; } if (toolMenu.Toolbars[0].Tools.Exists("PrintPicture")) { toolMenu.Toolbars[0].Tools["PrintPicture"].InstanceProps.Visible = DefaultableBoolean.True; } //ultraOptionSet1.Visible = false; this.chkPrintK.Visible = true; this.cmbPrintK.Visible = true; chkRegTime.Text = "审核日期"; } } private void FrmLabMecDataCJAuditNew_Shown(object sender, EventArgs e) { if (toolMenu == null) return; if (toolMenu.Toolbars[0].Tools.Exists("Query")) { toolMenu.Toolbars[0].Tools["Query"].InstanceProps.Visible = DefaultableBoolean.True; } if (toolMenu.Toolbars[0].Tools.Exists("Add")) { this.toolMenu.Toolbars[0].Tools["Add"].InstanceProps.Visible = DefaultableBoolean.True; } if (toolMenu.Toolbars[0].Tools.Exists("Update")) { toolMenu.Toolbars[0].Tools["Update"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("Delete")) { toolMenu.Toolbars[0].Tools["Delete"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("Audit")) { toolMenu.Toolbars[0].Tools["Audit"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("CancelAudit")) { toolMenu.Toolbars[0].Tools["CancelAudit"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("SingleAudit")) { toolMenu.Toolbars[0].Tools["SingleAudit"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("CancelSingleAudit")) { toolMenu.Toolbars[0].Tools["CancelSingleAudit"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("PrintMechanics")) { toolMenu.Toolbars[0].Tools["PrintMechanics"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("UpFile")) { toolMenu.Toolbars[0].Tools["UpFile"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("UpPicture")) { toolMenu.Toolbars[0].Tools["UpPicture"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("PrintPicture")) { toolMenu.Toolbars[0].Tools["PrintPicture"].InstanceProps.Visible = DefaultableBoolean.False; } this.chkPrintK.Visible = true; this.cmbPrintK.Visible = true; } private void ultraTextEditor1_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e) { UltraGridRow uRow = this.ultraGrid2.ActiveRow; if (uRow.Cells["CraftFileNo"].Text.Trim() == "" || uRow.Cells["CraftPath"].Text.Trim() == "") { return; } PublicPipeAndOutdec.ViewCarft_No(uRow.Cells["CraftPath"].Text.Trim()); } private void ultraTextEditor3_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e) { UltraGridRow uRow = this.ultraGrid15.ActiveRow; if (uRow.Cells["CraftFileNo"].Text.Trim() == "" || uRow.Cells["CraftPath"].Text.Trim() == "") { return; } PublicPipeAndOutdec.ViewCarft_No(uRow.Cells["CraftPath"].Text.Trim()); } private void ultraTextEditor4_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e) { UltraGridRow uRow = this.ultraGrid28.ActiveRow; if (uRow.Cells["CraftFileNo"].Text.Trim() == "" || uRow.Cells["CraftPath"].Text.Trim() == "") { return; } PublicPipeAndOutdec.ViewCarft_No(uRow.Cells["CraftPath"].Text.Trim()); } private void ultraTextEditor5_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e) { UltraGridRow uRow = this.ultraGrid41.ActiveRow; if (uRow.Cells["CraftFileNo"].Text.Trim() == "" || uRow.Cells["CraftPath"].Text.Trim() == "") { return; } PublicPipeAndOutdec.ViewCarft_No(uRow.Cells["CraftPath"].Text.Trim()); } private void ultraGrid4_CellChange(object sender, CellEventArgs e) { this.ultraGrid4.UpdateData(); UltraGridRow ur = this.ultraGrid4.ActiveRow; UltraGridRow uRow = this.ultraGrid2.ActiveRow; string specName = uRow.Cells["ItemNameS"].Text.Trim();//试验尺寸 int x = specName.IndexOf("×");//x位置 string width = specName.Substring(0, x).Replace("m",""); string height = specName.Substring(x + 1).Replace("m",""); int m = 0; string ak1 = "";//真实值 string ak2 = ""; string ak3 = ""; int akNum = 0; foreach(UltraGridRow row in this.ultraGrid4.Rows) { if (row.Cells["PhyName"].Text.Contains("ak")) { akNum = akNum + 1; } } if (akNum > 0 && ur.Cells["PhyName"].Text.Contains("冲击功")) { if (e.Cell.Column.Key == "Value1") { if (!StringUtil.IsDouble(e.Cell.Row.Cells["Value1"].Value.ToString3())) return; ak1 = (Math.Round(100 * double.Parse(ur.Cells["Value1"].Text.Trim().ToString3()) / (double.Parse(width) * (double.Parse(height) - 2)), 0)).ToString(); foreach (UltraGridRow akRow in this.ultraGrid4.Rows) { if (akRow.Cells["PhyName"].Text.Contains("ak")) { akRow.Cells["Value1"].Value = ak1; if (akRow.Cells["Value2"].Text != "") { m = m + 1; } if (akRow.Cells["Value3"].Text != "") { m = m + 1; } m = m + 1; akRow.Cells["AverageValue"].Value = Math.Round(((double.Parse(akRow.Cells["Value1"].Text.Trim().ToString3()) + double.Parse(akRow.Cells["Value2"].Text.ToString3()) + double.Parse(akRow.Cells["Value3"].Text.ToString3())) / m)).ToString(); } } } if (e.Cell.Column.Key == "Value2") { if (!StringUtil.IsDouble(e.Cell.Row.Cells["Value2"].Value.ToString3())) return; ak2 = (Math.Round(100 * double.Parse(ur.Cells["Value2"].Text.Trim().ToString3()) / (double.Parse(width) * (double.Parse(height) - 2)), 0)).ToString(); foreach (UltraGridRow akRow in this.ultraGrid4.Rows) { if (akRow.Cells["PhyName"].Text.Contains("ak")) { akRow.Cells["Value2"].Value = ak2; if (ur.Cells["Value1"].Text != "") { m = m + 1; } if (ur.Cells["Value3"].Text != "") { m = m + 1; } m = m + 1; akRow.Cells["AverageValue"].Value = Math.Round(((double.Parse(akRow.Cells["Value1"].Text.Trim().ToString3()) + double.Parse(akRow.Cells["Value2"].Text.ToString3()) + double.Parse(akRow.Cells["Value3"].Text.ToString3())) / m)).ToString(); } } } if (e.Cell.Column.Key == "Value3") { if (!StringUtil.IsDouble(e.Cell.Row.Cells["Value3"].Value.ToString3())) return; ak3 = (Math.Round(100 * double.Parse(ur.Cells["Value3"].Text.Trim().ToString3()) / (double.Parse(width) * (double.Parse(height) - 2)), 0)).ToString(); foreach (UltraGridRow akRow in this.ultraGrid4.Rows) { if (akRow.Cells["PhyName"].Text.Contains("ak")) { akRow.Cells["Value3"].Value = ak3; if (akRow.Cells["Value1"].Text != "") { m = m + 1; } if (akRow.Cells["Value2"].Text != "") { m = m + 1; } m = m + 1; akRow.Cells["AverageValue"].Value = Math.Round(((double.Parse(akRow.Cells["Value1"].Text.Trim().ToString3()) + double.Parse(akRow.Cells["Value2"].Text.ToString3()) + double.Parse(akRow.Cells["Value3"].Text.ToString3())) / m)).ToString(); } } } } else { if (e.Cell.Column.Key == "Value1" || e.Cell.Column.Key == "Value2" || e.Cell.Column.Key == "Value3") { if (ur.Cells["Value1"].Text != "") { m = m + 1; } if (ur.Cells["Value2"].Text != "") { m = m + 1; } if (ur.Cells["Value3"].Text != "") { m = m + 1; } ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.Trim().ToString3()) + double.Parse(ur.Cells["Value2"].Text.Trim().ToString3()) + double.Parse(ur.Cells["Value3"].Text.Trim().ToString3())) / m),2).ToString(); } } } private void ultraGrid5_CellChange(object sender, CellEventArgs e) { this.ultraGrid5.UpdateData(); UltraGridRow ur = this.ultraGrid5.ActiveRow; int m = 0; if (e.Cell.Column.Key == "Value1" || e.Cell.Column.Key == "Value2" || e.Cell.Column.Key == "Value3" || e.Cell.Column.Key == "Value4") { if (!StringUtil.IsDouble(e.Cell.Row.Cells["Value1"].Value.ToString3()) || !StringUtil.IsDouble(e.Cell.Row.Cells["Value2"].Value.ToString3()) || !StringUtil.IsDouble(e.Cell.Row.Cells["Value3"].Value.ToString3()) || !StringUtil.IsDouble(e.Cell.Row.Cells["Value4"].Value.ToString3())) { return; } if (ur.Cells["Value1"].Text != "") { m = m + 1; } if (ur.Cells["Value2"].Text != "") { m = m + 1; } if (ur.Cells["Value3"].Text != "") { m = m + 1; } if (ur.Cells["Value4"].Text != "") { m = m + 1; } ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.ToString3()) + double.Parse(ur.Cells["Value2"].Text.ToString3()) + double.Parse(ur.Cells["Value3"].Text.ToString3()) + double.Parse(ur.Cells["Value4"].Text.ToString3())) / m), 1).ToString(); } } private void ultraGrid7_CellChange(object sender, CellEventArgs e) { this.ultraGrid7.UpdateData(); UltraGridRow ur = this.ultraGrid7.ActiveRow; int m = 0; string comFormual = this.ultraComFormual.Text.Trim(); if (e.Cell.Column.Key == "Value1D1" || e.Cell.Column.Key == "Value1D2") { if (!StringUtil.IsDouble(e.Cell.Row.Cells["Value1D1"].Value.ToString3()) || !StringUtil.IsDouble(e.Cell.Row.Cells["Value1D2"].Value.ToString3())) { return; } if (comFormual.Equals("HV5")) { ur.Cells["Value1"].Value = Math.Round(0.1891 * 49.03 / Math.Pow((double.Parse(ur.Cells["Value1D1"].Text.ToString3()) + double.Parse(ur.Cells["Value1D2"].Text.ToString3()))/2,2),0); } else if (comFormual.Equals("HV10")) { ur.Cells["Value1"].Value = Math.Round(0.1891 * 98.07 / Math.Pow((double.Parse(ur.Cells["Value1D1"].Text.ToString3()) + double.Parse(ur.Cells["Value1D2"].Text.ToString3())) / 2, 2), 0); } else { MessageUtil.ShowTips("公式选择错误!"); return; } if (ur.Cells["Value1"].Text != "") { m = m + 1; } if (ur.Cells["Value2"].Text != "") { m = m + 1; } if (ur.Cells["Value3"].Text != "") { m = m + 1; } if (ur.Cells["Value4"].Text != "") { m = m + 1; } ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.ToString3()) + double.Parse(ur.Cells["Value2"].Text.ToString3()) + double.Parse(ur.Cells["Value3"].Text.ToString3()) + double.Parse(ur.Cells["Value4"].Text.ToString3())) / m), 0).ToString(); } if (e.Cell.Column.Key == "Value2D1" || e.Cell.Column.Key == "Value2D2") { if (!StringUtil.IsDouble(e.Cell.Row.Cells["Value2D1"].Value.ToString3()) || !StringUtil.IsDouble(e.Cell.Row.Cells["Value2D2"].Value.ToString3())) { return; } if (comFormual.Equals("HV5")) { ur.Cells["Value2"].Value = Math.Round(0.1891 * 49.03 / Math.Pow((double.Parse(ur.Cells["Value2D1"].Text.ToString3()) + double.Parse(ur.Cells["Value2D2"].Text.ToString3())) / 2, 2), 0); } else if (comFormual.Equals("HV10")) { ur.Cells["Value2"].Value = Math.Round(0.1891 * 98.07 / Math.Pow((double.Parse(ur.Cells["Value2D1"].Text.ToString3()) + double.Parse(ur.Cells["Value2D2"].Text.ToString3())) / 2, 2), 0); } else { MessageUtil.ShowTips("公式选择错误!"); return; } if (ur.Cells["Value1"].Text != "") { m = m + 1; } if (ur.Cells["Value2"].Text != "") { m = m + 1; } if (ur.Cells["Value3"].Text != "") { m = m + 1; } if (ur.Cells["Value4"].Text != "") { m = m + 1; } ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.ToString3()) + double.Parse(ur.Cells["Value2"].Text.ToString3()) + double.Parse(ur.Cells["Value3"].Text.ToString3()) + double.Parse(ur.Cells["Value4"].Text.ToString3())) / m), 0).ToString(); } if (e.Cell.Column.Key == "Value3D1" || e.Cell.Column.Key == "Value3D2") { if (!StringUtil.IsDouble(e.Cell.Row.Cells["Value3D1"].Value.ToString3()) || !StringUtil.IsDouble(e.Cell.Row.Cells["Value3D2"].Value.ToString3())) { return; } if (comFormual.Equals("HV5")) { ur.Cells["Value3"].Value = Math.Round(0.1891 * 49.03 / Math.Pow((double.Parse(ur.Cells["Value3D1"].Text.ToString3()) + double.Parse(ur.Cells["Value3D2"].Text.ToString3())) / 2, 2), 0); } else if (comFormual.Equals("HV10")) { ur.Cells["Value3"].Value = Math.Round(0.1891 * 98.07 / Math.Pow((double.Parse(ur.Cells["Value3D1"].Text.ToString3()) + double.Parse(ur.Cells["Value3D2"].Text.ToString3())) / 2, 2), 0); } else { MessageUtil.ShowTips("公式选择错误!"); return; } if (ur.Cells["Value1"].Text != "") { m = m + 1; } if (ur.Cells["Value2"].Text != "") { m = m + 1; } if (ur.Cells["Value3"].Text != "") { m = m + 1; } if (ur.Cells["Value4"].Text != "") { m = m + 1; } ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.ToString3()) + double.Parse(ur.Cells["Value2"].Text.ToString3()) + double.Parse(ur.Cells["Value3"].Text.ToString3()) + double.Parse(ur.Cells["Value4"].Text.ToString3())) / m), 0).ToString(); } if (e.Cell.Column.Key == "Value4D1" || e.Cell.Column.Key == "Value4D2") { if (!StringUtil.IsDouble(e.Cell.Row.Cells["Value4D1"].Value.ToString3()) || !StringUtil.IsDouble(e.Cell.Row.Cells["Value4D2"].Value.ToString3())) { return; } if (comFormual.Equals("HV5")) { ur.Cells["Value4"].Value = Math.Round(0.1891 * 49.03 / Math.Pow((double.Parse(ur.Cells["Value3D1"].Text.ToString3()) + double.Parse(ur.Cells["Value3D2"].Text.ToString3())) / 2, 2), 0); } else if (comFormual.Equals("HV10")) { ur.Cells["Value4"].Value = Math.Round(0.1891 * 98.07 / Math.Pow((double.Parse(ur.Cells["Value3D1"].Text.ToString3()) + double.Parse(ur.Cells["Value3D2"].Text.ToString3())) / 2, 2), 0); } else { MessageUtil.ShowTips("公式选择错误!"); return; } if (ur.Cells["Value1"].Text != "") { m = m + 1; } if (ur.Cells["Value2"].Text != "") { m = m + 1; } if (ur.Cells["Value3"].Text != "") { m = m + 1; } if (ur.Cells["Value4"].Text != "") { m = m + 1; } ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.ToString3()) + double.Parse(ur.Cells["Value2"].Text.ToString3()) + double.Parse(ur.Cells["Value3"].Text.ToString3()) + double.Parse(ur.Cells["Value4"].Text.ToString3())) / m), 0).ToString(); } if (e.Cell.Column.Key == "Value1" || e.Cell.Column.Key == "Value2" || e.Cell.Column.Key == "Value3" || e.Cell.Column.Key == "Value4") { if (!StringUtil.IsDouble(e.Cell.Row.Cells["Value1"].Value.ToString3()) || !StringUtil.IsDouble(e.Cell.Row.Cells["Value2"].Value.ToString3()) || !StringUtil.IsDouble(e.Cell.Row.Cells["Value3"].Value.ToString3()) || !StringUtil.IsDouble(e.Cell.Row.Cells["Value4"].Value.ToString3())) { return; } if (ur.Cells["Value1"].Text != "") { m = m + 1; } if (ur.Cells["Value2"].Text != "") { m = m + 1; } if (ur.Cells["Value3"].Text != "") { m = m + 1; } if (ur.Cells["Value4"].Text != "") { m = m + 1; } ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.ToString3()) + double.Parse(ur.Cells["Value2"].Text.ToString3()) + double.Parse(ur.Cells["Value3"].Text.ToString3()) + double.Parse(ur.Cells["Value4"].Text.ToString3())) / m), 0).ToString(); } } private void ultraGrid6_CellChange(object sender, CellEventArgs e) { this.ultraGrid6.UpdateData(); UltraGridRow ur = this.ultraGrid6.ActiveRow; int m = 0; string comFormual = this.ultraComFormual.Text.Trim(); if (e.Cell.Column.Key == "Value1D1" || e.Cell.Column.Key == "Value1D2") { if (!StringUtil.IsDouble(e.Cell.Row.Cells["Value1D1"].Value.ToString3()) || !StringUtil.IsDouble(e.Cell.Row.Cells["Value1D2"].Value.ToString3())) { return; } if (comFormual.Equals("HBW2.5")) { ur.Cells["Value1"].Value = (Math.Round(0.102 * 2 * 1838.75 / (2.5 * 3.142 * (2.5 - Math.Sqrt(6.25 - Math.Pow(double.Parse(ur.Cells["Value1D1"].Text.ToString3()) + double.Parse(ur.Cells["Value1D2"].Text.ToString3()), 2) / 4))), 0)).ToString(); } else if (comFormual.Equals("HBW5")) { ur.Cells["Value1"].Value = (Math.Round(0.102 * 2 * 7355 / (5 * 3.142 * (5 - Math.Sqrt(25 - Math.Pow(double.Parse(ur.Cells["Value1D1"].Text.ToString3()) + double.Parse(ur.Cells["Value1D2"].Text.ToString3()), 2) / 4))), 0)).ToString(); } else if (comFormual.Equals("HBW10")) { ur.Cells["Value1"].Value = (Math.Round(0.102 * 2 * 29420 / (10 * 3.142 * (10 - Math.Sqrt(100 - Math.Pow(double.Parse(ur.Cells["Value1D1"].Text.ToString3()) + double.Parse(ur.Cells["Value1D2"].Text.ToString3()), 2) / 4))), 0)).ToString(); } else { MessageUtil.ShowTips("公式选择错误!"); return; } if (ur.Cells["Value1"].Text != "") { m = m + 1; } if (ur.Cells["Value2"].Text != "") { m = m + 1; } if (ur.Cells["Value3"].Text != "") { m = m + 1; } if (ur.Cells["Value4"].Text != "") { m = m + 1; } ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.ToString3()) + double.Parse(ur.Cells["Value2"].Text.ToString3()) + double.Parse(ur.Cells["Value3"].Text.ToString3()) + double.Parse(ur.Cells["Value4"].Text.ToString3())) / m), 0).ToString(); } if (e.Cell.Column.Key == "Value2D1" || e.Cell.Column.Key == "Value2D2") { if (!StringUtil.IsDouble(e.Cell.Row.Cells["Value2D1"].Value.ToString3()) || !StringUtil.IsDouble(e.Cell.Row.Cells["Value2D2"].Value.ToString3())) { return; } if (comFormual.Equals("HBW2.5")) { ur.Cells["Value2"].Value = (Math.Round(0.102 * 2 * 1838.75 / (2.5 * 3.142 * (2.5 - Math.Sqrt(6.25 - Math.Pow(double.Parse(ur.Cells["Value2D1"].Text.ToString3()) + double.Parse(ur.Cells["Value2D2"].Text.ToString3()), 2) / 4))), 0)).ToString(); } else if (comFormual.Equals("HBW5")) { ur.Cells["Value2"].Value = (Math.Round(0.102 * 2 * 7355 / (5 * 3.142 * (5 - Math.Sqrt(25 - Math.Pow(double.Parse(ur.Cells["Value2D1"].Text.ToString3()) + double.Parse(ur.Cells["Value2D2"].Text.ToString3()), 2) / 4))), 0)).ToString(); } else if (comFormual.Equals("HBW10")) { ur.Cells["Value2"].Value = (Math.Round(0.102 * 2 * 29420 / (10 * 3.142 * (10 - Math.Sqrt(100 - Math.Pow(double.Parse(ur.Cells["Value2D1"].Text.ToString3()) + double.Parse(ur.Cells["Value2D2"].Text.ToString3()), 2) / 4))), 0)).ToString(); } else { MessageUtil.ShowTips("公式选择错误!"); return; } if (ur.Cells["Value1"].Text != "") { m = m + 1; } if (ur.Cells["Value2"].Text != "") { m = m + 1; } if (ur.Cells["Value3"].Text != "") { m = m + 1; } if (ur.Cells["Value4"].Text != "") { m = m + 1; } ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.ToString3()) + double.Parse(ur.Cells["Value2"].Text.ToString3()) + double.Parse(ur.Cells["Value3"].Text.ToString3()) + double.Parse(ur.Cells["Value4"].Text.ToString3())) / m), 0).ToString(); } if (e.Cell.Column.Key == "Value3D1" || e.Cell.Column.Key == "Value3D2") { if (!StringUtil.IsDouble(e.Cell.Row.Cells["Value3D1"].Value.ToString3()) || !StringUtil.IsDouble(e.Cell.Row.Cells["Value3D2"].Value.ToString3())) { return; } if (comFormual.Equals("HBW2.5")) { ur.Cells["Value3"].Value = (Math.Round(0.102 * 2 * 1838.75 / (2.5 * 3.142 * (2.5 - Math.Sqrt(6.25 - Math.Pow(double.Parse(ur.Cells["Value3D1"].Text.ToString3()) + double.Parse(ur.Cells["Value3D2"].Text.ToString3()), 2) / 4))), 0)).ToString(); } else if (comFormual.Equals("HBW5")) { ur.Cells["Value3"].Value = (Math.Round(0.102 * 2 * 7355 / (5 * 3.142 * (5 - Math.Sqrt(25 - Math.Pow(double.Parse(ur.Cells["Value3D1"].Text.ToString3()) + double.Parse(ur.Cells["Value3D2"].Text.ToString3()), 2) / 4))), 0)).ToString(); } else if (comFormual.Equals("HBW10")) { ur.Cells["Value3"].Value = (Math.Round(0.102 * 2 * 29420 / (10 * 3.142 * (10 - Math.Sqrt(100 - Math.Pow(double.Parse(ur.Cells["Value3D1"].Text.ToString3()) + double.Parse(ur.Cells["Value3D2"].Text.ToString3()), 2) / 4))), 0)).ToString(); } else { MessageUtil.ShowTips("公式选择错误!"); return; } if (ur.Cells["Value1"].Text != "") { m = m + 1; } if (ur.Cells["Value2"].Text != "") { m = m + 1; } if (ur.Cells["Value3"].Text != "") { m = m + 1; } if(ur.Cells["Value4"].Text != "") { m = m + 1; } ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.ToString3()) + double.Parse(ur.Cells["Value2"].Text.ToString3()) + double.Parse(ur.Cells["Value3"].Text.ToString3()) + double.Parse(ur.Cells["Value4"].Text.ToString3())) / m), 0).ToString(); } if (e.Cell.Column.Key == "Value4D1" || e.Cell.Column.Key == "Value4D2") { if (!StringUtil.IsDouble(e.Cell.Row.Cells["Value4D1"].Value.ToString3()) || !StringUtil.IsDouble(e.Cell.Row.Cells["Value4D2"].Value.ToString3())) { return; } if (comFormual.Equals("HBW2.5")) { ur.Cells["Value4"].Value = (Math.Round(0.102 * 2 * 1838.75 / (2.5 * 3.142 * (2.5 - Math.Sqrt(6.25 - Math.Pow(double.Parse(ur.Cells["Value4D1"].Text.ToString3()) + double.Parse(ur.Cells["Value4D2"].Text.ToString3()), 2) / 4))), 0)).ToString(); } else if (comFormual.Equals("HBW5")) { ur.Cells["Value4"].Value = (Math.Round(0.102 * 2 * 7355 / (5 * 3.142 * (5 - Math.Sqrt(25 - Math.Pow(double.Parse(ur.Cells["Value4D1"].Text.ToString3()) + double.Parse(ur.Cells["Value4D2"].Text.ToString3()), 2) / 4))), 0)).ToString(); } else if (comFormual.Equals("HBW10")) { ur.Cells["Value4"].Value = (Math.Round(0.102 * 2 * 29420 / (10 * 3.142 * (10 - Math.Sqrt(100 - Math.Pow(double.Parse(ur.Cells["Value4D1"].Text.ToString3()) + double.Parse(ur.Cells["Value4D2"].Text.ToString3()), 2) / 4))), 0)).ToString(); } else { MessageUtil.ShowTips("公式选择错误!"); return; } if (ur.Cells["Value1"].Text != "") { m = m + 1; } if (ur.Cells["Value2"].Text != "") { m = m + 1; } if (ur.Cells["Value3"].Text != "") { m = m + 1; } if (ur.Cells["Value4"].Text != "") { m = m + 1; } ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.ToString3()) + double.Parse(ur.Cells["Value2"].Text.ToString3()) + double.Parse(ur.Cells["Value3"].Text.ToString3()) + double.Parse(ur.Cells["Value4"].Text.ToString3())) / m), 0).ToString(); } if (e.Cell.Column.Key == "Value1" || e.Cell.Column.Key == "Value2" || e.Cell.Column.Key == "Value3" || e.Cell.Column.Key == "Value4") { if (!StringUtil.IsDouble(e.Cell.Row.Cells["Value1"].Value.ToString3()) || !StringUtil.IsDouble(e.Cell.Row.Cells["Value2"].Value.ToString3()) || !StringUtil.IsDouble(e.Cell.Row.Cells["Value3"].Value.ToString3()) || !StringUtil.IsDouble(e.Cell.Row.Cells["Value4"].Value.ToString3())) { return; } if (ur.Cells["Value1"].Text != "") { m = m + 1; } if (ur.Cells["Value2"].Text != "") { m = m + 1; } if (ur.Cells["Value3"].Text != "") { m = m + 1; } if (ur.Cells["Value4"].Text != "") { m = m + 1; } ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.ToString3()) + double.Parse(ur.Cells["Value2"].Text.ToString3()) + double.Parse(ur.Cells["Value3"].Text.ToString3()) + double.Parse(ur.Cells["Value4"].Text.ToString3())) / m), 0).ToString(); } } private void ultraButton1_Click(object sender, EventArgs e) { if (this.TxtYbEuestion.Text.Trim() == "") { MessageUtil.ShowTips("请选择计算公式!"); return; } double d = 0.0; double c = 0.0; double t = 0.0; if(this.TxtYbEuestion.Text.Trim() == "0.65*D" || this.TxtYbEuestion.Text.Trim() == "7*D/8" ||this.TxtYbEuestion.Text.Trim() == "2*D/3") { if(this.TxtYbD.Text.Trim() == "") { MessageUtil.ShowTips("请输入管子公称外径!"); return; } }else if(this.TxtYbEuestion.Text.Trim() == "(1+C)*T/(C+T/D)") { if(this.TxtYbD.Text.Trim() == "" || this.TxtYbC.Text.Trim() == "" || this.TxtYbS.Text.Trim() == "") { MessageUtil.ShowTips("请输入管子的公称外径壁厚以及压扁系数!"); return; } } d = double.Parse(this.TxtYbD.Text.Trim().ToString3()); t = double.Parse(this.TxtYbS.Text.Trim().ToString3()); c = double.Parse(this.TxtYbC.Text.Trim().ToString3()); if (this.TxtYbEuestion.Text.Trim() == "0.65*D") { this.TxtYbSpac.Text = Math.Ceiling((0.65 * d)).ToString(); } else if (this.TxtYbEuestion.Text.Trim() == "7*D/8") { this.TxtYbSpac.Text = Math.Ceiling(((7 * d) / 8)).ToString(); } else if (this.TxtYbEuestion.Text.Trim() == "2*D/3") { this.TxtYbSpac.Text = Math.Ceiling(((2 * d) / 3)).ToString(); } else if (this.TxtYbEuestion.Text.Trim() == "(1+C)*T/(C+T/D)") { this.TxtYbSpac.Text = Math.Floor((((1 + c) * t) / (c + t / d))).ToString(); } } /** * 验证字符串 如:1<2 * * @param strA * 数字字符串 * @param sign * 符号 * @param strB * 数字字符串 * @return true Or false */ private bool checkStr(string strA, string sign, string strB) { if (strA.Length == 0 || strB.Length == 0) { return true; } if (!StringUtil.IsDouble(strB) || !StringUtil.IsDouble(strA)) { return true; } double a = double.Parse(strA); double b = double.Parse(strB); if (sign.Equals("=")) { if (a == b) { return true; } else { return false; } } if (sign.Equals(">")) { if (a > b) { return true; } else { return false; } } if (sign.Equals(">=")) { if (a >= b) { return true; } else { return false; } } if (sign.Equals("<")) { if (a < b) { return true; } else { return false; } } if (sign.Equals("<=")) { if (a <= b) { return true; } else { return false; } } return false; } private void ultraGrid15_AfterRowActivate(object sender, EventArgs e) { ultraTabControl3.Visible = true; ultraTabControl4.Visible = false; ultraTabControl5.Visible = false; ultraTabControl2.Visible = false; UltraGridRow row = this.ultraGrid15.ActiveRow; if (row == null) return; initCheckMethod(row.Cells["PhyCodeMax"].Value.ToString());//根据试样组加载试验方法 initCheckEqiupment(row.Cells["PhyCodeMax"].Value.ToString());//根据试样组加载试验设备 List listSource = EntityHelper.GetData( "com.steering.lims.data.outdec.FrmOutdecDataCJBase.queryCheckConsignBaseDetailPhyItem", new object[] { row.Cells["CheckNo"].Value.ToString(), row.Cells["SampleNo"].Value.ToString(), row.Cells["PhyCodeMax"].Value.ToString() }, this.ob); if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0001"))//拉伸 { PipeCheckconsignPhydetailEntitybindingSource.DataSource = listSource; foreach (UltraGridRow forRow in ultraGrid16.Rows) { if (!checkStr(forRow.Cells["Value1"].Text.Trim(), forRow.Cells["StdMinSign"].Text.Trim(), forRow.Cells["StdMin"].Text.Trim())) { forRow.RowSelectorAppearance.BackColor = Color.Red; } if (!checkStr(forRow.Cells["Value1"].Text.Trim(), forRow.Cells["StdMaxSign"].Text.Trim(), forRow.Cells["StdMax"].Text.Trim())) { forRow.RowSelectorAppearance.BackColor = Color.Red; } } ultraTabControl3.Tabs["0"].Selected = true; ultraTabControl3.Tabs["0"].Visible = true; ultraTabControl3.Tabs["1"].Visible = false; ultraTabControl3.Tabs["2"].Visible = false; ultraTabControl3.Tabs["3"].Visible = false; ultraTabControl3.Tabs["4"].Visible = false; ultraTabControl3.Tabs["5"].Visible = false; ultraTabControl3.Tabs["6"].Visible = false; ultraTabControl3.Tabs["7"].Visible = false; ultraTabControl3.Tabs["8"].Visible = false; ultraTabControl3.Tabs["9"].Visible = false; ultraTabControl3.Tabs["10"].Visible = false; ultraTabControl3.Tabs["11"].Visible = false; this.ultraComFormual1.Visible = false; this.cmbStdSteelType1.Visible = false; this.txtStdSteelNo1.Visible = false; this.txtStdSteelValue1.Visible = false; this.txtActualValue1.Visible = false; ultraLabel59.Visible = false; ultraLabel53.Visible = false; ultraLabel52.Visible = false; ultraLabel51.Visible = false; ultraLabel50.Visible = false; } else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0002"))//冲击 { PipeCheckconsignPhydetailEntityCjbindingSource.DataSource = listSource; foreach (UltraGridRow forRow in ultraGrid17.Rows) { if (!checkStr(forRow.Cells["AverageValue"].Text.Trim(), forRow.Cells["StdMinSign"].Text.Trim(), forRow.Cells["StdMin"].Text.Trim())) { forRow.RowSelectorAppearance.BackColor = Color.Red; } if (!checkStr(forRow.Cells["AverageValue"].Text.Trim(), forRow.Cells["StdMaxSign"].Text.Trim(), forRow.Cells["StdMax"].Text.Trim())) { forRow.RowSelectorAppearance.BackColor = Color.Red; } } ultraTabControl3.Tabs["1"].Selected = true; ultraTabControl3.Tabs["0"].Visible = false; ultraTabControl3.Tabs["1"].Visible = true; ultraTabControl3.Tabs["2"].Visible = false; ultraTabControl3.Tabs["3"].Visible = false; ultraTabControl3.Tabs["4"].Visible = false; ultraTabControl3.Tabs["5"].Visible = false; ultraTabControl3.Tabs["6"].Visible = false; ultraTabControl3.Tabs["7"].Visible = false; ultraTabControl3.Tabs["8"].Visible = false; ultraTabControl3.Tabs["9"].Visible = false; ultraTabControl3.Tabs["10"].Visible = false; ultraTabControl3.Tabs["11"].Visible = false; this.ultraComFormual1.Visible = false; this.cmbStdSteelType1.Visible = false; this.txtStdSteelNo1.Visible = false; this.txtStdSteelValue1.Visible = false; this.txtActualValue1.Visible = false; ultraLabel59.Visible = false; ultraLabel53.Visible = false; ultraLabel52.Visible = false; ultraLabel51.Visible = false; ultraLabel50.Visible = false; } else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0003"))//布氏 { ultraComFormual1.Items.Clear(); cmbStdSteelType1.Items.Clear(); PipeCheckconsignPhydetailEntityBSbindingSource.DataSource = listSource; MergedCell(ultraGrid6, new string[] { "PhyName" }); foreach (UltraGridRow forRow in ultraGrid20.Rows) { if (!checkStr(forRow.Cells["AverageValue"].Text.Trim(), forRow.Cells["StdMinSign"].Text.Trim(), forRow.Cells["StdMin"].Text.Trim())) { forRow.RowSelectorAppearance.BackColor = Color.Red; } if (!checkStr(forRow.Cells["AverageValue"].Text.Trim(), forRow.Cells["StdMaxSign"].Text.Trim(), forRow.Cells["StdMax"].Text.Trim())) { forRow.RowSelectorAppearance.BackColor = Color.Red; } } ultraTabControl3.Tabs["4"].Selected = true; ultraTabControl3.Tabs["0"].Visible = false; ultraTabControl3.Tabs["1"].Visible = false; ultraTabControl3.Tabs["2"].Visible = false; ultraTabControl3.Tabs["3"].Visible = false; ultraTabControl3.Tabs["4"].Visible = true; ultraTabControl3.Tabs["5"].Visible = false; ultraTabControl3.Tabs["6"].Visible = false; ultraTabControl3.Tabs["7"].Visible = false; ultraTabControl3.Tabs["8"].Visible = false; ultraTabControl3.Tabs["9"].Visible = false; ultraTabControl3.Tabs["10"].Visible = false; ultraTabControl3.Tabs["11"].Visible = false; this.ultraComFormual1.Visible = true; this.cmbStdSteelType1.Visible = true; this.txtStdSteelNo1.Visible = true; this.txtStdSteelValue1.Visible = true; this.txtActualValue1.Visible = true; ultraLabel59.Visible = true; ultraLabel53.Visible = true; ultraLabel52.Visible = true; ultraLabel51.Visible = true; ultraLabel50.Visible = true; ultraComFormual1.Items.Add("HBW2.5"); ultraComFormual1.Items.Add("HBW5"); ultraComFormual1.Items.Add("HBW10"); cmbStdSteelType1.Items.Add("HBW2.5/187.5"); cmbStdSteelType1.Items.Add("HBW 5/750"); cmbStdSteelType1.Items.Add("HBW 10/1000"); } else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0004") || row.Cells["PhyCodeMin"].Value.ToString().Equals("R0018"))//洛氏 { cmbStdSteelType1.Items.Clear(); PipeCheckconsignPhydetailEntityLSbindingSource.DataSource = listSource; MergedCell(ultraGrid5, new string[] { "PhyName" }); foreach (UltraGridRow forRow in ultraGrid18.Rows) { if (!checkStr(forRow.Cells["AverageValue"].Text.Trim(), forRow.Cells["StdMinSign"].Text.Trim(), forRow.Cells["StdMin"].Text.Trim())) { forRow.RowSelectorAppearance.BackColor = Color.Red; } if (!checkStr(forRow.Cells["AverageValue"].Text.Trim(), forRow.Cells["StdMaxSign"].Text.Trim(), forRow.Cells["StdMax"].Text.Trim())) { forRow.RowSelectorAppearance.BackColor = Color.Red; } } ultraTabControl3.Tabs["2"].Selected = true; ultraTabControl3.Tabs["0"].Visible = false; ultraTabControl3.Tabs["1"].Visible = false; ultraTabControl3.Tabs["2"].Visible = true; ultraTabControl3.Tabs["3"].Visible = false; ultraTabControl3.Tabs["4"].Visible = false; ultraTabControl3.Tabs["5"].Visible = false; ultraTabControl3.Tabs["6"].Visible = false; ultraTabControl3.Tabs["7"].Visible = false; ultraTabControl3.Tabs["8"].Visible = false; ultraTabControl3.Tabs["9"].Visible = false; ultraTabControl3.Tabs["10"].Visible = false; ultraTabControl3.Tabs["11"].Visible = false; this.ultraComFormual1.Visible = false; this.cmbStdSteelType1.Visible = true; this.txtStdSteelNo1.Visible = true; this.txtStdSteelValue1.Visible = true; this.txtActualValue1.Visible = true; ultraLabel59.Visible = false; ultraLabel53.Visible = true; ultraLabel52.Visible = true; ultraLabel51.Visible = true; ultraLabel50.Visible = true; cmbStdSteelType1.Items.Add("HRA"); cmbStdSteelType1.Items.Add("HRB"); cmbStdSteelType1.Items.Add("HRC"); } else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0005"))//维氏 { ultraComFormual1.Items.Clear(); cmbStdSteelType1.Items.Clear(); PipeCheckconsignPhydetailEntityWSbindingSource.DataSource = listSource; MergedCell(ultraGrid5, new string[] { "PhyName" }); foreach (UltraGridRow forRow in ultraGrid19.Rows) { if (!checkStr(forRow.Cells["AverageValue"].Text.Trim(), forRow.Cells["StdMinSign"].Text.Trim(), forRow.Cells["StdMin"].Text.Trim())) { forRow.RowSelectorAppearance.BackColor = Color.Red; } if (!checkStr(forRow.Cells["AverageValue"].Text.Trim(), forRow.Cells["StdMaxSign"].Text.Trim(), forRow.Cells["StdMax"].Text.Trim())) { forRow.RowSelectorAppearance.BackColor = Color.Red; } } ultraTabControl3.Tabs["3"].Selected = true; ultraTabControl3.Tabs["0"].Visible = false; ultraTabControl3.Tabs["1"].Visible = false; ultraTabControl3.Tabs["2"].Visible = false; ultraTabControl3.Tabs["3"].Visible = true; ultraTabControl3.Tabs["4"].Visible = false; ultraTabControl3.Tabs["5"].Visible = false; ultraTabControl3.Tabs["6"].Visible = false; ultraTabControl3.Tabs["7"].Visible = false; ultraTabControl3.Tabs["8"].Visible = false; ultraTabControl3.Tabs["9"].Visible = false; ultraTabControl3.Tabs["10"].Visible = false; ultraTabControl3.Tabs["11"].Visible = false; this.ultraComFormual1.Visible = true; this.cmbStdSteelType1.Visible = true; this.txtStdSteelNo1.Visible = true; this.txtStdSteelValue1.Visible = true; this.txtActualValue1.Visible = true; ultraLabel59.Visible = true; ultraLabel53.Visible = true; ultraLabel52.Visible = true; ultraLabel51.Visible = true; ultraLabel50.Visible = true; ultraComFormual1.Items.Add("HV5"); ultraComFormual1.Items.Add("HV10"); cmbStdSteelType1.Items.Add("HV5"); cmbStdSteelType1.Items.Add("HV10"); cmbStdSteelType1.Items.Add("HV0.2"); } else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0014") || row.Cells["PhyCodeMin"].Value.ToString().Equals("R0016") || row.Cells["PhyCodeMin"].Value.ToString().Equals("R0031"))//组织 { PipeCheckconsignPhydetailEntityZZbindingSource.DataSource = listSource; foreach (UltraGridRow forRow in ultraGrid23.Rows) { if (!checkStr(forRow.Cells["Value1"].Text.Trim(), forRow.Cells["StdMinSign"].Text.Trim(), forRow.Cells["StdMin"].Text.Trim())) { forRow.RowSelectorAppearance.BackColor = Color.Red; } if (!checkStr(forRow.Cells["Value1"].Text.Trim(), forRow.Cells["StdMaxSign"].Text.Trim(), forRow.Cells["StdMax"].Text.Trim())) { forRow.RowSelectorAppearance.BackColor = Color.Red; } } ultraTabControl3.Tabs["7"].Selected = true; ultraTabControl3.Tabs["0"].Visible = false; ultraTabControl3.Tabs["1"].Visible = false; ultraTabControl3.Tabs["2"].Visible = false; ultraTabControl3.Tabs["3"].Visible = false; ultraTabControl3.Tabs["4"].Visible = false; ultraTabControl3.Tabs["5"].Visible = false; ultraTabControl3.Tabs["6"].Visible = false; ultraTabControl3.Tabs["7"].Visible = true; ultraTabControl3.Tabs["8"].Visible = false; ultraTabControl3.Tabs["9"].Visible = false; ultraTabControl3.Tabs["10"].Visible = false; ultraTabControl3.Tabs["11"].Visible = false; this.ultraComFormual1.Visible = false; this.cmbStdSteelType1.Visible = false; this.txtStdSteelNo1.Visible = false; this.txtStdSteelValue1.Visible = false; this.txtActualValue1.Visible = false; ultraLabel59.Visible = false; ultraLabel53.Visible = false; ultraLabel52.Visible = false; ultraLabel51.Visible = false; ultraLabel50.Visible = false; } else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0013"))//晶粒度 { PipeCheckconsignPhydetailEntityJLDbindingSource.DataSource = listSource; foreach (UltraGridRow forRow in ultraGrid22.Rows) { if (!checkStr(forRow.Cells["Value1"].Text.Trim(), forRow.Cells["StdMinSign"].Text.Trim(), forRow.Cells["StdMin"].Text.Trim())) { forRow.RowSelectorAppearance.BackColor = Color.Red; } if (!checkStr(forRow.Cells["Value1"].Text.Trim(), forRow.Cells["StdMaxSign"].Text.Trim(), forRow.Cells["StdMax"].Text.Trim())) { forRow.RowSelectorAppearance.BackColor = Color.Red; } } ultraTabControl3.Tabs["6"].Selected = true; ultraTabControl3.Tabs["0"].Visible = false; ultraTabControl3.Tabs["1"].Visible = false; ultraTabControl3.Tabs["2"].Visible = false; ultraTabControl3.Tabs["3"].Visible = false; ultraTabControl3.Tabs["4"].Visible = false; ultraTabControl3.Tabs["5"].Visible = false; ultraTabControl3.Tabs["6"].Visible = true; ultraTabControl3.Tabs["7"].Visible = false; ultraTabControl3.Tabs["8"].Visible = false; ultraTabControl3.Tabs["9"].Visible = false; ultraTabControl3.Tabs["10"].Visible = false; ultraTabControl3.Tabs["11"].Visible = false; this.ultraComFormual1.Visible = false; this.cmbStdSteelType1.Visible = true; this.txtStdSteelNo1.Visible = true; this.txtStdSteelValue1.Visible = true; this.txtActualValue1.Visible = true; ultraLabel59.Visible = false; ultraLabel53.Visible = false; ultraLabel52.Visible = false; ultraLabel51.Visible = false; ultraLabel50.Visible = false; } else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0012"))//夹杂 { PipeCheckconsignPhydetailEntityJZWbindingSource.DataSource = listSource; foreach (UltraGridRow forRow in ultraGrid21.Rows) { if (!checkStr(forRow.Cells["Value1"].Text.Trim(), forRow.Cells["StdMinSign"].Text.Trim(), forRow.Cells["StdMin"].Text.Trim())) { forRow.RowSelectorAppearance.BackColor = Color.Red; } if (!checkStr(forRow.Cells["Value1"].Text.Trim(), forRow.Cells["StdMaxSign"].Text.Trim(), forRow.Cells["StdMax"].Text.Trim())) { forRow.RowSelectorAppearance.BackColor = Color.Red; } } ultraTabControl3.Tabs["5"].Selected = true; ultraTabControl3.Tabs["0"].Visible = false; ultraTabControl3.Tabs["1"].Visible = false; ultraTabControl3.Tabs["2"].Visible = false; ultraTabControl3.Tabs["3"].Visible = false; ultraTabControl3.Tabs["4"].Visible = false; ultraTabControl3.Tabs["5"].Visible = true; ultraTabControl3.Tabs["6"].Visible = false; ultraTabControl3.Tabs["7"].Visible = false; ultraTabControl3.Tabs["8"].Visible = false; ultraTabControl3.Tabs["9"].Visible = false; ultraTabControl3.Tabs["10"].Visible = false; ultraTabControl3.Tabs["11"].Visible = false; this.ultraComFormual1.Visible = false; this.cmbStdSteelType1.Visible = false; this.txtStdSteelNo1.Visible = false; this.txtStdSteelValue1.Visible = false; this.txtActualValue1.Visible = false; ultraLabel59.Visible = false; ultraLabel53.Visible = false; ultraLabel52.Visible = false; ultraLabel51.Visible = false; ultraLabel50.Visible = false; ultraGrid21.DisplayLayout.Bands[0].Columns["Value1"].Header.Caption = "一象限"; ultraGrid21.DisplayLayout.Bands[0].Columns["Value2"].Header.Caption = "二象限"; ultraGrid21.DisplayLayout.Bands[0].Columns["Value3"].Header.Caption = "三象限"; ultraGrid21.DisplayLayout.Bands[0].Columns["Value4"].Header.Caption = "四象限"; if (row.Cells["PhyCodeMax"].Value.ToString().Equals("C0115")) { ultraGrid21.DisplayLayout.Bands[0].Columns["Value2"].Hidden = false; ultraGrid21.DisplayLayout.Bands[0].Columns["Value3"].Hidden = false; ultraGrid21.DisplayLayout.Bands[0].Columns["Value4"].Hidden = false; } else { ultraGrid21.DisplayLayout.Bands[0].Columns["Value2"].Hidden = true; ultraGrid21.DisplayLayout.Bands[0].Columns["Value3"].Hidden = true; ultraGrid21.DisplayLayout.Bands[0].Columns["Value4"].Hidden = true; } } else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0010"))//工艺 { if (row.Cells["PhyCodeMax"].Value.ToString().Equals("C0027") || row.Cells["PhyCodeMax"].Value.ToString().Equals("C0038") || row.Cells["PhyCodeMax"].Value.ToString().Equals("C0082") || row.Cells["PhyCodeMax"].Value.ToString().Equals("C0083") || row.Cells["PhyCodeMax"].Value.ToString().Equals("C0098"))//弯曲 { PipeCheckconsignPhydetailEntityWQbindingSource.DataSource = listSource; ultraTabControl3.Tabs["9"].Selected = true; ultraTabControl3.Tabs["0"].Visible = false; ultraTabControl3.Tabs["1"].Visible = false; ultraTabControl3.Tabs["2"].Visible = false; ultraTabControl3.Tabs["3"].Visible = false; ultraTabControl3.Tabs["4"].Visible = false; ultraTabControl3.Tabs["5"].Visible = false; ultraTabControl3.Tabs["6"].Visible = false; ultraTabControl3.Tabs["7"].Visible = false; ultraTabControl3.Tabs["8"].Visible = false; ultraTabControl3.Tabs["9"].Visible = true; ultraTabControl3.Tabs["10"].Visible = false; ultraTabControl3.Tabs["11"].Visible = false; this.ultraComFormual1.Visible = false; this.cmbStdSteelType1.Visible = false; this.txtStdSteelNo1.Visible = false; this.txtStdSteelValue1.Visible = false; this.txtActualValue1.Visible = false; } else if (row.Cells["PhyCodeMax"].Value.ToString().Equals("C0009"))//压扁 { ultraTxtYbEuestion.Text = ""; ultraTxtYbD.Text = ""; ultraTxtYbS.Text = ""; ultraTxtYbC.Text = ""; ultraTxtYbSpac.Text = ""; ultraTxtYbQualfiled.Text = ""; ultraTxtYbDefect.Text = ""; ultraTxtYbMemo.Text = ""; PipeCheckconsignPhydetailEntityYBbindingSource.DataSource = listSource; ultraTabControl3.Tabs["8"].Selected = true; ultraTabControl3.Tabs["0"].Visible = false; ultraTabControl3.Tabs["1"].Visible = false; ultraTabControl3.Tabs["2"].Visible = false; ultraTabControl3.Tabs["3"].Visible = false; ultraTabControl3.Tabs["4"].Visible = false; ultraTabControl3.Tabs["5"].Visible = false; ultraTabControl3.Tabs["6"].Visible = false; ultraTabControl3.Tabs["7"].Visible = false; ultraTabControl3.Tabs["8"].Visible = true; ultraTabControl3.Tabs["9"].Visible = false; ultraTabControl3.Tabs["10"].Visible = false; ultraTabControl3.Tabs["11"].Visible = false; this.ultraComFormual1.Visible = false; this.cmbStdSteelType1.Visible = false; this.txtStdSteelNo1.Visible = false; this.txtStdSteelValue1.Visible = false; this.txtActualValue1.Visible = false; ultraLabel59.Visible = false; ultraLabel53.Visible = false; ultraLabel52.Visible = false; ultraLabel51.Visible = false; ultraLabel50.Visible = false; int x = row.Cells["SpecName"].Text.IndexOf('x'); ultraTxtYbD.Text = row.Cells["SpecName"].Text.Substring(0, x); ultraTxtYbS.Text = row.Cells["SpecName"].Text.Substring(x + 1); ultraGrid24.DisplayLayout.Bands[0].Columns["IsGood"].Header.Caption = "试验结果(一次)"; ultraGrid24.DisplayLayout.Bands[0].Columns["IsDefect"].Header.Caption = "试验结果(二次)"; } else if (row.Cells["PhyCodeMax"].Value.ToString().Equals("C0026"))//扩口 { PipeCheckconsignPhydetailEntityKKbindingSource.DataSource = listSource; ultraTabControl3.Tabs["10"].Selected = true; ultraTabControl3.Tabs["0"].Visible = false; ultraTabControl3.Tabs["1"].Visible = false; ultraTabControl3.Tabs["2"].Visible = false; ultraTabControl3.Tabs["3"].Visible = false; ultraTabControl3.Tabs["4"].Visible = false; ultraTabControl3.Tabs["5"].Visible = false; ultraTabControl3.Tabs["6"].Visible = false; ultraTabControl3.Tabs["7"].Visible = false; ultraTabControl3.Tabs["8"].Visible = false; ultraTabControl3.Tabs["9"].Visible = false; ultraTabControl3.Tabs["10"].Visible = true; ultraTabControl3.Tabs["11"].Visible = false; this.ultraComFormual1.Visible = false; this.cmbStdSteelType1.Visible = false; this.txtStdSteelNo1.Visible = false; this.txtStdSteelValue1.Visible = false; this.txtActualValue1.Visible = false; ultraLabel59.Visible = false; ultraLabel53.Visible = false; ultraLabel52.Visible = false; ultraLabel51.Visible = false; ultraLabel50.Visible = false; } } else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0050")) { pipeCheckconsignPhydetailEntityQTBindingSource.DataSource = listSource; ultraTabControl3.Tabs["11"].Selected = true; ultraTabControl3.Tabs["0"].Visible = false; ultraTabControl3.Tabs["1"].Visible = false; ultraTabControl3.Tabs["2"].Visible = false; ultraTabControl3.Tabs["3"].Visible = false; ultraTabControl3.Tabs["4"].Visible = false; ultraTabControl3.Tabs["5"].Visible = false; ultraTabControl3.Tabs["6"].Visible = false; ultraTabControl3.Tabs["7"].Visible = false; ultraTabControl3.Tabs["8"].Visible = false; ultraTabControl3.Tabs["9"].Visible = false; ultraTabControl3.Tabs["10"].Visible = false; ultraTabControl3.Tabs["11"].Visible = true; ultraGrid55.DisplayLayout.Bands[0].Columns["AverageValue"].Header.Caption = "最小值"; this.ultraComFormual1.Visible = false; this.cmbStdSteelType1.Visible = false; this.txtStdSteelNo1.Visible = false; this.txtStdSteelValue1.Visible = false; this.txtActualValue1.Visible = false; ultraLabel59.Visible = false; ultraLabel53.Visible = false; ultraLabel52.Visible = false; ultraLabel51.Visible = false; ultraLabel50.Visible = false; } initCheckData(row);//加载编辑区信息 } private void initCheckData(UltraGridRow row) { this.txtCHECK_TEMP1.Text = row.Cells["CheckTemp"].Text; this.ultraDEVICE_NAME1.Value = row.Cells["DeviceNo"].Text; this.ultraComMethod1.Value = row.Cells["FormualNo"].Text; this.cmbChemOrder1.Value = row.Cells["CheckShift"].Text; this.cmbChemGroup1.Value = row.Cells["CheckClass"].Text; this.txtChemUser1.Text = row.Cells["CheckName"].Text; this.ultraComFormual1.Text = row.Cells["HardnessType"].Text; cmbStdSteelType1.Text = row.Cells["StdSteelType"].Text; this.txtStdSteelNo1.Text = row.Cells["StdSteelNo"].Text; this.txtStdSteelValue1.Text = row.Cells["StdSteelValue"].Text; this.txtActualValue1.Text = row.Cells["ActualValue"].Text; this.ultraComFormual1.Text = row.Cells["HardnessType"].Text; } private void ultraGrid28_AfterRowActivate(object sender, EventArgs e) { ultraTabControl3.Visible = false; ultraTabControl4.Visible = true; ultraTabControl5.Visible = false; ultraTabControl2.Visible = false; UltraGridRow row = this.ultraGrid28.ActiveRow; List listSource = EntityHelper.GetData( "com.steering.lims.data.outdec.FrmOutdecDataCJBase.queryCheckConsignBaseDetailPhyItem", new object[] { row.Cells["CheckNo"].Value.ToString(), row.Cells["SampleNo"].Value.ToString(), row.Cells["PhyCodeMax"].Value.ToString() }, this.ob); if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0001"))//拉伸 { PipeCheckconsignPhydetailEntitybindingSource.DataSource = listSource; ultraTabControl4.Tabs["0"].Selected = true; ultraTabControl4.Tabs["0"].Visible = true; ultraTabControl4.Tabs["1"].Visible = false; ultraTabControl4.Tabs["2"].Visible = false; ultraTabControl4.Tabs["3"].Visible = false; ultraTabControl4.Tabs["4"].Visible = false; ultraTabControl4.Tabs["5"].Visible = false; ultraTabControl4.Tabs["6"].Visible = false; ultraTabControl4.Tabs["7"].Visible = false; ultraTabControl4.Tabs["8"].Visible = false; ultraTabControl4.Tabs["9"].Visible = false; ultraTabControl4.Tabs["10"].Visible = false; ultraTabControl4.Tabs["11"].Visible = false; foreach (UltraGridRow forRow in ultraGrid29.Rows) { if (!checkStr(forRow.Cells["Value1"].Text.Trim(), forRow.Cells["StdMinSign"].Text.Trim(), forRow.Cells["StdMin"].Text.Trim())) { forRow.RowSelectorAppearance.BackColor = Color.Red; } if (!checkStr(forRow.Cells["Value1"].Text.Trim(), forRow.Cells["StdMaxSign"].Text.Trim(), forRow.Cells["StdMax"].Text.Trim())) { forRow.RowSelectorAppearance.BackColor = Color.Red; } } } else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0002"))//冲击 { PipeCheckconsignPhydetailEntityCjbindingSource.DataSource = listSource; ultraTabControl4.Tabs["1"].Selected = true; ultraTabControl4.Tabs["0"].Visible = false; ultraTabControl4.Tabs["1"].Visible = true; ultraTabControl4.Tabs["2"].Visible = false; ultraTabControl4.Tabs["3"].Visible = false; ultraTabControl4.Tabs["4"].Visible = false; ultraTabControl4.Tabs["5"].Visible = false; ultraTabControl4.Tabs["6"].Visible = false; ultraTabControl4.Tabs["7"].Visible = false; ultraTabControl4.Tabs["8"].Visible = false; ultraTabControl4.Tabs["9"].Visible = false; ultraTabControl4.Tabs["10"].Visible = false; ultraTabControl4.Tabs["11"].Visible = false; foreach (UltraGridRow forRow in ultraGrid30.Rows) { if (!checkStr(forRow.Cells["AverageValue"].Text.Trim(), forRow.Cells["StdMinSign"].Text.Trim(), forRow.Cells["StdMin"].Text.Trim())) { forRow.RowSelectorAppearance.BackColor = Color.Red; } if (!checkStr(forRow.Cells["AverageValue"].Text.Trim(), forRow.Cells["StdMaxSign"].Text.Trim(), forRow.Cells["StdMax"].Text.Trim())) { forRow.RowSelectorAppearance.BackColor = Color.Red; } } } else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0003"))//布氏 { PipeCheckconsignPhydetailEntityBSbindingSource.DataSource = listSource; MergedCell(ultraGrid6, new string[] { "PhyName" }); ultraTabControl4.Tabs["4"].Selected = true; ultraTabControl4.Tabs["0"].Visible = false; ultraTabControl4.Tabs["1"].Visible = false; ultraTabControl4.Tabs["2"].Visible = false; ultraTabControl4.Tabs["3"].Visible = false; ultraTabControl4.Tabs["4"].Visible = true; ultraTabControl4.Tabs["5"].Visible = false; ultraTabControl4.Tabs["6"].Visible = false; ultraTabControl4.Tabs["7"].Visible = false; ultraTabControl4.Tabs["8"].Visible = false; ultraTabControl4.Tabs["9"].Visible = false; ultraTabControl4.Tabs["10"].Visible = false; ultraTabControl4.Tabs["11"].Visible = false; foreach (UltraGridRow forRow in ultraGrid33.Rows) { if (!checkStr(forRow.Cells["AverageValue"].Text.Trim(), forRow.Cells["StdMinSign"].Text.Trim(), forRow.Cells["StdMin"].Text.Trim())) { forRow.RowSelectorAppearance.BackColor = Color.Red; } if (!checkStr(forRow.Cells["AverageValue"].Text.Trim(), forRow.Cells["StdMaxSign"].Text.Trim(), forRow.Cells["StdMax"].Text.Trim())) { forRow.RowSelectorAppearance.BackColor = Color.Red; } } } else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0004") || row.Cells["PhyCodeMin"].Value.ToString().Equals("R0018"))//洛氏 { PipeCheckconsignPhydetailEntityLSbindingSource.DataSource = listSource; MergedCell(ultraGrid5, new string[] { "PhyName" }); ultraTabControl4.Tabs["2"].Selected = true; ultraTabControl4.Tabs["0"].Visible = false; ultraTabControl4.Tabs["1"].Visible = false; ultraTabControl4.Tabs["2"].Visible = true; ultraTabControl4.Tabs["3"].Visible = false; ultraTabControl4.Tabs["4"].Visible = false; ultraTabControl4.Tabs["5"].Visible = false; ultraTabControl4.Tabs["6"].Visible = false; ultraTabControl4.Tabs["7"].Visible = false; ultraTabControl4.Tabs["8"].Visible = false; ultraTabControl4.Tabs["9"].Visible = false; ultraTabControl4.Tabs["10"].Visible = false; ultraTabControl4.Tabs["11"].Visible = false; foreach (UltraGridRow forRow in ultraGrid31.Rows) { if (!checkStr(forRow.Cells["AverageValue"].Text.Trim(), forRow.Cells["StdMinSign"].Text.Trim(), forRow.Cells["StdMin"].Text.Trim())) { forRow.RowSelectorAppearance.BackColor = Color.Red; } if (!checkStr(forRow.Cells["AverageValue"].Text.Trim(), forRow.Cells["StdMaxSign"].Text.Trim(), forRow.Cells["StdMax"].Text.Trim())) { forRow.RowSelectorAppearance.BackColor = Color.Red; } } } else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0005"))//维氏 { PipeCheckconsignPhydetailEntityWSbindingSource.DataSource = listSource; MergedCell(ultraGrid5, new string[] { "PhyName" }); ultraTabControl4.Tabs["3"].Selected = true; ultraTabControl4.Tabs["0"].Visible = false; ultraTabControl4.Tabs["1"].Visible = false; ultraTabControl4.Tabs["2"].Visible = false; ultraTabControl4.Tabs["3"].Visible = true; ultraTabControl4.Tabs["4"].Visible = false; ultraTabControl4.Tabs["5"].Visible = false; ultraTabControl4.Tabs["6"].Visible = false; ultraTabControl4.Tabs["7"].Visible = false; ultraTabControl4.Tabs["8"].Visible = false; ultraTabControl4.Tabs["9"].Visible = false; ultraTabControl4.Tabs["10"].Visible = false; ultraTabControl4.Tabs["11"].Visible = false; foreach (UltraGridRow forRow in ultraGrid32.Rows) { if (!checkStr(forRow.Cells["AverageValue"].Text.Trim(), forRow.Cells["StdMinSign"].Text.Trim(), forRow.Cells["StdMin"].Text.Trim())) { forRow.RowSelectorAppearance.BackColor = Color.Red; } if (!checkStr(forRow.Cells["AverageValue"].Text.Trim(), forRow.Cells["StdMaxSign"].Text.Trim(), forRow.Cells["StdMax"].Text.Trim())) { forRow.RowSelectorAppearance.BackColor = Color.Red; } } } else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0014") || row.Cells["PhyCodeMin"].Value.ToString().Equals("R0016") || row.Cells["PhyCodeMin"].Value.ToString().Equals("R0031"))//组织 { PipeCheckconsignPhydetailEntityZZbindingSource.DataSource = listSource; ultraTabControl4.Tabs["7"].Selected = true; ultraTabControl4.Tabs["0"].Visible = false; ultraTabControl4.Tabs["1"].Visible = false; ultraTabControl4.Tabs["2"].Visible = false; ultraTabControl4.Tabs["3"].Visible = false; ultraTabControl4.Tabs["4"].Visible = false; ultraTabControl4.Tabs["5"].Visible = false; ultraTabControl4.Tabs["6"].Visible = false; ultraTabControl4.Tabs["7"].Visible = true; ultraTabControl4.Tabs["8"].Visible = false; ultraTabControl4.Tabs["9"].Visible = false; ultraTabControl4.Tabs["10"].Visible = false; ultraTabControl4.Tabs["11"].Visible = false; foreach (UltraGridRow forRow in ultraGrid36.Rows) { if (!checkStr(forRow.Cells["Value1"].Text.Trim(), forRow.Cells["StdMinSign"].Text.Trim(), forRow.Cells["StdMin"].Text.Trim())) { forRow.RowSelectorAppearance.BackColor = Color.Red; } if (!checkStr(forRow.Cells["Value1"].Text.Trim(), forRow.Cells["StdMaxSign"].Text.Trim(), forRow.Cells["StdMax"].Text.Trim())) { forRow.RowSelectorAppearance.BackColor = Color.Red; } } } else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0013"))//晶粒度 { PipeCheckconsignPhydetailEntityJLDbindingSource.DataSource = listSource; ultraTabControl4.Tabs["6"].Selected = true; ultraTabControl4.Tabs["0"].Visible = false; ultraTabControl4.Tabs["1"].Visible = false; ultraTabControl4.Tabs["2"].Visible = false; ultraTabControl4.Tabs["3"].Visible = false; ultraTabControl4.Tabs["4"].Visible = false; ultraTabControl4.Tabs["5"].Visible = false; ultraTabControl4.Tabs["6"].Visible = true; ultraTabControl4.Tabs["7"].Visible = false; ultraTabControl4.Tabs["8"].Visible = false; ultraTabControl4.Tabs["9"].Visible = false; ultraTabControl4.Tabs["10"].Visible = false; ultraTabControl4.Tabs["11"].Visible = false; foreach (UltraGridRow forRow in ultraGrid35.Rows) { if (!checkStr(forRow.Cells["Value1"].Text.Trim(), forRow.Cells["StdMinSign"].Text.Trim(), forRow.Cells["StdMin"].Text.Trim())) { forRow.RowSelectorAppearance.BackColor = Color.Red; } if (!checkStr(forRow.Cells["Value1"].Text.Trim(), forRow.Cells["StdMaxSign"].Text.Trim(), forRow.Cells["StdMax"].Text.Trim())) { forRow.RowSelectorAppearance.BackColor = Color.Red; } } } else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0012"))//夹杂 { PipeCheckconsignPhydetailEntityJZWbindingSource.DataSource = listSource; ultraTabControl4.Tabs["5"].Selected = true; ultraTabControl4.Tabs["0"].Visible = false; ultraTabControl4.Tabs["1"].Visible = false; ultraTabControl4.Tabs["2"].Visible = false; ultraTabControl4.Tabs["3"].Visible = false; ultraTabControl4.Tabs["4"].Visible = false; ultraTabControl4.Tabs["5"].Visible = true; ultraTabControl4.Tabs["6"].Visible = false; ultraTabControl4.Tabs["7"].Visible = false; ultraTabControl4.Tabs["8"].Visible = false; ultraTabControl4.Tabs["9"].Visible = false; ultraTabControl4.Tabs["10"].Visible = false; ultraTabControl4.Tabs["11"].Visible = false; foreach (UltraGridRow forRow in ultraGrid34.Rows) { if (!checkStr(forRow.Cells["Value1"].Text.Trim(), forRow.Cells["StdMinSign"].Text.Trim(), forRow.Cells["StdMin"].Text.Trim())) { forRow.RowSelectorAppearance.BackColor = Color.Red; } if (!checkStr(forRow.Cells["Value1"].Text.Trim(), forRow.Cells["StdMaxSign"].Text.Trim(), forRow.Cells["StdMax"].Text.Trim())) { forRow.RowSelectorAppearance.BackColor = Color.Red; } } ultraGrid34.DisplayLayout.Bands[0].Columns["Value1"].Header.Caption = "一象限"; ultraGrid34.DisplayLayout.Bands[0].Columns["Value2"].Header.Caption = "二象限"; ultraGrid34.DisplayLayout.Bands[0].Columns["Value3"].Header.Caption = "三象限"; ultraGrid34.DisplayLayout.Bands[0].Columns["Value4"].Header.Caption = "四象限"; if (row.Cells["PhyCodeMax"].Value.ToString().Equals("C0115")) { ultraGrid34.DisplayLayout.Bands[0].Columns["Value2"].Hidden = false; ultraGrid34.DisplayLayout.Bands[0].Columns["Value3"].Hidden = false; ultraGrid34.DisplayLayout.Bands[0].Columns["Value4"].Hidden = false; } else { ultraGrid34.DisplayLayout.Bands[0].Columns["Value2"].Hidden = true; ultraGrid34.DisplayLayout.Bands[0].Columns["Value3"].Hidden = true; ultraGrid34.DisplayLayout.Bands[0].Columns["Value4"].Hidden = true; } } else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0010"))//工艺 { if (row.Cells["PhyCodeMax"].Value.ToString().Equals("C0027") || row.Cells["PhyCodeMax"].Value.ToString().Equals("C0038") || row.Cells["PhyCodeMax"].Value.ToString().Equals("C0082") || row.Cells["PhyCodeMax"].Value.ToString().Equals("C0083") || row.Cells["PhyCodeMax"].Value.ToString().Equals("C0098"))//弯曲 { PipeCheckconsignPhydetailEntityWQbindingSource.DataSource = listSource; ultraTabControl4.Tabs["9"].Selected = true; ultraTabControl4.Tabs["0"].Visible = false; ultraTabControl4.Tabs["1"].Visible = false; ultraTabControl4.Tabs["2"].Visible = false; ultraTabControl4.Tabs["3"].Visible = false; ultraTabControl4.Tabs["4"].Visible = false; ultraTabControl4.Tabs["5"].Visible = false; ultraTabControl4.Tabs["6"].Visible = false; ultraTabControl4.Tabs["7"].Visible = false; ultraTabControl4.Tabs["8"].Visible = false; ultraTabControl4.Tabs["9"].Visible = true; ultraTabControl4.Tabs["10"].Visible = false; ultraTabControl4.Tabs["11"].Visible = false; } else if (row.Cells["PhyCodeMax"].Value.ToString().Equals("C0009"))//压扁 { PipeCheckconsignPhydetailEntityYBbindingSource.DataSource = listSource; ultraTabControl4.Tabs["8"].Selected = true; ultraTabControl4.Tabs["0"].Visible = false; ultraTabControl4.Tabs["1"].Visible = false; ultraTabControl4.Tabs["2"].Visible = false; ultraTabControl4.Tabs["3"].Visible = false; ultraTabControl4.Tabs["4"].Visible = false; ultraTabControl4.Tabs["5"].Visible = false; ultraTabControl4.Tabs["6"].Visible = false; ultraTabControl4.Tabs["7"].Visible = false; ultraTabControl4.Tabs["8"].Visible = true; ultraTabControl4.Tabs["9"].Visible = false; ultraTabControl4.Tabs["10"].Visible = false; ultraTabControl4.Tabs["11"].Visible = false; ultraGrid37.DisplayLayout.Bands[0].Columns["IsGood"].Header.Caption = "试验结果(一次)"; ultraGrid37.DisplayLayout.Bands[0].Columns["IsDefect"].Header.Caption = "试验结果(二次)"; } else if (row.Cells["PhyCodeMax"].Value.ToString().Equals("C0026"))//扩口 { PipeCheckconsignPhydetailEntityKKbindingSource.DataSource = listSource; ultraTabControl4.Tabs["10"].Selected = true; ultraTabControl4.Tabs["0"].Visible = false; ultraTabControl4.Tabs["1"].Visible = false; ultraTabControl4.Tabs["2"].Visible = false; ultraTabControl4.Tabs["3"].Visible = false; ultraTabControl4.Tabs["4"].Visible = false; ultraTabControl4.Tabs["5"].Visible = false; ultraTabControl4.Tabs["6"].Visible = false; ultraTabControl4.Tabs["7"].Visible = false; ultraTabControl4.Tabs["8"].Visible = false; ultraTabControl4.Tabs["9"].Visible = false; ultraTabControl4.Tabs["10"].Visible = true; ultraTabControl4.Tabs["11"].Visible = false; } } else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0050"))//其他 { PipeCheckconsignPhydetailEntityKKbindingSource.DataSource = listSource; ultraTabControl4.Tabs["11"].Selected = true; ultraTabControl4.Tabs["0"].Visible = false; ultraTabControl4.Tabs["1"].Visible = false; ultraTabControl4.Tabs["2"].Visible = false; ultraTabControl4.Tabs["3"].Visible = false; ultraTabControl4.Tabs["4"].Visible = false; ultraTabControl4.Tabs["5"].Visible = false; ultraTabControl4.Tabs["6"].Visible = false; ultraTabControl4.Tabs["7"].Visible = false; ultraTabControl4.Tabs["8"].Visible = false; ultraTabControl4.Tabs["9"].Visible = false; ultraTabControl4.Tabs["10"].Visible = false; ultraTabControl4.Tabs["11"].Visible = true; ultraGrid56.DisplayLayout.Bands[0].Columns["AverageValue"].Header.Caption = "最小值"; foreach (UltraGridRow forRow in ultraGrid56.Rows) { if (!checkStr(forRow.Cells["AverageValue"].Text.Trim(), forRow.Cells["StdMinSign"].Text.Trim(), forRow.Cells["StdMin"].Text.Trim())) { forRow.RowSelectorAppearance.BackColor = Color.Red; } if (!checkStr(forRow.Cells["AverageValue"].Text.Trim(), forRow.Cells["StdMaxSign"].Text.Trim(), forRow.Cells["StdMax"].Text.Trim())) { forRow.RowSelectorAppearance.BackColor = Color.Red; } } } } private void ultraGrid14_AfterRowActivate(object sender, EventArgs e) { UltraGridRow uRow = this.ultraGrid14.ActiveRow; List listSource = EntityHelper.GetData( "com.steering.lims.data.outdec.FrmOutdecDataCJBase.queryCheckConsignBaseDetailPHY", new object[] { uRow.Cells["CheckNo"].Value.ToString(), uRow.Cells["SampleNo"].Value.ToString(), "3", arrId, this.ultraOptionSet1.CheckedItem.DataValue.ToString() }, this.ob); PipeCheckconsignDetailEntitybindingSource4.DataSource = listSource; } private void ultraButton2_Click(object sender, EventArgs e) { if (this.ultraTxtYbEuestion.Text.Trim() == "") { MessageUtil.ShowTips("请选择计算公式!"); return; } double d = 0.0; double c = 0.0; double t = 0.0; if (this.ultraTxtYbEuestion.Text.Trim() == "0.65*D" || this.ultraTxtYbEuestion.Text.Trim() == "7*D/8" || this.ultraTxtYbEuestion.Text.Trim() == "2*D/3") { if (this.ultraTxtYbD.Text.Trim() == "") { MessageUtil.ShowTips("请输入管子公称外径!"); return; } } else if (this.ultraTxtYbEuestion.Text.Trim() == "(1+C)*T/(C+T/D)") { if (this.ultraTxtYbD.Text.Trim() == "" || this.ultraTxtYbC.Text.Trim() == "" || this.ultraTxtYbS.Text.Trim() == "") { MessageUtil.ShowTips("请输入管子的公称外径壁厚以及压扁系数!"); return; } } d = double.Parse(this.ultraTxtYbD.Text.Trim().ToString3()); t = double.Parse(this.ultraTxtYbS.Text.Trim().ToString3()); c = double.Parse(this.ultraTxtYbC.Text.Trim().ToString3()); if (this.ultraTxtYbEuestion.Text.Trim() == "0.65*D") { this.ultraTxtYbSpac.Text = Math.Floor((0.65 * d)).ToString(); } else if (this.ultraTxtYbEuestion.Text.Trim() == "7*D/8") { this.ultraTxtYbSpac.Text = Math.Floor(((7 * d) / 8)).ToString(); } else if (this.ultraTxtYbEuestion.Text.Trim() == "2*D/3") { this.ultraTxtYbSpac.Text = Math.Floor(((2 * d) / 3)).ToString(); } else if (this.ultraTxtYbEuestion.Text.Trim() == "(1+C)*T/(C+T/D)") { this.ultraTxtYbSpac.Text = Math.Floor((((1 + c) * t) / (c + t / d))).ToString(); } } private void ultraGrid17_CellChange(object sender, CellEventArgs e) { this.ultraGrid17.UpdateData(); UltraGridRow ur = this.ultraGrid17.ActiveRow; UltraGridRow uRow = this.ultraGrid15.ActiveRow; string specName = uRow.Cells["ItemNameS"].Text.Trim();//试验尺寸 int x = specName.IndexOf("×");//x位置 string width = specName.Substring(0, x).Replace("m", ""); string height = specName.Substring(x + 1).Replace("m", ""); int m = 0; string ak1 = "";//真实值 string ak2 = ""; string ak3 = ""; int akNum = 0; foreach (UltraGridRow row in this.ultraGrid17.Rows) { if (row.Cells["PhyName"].Text.Contains("ak")) { akNum = akNum + 1; } } if (akNum > 0 && ur.Cells["PhyName"].Text.Contains("冲击功")) { if (e.Cell.Column.Key == "Value1") { if (ur.Cells["Value1"].Text == "-") { return; } ak1 = (Math.Round(100 * double.Parse(ur.Cells["Value1"].Text.Trim().Replace('<','-').ToString3()) / (double.Parse(width) * (double.Parse(height) - 2)), 0)).ToString(); foreach (UltraGridRow akRow in this.ultraGrid17.Rows) { if (akRow.Cells["PhyName"].Text.Contains("ak")) { akRow.Cells["Value1"].Value = ak1; if (akRow.Cells["Value2"].Text != "") { m = m + 1; } if (akRow.Cells["Value3"].Text != "") { m = m + 1; } m = m + 1; akRow.Cells["AverageValue"].Value = Math.Round(((double.Parse(akRow.Cells["Value1"].Text.Trim().Replace('<', '-').ToString3()) + double.Parse(akRow.Cells["Value2"].Text.Replace('<', '-').ToString3()) + double.Parse(akRow.Cells["Value3"].Text.Replace('<', '-').ToString3())) / m)).ToString(); } } } if (e.Cell.Column.Key == "Value2") { if (ur.Cells["Value2"].Text == "-") { return; } ak2 = (Math.Round(100 * double.Parse(ur.Cells["Value2"].Text.Trim().Replace('<','-').ToString3()) / (double.Parse(width) * (double.Parse(height) - 2)), 0)).ToString(); foreach (UltraGridRow akRow in this.ultraGrid17.Rows) { if (akRow.Cells["PhyName"].Text.Contains("ak")) { akRow.Cells["Value2"].Value = ak2; if (ur.Cells["Value1"].Text != "") { m = m + 1; } if (ur.Cells["Value3"].Text != "") { m = m + 1; } m = m + 1; akRow.Cells["AverageValue"].Value = Math.Round(((double.Parse(akRow.Cells["Value1"].Text.Trim().Replace('<', '-').ToString3()) + double.Parse(akRow.Cells["Value2"].Text.Replace('<', '-').ToString3()) + double.Parse(akRow.Cells["Value3"].Text.Replace('<', '-').ToString3())) / m)).ToString(); } } } if (e.Cell.Column.Key == "Value3") { if (ur.Cells["Value3"].Text == "-") { return; } ak3 = (Math.Round(100 * double.Parse(ur.Cells["Value3"].Text.Trim().Replace('<', '-').ToString3()) / (double.Parse(width) * (double.Parse(height) - 2)), 0)).ToString(); foreach (UltraGridRow akRow in this.ultraGrid17.Rows) { if (akRow.Cells["PhyName"].Text.Contains("ak")) { akRow.Cells["Value3"].Value = ak3; if (akRow.Cells["Value1"].Text != "") { m = m + 1; } if (akRow.Cells["Value2"].Text != "") { m = m + 1; } m = m + 1; akRow.Cells["AverageValue"].Value = Math.Round(((double.Parse(akRow.Cells["Value1"].Text.Trim().Replace('<', '-').ToString3()) + double.Parse(akRow.Cells["Value2"].Text.Replace('<', '-').ToString3()) + double.Parse(akRow.Cells["Value3"].Text.Replace('<', '-').ToString3())) / m)).ToString(); } } } } else { if (e.Cell.Column.Key == "Value1") { if (ur.Cells["Value1"].Text != "") { m = m + 1; } if (ur.Cells["Value2"].Text != "") { m = m + 1; } if (ur.Cells["Value3"].Text != "") { m = m + 1; } if (ur.Cells["Value1"].Text == "-") { return; } ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.Trim().Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value2"].Text.Trim().Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value3"].Text.Trim().Replace('<', '-').ToString3())) / m), 2).ToString(); } if (e.Cell.Column.Key == "Value2") { if (ur.Cells["Value1"].Text != "") { m = m + 1; } if (ur.Cells["Value2"].Text != "") { m = m + 1; } if (ur.Cells["Value3"].Text != "") { m = m + 1; } if (ur.Cells["Value2"].Text == "-") { return; } ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.Trim().Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value2"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value3"].Text.Replace('<', '-').ToString3())) / m), 2).ToString(); } if (e.Cell.Column.Key == "Value3") { if (ur.Cells["Value1"].Text != "") { m = m + 1; } if (ur.Cells["Value2"].Text != "") { m = m + 1; } if (ur.Cells["Value3"].Text != "") { m = m + 1; } if (ur.Cells["Value3"].Text == "-") { return; } ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.Trim().Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value2"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value3"].Text.Replace('<', '-').ToString3())) / m), 2).ToString(); } } } private void ultraGrid18_CellChange(object sender, CellEventArgs e) { this.ultraGrid18.UpdateData(); UltraGridRow ur = this.ultraGrid18.ActiveRow; int m = 0; if (e.Cell.Column.Key == "Value1") { if (ur.Cells["Value1"].Text != "") { m = m + 1; } if (ur.Cells["Value2"].Text != "") { m = m + 1; } if (ur.Cells["Value3"].Text != "") { m = m + 1; } if (ur.Cells["Value1"].Text == "-") { return; } if (ur.Cells["Value1"].Text == "-") { return; } ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value2"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value3"].Text.Replace('<', '-').ToString3())) / m), 1).ToString(); } if (e.Cell.Column.Key == "Value2") { if (ur.Cells["Value1"].Text != "") { m = m + 1; } if (ur.Cells["Value2"].Text != "") { m = m + 1; } if (ur.Cells["Value3"].Text != "") { m = m + 1; } if (ur.Cells["Value2"].Text == "-") { return; } if (ur.Cells["Value2"].Text == "-") { return; } ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value2"].Text.Replace('-', '0').Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value3"].Text.Replace('-', '0').Replace('<', '-').ToString3())) / m), 1).ToString(); } if (e.Cell.Column.Key == "Value3") { if (ur.Cells["Value1"].Text != "") { m = m + 1; } if (ur.Cells["Value2"].Text != "") { m = m + 1; } if (ur.Cells["Value3"].Text != "") { m = m + 1; } if (ur.Cells["Value3"].Text == "-") { return; } if (ur.Cells["Value3"].Text == "-") { return; } ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value2"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value3"].Text.Replace('<', '-').ToString3())) / m), 1).ToString(); } } private void ultraGrid19_CellChange(object sender, CellEventArgs e) { this.ultraGrid19.UpdateData(); UltraGridRow ur = this.ultraGrid19.ActiveRow; int m = 0; string comFormual = this.ultraComFormual.Text.Trim(); if (e.Cell.Column.Key == "Value1D1" || e.Cell.Column.Key == "Value1D2") { if (comFormual.Equals("HV5")) { ur.Cells["Value1"].Value = Math.Round(0.1891 * 49.03 / Math.Pow((double.Parse(ur.Cells["Value1D1"].Text.ToString3()) + double.Parse(ur.Cells["Value1D2"].Text.ToString3())) / 2, 2), 0); } else if (comFormual.Equals("HV10")) { ur.Cells["Value1"].Value = Math.Round(0.1891 * 98.07 / Math.Pow((double.Parse(ur.Cells["Value1D1"].Text.ToString3()) + double.Parse(ur.Cells["Value1D2"].Text.ToString3())) / 2, 2), 0); } else { MessageUtil.ShowTips("公式选择错误!"); return; } if (ur.Cells["Value1"].Text != "") { m = m + 1; } if (ur.Cells["Value2"].Text != "") { m = m + 1; } if (ur.Cells["Value3"].Text != "") { m = m + 1; } if (ur.Cells["Value4"].Text != "") { m = m + 1; } ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value2"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value3"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value4"].Text.Replace('<', '-').ToString3())) / m), 0).ToString(); } if (e.Cell.Column.Key == "Value2D1" || e.Cell.Column.Key == "Value2D2") { if (comFormual.Equals("HV5")) { ur.Cells["Value1"].Value = Math.Round(0.1891 * 49.03 / Math.Pow((double.Parse(ur.Cells["Value2D1"].Text.ToString3()) + double.Parse(ur.Cells["Value2D2"].Text.ToString3())) / 2, 2), 0); } else if (comFormual.Equals("HV10")) { ur.Cells["Value1"].Value = Math.Round(0.1891 * 98.07 / Math.Pow((double.Parse(ur.Cells["Value2D1"].Text.ToString3()) + double.Parse(ur.Cells["Value2D2"].Text.ToString3())) / 2, 2), 0); } else { MessageUtil.ShowTips("公式选择错误!"); return; } if (ur.Cells["Value1"].Text != "") { m = m + 1; } if (ur.Cells["Value2"].Text != "") { m = m + 1; } if (ur.Cells["Value3"].Text != "") { m = m + 1; } if (ur.Cells["Value4"].Text != "") { m = m + 1; } ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value2"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value3"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value4"].Text.Replace('<', '-').ToString3())) / m), 0).ToString(); } if (e.Cell.Column.Key == "Value3D1" || e.Cell.Column.Key == "Value3D2") { if (comFormual.Equals("HV5")) { ur.Cells["Value1"].Value = Math.Round(0.1891 * 49.03 / Math.Pow((double.Parse(ur.Cells["Value3D1"].Text.ToString3()) + double.Parse(ur.Cells["Value3D2"].Text.ToString3())) / 2, 2), 0); } else if (comFormual.Equals("HV10")) { ur.Cells["Value1"].Value = Math.Round(0.1891 * 98.07 / Math.Pow((double.Parse(ur.Cells["Value3D1"].Text.ToString3()) + double.Parse(ur.Cells["Value3D2"].Text.ToString3())) / 2, 2), 0); } else { MessageUtil.ShowTips("公式选择错误!"); return; } if (ur.Cells["Value1"].Text != "") { m = m + 1; } if (ur.Cells["Value2"].Text != "") { m = m + 1; } if (ur.Cells["Value3"].Text != "") { m = m + 1; } if (ur.Cells["Value4"].Text != "") { m = m + 1; } ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value2"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value3"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value4"].Text.Replace('<', '-').ToString3())) / m), 0).ToString(); } if (e.Cell.Column.Key == "Value4D1" || e.Cell.Column.Key == "Value4D2") { if (comFormual.Equals("HV5")) { ur.Cells["Value1"].Value = Math.Round(0.1891 * 49.03 / Math.Pow((double.Parse(ur.Cells["Value3D1"].Text.ToString3()) + double.Parse(ur.Cells["Value3D2"].Text.ToString3())) / 2, 2), 0); } else if (comFormual.Equals("HV10")) { ur.Cells["Value1"].Value = Math.Round(0.1891 * 98.07 / Math.Pow((double.Parse(ur.Cells["Value3D1"].Text.ToString3()) + double.Parse(ur.Cells["Value3D2"].Text.ToString3())) / 2, 2), 0); } else { MessageUtil.ShowTips("公式选择错误!"); return; } if (ur.Cells["Value1"].Text != "") { m = m + 1; } if (ur.Cells["Value2"].Text != "") { m = m + 1; } if (ur.Cells["Value3"].Text != "") { m = m + 1; } if (ur.Cells["Value4"].Text != "") { m = m + 1; } ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value2"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value3"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value4"].Text.Replace('<', '-').ToString3())) / m), 0).ToString(); } if (e.Cell.Column.Key == "Value1") { if (ur.Cells["Value1"].Text != "") { m = m + 1; } if (ur.Cells["Value2"].Text != "") { m = m + 1; } if (ur.Cells["Value3"].Text != "") { m = m + 1; } if (ur.Cells["Value4"].Text != "") { m = m + 1; } if (ur.Cells["Value1"].Text == "-") { return; } ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value2"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value3"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value4"].Text.Replace('<', '-').ToString3())) / m), 0).ToString(); } if (e.Cell.Column.Key == "Value2") { if (ur.Cells["Value1"].Text != "") { m = m + 1; } if (ur.Cells["Value2"].Text != "") { m = m + 1; } if (ur.Cells["Value3"].Text != "") { m = m + 1; } if (ur.Cells["Value4"].Text != "") { m = m + 1; } if (ur.Cells["Value2"].Text == "-") { return; } ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value2"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value3"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value4"].Text.Replace('<', '-').ToString3())) / m), 0).ToString(); } if (e.Cell.Column.Key == "Value3") { if (ur.Cells["Value1"].Text != "") { m = m + 1; } if (ur.Cells["Value2"].Text != "") { m = m + 1; } if (ur.Cells["Value3"].Text != "") { m = m + 1; } if (ur.Cells["Value4"].Text != "") { m = m + 1; } if (ur.Cells["Value3"].Text == "-") { return; } ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value2"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value3"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value4"].Text.Replace('<', '-').ToString3())) / m), 0).ToString(); } if (e.Cell.Column.Key == "Value4") { if (ur.Cells["Value1"].Text != "") { m = m + 1; } if (ur.Cells["Value2"].Text != "") { m = m + 1; } if (ur.Cells["Value3"].Text != "") { m = m + 1; } if (ur.Cells["Value4"].Text != "") { m = m + 1; } if (ur.Cells["Value4"].Text == "-") { return; } ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value2"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value3"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value4"].Text.Replace('<', '-').ToString3())) / m), 0).ToString(); } } private void ultraGrid20_CellChange(object sender, CellEventArgs e) { this.ultraGrid20.UpdateData(); UltraGridRow ur = this.ultraGrid20.ActiveRow; int m = 0; string comFormual = this.ultraComFormual.Text.Trim(); if (e.Cell.Column.Key == "Value1D1" || e.Cell.Column.Key == "Value1D2") { if (comFormual.Equals("HBW2.5")) { ur.Cells["Value1"].Value = (Math.Round(0.102 * 2 * 1838.75 / (2.5 * 3.142 * (2.5 - Math.Sqrt(6.25 - Math.Pow(double.Parse(ur.Cells["Value1D1"].Text.ToString3()) + double.Parse(ur.Cells["Value1D2"].Text.ToString3()), 2) / 4))), 0)).ToString(); } else if (comFormual.Equals("HBW5")) { ur.Cells["Value1"].Value = (Math.Round(0.102 * 2 * 7355 / (5 * 3.142 * (5 - Math.Sqrt(25 - Math.Pow(double.Parse(ur.Cells["Value1D1"].Text.ToString3()) + double.Parse(ur.Cells["Value1D2"].Text.ToString3()), 2) / 4))), 0)).ToString(); } else if (comFormual.Equals("HBW10")) { ur.Cells["Value1"].Value = (Math.Round(0.102 * 2 * 29420 / (10 * 3.142 * (10 - Math.Sqrt(100 - Math.Pow(double.Parse(ur.Cells["Value1D1"].Text.ToString3()) + double.Parse(ur.Cells["Value1D2"].Text.ToString3()), 2) / 4))), 0)).ToString(); } else { MessageUtil.ShowTips("公式选择错误!"); return; } if (ur.Cells["Value1"].Text != "") { m = m + 1; } if (ur.Cells["Value2"].Text != "") { m = m + 1; } if (ur.Cells["Value3"].Text != "") { m = m + 1; } ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value2"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value3"].Text.Replace('<', '-').ToString3())) / m), 2).ToString(); } if (e.Cell.Column.Key == "Value2D1" || e.Cell.Column.Key == "Value2D2") { if (comFormual.Equals("HBW2.5")) { ur.Cells["Value2"].Value = (Math.Round(0.102 * 2 * 1838.75 / (2.5 * 3.142 * (2.5 - Math.Sqrt(6.25 - Math.Pow(double.Parse(ur.Cells["Value2D1"].Text.ToString3()) + double.Parse(ur.Cells["Value2D2"].Text.ToString3()), 2) / 4))), 0)).ToString(); } else if (comFormual.Equals("HBW5")) { ur.Cells["Value2"].Value = (Math.Round(0.102 * 2 * 7355 / (5 * 3.142 * (5 - Math.Sqrt(25 - Math.Pow(double.Parse(ur.Cells["Value2D1"].Text.ToString3()) + double.Parse(ur.Cells["Value2D2"].Text.ToString3()), 2) / 4))), 0)).ToString(); } else if (comFormual.Equals("HBW10")) { ur.Cells["Value2"].Value = (Math.Round(0.102 * 2 * 29420 / (10 * 3.142 * (10 - Math.Sqrt(100 - Math.Pow(double.Parse(ur.Cells["Value2D1"].Text.ToString3()) + double.Parse(ur.Cells["Value2D2"].Text.ToString3()), 2) / 4))), 0)).ToString(); } else { MessageUtil.ShowTips("公式选择错误!"); return; } if (ur.Cells["Value1"].Text != "") { m = m + 1; } if (ur.Cells["Value2"].Text != "") { m = m + 1; } if (ur.Cells["Value3"].Text != "") { m = m + 1; } ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value2"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value3"].Text.Replace('<', '-').ToString3())) / m), 2).ToString(); } if (e.Cell.Column.Key == "Value3D1" || e.Cell.Column.Key == "Value3D2") { if (comFormual.Equals("HBW2.5")) { ur.Cells["Value3"].Value = (Math.Round(0.102 * 2 * 1838.75 / (2.5 * 3.142 * (2.5 - Math.Sqrt(6.25 - Math.Pow(double.Parse(ur.Cells["Value3D1"].Text.ToString3()) + double.Parse(ur.Cells["Value3D2"].Text.ToString3()), 2) / 4))), 0)).ToString(); } else if (comFormual.Equals("HBW5")) { ur.Cells["Value3"].Value = (Math.Round(0.102 * 2 * 7355 / (5 * 3.142 * (5 - Math.Sqrt(25 - Math.Pow(double.Parse(ur.Cells["Value3D1"].Text.ToString3()) + double.Parse(ur.Cells["Value3D2"].Text.ToString3()), 2) / 4))), 0)).ToString(); } else if (comFormual.Equals("HBW10")) { ur.Cells["Value3"].Value = (Math.Round(0.102 * 2 * 29420 / (10 * 3.142 * (10 - Math.Sqrt(100 - Math.Pow(double.Parse(ur.Cells["Value3D1"].Text.ToString3()) + double.Parse(ur.Cells["Value3D2"].Text.ToString3()), 2) / 4))), 0)).ToString(); } else { MessageUtil.ShowTips("公式选择错误!"); return; } if (ur.Cells["Value1"].Text != "") { m = m + 1; } if (ur.Cells["Value2"].Text != "") { m = m + 1; } if (ur.Cells["Value3"].Text != "") { m = m + 1; } ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value2"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value3"].Text.Replace('<', '-').ToString3())) / m), 0).ToString(); } if (e.Cell.Column.Key == "Value1") { if (ur.Cells["Value1"].Text != "") { m = m + 1; } if (ur.Cells["Value2"].Text != "") { m = m + 1; } if (ur.Cells["Value3"].Text != "") { m = m + 1; } if (ur.Cells["Value1"].Text == "-") { return; } ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value2"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value3"].Text.Replace('<', '-').ToString3())) / m), 0).ToString(); } if (e.Cell.Column.Key == "Value2") { if (ur.Cells["Value1"].Text != "") { m = m + 1; } if (ur.Cells["Value2"].Text != "") { m = m + 1; } if (ur.Cells["Value3"].Text != "") { m = m + 1; } if (ur.Cells["Value2"].Text == "-") { return; } ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value2"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value3"].Text.Replace('<', '-').ToString3())) / m), 0).ToString(); } if (e.Cell.Column.Key == "Value3") { if (ur.Cells["Value1"].Text != "") { m = m + 1; } if (ur.Cells["Value2"].Text != "") { m = m + 1; } if (ur.Cells["Value3"].Text != "") { m = m + 1; } if (ur.Cells["Value3"].Text == "-") { return; } ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value2"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value3"].Text.Replace('<', '-').ToString3())) / m), 0).ToString(); } } private void ultraGrid27_AfterRowActivate(object sender, EventArgs e) { UltraGridRow uRow = this.ultraGrid27.ActiveRow; if(uRow.HasChild()) { return; } if(uRow == null) { return; } List listSource = EntityHelper.GetData( "com.steering.lims.data.outdec.FrmOutdecDataCJBase.queryCheckConsignBaseDetailPHYNoFrim", new object[] { uRow.Cells["CheckNo"].Value.ToString(), "3", arrId, ultraOptionSet1.CheckedItem.DataValue.ToString() }, this.ob); PipeCheckconsignDetailEntitybindingSource2.DataSource = listSource; } //private void ultraGrid27_CellChange(object sender, CellEventArgs e) //{ // if (e.Cell.Row.HasChild() && e.Cell.Column.Key == "CHK") // { // ultraGrid27.UpdateData(); // if (e.Cell.Value.ToString() == "True") // { // foreach (UltraGridRow dr in e.Cell.Row.ChildBands[0].Rows) // { // dr.Cells["CHK1"].Value = "True"; // } // } // else // { // foreach (UltraGridRow dr in e.Cell.Row.ChildBands[0].Rows) // { // dr.Cells["CHK1"].Value = "False"; // } // } // } //} private void ultraGrid40_AfterRowActivate(object sender, EventArgs e) { UltraGridRow uRow = this.ultraGrid40.ActiveRow; if (uRow.HasChild()) { return; } if (uRow == null) { return; } List listSource = EntityHelper.GetData( "com.steering.lims.data.outdec.FrmOutdecDataCJBase.queryCheckConsignBaseDetailPHYFrim", new object[] { uRow.Cells["CheckNo"].Value.ToString(), arrId, ultraOptionSet1.CheckedItem.DataValue.ToString() }, this.ob); PipeCheckconsignDetailEntitybindingSource3.DataSource = listSource; List listSource1 = EntityHelper.GetData( "com.steering.lims.data.outdec.FrmOutdecDataCJBase.queryDetaiFlag", new object[] { uRow.Cells["CheckNo"].Value.ToString(), arrId }, this.ob); pipeCheckconsignDetailEntityBindingSource7.DataSource = listSource1; for(int i = 0;i listSource = EntityHelper.GetData( "com.steering.lims.data.outdec.FrmOutdecDataCJBase.queryCheckConsignBaseDetailPhyItem", new object[] { row.Cells["CheckNo"].Value.ToString(), row.Cells["SampleNo"].Value.ToString(), row.Cells["PhyCodeMax"].Value.ToString() }, this.ob); if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0001"))//拉伸 { PipeCheckconsignPhydetailEntitybindingSource.DataSource = listSource; ultraTabControl5.Tabs["0"].Selected = true; ultraTabControl5.Tabs["0"].Visible = true; ultraTabControl5.Tabs["1"].Visible = false; ultraTabControl5.Tabs["2"].Visible = false; ultraTabControl5.Tabs["3"].Visible = false; ultraTabControl5.Tabs["4"].Visible = false; ultraTabControl5.Tabs["5"].Visible = false; ultraTabControl5.Tabs["6"].Visible = false; ultraTabControl5.Tabs["7"].Visible = false; ultraTabControl5.Tabs["8"].Visible = false; ultraTabControl5.Tabs["9"].Visible = false; ultraTabControl5.Tabs["10"].Visible = false; ultraTabControl5.Tabs["11"].Visible = false; } else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0002"))//冲击 { PipeCheckconsignPhydetailEntityCjbindingSource.DataSource = listSource; ultraTabControl5.Tabs["1"].Selected = true; ultraTabControl5.Tabs["0"].Visible = false; ultraTabControl5.Tabs["1"].Visible = true; ultraTabControl5.Tabs["2"].Visible = false; ultraTabControl5.Tabs["3"].Visible = false; ultraTabControl5.Tabs["4"].Visible = false; ultraTabControl5.Tabs["5"].Visible = false; ultraTabControl5.Tabs["6"].Visible = false; ultraTabControl5.Tabs["7"].Visible = false; ultraTabControl5.Tabs["8"].Visible = false; ultraTabControl5.Tabs["9"].Visible = false; ultraTabControl5.Tabs["10"].Visible = false; ultraTabControl5.Tabs["11"].Visible = false; } else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0003"))//布氏 { PipeCheckconsignPhydetailEntityBSbindingSource.DataSource = listSource; MergedCell(ultraGrid6, new string[] { "PhyName" }); ultraTabControl5.Tabs["4"].Selected = true; ultraTabControl5.Tabs["0"].Visible = false; ultraTabControl5.Tabs["1"].Visible = false; ultraTabControl5.Tabs["2"].Visible = false; ultraTabControl5.Tabs["3"].Visible = false; ultraTabControl5.Tabs["4"].Visible = true; ultraTabControl5.Tabs["5"].Visible = false; ultraTabControl5.Tabs["6"].Visible = false; ultraTabControl5.Tabs["7"].Visible = false; ultraTabControl5.Tabs["8"].Visible = false; ultraTabControl5.Tabs["9"].Visible = false; ultraTabControl5.Tabs["10"].Visible = false; ultraTabControl5.Tabs["11"].Visible = false; } else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0004") || row.Cells["PhyCodeMin"].Value.ToString().Equals("R0018"))//洛氏 { PipeCheckconsignPhydetailEntityLSbindingSource.DataSource = listSource; MergedCell(ultraGrid5, new string[] { "PhyName" }); ultraTabControl5.Tabs["2"].Selected = true; ultraTabControl5.Tabs["0"].Visible = false; ultraTabControl5.Tabs["1"].Visible = false; ultraTabControl5.Tabs["2"].Visible = true; ultraTabControl5.Tabs["3"].Visible = false; ultraTabControl5.Tabs["4"].Visible = false; ultraTabControl5.Tabs["5"].Visible = false; ultraTabControl5.Tabs["6"].Visible = false; ultraTabControl5.Tabs["7"].Visible = false; ultraTabControl5.Tabs["8"].Visible = false; ultraTabControl5.Tabs["9"].Visible = false; ultraTabControl5.Tabs["10"].Visible = false; ultraTabControl5.Tabs["11"].Visible = false; } else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0005"))//维氏 { PipeCheckconsignPhydetailEntityWSbindingSource.DataSource = listSource; MergedCell(ultraGrid5, new string[] { "PhyName" }); ultraTabControl5.Tabs["3"].Selected = true; ultraTabControl5.Tabs["0"].Visible = false; ultraTabControl5.Tabs["1"].Visible = false; ultraTabControl5.Tabs["2"].Visible = false; ultraTabControl5.Tabs["3"].Visible = true; ultraTabControl5.Tabs["4"].Visible = false; ultraTabControl5.Tabs["5"].Visible = false; ultraTabControl5.Tabs["6"].Visible = false; ultraTabControl5.Tabs["7"].Visible = false; ultraTabControl5.Tabs["8"].Visible = false; ultraTabControl5.Tabs["9"].Visible = false; ultraTabControl5.Tabs["10"].Visible = false; ultraTabControl5.Tabs["11"].Visible = false; } else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0014") || row.Cells["PhyCodeMin"].Value.ToString().Equals("R0016") || row.Cells["PhyCodeMin"].Value.ToString().Equals("R0031"))//组织 { PipeCheckconsignPhydetailEntityZZbindingSource.DataSource = listSource; ultraTabControl5.Tabs["7"].Selected = true; ultraTabControl5.Tabs["0"].Visible = false; ultraTabControl5.Tabs["1"].Visible = false; ultraTabControl5.Tabs["2"].Visible = false; ultraTabControl5.Tabs["3"].Visible = false; ultraTabControl5.Tabs["4"].Visible = false; ultraTabControl5.Tabs["5"].Visible = false; ultraTabControl5.Tabs["6"].Visible = false; ultraTabControl5.Tabs["7"].Visible = true; ultraTabControl5.Tabs["8"].Visible = false; ultraTabControl5.Tabs["9"].Visible = false; ultraTabControl5.Tabs["10"].Visible = false; ultraTabControl5.Tabs["11"].Visible = false; } else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0013"))//晶粒度 { PipeCheckconsignPhydetailEntityJLDbindingSource.DataSource = listSource; ultraTabControl5.Tabs["6"].Selected = true; ultraTabControl5.Tabs["0"].Visible = false; ultraTabControl5.Tabs["1"].Visible = false; ultraTabControl5.Tabs["2"].Visible = false; ultraTabControl5.Tabs["3"].Visible = false; ultraTabControl5.Tabs["4"].Visible = false; ultraTabControl5.Tabs["5"].Visible = false; ultraTabControl5.Tabs["6"].Visible = true; ultraTabControl5.Tabs["7"].Visible = false; ultraTabControl5.Tabs["8"].Visible = false; ultraTabControl5.Tabs["9"].Visible = false; ultraTabControl5.Tabs["10"].Visible = false; ultraTabControl5.Tabs["11"].Visible = false; } else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0012"))//夹杂 { PipeCheckconsignPhydetailEntityJZWbindingSource.DataSource = listSource; ultraTabControl5.Tabs["5"].Selected = true; ultraTabControl5.Tabs["0"].Visible = false; ultraTabControl5.Tabs["1"].Visible = false; ultraTabControl5.Tabs["2"].Visible = false; ultraTabControl5.Tabs["3"].Visible = false; ultraTabControl5.Tabs["4"].Visible = false; ultraTabControl5.Tabs["5"].Visible = true; ultraTabControl5.Tabs["6"].Visible = false; ultraTabControl5.Tabs["7"].Visible = false; ultraTabControl5.Tabs["8"].Visible = false; ultraTabControl5.Tabs["9"].Visible = false; ultraTabControl5.Tabs["10"].Visible = false; ultraTabControl5.Tabs["11"].Visible = false; ultraGrid47.DisplayLayout.Bands[0].Columns["Value1"].Header.Caption = "一象限"; ultraGrid47.DisplayLayout.Bands[0].Columns["Value2"].Header.Caption = "二象限"; ultraGrid47.DisplayLayout.Bands[0].Columns["Value3"].Header.Caption = "三象限"; ultraGrid47.DisplayLayout.Bands[0].Columns["Value4"].Header.Caption = "四象限"; if (row.Cells["PhyCodeMax"].Value.ToString().Equals("C0115")) { ultraGrid47.DisplayLayout.Bands[0].Columns["Value2"].Hidden = false; ultraGrid47.DisplayLayout.Bands[0].Columns["Value3"].Hidden = false; ultraGrid47.DisplayLayout.Bands[0].Columns["Value4"].Hidden = false; } else { ultraGrid47.DisplayLayout.Bands[0].Columns["Value2"].Hidden = true; ultraGrid47.DisplayLayout.Bands[0].Columns["Value3"].Hidden = true; ultraGrid47.DisplayLayout.Bands[0].Columns["Value4"].Hidden = true; } } else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0010"))//工艺 { if (row.Cells["PhyCodeMax"].Value.ToString().Equals("C0027") || row.Cells["PhyCodeMax"].Value.ToString().Equals("C0038") || row.Cells["PhyCodeMax"].Value.ToString().Equals("C0082") || row.Cells["PhyCodeMax"].Value.ToString().Equals("C0083") || row.Cells["PhyCodeMax"].Value.ToString().Equals("C0098"))//弯曲 { PipeCheckconsignPhydetailEntityWQbindingSource.DataSource = listSource; ultraTabControl5.Tabs["9"].Selected = true; ultraTabControl5.Tabs["0"].Visible = false; ultraTabControl5.Tabs["1"].Visible = false; ultraTabControl5.Tabs["2"].Visible = false; ultraTabControl5.Tabs["3"].Visible = false; ultraTabControl5.Tabs["4"].Visible = false; ultraTabControl5.Tabs["5"].Visible = false; ultraTabControl5.Tabs["6"].Visible = false; ultraTabControl5.Tabs["7"].Visible = false; ultraTabControl5.Tabs["8"].Visible = false; ultraTabControl5.Tabs["9"].Visible = true; ultraTabControl5.Tabs["10"].Visible = false; ultraTabControl5.Tabs["11"].Visible = false; } else if (row.Cells["PhyCodeMax"].Value.ToString().Equals("C0009"))//压扁 { PipeCheckconsignPhydetailEntityYBbindingSource.DataSource = listSource; ultraTabControl5.Tabs["8"].Selected = true; ultraTabControl5.Tabs["0"].Visible = false; ultraTabControl5.Tabs["1"].Visible = false; ultraTabControl5.Tabs["2"].Visible = false; ultraTabControl5.Tabs["3"].Visible = false; ultraTabControl5.Tabs["4"].Visible = false; ultraTabControl5.Tabs["5"].Visible = false; ultraTabControl5.Tabs["6"].Visible = false; ultraTabControl5.Tabs["7"].Visible = false; ultraTabControl5.Tabs["8"].Visible = true; ultraTabControl5.Tabs["9"].Visible = false; ultraTabControl5.Tabs["10"].Visible = false; ultraTabControl5.Tabs["11"].Visible = false; ultraGrid50.DisplayLayout.Bands[0].Columns["IsGood"].Header.Caption = "试验结果(一次)"; ultraGrid50.DisplayLayout.Bands[0].Columns["IsDefect"].Header.Caption = "试验结果(二次)"; } else if (row.Cells["PhyCodeMax"].Value.ToString().Equals("C0026"))//扩口 { PipeCheckconsignPhydetailEntityKKbindingSource.DataSource = listSource; ultraTabControl5.Tabs["10"].Selected = true; ultraTabControl5.Tabs["0"].Visible = false; ultraTabControl5.Tabs["1"].Visible = false; ultraTabControl5.Tabs["2"].Visible = false; ultraTabControl5.Tabs["3"].Visible = false; ultraTabControl5.Tabs["4"].Visible = false; ultraTabControl5.Tabs["5"].Visible = false; ultraTabControl5.Tabs["6"].Visible = false; ultraTabControl5.Tabs["7"].Visible = false; ultraTabControl5.Tabs["8"].Visible = false; ultraTabControl5.Tabs["9"].Visible = false; ultraTabControl5.Tabs["10"].Visible = true; ultraTabControl5.Tabs["11"].Visible = false; } } else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0050")) { pipeCheckconsignPhydetailEntityQTBindingSource.DataSource = listSource; ultraTabControl5.Tabs["11"].Selected = true; ultraTabControl5.Tabs["0"].Visible = false; ultraTabControl5.Tabs["1"].Visible = false; ultraTabControl5.Tabs["2"].Visible = false; ultraTabControl5.Tabs["3"].Visible = false; ultraTabControl5.Tabs["4"].Visible = false; ultraTabControl5.Tabs["5"].Visible = false; ultraTabControl5.Tabs["6"].Visible = false; ultraTabControl5.Tabs["7"].Visible = false; ultraTabControl5.Tabs["8"].Visible = false; ultraTabControl5.Tabs["9"].Visible = false; ultraTabControl5.Tabs["10"].Visible = false; ultraTabControl5.Tabs["11"].Visible = true; ultraGrid57.DisplayLayout.Bands[0].Columns["AverageValue"].Header.Caption = "最小值"; } } private void ultraGrid8_CellChange(object sender, CellEventArgs e) { this.ultraGrid8.UpdateData(); if (e.Cell.Column.Key == "Value1") { if(!StringUtil.IsDouble(e.Cell.Row.Cells["Value1"].Value.ToString3()) && e.Cell.Row.Cells["Value1"].Value.ToString2() == "") { return; //if (!(e.Cell.Row.Cells["Value1"].Value.ToString2().Substring(e.Cell.Row.Cells["Value1"].Value.ToString2().Length - 1, 1)).Equals("0") && !(e.Cell.Row.Cells["Value1"].Value.ToString2().Substring(e.Cell.Row.Cells["Value1"].Value.ToString2().Length - 1, 1)).Equals("5")) //{ // MessageUtil.ShowTips("末尾位只能是0或者5"); // return; //} } List list = PipeCheckconsignPhydetailEntityJZWbindingSource.DataSource as List; list.Where(p => p.PhyCode == "P0064").ToList().ForEach(p => { p.Value1 = list.Where(q => q.PhyCode == "P0052" || q.PhyCode == "P0057" || q.PhyCode == "P0060" || q.PhyCode == "P0061").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(A+B+C+D)细系总和 }); list.Where(p => p.PhyCode == "P0065").ToList().ForEach(p => { p.Value1 = list.Where(q => q.PhyCode == "P0056" || q.PhyCode == "P0058" || q.PhyCode == "P0059" || q.PhyCode == "P0062").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(A+B+C+D)粗系总和 }); list.Where(p => p.PhyCode == "P0069").ToList().ForEach(p => { p.Value1 = list.Where(q => q.PhyCode == "P0056" || q.PhyCode == "P0059").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(A+C)粗系总和 }); list.Where(p => p.PhyCode == "P0070").ToList().ForEach(p => { p.Value1 = list.Where(q => q.PhyCode == "P0056" || q.PhyCode == "P0059").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(A+C)细系总和 }); list.Where(p => p.PhyCode == "P0071").ToList().ForEach(p => { p.Value1 = list.Where(q => q.PhyCode == "P0052" || q.PhyCode == "P0057" || q.PhyCode == "P0060").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(A+B+C)细系总和 }); list.Where(p => p.PhyCode == "P0072").ToList().ForEach(p => { p.Value1 = list.Where(q => q.PhyCode == "P0056" || q.PhyCode == "P0058" || q.PhyCode == "P0059").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(A+B+C)粗系总和 }); list.Where(p => p.PhyCode == "P0085").ToList().ForEach(p => { p.Value1 = list.Where(q => q.PhyCode == "P0052" || q.PhyCode == "P0056" || q.PhyCode == "P0057" || q.PhyCode == "P0058" || q.PhyCode == "P0059" || q.PhyCode == "P0060" || q.PhyCode == "P0061" || q.PhyCode == "P0062").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(A+B+C+D)粗细系总和 }); list.Where(p => p.PhyCode == "P0090").ToList().ForEach(p => { p.Value1 = list.Where(q => q.PhyCode == "P0056" || q.PhyCode == "P0058").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(A+B)粗系总和 }); list.Where(p => p.PhyCode == "P0091").ToList().ForEach(p => { p.Value1 = list.Where(q => q.PhyCode == "P0052" || q.PhyCode == "P0057").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(A+B)细系总和 }); list.Where(p => p.PhyCode == "P0096").ToList().ForEach(p => { p.Value1 = list.Where(q => q.PhyCode == "P0058" || q.PhyCode == "P0062").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(B+D)粗系总和 }); list.Where(p => p.PhyCode == "P0097").ToList().ForEach(p => { p.Value1 = list.Where(q => q.PhyCode == "P0057" || q.PhyCode == "P0061").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(B+D)粗系总和 }); ultraGrid8.Refresh(); } } private void ultraGrid21_CellChange(object sender, CellEventArgs e) { this.ultraGrid21.UpdateData(); if (e.Cell.Column.Key == "Value1") { List list = PipeCheckconsignPhydetailEntityJZWbindingSource.DataSource as List; list.Where(p => p.PhyCode == "P0064").ToList().ForEach(p => { p.Value1 = list.Where(q => q.PhyCode == "P0052" || q.PhyCode == "P0057" || q.PhyCode == "P0060" || q.PhyCode == "P0061").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(A+B+C+D)细系总和 }); list.Where(p => p.PhyCode == "P0065").ToList().ForEach(p => { p.Value1 = list.Where(q => q.PhyCode == "P0056" || q.PhyCode == "P0058" || q.PhyCode == "P0059" || q.PhyCode == "P0062").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(A+B+C+D)粗系总和 }); list.Where(p => p.PhyCode == "P0069").ToList().ForEach(p => { p.Value1 = list.Where(q => q.PhyCode == "P0056" || q.PhyCode == "P0059").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(A+C)粗系总和 }); list.Where(p => p.PhyCode == "P0070").ToList().ForEach(p => { p.Value1 = list.Where(q => q.PhyCode == "P0056" || q.PhyCode == "P0059").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(A+C)细系总和 }); list.Where(p => p.PhyCode == "P0071").ToList().ForEach(p => { p.Value1 = list.Where(q => q.PhyCode == "P0052" || q.PhyCode == "P0057" || q.PhyCode == "P0060").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(A+B+C)细系总和 }); list.Where(p => p.PhyCode == "P0072").ToList().ForEach(p => { p.Value1 = list.Where(q => q.PhyCode == "P0056" || q.PhyCode == "P0058" || q.PhyCode == "P0059").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(A+B+C)粗系总和 }); list.Where(p => p.PhyCode == "P0085").ToList().ForEach(p => { p.Value1 = list.Where(q => q.PhyCode == "P0052" || q.PhyCode == "P0056" || q.PhyCode == "P0057" || q.PhyCode == "P0058" || q.PhyCode == "P0059" || q.PhyCode == "P0060" || q.PhyCode == "P0061" || q.PhyCode == "P0062").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(A+B+C+D)粗细系总和 }); list.Where(p => p.PhyCode == "P0090").ToList().ForEach(p => { p.Value1 = list.Where(q => q.PhyCode == "P0056" || q.PhyCode == "P0058").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(A+B)粗系总和 }); list.Where(p => p.PhyCode == "P0091").ToList().ForEach(p => { p.Value1 = list.Where(q => q.PhyCode == "P0052" || q.PhyCode == "P0057").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(A+B)细系总和 }); list.Where(p => p.PhyCode == "P0096").ToList().ForEach(p => { p.Value1 = list.Where(q => q.PhyCode == "P0058" || q.PhyCode == "P0062").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(B+D)粗系总和 }); list.Where(p => p.PhyCode == "P0097").ToList().ForEach(p => { p.Value1 = list.Where(q => q.PhyCode == "P0057" || q.PhyCode == "P0061").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(B+D)粗系总和 }); ultraGrid21.Refresh(); } } private void ultraGrid10_CellChange(object sender, CellEventArgs e) { this.ultraGrid10.UpdateData(); if (e.Cell.Column.Key == "Value1") { if (StringUtil.IsDouble(e.Cell.Row.Cells["Value1"].Value.ToString3())) return; } } private void chkRegTime_CheckedChanged(object sender, EventArgs e) { this.RegStartTime.Enabled = this.RegEndTime.Enabled = this.chkRegTime.Checked; } private void chkCheckNo_CheckedChanged(object sender, EventArgs e) { this.txtCheckNo.Enabled = this.chkCheckNo.Checked; } private void chkJudgeNo_CheckedChanged(object sender, EventArgs e) { this.txtJudgeNo.Enabled = this.chkJudgeNo.Checked; } private void chkSteel_CheckedChanged(object sender, EventArgs e) { this.txtSteel.Enabled = this.chkSteel.Checked; } private void chkGroup_CheckedChanged(object sender, EventArgs e) { this.cmbGroup.Enabled = this.chkGroup.Checked; } private void chkSampleNo_CheckedChanged(object sender, EventArgs e) { this.txtSampleNo.Enabled = this.chkSampleNo.Checked; } private void chkOrderNo_CheckedChanged(object sender, EventArgs e) { this.txtOrderNo.Enabled = this.chkOrderNo.Checked; } private void chkSpec_CheckedChanged(object sender, EventArgs e) { this.txtSpec.Enabled = this.chkSpec.Checked; } private void ultraGrid24_AfterRowActivate(object sender, EventArgs e) { this.ultraGrid24.UpdateData(); UltraGridRow row = this.ultraGrid24.ActiveRow; if (row == null) return; ultraTxtYbEuestion.Text = row.Cells["CalculationFormula"].Text; ultraTxtYbC.Text = row.Cells["Value7"].Text; ultraTxtYbSpac.Text = row.Cells["Value8"].Text; ultraTxtYbQualfiled.Text = row.Cells["IsGood"].Text; ultraTxtYbDefect.Text = row.Cells["IsDefect"].Text; ultraTxtYbMemo.Text = row.Cells["Remark"].Text; } private void ultraGrid25_AfterRowActivate(object sender, EventArgs e) { this.ultraGrid25.UpdateData(); UltraGridRow row = this.ultraGrid25.ActiveRow; if (row == null) return; ultraTxtWqDiameter.Text = row.Cells["Value9"].Text; ultraTxtWqAngle.Text = row.Cells["Value10"].Text; ultraTxtWqQualfiled.Text = row.Cells["IsGood"].Text; ultraTxtWqMemo.Text = row.Cells["Remark"].Text; } private void ultraGrid26_AfterRowActivate(object sender, EventArgs e) { this.ultraGrid26.UpdateData(); UltraGridRow row = this.ultraGrid26.ActiveRow; if (row == null) return; ultraTxtKkTop.Text = row.Cells["Value11"].Text; ultraTxtKkFlarRate.Text = row.Cells["Value12"].Text; ultraTxtKkGood.Text = row.Cells["IsGood"].Text; ultraTxtKkMemo.Text = row.Cells["Remark"].Text; } private void ultraComMethod_ValueChanged(object sender, EventArgs e) { DataTable ds = PublicServer.GetData("com.steering.lims.data.outdec.FrmOutdecDataCJBase.doQueryMothName", new object[] { this.ultraComMethod.Value.ToString2() }, ob); if(ds.Rows.Count > 0) { ultraComMethodName.DataSource = ds; ultraComMethodName.ValueMember = "STD_ID"; } ultraComMethodName.SelectedIndex = 0; } private void chkIsProuctor_CheckedChanged(object sender, EventArgs e) { this.cmbIsProductor.Enabled = this.chkIsProuctor.Checked; } private void chkType_CheckedChanged(object sender, EventArgs e) { this.cmbType.Enabled = this.chkType.Checked; } private void chkPrintK_CheckedChanged(object sender, EventArgs e) { this.cmbPrintK.Enabled = this.chkPrintK.Checked; } private void ultraGrid53_CellChange(object sender, CellEventArgs e) { this.ultraGrid53.UpdateData(); UltraGridRow ur = this.ultraGrid53.ActiveRow; int m = 0; double min = 0.0; if (e.Cell.Column.Key == "Value1" || e.Cell.Column.Key == "Value2" || e.Cell.Column.Key == "Value3") { if (!StringUtil.IsDouble(e.Cell.Row.Cells["Value1"].Value.ToString3()) || !StringUtil.IsDouble(e.Cell.Row.Cells["Value2"].Value.ToString3()) || !StringUtil.IsDouble(e.Cell.Row.Cells["Value3"].Value.ToString3())) { return; } min = double.Parse(ur.Cells["Value1"].Text.ToString3()); if (double.Parse(ur.Cells["Value2"].Text.ToString3()) < min) { min = double.Parse(ur.Cells["Value2"].Text.ToString3()); } if (double.Parse(ur.Cells["Value3"].Text.ToString3()) < min) { min = double.Parse(ur.Cells["Value3"].Text.ToString3()); } ur.Cells["AverageValue"].Value = Math.Round(min, 3).ToString(); } } private void ultraGrid55_CellChange(object sender, CellEventArgs e) { this.ultraGrid55.UpdateData(); UltraGridRow ur = this.ultraGrid55.ActiveRow; int m = 0; double min = 0.0; if (e.Cell.Column.Key == "Value1" || e.Cell.Column.Key == "Value2" || e.Cell.Column.Key == "Value3") { if (!StringUtil.IsDouble(e.Cell.Row.Cells["Value1"].Value.ToString3()) || !StringUtil.IsDouble(e.Cell.Row.Cells["Value2"].Value.ToString3()) || !StringUtil.IsDouble(e.Cell.Row.Cells["Value3"].Value.ToString3())) { return; } min = double.Parse(ur.Cells["Value1"].Text.ToString3()); if (double.Parse(ur.Cells["Value2"].Text.ToString3()) < min) { min = double.Parse(ur.Cells["Value2"].Text.ToString3()); } if (double.Parse(ur.Cells["Value3"].Text.ToString3()) < min) { min = double.Parse(ur.Cells["Value3"].Text.ToString3()); } ur.Cells["AverageValue"].Value = Math.Round(min, 3).ToString(); } } } }