/******************************************************************************* * Copyright(c) 2015 DongkeSoft All rights reserved. / Confidential * 类的信息: * 1.程序名称:F_PM_3601.cs * 2.功能描述:首件登记 * 编辑履历: * 作者 日期 版本 修改内容 * 秦祺 2024/9/11 1.00 新建 *******************************************************************************/ using Dongke.IBOSS.PRD.Basics.BaseResources; using Dongke.IBOSS.PRD.Client.CommonModule; using Dongke.IBOSS.PRD.Client.Controls; using Dongke.IBOSS.PRD.WCF.DataModels; using Dongke.IBOSS.PRD.WCF.Proxys; using System; using System.Data; using System.Drawing; using System.IO; using System.Windows.Forms; namespace Dongke.IBOSS.PRD.Client.PMModule { public partial class F_PM_3601 : DKDockPanelBase { #region 成员变量 // 窗体的单例模式 private static F_PM_3601 _instance; private int _registerID = 0; #endregion #region 构造函数 public F_PM_3601() { InitializeComponent(); // 窗体显示的Title this.Text = "首件登记"; this.tsbtnAdaptive.Text = ButtonText.TSBTN_ADAPTIVE; this.tsbtnClose.Text = ButtonText.TSBTN_CLOSE; this.btnSearch.Text = ButtonText.BTN_SEARCH; this.btnClearCondition.Text = ButtonText.BTN_CLEARCONDITION; this.gbxCondition.Text = Constant.LABEL_QUERY_CONDITIONS; } #endregion #region 单例模式 /// /// 单例模式,防止重复创建窗体 /// public static F_PM_3601 Instance { get { if (_instance == null || _instance.IsDisposed) { _instance = new F_PM_3601(); } return _instance; } } #endregion #region 事件处理 /// /// 窗体加载事件 /// /// /// private void F_PM_3601_Load(object sender, EventArgs e) { try { //时间控件 this.dtpCreatetimebegin.Value = DateTime.Now.Date; this.dtpCreatetimeend.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1); //不自动添加列 dgvRegister.AutoGenerateColumns = false; dgvBarcode.AutoGenerateColumns = false; dgvRegisterDetail.AutoGenerateColumns = false; #region 车间 DataTable dtWorkShop = new DataTable(); dtWorkShop.Columns.Add("WorkShopID"); dtWorkShop.Columns.Add("WorkShopNames"); DataRow drWorkShop = dtWorkShop.NewRow(); drWorkShop["WorkShopID"] = DBNull.Value; drWorkShop["WorkShopNames"] = Constant.CBO_SELECT_EMPTY_NAME; dtWorkShop.Rows.Add(drWorkShop); drWorkShop = dtWorkShop.NewRow(); drWorkShop["WorkShopID"] = 1; drWorkShop["WorkShopNames"] = "1"; dtWorkShop.Rows.Add(drWorkShop); drWorkShop = dtWorkShop.NewRow(); drWorkShop["WorkShopID"] = 2; drWorkShop["WorkShopNames"] = "2"; dtWorkShop.Rows.Add(drWorkShop); drWorkShop = dtWorkShop.NewRow(); drWorkShop["WorkShopID"] = 3; drWorkShop["WorkShopNames"] = "3"; dtWorkShop.Rows.Add(drWorkShop); cmbWORKSHOP.DisplayMember = "WorkShopID"; cmbWORKSHOP.ValueMember = "WorkShopNames"; cmbWORKSHOP.DataSource = dtWorkShop; #endregion #region 状态 DataTable dtStatus = new DataTable(); dtStatus.Columns.Add("Status"); dtStatus.Columns.Add("StatusName"); DataRow drStatus = dtStatus.NewRow(); drStatus["Status"] = DBNull.Value; drStatus["StatusName"] = Constant.CBO_SELECT_EMPTY_NAME; dtStatus.Rows.Add(drStatus); drStatus = dtStatus.NewRow(); drStatus["Status"] = 0; drStatus["StatusName"] = "未登记"; dtStatus.Rows.Add(drStatus); drStatus = dtStatus.NewRow(); drStatus["Status"] = 1; drStatus["StatusName"] = "检测中"; dtStatus.Rows.Add(drStatus); drStatus = dtStatus.NewRow(); drStatus["Status"] = 2; drStatus["StatusName"] = "待研发部检验"; dtStatus.Rows.Add(drStatus); drStatus = dtStatus.NewRow(); drStatus["Status"] = 3; drStatus["StatusName"] = "待签名"; dtStatus.Rows.Add(drStatus); drStatus = dtStatus.NewRow(); drStatus["Status"] = 4; drStatus["StatusName"] = "已完结"; dtStatus.Rows.Add(drStatus); cmbStuts.DisplayMember = "StatusName"; cmbStuts.ValueMember = "Status"; cmbStuts.DataSource = dtStatus; #endregion #region 首件检验产品类型 // 获取产品类型 ServiceResultEntity sreType = DoAsync(() => { return ReportModuleProxy.Service.GetRptDictionaryData(0, "TPC025"); } ); if (sreType.Data == null) { return; } if (sreType.Data != null && sreType.Data.Tables[0].Rows.Count > 0) { // 设置空选项 DataRow dataRow = sreType.Data.Tables[0].NewRow(); dataRow["DictionaryID"] = DBNull.Value; dataRow["DictionaryValue"] = Constant.CBO_SELECT_EMPTY_NAME; dataRow["DisplayNo"] = 0; sreType.Data.Tables[0].Rows.InsertAt(dataRow, 0); this.cmbFIRGOODSTYPE.DisplayMember = "DictionaryValue"; this.cmbFIRGOODSTYPE.ValueMember = "DictionaryID"; this.cmbFIRGOODSTYPE.DataSource = sreType.Data.Tables[0]; } #endregion #region 首件检验检验依据 // 获取检验依据 ServiceResultEntity sreType1 = DoAsync(() => { return ReportModuleProxy.Service.GetRptDictionaryData(0, "TPC026"); } ); if (sreType1.Data == null) { return; } if (sreType1.Data != null && sreType1.Data.Tables[0].Rows.Count > 0) { // 设置空选项 DataRow dataRow = sreType1.Data.Tables[0].NewRow(); dataRow["DictionaryID"] = DBNull.Value; dataRow["DictionaryValue"] = Constant.CBO_SELECT_EMPTY_NAME; dataRow["DisplayNo"] = 0; sreType1.Data.Tables[0].Rows.InsertAt(dataRow, 0); this.cmbFIRBASIS.DisplayMember = "DictionaryValue"; this.cmbFIRBASIS.ValueMember = "DictionaryID"; this.cmbFIRBASIS.DataSource = sreType1.Data.Tables[0]; } #endregion } catch (Exception ex) { // 对异常进行共通处理 ExceptionManager.HandleEventException(this.ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex); } } /// /// 窗体关闭事件 /// /// /// private void F_PM_3601_FormClosed(object sender, FormClosedEventArgs e) { _instance = null; } /// /// 关闭按钮 /// /// /// private void tsbtnClose_Click(object sender, EventArgs e) { this.Close(); } /// /// 查询按钮事件 /// /// /// private void btnSearch_Click(object sender, EventArgs e) { try { #region 总单 this.btnSearch.Focus(); //数据清空 this.dgvRegister.DataSource = null; this.dgvRegisterDetail.DataSource = null; this.dgvBarcode.DataSource = null; _registerID = 0; //图片清空 this.pictureBox1.Image = Properties.Resources.bg; this.pictureBox2.Image = Properties.Resources.bg; this.pictureBox3.Image = Properties.Resources.bg; this.pictureBox4.Image = Properties.Resources.bg; this.pictureBox5.Image = Properties.Resources.bg; this.pictureBox6.Image = Properties.Resources.bg; ClientRequestEntity cre = new ClientRequestEntity(); cre.NameSpace = "F_PM_3601"; cre.Name = "GetRegisterData"; cre.Properties["REGISTERNO"] = this.txtRegisterNo.Text; if (string.IsNullOrWhiteSpace(this.cmbWORKSHOP.Text)) { cre.Properties["WORKSHOP"] = ""; } else { cre.Properties["WORKSHOP"] = Convert.ToInt32(this.cmbWORKSHOP.SelectedValue); } if (string.IsNullOrWhiteSpace(this.cmbFIRGOODSTYPE.Text)) { cre.Properties["FIRGOODSTYPE"] = ""; } else { cre.Properties["FIRGOODSTYPE"] = Convert.ToInt32(this.cmbFIRGOODSTYPE.SelectedValue); } if (string.IsNullOrWhiteSpace(this.cmbFIRBASIS.Text)) { cre.Properties["FIRBASIS"] = ""; } else { cre.Properties["FIRBASIS"] = Convert.ToInt32(this.cmbFIRBASIS.SelectedValue); } if (string.IsNullOrWhiteSpace(this.cmbStuts.Text)) { cre.Properties["STATUS"] = ""; } else { cre.Properties["STATUS"] = Convert.ToInt32(this.cmbStuts.SelectedValue); } cre.Properties["GOODSCODE"] = this.txtGoodsCode.Text; cre.Properties["CREATETIMEBEGIN"] = this.dtpCreatetimebegin.Value; cre.Properties["CREATETIMEEND"] = this.dtpCreatetimeend.Value; ServiceResultEntity sre = DoAsync(() => { return PMModuleProxyNew.Service.HandleRequest(cre); }); if (sre.Status == Constant.ServiceResultStatus.Success) { if (sre.Data.Tables[0] != null && sre.Data.Tables[0].Rows.Count > 0) { dgvRegister.DataSource = sre.Data.Tables[0]; this.dgvRegister.Rows[0].Selected = true; } else { // 提示未查找到数据 MessageBox.Show(Messages.MSG_CMN_I002, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); DataTable dt = new DataTable(); DataTable dtd = new DataTable(); if (dgvRegister.DataSource != null) { dt = ((DataTable)dgvRegister.DataSource).Clone(); } dgvRegister.DataSource = dt; if (dgvRegisterDetail.DataSource != null) { dtd = ((DataTable)dgvRegisterDetail.DataSource).Clone(); } dgvRegisterDetail.DataSource = dtd; //图片清空 this.pictureBox1.Image = Properties.Resources.bg; this.pictureBox2.Image = Properties.Resources.bg; this.pictureBox3.Image = Properties.Resources.bg; this.pictureBox4.Image = Properties.Resources.bg; this.pictureBox5.Image = Properties.Resources.bg; this.pictureBox6.Image = Properties.Resources.bg; return; } } #endregion #region 明细 //dgvRegister_SelectionChanged(null, null); #endregion } catch (Exception ex) { this.btnSearch.Enabled = true; this.btnClearCondition.Enabled = true; // 对异常进行共通处理 ExceptionManager.HandleEventException(this.ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex); } } /// /// 总单选择事件 /// /// /// private void dgvRegister_SelectionChanged(object sender, EventArgs e) { try { if (this.dgvRegister.CurrentRow != null) { int registerID = Convert.ToInt32(this.dgvRegister.CurrentRow.Cells["REGISTERID"].Value.ToString()); if (_registerID != registerID) { ClientRequestEntity cre = new ClientRequestEntity(); cre.NameSpace = "F_PM_3601"; cre.Name = "GetRegisterDetail"; cre.Properties["REGISTERID"] = registerID; ServiceResultEntity sre = DoAsync(() => { return PMModuleProxyNew.Service.HandleRequest(cre); }); if (sre.Status == Constant.ServiceResultStatus.Success) { if (sre.Data.Tables[0] != null && sre.Data.Tables[0].Rows.Count > 0) { dgvBarcode.DataSource = sre.Data.Tables[0]; this.dgvBarcode.Rows[0].Selected = true; } else { //清空 if (dgvBarcode.DataSource != null) { dgvBarcode.DataSource = ((DataTable)dgvBarcode.DataSource).Clone(); } else { dgvBarcode.DataSource = null; } } if (sre.Data.Tables.Count > 1 && sre.Data.Tables[1] != null && sre.Data.Tables[1].Rows.Count > 0) { DataTable imageTable = sre.Data.Tables[1]; //加载品管签名 if (!string.IsNullOrEmpty(imageTable.Rows[0]["PGSIGNATURE"].ToString())) { // 读取二进制数据 byte[] binaryDataPG = (byte[])(imageTable.Rows[0]["PGSIGNATURE"]); // 解码为图像对象 try { using (MemoryStream stream = new MemoryStream(binaryDataPG)) { if (pictureBox1.Image != null) { // 其他操作 // 显示图像在PictureBox中 pictureBox1.Image = Image.FromStream(stream); } } } catch (ArgumentException ex) { // 处理异常,例如记录日志或显示用户友好的错误消息 MessageBox.Show("品管签名加载失败: " + ex.Message); } } else { //图片清空 this.pictureBox1.Image = Properties.Resources.bg; } //加载成检签名 if (!string.IsNullOrEmpty(imageTable.Rows[0]["CJSIGNATURE"].ToString())) { // 读取二进制数据 byte[] binaryDataCJ = (byte[])(imageTable.Rows[0]["CJSIGNATURE"]); // 解码为图像对象 try { using (MemoryStream stream1 = new MemoryStream(binaryDataCJ)) { if (pictureBox2.Image != null) { // 其他操作 // 显示图像在PictureBox中 pictureBox2.Image = Image.FromStream(stream1); } } } catch (ArgumentException ex) { // 处理异常,例如记录日志或显示用户友好的错误消息 MessageBox.Show("成检签名加载失败: " + ex.Message); } } else { //图片清空 this.pictureBox2.Image = Properties.Resources.bg; } //加载生控签名 if (!string.IsNullOrEmpty(imageTable.Rows[0]["SKSIGNATURE"].ToString())) { // 读取二进制数据 byte[] binaryDataSK = (byte[])(imageTable.Rows[0]["SKSIGNATURE"]); // 解码为图像对象 try { using (MemoryStream stream2 = new MemoryStream(binaryDataSK)) { if (pictureBox3.Image != null) { // 其他操作 // 显示图像在PictureBox中 pictureBox3.Image = Image.FromStream(stream2); } } } catch (ArgumentException ex) { // 处理异常,例如记录日志或显示用户友好的错误消息 MessageBox.Show("生控签名加载失败: " + ex.Message); } } else { //图片清空 this.pictureBox3.Image = Properties.Resources.bg; } //加载研发签名 if (!string.IsNullOrEmpty(imageTable.Rows[0]["YFSIGNATURE"].ToString())) { // 读取二进制数据 byte[] binaryDataYF = (byte[])(imageTable.Rows[0]["YFSIGNATURE"]); // 解码为图像对象 try { using (MemoryStream stream1 = new MemoryStream(binaryDataYF)) { if (pictureBox4.Image != null) { // 其他操作 // 显示图像在PictureBox中 pictureBox4.Image = Image.FromStream(stream1); } } } catch (ArgumentException ex) { // 处理异常,例如记录日志或显示用户友好的错误消息 MessageBox.Show("研发签名加载失败: " + ex.Message); } } else { //图片清空 this.pictureBox4.Image = Properties.Resources.bg; } //加载工艺签名 if (!string.IsNullOrEmpty(imageTable.Rows[0]["GYSIGNATURE"].ToString())) { // 读取二进制数据 byte[] binaryDataGY = (byte[])(imageTable.Rows[0]["GYSIGNATURE"]); // 解码为图像对象 try { using (MemoryStream stream1 = new MemoryStream(binaryDataGY)) { if (pictureBox5.Image != null) { // 其他操作 // 显示图像在PictureBox中 pictureBox5.Image = Image.FromStream(stream1); } } } catch (ArgumentException ex) { // 处理异常,例如记录日志或显示用户友好的错误消息 MessageBox.Show("工艺签名加载失败: " + ex.Message); } } else { //图片清空 this.pictureBox5.Image = Properties.Resources.bg; } //加载项目组签名 if (!string.IsNullOrEmpty(imageTable.Rows[0]["XMZSIGNATURE"].ToString())) { // 读取二进制数据 byte[] binaryDataXMZ = (byte[])(imageTable.Rows[0]["XMZSIGNATURE"]); // 解码为图像对象 try { using (MemoryStream stream1 = new MemoryStream(binaryDataXMZ)) { if (pictureBox6.Image != null) { // 其他操作 // 显示图像在PictureBox中 pictureBox6.Image = Image.FromStream(stream1); } } } catch (ArgumentException ex) { // 处理异常,例如记录日志或显示用户友好的错误消息 MessageBox.Show("项目组签名加载失败: " + ex.Message); } } else { //图片清空 this.pictureBox6.Image = Properties.Resources.bg; } } } } _registerID = registerID; } } catch (Exception ex) { this.btnSearch.Enabled = true; this.btnClearCondition.Enabled = true; // 对异常进行共通处理 ExceptionManager.HandleEventException(this.ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex); } } /// /// 清空条件按钮事件 /// /// /// private void btnClearCondition_Click(object sender, EventArgs e) { try { this.txtGoodsCode.Text = ""; this.txtRegisterNo.Text = ""; this.cmbFIRBASIS.SelectedIndex = Constant.INT_IS_ZERO; this.cmbFIRGOODSTYPE.SelectedIndex = Constant.INT_IS_ZERO; this.cmbWORKSHOP.SelectedIndex = Constant.INT_IS_ZERO; } catch (Exception ex) { this.btnSearch.Enabled = true; this.btnClearCondition.Enabled = true; // 对异常进行共通处理 ExceptionManager.HandleEventException(this.ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex); } } /// /// 自动适应列宽 /// /// /// private void tsbtnAdaptive_Click(object sender, EventArgs e) { try { this.dgvRegister.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells); this.dgvBarcode.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells); this.dgvRegisterDetail.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells); } catch (Exception ex) { this.btnSearch.Enabled = true; this.btnClearCondition.Enabled = true; // 对异常进行共通处理 ExceptionManager.HandleEventException(this.ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex); } } /// /// 新建 /// /// /// private void btnFirAdd_Click(object sender, EventArgs e) { try { F_PM_3602 firEdit = new F_PM_3602(Constant.FormMode.Add, 0); firEdit.ShowDialog(); } catch (Exception ex) { this.btnSearch.Enabled = true; this.btnClearCondition.Enabled = true; // 对异常进行共通处理 ExceptionManager.HandleEventException(this.ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex); } } /// /// 编辑 /// /// /// private void btnFirEdit_Click(object sender, EventArgs e) { try { DataGridViewRow currentRow = this.dgvRegister.CurrentRow; if (currentRow != null) // 获取相应节点数据 { int status = Convert.ToInt32(currentRow.Cells["STATUSID"].Value); //判断状态(0:未登记(可编辑总单,没有明细) //1:部分检测中(不可编辑总单,点击条码) //2:待研发部检验(不可编辑总单,点击条码) //3:待签名(不可编辑) //4:已完结(不可编辑)) if (status == 0) { F_PM_3602 frmPM3602 = new F_PM_3602(Constant.FormMode.Edit, Convert.ToInt32(currentRow.Cells["REGISTERID"].Value)); DialogResult dialogresult = frmPM3602.ShowDialog(); if (dialogresult.Equals(DialogResult.OK)) { // 刷新窗口数据 btnSearch_Click(sender, e); } } else if(status == 1 || status == 2) { if (this.dgvBarcode.CurrentRow == null) { MessageBox.Show("当前登记单状态不允许编辑总单,选择条码后可编辑检验结果!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1); return; } DataGridViewRow barRow = this.dgvBarcode.CurrentRow; int registerid = Convert.ToInt32(currentRow.Cells["REGISTERID"].Value); int barid = Convert.ToInt32(barRow.Cells["BARID"].Value); F_PM_3602 frmPM3602 = new F_PM_3602(Constant.FormMode.Edit, registerid, barid); DialogResult dialogresult = frmPM3602.ShowDialog(); if (dialogresult.Equals(DialogResult.OK)) { // 刷新窗口数据 btnSearch_Click(sender, e); } } else if(status == 3 || status == 4) { MessageBox.Show("当前登记单状态不允许编辑", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1); return; } } } catch (Exception ex) { this.btnSearch.Enabled = true; this.btnClearCondition.Enabled = true; // 对异常进行共通处理 ExceptionManager.HandleEventException(this.ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex); } } /// /// 条码选中查询明细 /// /// /// private void dgvBarcode_SelectionChanged(object sender, EventArgs e) { try { if (this.dgvRegister.CurrentRow != null && this.dgvBarcode.CurrentRow != null) { int registerID = Convert.ToInt32(this.dgvRegister.CurrentRow.Cells["REGISTERID"].Value.ToString()); int barID = Convert.ToInt32(this.dgvBarcode.CurrentRow.Cells["BARID"].Value.ToString()); ClientRequestEntity cre = new ClientRequestEntity(); cre.NameSpace = "F_PM_3601"; cre.Name = "GetItemDetail"; cre.Properties["REGISTERID"] = registerID; cre.Properties["BARID"] = barID; ServiceResultEntity sre = DoAsync(() => { return PMModuleProxyNew.Service.HandleRequest(cre); }); if (sre.Status == Constant.ServiceResultStatus.Success) { if (sre.Data.Tables[0] != null && sre.Data.Tables[0].Rows.Count > 0) { dgvRegisterDetail.DataSource = sre.Data.Tables[0]; this.dgvRegisterDetail.Rows[0].Selected = true; this.dgvRegisterDetail.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells); } else { if (dgvRegisterDetail.DataSource != null ) { dgvRegisterDetail.DataSource = ((DataTable)dgvRegisterDetail.DataSource).Clone(); } else { dgvRegisterDetail.DataSource = null; } } } } } catch (Exception ex) { this.btnSearch.Enabled = true; this.btnClearCondition.Enabled = true; // 对异常进行共通处理 ExceptionManager.HandleEventException(this.ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex); } } /// /// 删除 /// /// /// /// 李士越 private void del_button_Click(object sender, EventArgs e) { try { int statusid = Convert.ToInt32(this.dgvRegister.CurrentRow.Cells["STATUSID"].Value.ToString()); if (statusid != 0) { MessageBox.Show("当前登记单状态不允许删除", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1); return; } int registerid = Convert.ToInt32(this.dgvRegister.CurrentRow.Cells["REGISTERID"].Value.ToString()); ClientRequestEntity cre = new ClientRequestEntity(); cre.NameSpace = "F_PM_3601"; cre.Name = "DelInfo"; cre.Properties["REGISTERID"] = registerid; ServiceResultEntity sre = DoAsync(() => { return PMModuleProxyNew.Service.HandleRequest(cre); }); if (sre.Status == Constant.ServiceResultStatus.Success) { MessageBox.Show("当前登记单状态删除成功", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); } // 刷新窗口数据 btnSearch_Click(sender, e); } catch (Exception ex) { this.btnSearch.Enabled = true; this.btnClearCondition.Enabled = true; // 对异常进行共通处理 ExceptionManager.HandleEventException(this.ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex); } } /// /// 查看型式检验 /// /// /// /// 李士越 private void ShowTest_Click(object sender, EventArgs e) { try { //获取选中的BARCODE if (this.dgvRegister.CurrentRow != null && this.dgvBarcode.CurrentRow != null) { string barID = this.dgvBarcode.CurrentRow.Cells["BARCODE"].Value.ToString(); //查找型式检验数据 ClientRequestEntity cre = new ClientRequestEntity(); cre.NameSpace = "F_PM_3601"; cre.Name = "ShowTest"; cre.Properties["barCode"] = barID; ServiceResultEntity sre = DoAsync(() => PMModuleProxyNew.Service.HandleRequest(cre)); //无数据 if (sre.Data.Tables[0].Rows.Count == 0) { // 提示信息 MessageBox.Show("未查询到数据", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } //构造查看形式检验结果页面 F_PM_3603 firEdit = new F_PM_3603(Constant.FormMode.Display, sre.Data.Tables[0]); firEdit.ShowDialog(); } //没选中 提示选择条码 else { MessageBox.Show("请选择条码", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning); } } catch (Exception ex) { this.btnSearch.Enabled = true; this.btnClearCondition.Enabled = true; // 对异常进行共通处理 ExceptionManager.HandleEventException(this.ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex); } } #endregion #region 私有方法 #endregion } }