7cdcba7efba11b1afc136f14ae440a9f96c99541.svn-base 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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 UIJ030010 : FrmBase
  13. {
  14. public UIJ030010()
  15. {
  16. InitializeComponent();
  17. }
  18. public override void ToolBar_Click(object sender, string ToolbarKey)
  19. {
  20. switch (ToolbarKey)
  21. {
  22. case "Query":
  23. this.DoQuery();
  24. break;
  25. case "Export":
  26. this.DoExport();
  27. break;
  28. case "Update":
  29. //this.DoUpdate();
  30. break;
  31. case "Delete":
  32. //this.DoDelete();
  33. break;
  34. case "Save":
  35. break;
  36. case "Exit":
  37. this.Close();
  38. break;
  39. }
  40. }
  41. private void DoQuery()
  42. {
  43. try
  44. {
  45. string dlivDirDate = this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd");
  46. string dlivDirDateED = this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd");
  47. string dlivTp = this.ultraComboEditor1.Value.ToString(); ;
  48. string ordNo = this.textBox1.Text.Trim();
  49. this.dataSet1.Tables[0].Clear();
  50. CoreClientParam ccp = new CoreClientParam();
  51. ccp.ServerName = "UIJ.UIJ03.UIJ030010";
  52. ccp.MethodName = "queryShippingPlan";
  53. ccp.ServerParams = new object[] { dlivDirDate,dlivDirDateED, dlivTp, ordNo };
  54. ccp.SourceDataTable = this.dataSet1.Tables[0];
  55. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  56. double coilCount = 0;
  57. double wgtCount = 0;
  58. DataRowCollection drs = this.dataSet1.Tables[0].Rows;
  59. for (int i = 0; i < drs.Count; i++)
  60. {
  61. coilCount += double.Parse(drs[i]["CNT"].ToString().Trim());
  62. wgtCount += double.Parse(drs[i]["ACT_WGT"].ToString().Trim());
  63. }
  64. this.textBox4.Text= this.ultraGrid1.Rows.Count().ToString();
  65. this.textBox2.Text = coilCount.ToString();
  66. this.textBox3.Text = (wgtCount/1000).ToString();
  67. }
  68. catch (Exception EX)
  69. {
  70. MessageBox.Show(EX.ToString());
  71. }
  72. }
  73. private void UIJ030010_Load(object sender, EventArgs e)
  74. {
  75. this.ultraComboEditor1.SelectedIndex = 1;
  76. }
  77. private void ultraGrid1_DoubleClickRow(object sender, Infragistics.Win.UltraWinGrid.DoubleClickRowEventArgs e)
  78. {
  79. Infragistics.Win.UltraWinGrid.UltraGrid uGrid = (Infragistics.Win.UltraWinGrid.UltraGrid)sender;
  80. string dlivDirNo = uGrid.ActiveRow.Cells["DLIV_DIRNO"].Text.Trim();
  81. this.dataSet2.Tables[0].Clear();
  82. CoreClientParam ccp = new CoreClientParam();
  83. ccp.ServerName = "UIJ.UIJ03.UIJ030010";
  84. ccp.MethodName = "queryShippingCoil";
  85. ccp.ServerParams = new object[] { dlivDirNo };
  86. ccp.SourceDataTable = this.dataSet2.Tables[0];
  87. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  88. foreach (Infragistics.Win.UltraWinGrid.UltraGridRow ugr in ultraGrid2.Rows)
  89. {
  90. if (ugr.Cells["IS_CUT"].Text.Trim().Equals("N"))
  91. {
  92. ugr.Appearance.BackColor = Color.Orange;//LimeGreen
  93. }
  94. //this.ultraGrid2.ActiveRow = null;
  95. this.ultraGrid2.DisplayLayout.Override.ActiveRowAppearance = null;
  96. }
  97. }
  98. private void DoExport()
  99. {
  100. try
  101. {
  102. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  103. {
  104. string fileName = this.saveFileDialog1.FileName;
  105. ultraGridExcelExporter1.Export(ultraGrid1, fileName);
  106. System.Diagnostics.Process.Start(fileName);
  107. }
  108. }
  109. catch (Exception ex)
  110. {
  111. MessageBox.Show(ex.ToString());
  112. }
  113. }
  114. private void ultraButton1_Click(object sender, EventArgs e)
  115. {
  116. try
  117. {
  118. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  119. {
  120. string fileName = this.saveFileDialog1.FileName;
  121. ultraGridExcelExporter1.Export(ultraGrid2, fileName);
  122. System.Diagnostics.Process.Start(fileName);
  123. }
  124. }
  125. catch (Exception ex)
  126. {
  127. MessageBox.Show(ex.ToString());
  128. }
  129. }
  130. }
  131. }