| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- 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 System.Diagnostics;
- namespace Core.LZMes.Client.UIM.UIM01
- {
- public partial class UIM010400 : FrmBase
- {
- public UIM010400()
- {
- InitializeComponent();
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "DoQuery":
- this.DoQuery();
- break;
- case "doexport":
- this.DoExport();
- break;
- case "Exit":
- this.Close();
- break;
- }
- }
- private void DoQuery()
- {
- try
- {
-
- CoreClientParam ccp = null;
-
- ccp = new CoreClientParam();
- Hashtable ht = new Hashtable();
- ht.Add("i1", this.ultraComboEditor1.Text);
- ht.Add("i2", this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd"));
- ht.Add("i3", this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd"));
- ht.Add("o4", "");
- ccp.ServerName = "UIB.COM.ComDBProcedure";
- ccp.MethodName = "doXmlProcedure";
- ccp.ServerParams = new object[] { "UIM010400.CALL", ht };
- this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
-
- //查询
- this.dataSet2.Clear();
- ArrayList al = new ArrayList();
- al.Add("UIM010400.SELECT");
- al.Add(this.ultraComboEditor1.Text);
- al.Add(this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") + "-" + this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd"));
- ccp = new CoreClientParam();
- ccp.ServerName = "UIB.COM.ComDBQuery";
- ccp.MethodName = "doSimpleQuery";
- ccp.ServerParams = new object[] { al };
- ccp.IfShowErrMsg = false;
- ccp.SourceDataTable = this.dataSet2.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- this.dataSet1.Clear();
- ArrayList al1 = new ArrayList();
- string line = this.ultraComboEditor1.Text.ToString();
- if(line=="酸轧")
- {
- al1.Add("UIM010400_02.SELECT");
- }
- else if (line == "连退重卷")
- {
- al1.Add("UIM010400_01.SELECT");
-
- }
- //al.Add(this.ultraComboEditor1.Text);
- al1.Add(this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd"));
- al1.Add(this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd"));
- CoreClientParam ccp2 = new CoreClientParam();
- ccp2.ServerName = "UIB.COM.ComDBQuery";
- ccp2.MethodName = "doSimpleQuery";
- ccp2.ServerParams = new object[] { al1 };
- ccp2.IfShowErrMsg = false;
- ccp2.SourceDataTable = this.dataSet1.Tables[0];
- this.ExecuteQueryToDataTable(ccp2, CoreInvokeType.Internal);
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private void DoExport()
- {
- try
- {
- if (this.ultraGrid1.Rows.Count == 0)
- {
- MessageBox.Show("没有可以导出的数据", "提示");
- return;
- }
- if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
- {
- string fName = this.saveFileDialog1.FileName;
- this.ultraGridExcelExporter1.Export(this.ultraGrid1, fName);
- Process.Start(fName);
- }
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private void UIM010400_Load(object sender, EventArgs e)
- {
- this.ultraComboEditor1.SelectedIndex = 1;
- }
- }
- }
|