| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168 |
- 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 UIJ050010 : FrmBase
- {
- public UIJ050010()
- {
- InitializeComponent();
- }
- private void UIJ050010_Load(object sender, EventArgs e)
- {
- this.ultraComboEditor1.SelectedIndex = 1;
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- this.DoQuery();
- break;
- case "Export":
- this.DoExport();
- break;
- case "Exportx":
- this.DoExportx();
- 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 = "LtqueryShippingPlan";
- 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 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 = "queryShippingCoilLt";
- ccp.ServerParams = new object[] { dlivDirNo };
- ccp.SourceDataTable = this.dataSet2.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow ugr in ultraGrid2.Rows)
- {
- string a = ugr.Cells["T_W"].Text.Trim();
- // if(double.Parse(substring(a,0)))
- string[] tw = a.Split('*');
- double b = double.Parse(ugr.Cells["C_ORD_THK_MAX"].Text.Trim());
- double c = double.Parse(ugr.Cells["C_ORD_THK_MIN"].Text.Trim());
- double d = double.Parse(ugr.Cells["C_ORD_WTH_MIN"].Text.Trim());
- double f = double.Parse(ugr.Cells["C_ORD_WTH_MAX"].Text.Trim());
- if (double.Parse(tw[0]) > b || double.Parse(tw[0]) < c || double.Parse(tw[1]) < d || double.Parse(tw[1]) > f)
- {
- ugr.Appearance.BackColor = Color.Yellow;
- }
- string pkglel = ugr.Cells["PKGLEL"].Text;
- string PAKMTH_TP = ugr.Cells["PAKMTH_TP"].Text;
- if (pkglel != PAKMTH_TP)
- {
- ugr.Cells["PKGLEL"].Appearance.BackColor = Color.Red;
-
- }
- if (ugr.Cells["IS_CUT"].Text.Trim().Equals("N"))
- {
- ugr.Appearance.BackColor = Color.Orange;//LimeGreen
- }
- //this.ultraGrid2.ActiveRow = null;
- this.ultraGrid2.DisplayLayout.Override.ActiveRowAppearance = null;
- }
- }
- 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 DoExportx()
- {
- try
- {
- if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
- {
- string fileName = this.saveFileDialog1.FileName;
- ultraGridExcelExporter1.Export(ultraGrid2, fileName);
- System.Diagnostics.Process.Start(fileName);
- }
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.ToString());
- }
- }
- }
- }
|