8463d4e5c2bc1f222b75301df6a03e8b5deac353.svn-base 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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 UIJ030011 : FrmBase
  13. {
  14. public UIJ030011()
  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 = "queryShippingPlanSuanX";
  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.textBox2.Text = coilCount.ToString();
  65. this.textBox3.Text = (wgtCount/1000).ToString();
  66. }
  67. catch (Exception EX)
  68. {
  69. MessageBox.Show(EX.ToString());
  70. }
  71. }
  72. private void UIJ030011_Load(object sender, EventArgs e)
  73. {
  74. this.ultraComboEditor1.SelectedIndex = 1;
  75. }
  76. private void ultraGrid1_DoubleClickRow(object sender, Infragistics.Win.UltraWinGrid.DoubleClickRowEventArgs e)
  77. {
  78. Infragistics.Win.UltraWinGrid.UltraGrid uGrid = (Infragistics.Win.UltraWinGrid.UltraGrid)sender;
  79. string dlivDirNo = uGrid.ActiveRow.Cells["DLIV_DIRNO"].Text.Trim();
  80. this.dataSet2.Tables[0].Clear();
  81. CoreClientParam ccp = new CoreClientParam();
  82. ccp.ServerName = "UIJ.UIJ03.UIJ030010";
  83. ccp.MethodName = "queryShippingCoil";
  84. ccp.ServerParams = new object[] { dlivDirNo };
  85. ccp.SourceDataTable = this.dataSet2.Tables[0];
  86. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  87. }
  88. private void DoExport()
  89. {
  90. try
  91. {
  92. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  93. {
  94. string fileName = this.saveFileDialog1.FileName;
  95. ultraGridExcelExporter1.Export(ultraGrid1, fileName);
  96. System.Diagnostics.Process.Start(fileName);
  97. }
  98. }
  99. catch (Exception ex)
  100. {
  101. MessageBox.Show(ex.ToString());
  102. }
  103. }
  104. }
  105. }