| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- 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;
- namespace Core.LZMes.Client.UIJ
- {
- public partial class UIJ030011 : FrmBase
- {
- public UIJ030011()
- {
- InitializeComponent();
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- this.DoQuery();
- break;
- case "Export":
- this.DoExport();
- break;
- case "Update":
- //this.DoUpdate();
- break;
- case "Delete":
- //this.DoDelete();
- break;
- case "Save":
- break;
- case "Exit":
- this.Close();
- break;
- }
- }
- private void DoQuery()
- {
- try
- {
- string dlivDirDate = this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd");
- string dlivDirDateED = this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd");
- string dlivTp = this.ultraComboEditor1.Value.ToString(); ;
- string ordNo = this.textBox1.Text.Trim();
- this.dataSet1.Tables[0].Clear();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIJ.UIJ03.UIJ030010";
- ccp.MethodName = "queryShippingPlanSuanX";
- ccp.ServerParams = new object[] { dlivDirDate,dlivDirDateED, dlivTp, ordNo };
- ccp.SourceDataTable = this.dataSet1.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- double coilCount = 0;
- double wgtCount = 0;
- DataRowCollection drs = this.dataSet1.Tables[0].Rows;
- for (int i = 0; i < drs.Count; i++)
- {
- coilCount += double.Parse(drs[i]["CNT"].ToString().Trim());
- wgtCount += double.Parse(drs[i]["ACT_WGT"].ToString().Trim());
- }
- this.textBox2.Text = coilCount.ToString();
- this.textBox3.Text = (wgtCount/1000).ToString();
- }
- catch (Exception EX)
- {
- MessageBox.Show(EX.ToString());
- }
- }
- private void UIJ030011_Load(object sender, EventArgs e)
- {
- this.ultraComboEditor1.SelectedIndex = 1;
- }
- private void ultraGrid1_DoubleClickRow(object sender, Infragistics.Win.UltraWinGrid.DoubleClickRowEventArgs e)
- {
- Infragistics.Win.UltraWinGrid.UltraGrid uGrid = (Infragistics.Win.UltraWinGrid.UltraGrid)sender;
- string dlivDirNo = uGrid.ActiveRow.Cells["DLIV_DIRNO"].Text.Trim();
- this.dataSet2.Tables[0].Clear();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIJ.UIJ03.UIJ030010";
- ccp.MethodName = "queryShippingCoil";
- ccp.ServerParams = new object[] { dlivDirNo };
- ccp.SourceDataTable = this.dataSet2.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- }
- 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());
- }
- }
- }
- }
|