UIJ050010.cs 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using CoreFS.CA06;
  10. namespace Core.LZMes.Client.UIJ
  11. {
  12. public partial class UIJ050010 : FrmBase
  13. {
  14. public UIJ050010()
  15. {
  16. InitializeComponent();
  17. }
  18. private void UIJ050010_Load(object sender, EventArgs e)
  19. {
  20. this.ultraComboEditor1.SelectedIndex = 1;
  21. }
  22. public override void ToolBar_Click(object sender, string ToolbarKey)
  23. {
  24. switch (ToolbarKey)
  25. {
  26. case "Query":
  27. this.DoQuery();
  28. break;
  29. case "Export":
  30. this.DoExport();
  31. break;
  32. case "Exportx":
  33. this.DoExportx();
  34. break;
  35. case "Update":
  36. //this.DoUpdate();
  37. break;
  38. case "Delete":
  39. //this.DoDelete();
  40. break;
  41. case "Save":
  42. break;
  43. case "Exit":
  44. this.Close();
  45. break;
  46. }
  47. }
  48. private void DoQuery()
  49. {
  50. try
  51. {
  52. string dlivDirDate = this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd");
  53. string dlivDirDateED = this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd");
  54. string dlivTp = this.ultraComboEditor1.Value.ToString(); ;
  55. string ordNo = this.textBox1.Text.Trim();
  56. this.dataSet1.Tables[0].Clear();
  57. CoreClientParam ccp = new CoreClientParam();
  58. ccp.ServerName = "UIJ.UIJ03.UIJ030010";
  59. ccp.MethodName = "LtqueryShippingPlan";
  60. ccp.ServerParams = new object[] { dlivDirDate,dlivDirDateED, dlivTp, ordNo };
  61. ccp.SourceDataTable = this.dataSet1.Tables[0];
  62. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  63. double coilCount = 0;
  64. double wgtCount = 0;
  65. DataRowCollection drs = this.dataSet1.Tables[0].Rows;
  66. for (int i = 0; i < drs.Count; i++)
  67. {
  68. coilCount += double.Parse(drs[i]["CNT"].ToString().Trim());
  69. wgtCount += double.Parse(drs[i]["ACT_WGT"].ToString().Trim());
  70. }
  71. this.textBox2.Text = coilCount.ToString();
  72. this.textBox3.Text = (wgtCount / 1000).ToString();
  73. }
  74. catch (Exception EX)
  75. {
  76. MessageBox.Show(EX.ToString());
  77. }
  78. }
  79. private void ultraGrid1_DoubleClickRow(object sender, Infragistics.Win.UltraWinGrid.DoubleClickRowEventArgs e)
  80. {
  81. Infragistics.Win.UltraWinGrid.UltraGrid uGrid = (Infragistics.Win.UltraWinGrid.UltraGrid)sender;
  82. string dlivDirNo = uGrid.ActiveRow.Cells["DLIV_DIRNO"].Text.Trim();
  83. this.dataSet2.Tables[0].Clear();
  84. CoreClientParam ccp = new CoreClientParam();
  85. ccp.ServerName = "UIJ.UIJ03.UIJ030010";
  86. ccp.MethodName = "queryShippingCoilLt";
  87. ccp.ServerParams = new object[] { dlivDirNo };
  88. ccp.SourceDataTable = this.dataSet2.Tables[0];
  89. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  90. foreach (Infragistics.Win.UltraWinGrid.UltraGridRow ugr in ultraGrid2.Rows)
  91. {
  92. string a = ugr.Cells["T_W"].Text.Trim();
  93. // if(double.Parse(substring(a,0)))
  94. string[] tw = a.Split('*');
  95. double b = double.Parse(ugr.Cells["C_ORD_THK_MAX"].Text.Trim());
  96. double c = double.Parse(ugr.Cells["C_ORD_THK_MIN"].Text.Trim());
  97. double d = double.Parse(ugr.Cells["C_ORD_WTH_MIN"].Text.Trim());
  98. double f = double.Parse(ugr.Cells["C_ORD_WTH_MAX"].Text.Trim());
  99. if (double.Parse(tw[0]) > b || double.Parse(tw[0]) < c || double.Parse(tw[1]) < d || double.Parse(tw[1]) > f)
  100. {
  101. ugr.Appearance.BackColor = Color.Yellow;
  102. }
  103. string pkglel = ugr.Cells["PKGLEL"].Text;
  104. string PAKMTH_TP = ugr.Cells["PAKMTH_TP"].Text;
  105. if (pkglel != PAKMTH_TP)
  106. {
  107. ugr.Cells["PKGLEL"].Appearance.BackColor = Color.Red;
  108. }
  109. if (ugr.Cells["IS_CUT"].Text.Trim().Equals("N"))
  110. {
  111. ugr.Appearance.BackColor = Color.Orange;//LimeGreen
  112. }
  113. //this.ultraGrid2.ActiveRow = null;
  114. this.ultraGrid2.DisplayLayout.Override.ActiveRowAppearance = null;
  115. }
  116. }
  117. private void DoExport()
  118. {
  119. try
  120. {
  121. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  122. {
  123. string fileName = this.saveFileDialog1.FileName;
  124. ultraGridExcelExporter1.Export(ultraGrid1, fileName);
  125. System.Diagnostics.Process.Start(fileName);
  126. }
  127. }
  128. catch (Exception ex)
  129. {
  130. MessageBox.Show(ex.ToString());
  131. }
  132. }
  133. private void DoExportx()
  134. {
  135. try
  136. {
  137. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  138. {
  139. string fileName = this.saveFileDialog1.FileName;
  140. ultraGridExcelExporter1.Export(ultraGrid2, fileName);
  141. System.Diagnostics.Process.Start(fileName);
  142. }
  143. }
  144. catch (Exception ex)
  145. {
  146. MessageBox.Show(ex.ToString());
  147. }
  148. }
  149. }
  150. }