using CoreFS.CA06; using Infragistics.Win; using Infragistics.Win.UltraWinGrid; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace Core.LZMes.Client.QCM { public partial class QCM0402 : FrmBase { public QCM0402() { InitializeComponent(); } #region 初始化 private void QCM0402_Load(object sender, EventArgs e) { ValueList v2 = new ValueList(); v2.ValueListItems.Add("00", "待提报"); v2.ValueListItems.Add("10", "待确认"); v2.ValueListItems.Add("20", "审批中"); v2.ValueListItems.Add("30", "审批拒绝"); v2.ValueListItems.Add("40", "审批退回"); v2.ValueListItems.Add("50", "审批通过"); ultraGrid1.DisplayLayout.Bands[0].Columns["CERT_STATUS"].ValueList = v2.Clone(); } #endregion #region 按钮 #region 查询按钮 private void button3_Click(object sender, EventArgs e) { Query(); } private void Query() { try { String STARTTIME = this.dateTimePicker4.Value.ToString("yyyy-MM-dd"); String ENDTIME = this.dateTimePicker3.Value.ToString("yyyy-MM-dd"); String CERT_INST_NAME = this.textBox6.Text.Trim();//认证机构 String BATCH_NO = this.textBox5.Text.Trim();//轧批号 String shordh = "";//销售订单号 CoreClientParam ccp = new CoreClientParam(); this.dataSet1.Clear(); ccp.ServerName = "QCM.JHY01.JHY0103.QuerryThirdInfo"; ccp.MethodName = "QueryMainInfo"; ccp.ServerParams = new object[] { STARTTIME, ENDTIME, CERT_INST_NAME, BATCH_NO, shordh }; ccp.SourceDataTable = this.dataSet1.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } #endregion #region 剔除子板按钮 private void button2_Click(object sender, EventArgs e) { try { if (MessageBox.Show("确认剔除子板?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { return; } UltraGridRow row = ultraGrid2.ActiveRow; String CERT_NO = row.Cells["CERT_NO"].Value.ToString();//认证申报编号 String MATERIAL_NO = row.Cells["MATERIAL_NO"].Value.ToString();//产品序号 string cm = CERT_NO + "," + MATERIAL_NO; this.dataSet2.Clear(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.JHY01.JHY0103.DeleteMaterialInfo"; ccp.MethodName = "delete2"; ccp.ServerParams = new object[] { cm }; ccp.SourceDataTable = this.dataSet2.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); ultraGrid1AfterRowActivate(); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } #endregion #region 申报确认 private void button1_Click(object sender, EventArgs e) { try { if (MessageBox.Show("确认申报确认?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { return; } UltraGridRow row = ultraGrid1.ActiveRow; String CERT_NO = row.Cells["CERT_NO"].Value.ToString();//认证申报编号 this.dataSet1.Clear(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.JHY01.JHY0103.DeleteMaterialInfo"; ccp.MethodName = "updateM"; ccp.ServerParams = new object[] { CERT_NO }; ccp.SourceDataTable = this.dataSet1.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); Query(); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } #endregion #endregion #region ultraGrid1单击事件 private void ultraGrid1_AfterRowActivate(object sender, EventArgs e) { ultraGrid1AfterRowActivate(); } public void ultraGrid1AfterRowActivate() { try { UltraGridRow row = ultraGrid1.ActiveRow; String CERT_NO = row.Cells["CERT_NO"].Value.ToString();//认证申报编号 String BATCH_NO = "";//轧批号 String design_key = "";//design_key this.dataSet2.Clear(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.JHY01.JHY0103.QuerryThirdInfo"; ccp.MethodName = "QueryDetailInfo"; ccp.ServerParams = new object[] { CERT_NO, BATCH_NO, design_key }; ccp.SourceDataTable = this.dataSet2.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); DataTable table = this.dataTable1; if (table == null) { this.dataSet2.Clear(); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } #endregion } }