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; namespace Core.LZMes.Client.UIK { public partial class UIK050100 : FrmBase { public UIK050100() { InitializeComponent(); } public override void ToolBar_Click(object sender, string ToolbarKey) { switch (ToolbarKey) { case "Query": this.DoQuery(); break; case "Export": this.DoExport(); break; } } private void DoExport() { try { if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK) { string fileName = this.saveFileDialog1.FileName; ultraGridExcelExporter1.Export(ultraGrid1, fileName); System.Diagnostics.Process.Start(fileName); } } catch (Exception EX) { MessageBox.Show(EX.ToString()); } } private void DoQuery() { try { string in_start_time = this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd"); string in_end_time = this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd"); string C_SPEC_STL_GRD = ""; string C_OUT_YARD = "";//出库类型 string I_C_OUT_YARD = ""; int queryType = 8; try { queryType = int.Parse(this.ultraComboEditor5.Value.ToString()); } catch(Exception e) { MessageBox.Show("请选择查询类型!"); return; } if (this.checkBox1.Checked == false && this.checkBox2.Checked == false) { MessageBox.Show("请选择查询条件!"); return; } else { this.dataSet1.Tables[0].Clear(); if (this.checkBox1.Checked ) { C_OUT_YARD = this.ultraComboEditor3.Text.ToString().Trim(); if (C_OUT_YARD == "上料出库") { I_C_OUT_YARD = "1"; } if(C_OUT_YARD =="热退") { I_C_OUT_YARD = "2"; } } else { I_C_OUT_YARD = ""; } if(this.checkBox2.Checked) { C_SPEC_STL_GRD = this.ultraComboEditor1.Text.ToString().Trim(); } else { C_SPEC_STL_GRD = ""; } CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "UIK.UIK05.UIK050100"; ccp.MethodName = "DoQuery"; ccp.ServerParams = new object[] { in_start_time, in_end_time, C_SPEC_STL_GRD, I_C_OUT_YARD, queryType }; ccp.SourceDataTable = this.dataSet1.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); DataRowCollection drc = this.dataSet1.Tables[0].Rows; if(drc.Count <= 0) { MessageBox.Show("该时间内无出库钢卷!"); return; } return; } } catch (Exception ex) { MessageBox.Show("系统更新,请重启客户端!"); return; } } private void UIK050100_Load(object sender, EventArgs e) { this.checkBox1.Checked = false; this.checkBox2.Checked = false; this.ultraComboEditor1.Enabled = false; this.ultraComboEditor3.Enabled = false; } private void checkBox1_CheckedChanged(object sender, EventArgs e) { if (this.checkBox1.Checked == true) { this.ultraComboEditor3.Enabled = true; } else { this.ultraComboEditor3.Enabled = false; } } private void checkBox2_CheckedChanged(object sender, EventArgs e) { if (this.checkBox2.Checked == true) { this.ultraComboEditor1.Enabled = true; } else { this.ultraComboEditor1.Enabled = false; } } //private void DoExport() //{ // try // { // if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK) // { // string fileName = this.saveFileDialog1.FileName; // ultraGridExcelExporter1.Export(ultraGrid1, fileName); // System.Diagnostics.Process.Start(fileName); // } // } // catch (Exception EX) // { // MessageBox.Show(EX.ToString()); // } //} } }