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; using CoreFS.CA06; using System.Collections; using Infragistics.Win; using Infragistics.Win.UltraWinGrid; using Core.LZMes.Client.QCM.QCM03; using System.Diagnostics; using Infragistics.Win.UltraWinEditors; namespace Core.LZMes.Client.QCM { public partial class QCM030706 : FrmBase { private string judge_type = "";//用于区分1检测中心和2轧钢厂 public QCM030706() { InitializeComponent(); } public override void ToolBar_Click(object sender, string ToolbarKey) { switch (ToolbarKey) { case "Query": this.DoQuery(); break; case "Exit": this.Close(); break; case "Unlock": this.Judge(); break; case "Export": this.DoExport(); break; case "CancelFy": CancelFy(); break; case "CancelFx": CancelFx(); break; case "CancelPf": CancelPf(); break; } } private void CancelFx() { UltraGridRow ugr = this.ultraGrid2.ActiveRow; if (ugr == null) { MessageBox.Show("请选择数据!"); return; } string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString(); if (MessageBox.Show(this, "是否对" + material_no + "取消放行操作?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No) { return; } QCM030607 frm = new QCM030607(); string remark = ""; if (frm.ShowDialog() == DialogResult.OK) { remark = frm._memo; if (remark == "") { MessageBox.Show("请录入备注信息!"); return; } string lock_type_code = ugr.Cells["LOCK_TYPE_CODE"].Value.ToString(); string lock_seq = ugr.Cells["LOCK_SEQ"].Value.ToString(); string username = this.UserInfo.GetUserName(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl"; ccp.MethodName = "CancelFx"; ccp.ServerParams = new object[] { material_no, lock_type_code, lock_seq, username, remark }; this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode == -1) { return; } MessageBox.Show("取消放行成功!"); DoQuery(); } } private void CancelPf() { UltraGridRow ugr = this.ultraGrid2.ActiveRow; if (ugr == null) { MessageBox.Show("请选择数据!"); return; } string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString(); if (MessageBox.Show(this, "是否对" + material_no + "取消判废操作?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No) { return; } QCM030607 frm = new QCM030607(); string remark = ""; if (frm.ShowDialog() == DialogResult.OK) { remark = frm._memo; if (remark == "") { MessageBox.Show("请录入备注信息!"); return; } string lock_type_code = ugr.Cells["LOCK_TYPE_CODE"].Value.ToString(); string lock_seq = ugr.Cells["LOCK_SEQ"].Value.ToString(); string username = this.UserInfo.GetUserName(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl"; ccp.MethodName = "CancelPf"; ccp.ServerParams = new object[] { material_no, lock_type_code, lock_seq, username, remark }; this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode == -1) { return; } MessageBox.Show("取消判废成功!"); DoQuery(); } } private void CancelFy() { UltraGridRow ugr = this.ultraGrid2.ActiveRow; if (ugr == null) { MessageBox.Show("请选择数据!"); return; } string batch_no = ugr.Cells["BATCH_NO"].Value.ToString(); if (MessageBox.Show(this, "是否对" + batch_no + "取消复样操作?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No) { return; } QCM030607 frm = new QCM030607(); string remark = ""; if (frm.ShowDialog() == DialogResult.OK) { remark = frm._memo; if (remark == "") { MessageBox.Show("请录入备注信息!"); return; } string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString(); string lock_seq = ugr.Cells["LOCK_SEQ"].Value.ToString(); string username = this.UserInfo.GetUserName(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl"; ccp.MethodName = "CancelFy"; ccp.ServerParams = new object[] { batch_no, material_no, lock_seq, username, remark }; this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode == -1) { return; } MessageBox.Show("取消复样成功!"); DoQuery(); } } private void Judge() { if (this.ultraGrid9.Selected.Rows.Count == 0) this.ultraGrid9.ActiveRow.Selected = true; List lists = new List(); if (comboBox1.Text.Trim().ToString() == "") { MessageBox.Show("请选择异常材处置放向!"); return; } if (comboBox1.Text.Trim().ToString() == "放行") { if (MessageBox.Show(this, "是否放行处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No) { return; } } else if (comboBox1.Text.Trim().ToString() == "复样") { if (MessageBox.Show(this, "是否复样处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No) { return; } } else if (comboBox1.Text.Trim().ToString() == "修磨") { if (MessageBox.Show(this, "是否修磨处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No) { return; } } else if (comboBox1.Text.Trim().ToString() == "改尺") { if (MessageBox.Show(this, "是否改尺处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No) { return; } } else if (comboBox1.Text.Trim().ToString() == "判次") { if (MessageBox.Show(this, "是否判次处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No) { return; } } else if (comboBox1.Text.Trim().ToString() == "判废") { if (MessageBox.Show(this, "是否判废处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No) { return; } } else if (comboBox1.Text.Trim().ToString() == "脱单") { if (MessageBox.Show(this, "是否脱单处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No) { return; } } else if (comboBox1.Text.Trim().ToString() == "按子板件件取样") { if (MessageBox.Show(this, "是否按子板件件取样处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No) { return; } } else if (comboBox1.Text.Trim().ToString() == "解除") { if (MessageBox.Show(this, "是否解除处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No) { return; } } else if (comboBox1.Text.Trim().ToString() == "待判") { if (MessageBox.Show(this, "是否待判处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No) { return; } } else if (comboBox1.Text.Trim().ToString() == "按母板件件取样") { if (MessageBox.Show(this, "是否按母板件件取样处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No) { return; } } else if (comboBox1.Text.Trim().ToString() == "性能改善") { if (MessageBox.Show(this, "是否性能改善处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No) { return; } } else if (comboBox1.Text.Trim().ToString() == "改判") { if (textBox3.Text.ToString() == "") { MessageBox.Show("请选择改判订单!"); return; } if (MessageBox.Show(this, "是否改判处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No) { return; } } foreach (UltraGridRow ugr in this.ultraGrid9.Rows) { if (ugr.Cells["CHECK"].Text.ToString() == "True") { ArrayList al = new ArrayList(); if (comboBox1.Text.Trim().ToString() != "改判") { string material = ugr.Cells["MATERIAL_NO"].Value.ToString(); string lock_seq = ugr.Cells["LOCK_SEQ"].Value.ToString(); string lock_type_code = ugr.Cells["LOCK_TYPE_CODE"].Value.ToString(); string prodline = ugr.Cells["PLINE_CODE"].Value.ToString(); string unlock_type_code = ""; if (lock_type_code == "C" || lock_type_code == "P") { if (comboBox1.Text.Trim().ToString() == "放行") { unlock_type_code = "0"; } else if (comboBox1.Text.Trim().ToString() == "复样") { unlock_type_code = "1"; } else if (comboBox1.Text.Trim().ToString() == "判次") { unlock_type_code = "4"; } else if (comboBox1.Text.Trim().ToString() == "判废") { unlock_type_code = "5"; } else if (comboBox1.Text.Trim().ToString() == "脱单") { unlock_type_code = "6"; } else if (comboBox1.Text.Trim().ToString() == "按子板件件取样") { unlock_type_code = "8"; } else if (comboBox1.Text.Trim().ToString() == "解除") { unlock_type_code = "9"; } else if (comboBox1.Text.Trim().ToString() == "待判") { unlock_type_code = "10"; } else if (comboBox1.Text.Trim().ToString() == "按母板件件取样") { unlock_type_code = "16"; } else if (comboBox1.Text.Trim().ToString() == "性能改善") { unlock_type_code = "17"; } string unlock_memo = ultraComboEditor1.Text.Trim().ToString(); string bh_combobox = this.comboBox4.Text.Trim().ToString(); if (comboBox1.Text.Trim().ToString() == "放行" && (lock_type_code == "P" || lock_type_code == "C")) { if (string.IsNullOrEmpty(unlock_memo) || string.IsNullOrEmpty(bh_combobox)) { this.alert("请选择审理人员及不合格品审理类型!"); return; } } string username = this.UserInfo.GetUserName() + 'Y'; string lock_id = ugr.Cells["LOCK_ID"].Value.ToString(); al.Add(material); al.Add(lock_seq); al.Add(lock_type_code); al.Add(unlock_type_code); al.Add(unlock_memo); al.Add(username); al.Add(lock_id); if (ultraCombo1.Text.ToString() == "") { al.Add(""); } else { al.Add(ultraCombo1.Value.ToString()); } al.Add(prodline); al.Add(this.comboBox4.Text.ToString()); if (comboBox1.Text.Trim().ToString() == "放行" && (lock_type_code == "P" || lock_type_code == "C")) { lists.Add(ugr); String status = ugr.Cells["STATUS"].Text.Trim().ToString(); if ("已申请".Equals(status)) { continue; } CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl"; ccp.MethodName = "LockingApply"; ccp.ServerParams = new object[] { al }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode == -1) { return; } } else { CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl"; ccp.MethodName = "doInformationSure"; ccp.ServerParams = new object[] { al }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode == -1) { return; } lists.Add(ugr); } } else { if (comboBox1.Text.Trim().ToString() == "放行") { unlock_type_code = "0"; } else if (comboBox1.Text.Trim().ToString() == "修磨") { unlock_type_code = "2"; } else if (comboBox1.Text.Trim().ToString() == "改尺") { unlock_type_code = "3"; } else if (comboBox1.Text.Trim().ToString() == "判次") { unlock_type_code = "4"; } else if (comboBox1.Text.Trim().ToString() == "判废") { unlock_type_code = "5"; } else if (comboBox1.Text.Trim().ToString() == "脱单") { unlock_type_code = "6"; } else if (comboBox1.Text.Trim().ToString() == "解除") { unlock_type_code = "9"; } else if (comboBox1.Text.Trim().ToString() == "待判") { unlock_type_code = "10"; } string unlock_memo = this.ultraComboEditor1.Text.Trim().ToString(); string username = this.UserInfo.GetUserName(); string lock_id = ugr.Cells["LOCK_ID"].Value.ToString(); string sf_type = ugr.Cells["SF_TYPE"].Value.ToString(); al.Add(material); al.Add(lock_seq); al.Add(lock_type_code); al.Add(unlock_type_code); al.Add(unlock_memo); al.Add(username); al.Add(lock_id); if (ultraCombo1.Text.ToString() == "") { al.Add(""); } else { al.Add(ultraCombo1.Value.ToString()); } al.Add(sf_type); al.Add(this.comboBox4.Text.ToString()); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl"; ccp.MethodName = "doInformationSureH2"; ccp.ServerParams = new object[] { al }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode == -1) { return; } lists.Add(ugr); } } else { string material = ugr.Cells["MATERIAL_NO"].Value.ToString(); string lock_seq = ugr.Cells["LOCK_SEQ"].Value.ToString(); string lock_type_code = ugr.Cells["LOCK_TYPE_CODE"].Value.ToString(); string unlock_type_code = "7"; string unlock_memo = this.ultraComboEditor1.Text.Trim().ToString(); string username = this.UserInfo.GetUserName(); string lock_id = ugr.Cells["LOCK_ID"].Value.ToString(); al.Add(material); al.Add(lock_seq); al.Add(lock_type_code); al.Add(unlock_type_code); al.Add(unlock_memo); al.Add(username); al.Add(lock_id); al.Add(textBox3.Text.ToString()); if (ultraCombo1.Text.ToString() == "") { al.Add(""); } else { al.Add(ultraCombo1.Value.ToString()); } al.Add(this.txt_gp_tradeno.Text); al.Add(this.comboBox4.Text.ToString()); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl"; ccp.MethodName = "doInformationGp"; ccp.ServerParams = new object[] { al }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode == -1) { return; } lists.Add(ugr); } } } for (int i = 0; i < lists.Count; i++) { lists[i].Delete(false); } MessageBox.Show("异常处置成功!"); } private void DoQuery() { if (this.ultraTabControl1.Tabs[0].Selected) //待判信息 { DoQueryMe(); } if (this.ultraTabControl1.Tabs[1].Selected) //判定记录 { DoQueryRe(); } } private void DoQueryMe() { try { this.dataSet1.Clear(); this.dataSet8.Clear(); string ebatchno = ""; string sbatchno = BatchNo.Text.Trim(); if (BatchNo1.Text.ToString() == "") { ebatchno = this.BatchNo.Text.Trim(); } else { ebatchno = BatchNo1.Text.Trim(); } string orderno = this.OrderNo.Text.Trim(); string psc = this.PscDesc.Text.Trim(); string prodline = this.comboBox3.Text.ToString(); string lock_type_desc = this.comboBox5.Text.ToString(); string heat_no = textBox1.Text.ToString(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl"; if (String.IsNullOrEmpty(judge_type)) { ccp.MethodName = "getInformationH"; ccp.ServerParams = new object[] { this.dateTimePicker1.Value.ToString("yyyyMMdd"), this.dateTimePicker2.Value.ToString("yyyyMMdd"), sbatchno, ebatchno, orderno, psc, "1", prodline,lock_type_desc,heat_no,"1" }; } else { ccp.MethodName = "getInformation2H"; ccp.ServerParams = new object[] { this.dateTimePicker1.Value.ToString("yyyyMMdd"), this.dateTimePicker2.Value.ToString("yyyyMMdd"), sbatchno, ebatchno, orderno, psc, "1", prodline, judge_type,lock_type_desc,heat_no,"1" }; } ccp.SourceDataTable = this.dataSet1.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl"; ccp.MethodName = "findFlawDataB"; ccp.ServerParams = new object[] { prodline }; ccp.SourceDataTable = this.dataSet8.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); this.ultraCombo1.DataSource = ccp.SourceDataTable; } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } private void DoQueryRe() { try { this.dataSet2.Clear(); string ebatchno = ""; string sbatchno = BatchNo.Text.Trim(); if (BatchNo1.Text.ToString() == "") { ebatchno = this.BatchNo.Text.Trim(); } else { ebatchno = BatchNo1.Text.Trim(); } string orderno = this.OrderNo.Text.Trim(); string psc = this.PscDesc.Text.Trim(); string prodline = this.comboBox3.Text.ToString(); string lock_type_desc = this.comboBox5.Text.ToString(); string heat_no = textBox1.Text.ToString(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl"; if (String.IsNullOrEmpty(judge_type)) { ccp.MethodName = "getAbnormalRecordInfoH"; ccp.ServerParams = new object[] { this.dateTimePicker1.Value.ToString("yyyyMMdd"), this.dateTimePicker2.Value.ToString("yyyyMMdd"), sbatchno, ebatchno, orderno, psc, "1", prodline,lock_type_desc,heat_no,"1" }; } else { ccp.MethodName = "getAbnormalRecordInfo2H"; ccp.ServerParams = new object[] { this.dateTimePicker1.Value.ToString("yyyyMMdd"), this.dateTimePicker2.Value.ToString("yyyyMMdd"), sbatchno, ebatchno, orderno, psc, "1", prodline, judge_type,lock_type_desc,heat_no,"1" }; } ccp.SourceDataTable = this.dataSet2.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); foreach (UltraGridRow ugrs in this.ultraGrid2.Rows) { if (ugrs.Cells["UNLOCK_TYPE_DESC"].Text.ToString().Contains("复样")) { ugrs.Appearance.BackColor = Color.Pink; } } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } private void label1_Click(object sender, EventArgs e) { UltraGridRow ugr = this.ultraGrid9.ActiveRow; if (ugr == null) return; string material_no = ugr.Cells["MATERIAL_NO"].Text.ToString(); string std_code = ugr.Cells["STD_CODE"].Text.ToString(); string steel_code = ugr.Cells["STEEL_CODE"].Text.ToString(); string delivery_state_code = ugr.Cells["DELIVERY_STATE_DESC"].Text.ToString(); string thick = ugr.Cells["THICK"].Text.ToString(); string PSC = ugr.Cells["PSC"].Text.ToString(); string WIDTH = ugr.Cells["WIDTH"].Text.ToString(); string LENGTH = ugr.Cells["LENGTH"].Text.ToString(); string PRODLINE = ugr.Cells["PLINE_CODE"].Text.ToString(); QCM030709 dlg = new QCM030709(); dlg.MATERIAL_NO = material_no; dlg.STD_CODE = std_code; dlg.STEELCODE = steel_code; dlg.DELIVERY_STATE_CODE = delivery_state_code; dlg.HEIGHT = thick; dlg.PSC = PSC; dlg.WIDTH = WIDTH; dlg.LENGTH = LENGTH; dlg.PROD_LINE = PRODLINE; dlg.ob = this.ob; dlg.ShowDialog(); this.textBox3.Text = dlg.orderno; this.txt_gp_tradeno.Text = dlg.gp_tradeno; } private void panel4_Paint(object sender, PaintEventArgs e) { } private void panel2_Paint(object sender, PaintEventArgs e) { } private void DoQueryC() { try { UltraGridRow ugr = this.ultraGrid9.ActiveRow; if (ugr == null) return; this.dataSet4.Clear(); string design_key = ugr.Cells["design_key"].Value.ToString(); string smp_no = ugr.Cells["smp_no"].Value.ToString(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl"; ccp.MethodName = "GetChemeInfo"; ccp.ServerParams = new object[] { design_key, smp_no}; ccp.SourceDataTable = this.dataSet4.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } private void ultraGrid9_DoubleClickCell(object sender, DoubleClickCellEventArgs e) { UltraGridRow ugr = e.Cell.Row; string lock_id = ugr.Cells["LOCK_ID"].Value.ToString(); if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "F") { QCM030705 dlg = new QCM030705(); dlg.lock_id = lock_id; dlg.ob = this.ob; dlg.ShowDialog(); } else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "D") { QCM030704 dlg = new QCM030704(); dlg.lock_id = lock_id; dlg.ob = this.ob; dlg.ShowDialog(); } else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "C") { QCM030701 dlg = new QCM030701(); dlg.lock_id = lock_id; dlg.ob = this.ob; dlg.ShowDialog(); } else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "P") { QCM030702 dlg = new QCM030702(); dlg.lock_id = lock_id; dlg.ob = this.ob; dlg.ShowDialog(); } else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "S") { QCM030703 dlg = new QCM030703(); dlg.lock_id = lock_id; dlg.ob = this.ob; dlg.ShowDialog(); } } public static bool SetUltraComboEditor(ref UltraComboEditor cbEdt, ref ValueList vlist, bool bNull) { if (cbEdt == null || vlist == null) return false; cbEdt.Items.Clear(); if (bNull) cbEdt.Items.Add(null, ""); for (int i = 0; i < vlist.ValueListItems.Count; i++) { try { cbEdt.Items.Add(vlist.ValueListItems[i].DataValue, vlist.ValueListItems[i].DisplayText); } catch { } } return true; } public static ValueList GeneralValuelist(ref DataTable table, string strKey, string strText) { if (table == null || !table.Columns.Contains(strKey) || !table.Columns.Contains(strText)) return null; ArrayList alist = new ArrayList(); ValueList vlist = new ValueList(); for (int i = 0; i < table.Rows.Count; i++) { try { if (!alist.Contains(table.Rows[i][strKey])) { alist.Add(table.Rows[i][strKey]); vlist.ValueListItems.Add(table.Rows[i][strKey], Convert.ToString(table.Rows[i][strText])); } } catch { } } return vlist; } private void QCM030706_Load(object sender, EventArgs e) { this.comboBox3.SelectedIndex = 0; this.ultraGrid9.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons; this.ultraGrid2.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons; this.dateTimePicker1.Value = System.DateTime.Now.AddDays(-7); judge_type = String.IsNullOrEmpty(this.CustomInfo) ? "" : this.CustomInfo; CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM01.QCM0106.QueryDefect"; ccp.MethodName = "QueryMemo"; ccp.ServerParams = new object[] { "ZHB" }; ccp = this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); DataTable table2 = ccp.SourceDataTable; ValueList valueList2 = GeneralValuelist(ref table2, "MEMO_CODE", "MEMO"); ClsControlPack.SetUltraComboEditor(ref ultraComboEditor1, ref valueList2, false); } private void ultraGrid2_DoubleClickCell(object sender, DoubleClickCellEventArgs e) { UltraGridRow ugr = e.Cell.Row; string lock_id = ugr.Cells["LOCK_ID"].Value.ToString(); if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "F") { QCM030705 dlg = new QCM030705(); dlg.lock_id = lock_id; dlg.ob = this.ob; dlg.ShowDialog(); } else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "D") { QCM030704 dlg = new QCM030704(); dlg.lock_id = lock_id; dlg.ob = this.ob; dlg.ShowDialog(); } else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "C") { QCM030701 dlg = new QCM030701(); dlg.lock_id = lock_id; dlg.ob = this.ob; dlg.ShowDialog(); } else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "P") { QCM030702 dlg = new QCM030702(); dlg.lock_id = lock_id; dlg.ob = this.ob; dlg.ShowDialog(); } else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "S") { QCM030703 dlg = new QCM030703(); dlg.lock_id = lock_id; dlg.ob = this.ob; dlg.ShowDialog(); } } private void ultraTabControl1_Click(object sender, EventArgs e) { if (this.ultraTabControl1.Tabs[1].Selected) //判定记录 { this.label9.Text = "处置时间"; } if (this.ultraTabControl1.Tabs[0].Selected) //判定记录 { this.label9.Text = "封锁时间"; } } private void DoExport() { if (this.ultraTabControl1.Tabs[0].Selected) //待判信息 { try { if (this.ultraGrid9.Rows.Count == 0) { MessageBox.Show("没有可以导出的数据", "提示"); return; } if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK) { string fName = this.saveFileDialog1.FileName; this.ultraGridExcelExporter1.Export(this.ultraGrid9, fName); Process.Start(fName); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); } } if (this.ultraTabControl1.Tabs[1].Selected) //判定记录 { try { if (this.ultraGrid2.Rows.Count == 0) { MessageBox.Show("没有可以导出的数据", "提示"); return; } if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK) { string fName = this.saveFileDialog1.FileName; this.ultraGridExcelExporter1.Export(this.ultraGrid2, fName); Process.Start(fName); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); } } } private void label11_Click(object sender, EventArgs e) { //获取勾选的批次 ultraGrid9.UpdateData(); DataRow[] rows = dataTable1.Copy().Select("CHECK = 'True'"); if (this.ultraGrid9.Rows.Count == 0 || rows.Length == 0) { return; } DataRow[] rows2 = rows.CopyToDataTable().Select("BATCH_NO = '" + rows[0]["BATCH_NO"].ToString() + "'"); if (rows2.Length != rows.Length) { MessageBox.Show("选择了多个批次信息!"); return; } foreach (UltraGridRow ugr in this.ultraGrid9.Rows) { if (ugr.Cells["BATCH_NO"].Text.ToString() == rows[0]["BATCH_NO"].ToString()) { ugr.Cells["CHECK"].Value = "True"; } } } private void checkBox2_CheckedChanged(object sender, EventArgs e) { foreach (UltraGridRow ugr in this.ultraGrid9.Rows.Where(p => p.IsFilteredOut == false).ToList()) { if (checkBox2.Checked) { ugr.Cells["CHECK"].Value = "True"; } else { ugr.Cells["CHECK"].Value = "False"; } } } } }