| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- 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.UIK.UIK05
- {
- public partial class UIK050070 : FrmBase
- {
- public UIK050070()
- {
- InitializeComponent();
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "query"://查询轧辊库存数据
- this.DoQuery();
- break;
- case "export"://导出
- this.DoExport();
- break;
- case "insert"://导出
- this.DoInSert();
- break;
- }
- }
- private void DoQuery()
- {
- try
- {
- dataSet1.Tables[0].Clear();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIK.UIK05.UIK050001";
- ccp.MethodName = "DoQuery";
- ccp.ServerParams = new object[] { };
- ccp.SourceDataTable = this.dataSet1.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- if (this.ultraGrid1.Rows.Count <= 0)
- {
- MessageBox.Show("暂无记录!");
- }
- return;
- }
- catch (Exception Ex)
- {
- MessageBox.Show(Ex.ToString());
- }
- }
- private void DoExport()
- {
- try
- {
- if (this.ultraGrid1.Rows.Count == 0)
- {
- MessageBox.Show("没有可以导出的数据", "提示");
- return;
- }
- //saveFileDialog1.FileName = "轧辊库存数据" + DateTime.Today.ToShortDateString() + "_01";
- saveFileDialog1.FileName = "轧辊库存数据" + DateTime.Today.ToString("yyyyMMdd")+"_01";
- saveFileDialog1.Filter = "表格(*.xls)|*.xls";
- if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
- {
- string fName = this.saveFileDialog1.FileName;
- this.ultraGridExcelExporter1.Export(ultraGrid1, fName);
- Process.Start(fName);
- }
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private void DoInSert()
- {
- UIK050090 CWindow = new UIK050090();
- CWindow.ob = this.ob;
- //CWindow.UIK050090_Load(sender,e);
- CWindow.Show();
- }
- }
- }
|