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.UltraWinGrid; using System.Diagnostics; namespace Core.LZMes.Client.QCM { public partial class QCM030806 : FrmBase { public QCM030806() { InitializeComponent(); } public override void ToolBar_Click(object sender, string ToolbarKey) { switch (ToolbarKey) { case"Query": this.DoQuery(); break; case "Affirm": this.affirm(); break; case "Export": this.DoExport(); break; } } private void affirm() { try { UltraGridRow ugr = this.ultraGrid2.ActiveRow; if (ugr == null) return; string heat_no = ugr.Cells["HEAT_NO"].Value.ToString(); string assay_no = ugr.Cells["ASSAY_NO"].Value.ToString(); string pline_code = ugr.Cells["pline_code"].Value.ToString(); ArrayList list1 = new ArrayList(); list1.Add(heat_no); list1.Add(assay_no); list1.Add(pline_code); list1.Add(this.UserInfo.GetUserName()); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl"; ccp.MethodName = "UpdateChemeInfo"; ccp.ServerParams = new object[] { list1 }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode == -1) { return; } DoQuery(); MessageBox.Show("修改成功!"); } catch(Exception EX) { MessageBox.Show(EX.ToString()); } } private void DoQuery() { DoQueryMe(); } //查询待判信息 private void DoQueryMe() { try { this.dataSet3.Clear(); string heatno = this.textBox1.Text.Trim(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl"; ccp.MethodName = "GetElement"; ccp.SourceDataTable = this.dataSet3.Tables[0]; ccp.ServerParams = new object[] { this.dateTimePicker1.Value.ToString("yyyy-MM-dd"), this.dateTimePicker2.Value.ToString("yyyy-MM-dd"), heatno}; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } private void QCM030803_Load(object sender, EventArgs e) { this.ultraGrid2.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons; this.dateTimePicker1.Value = System.DateTime.Now.AddDays(-3); } private void DoExport() { 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()); } } } }