UIM070060.cs 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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. using System.Collections;
  11. namespace Core.LZMes.Client.UIM
  12. {
  13. public partial class UIM070060 : FrmBase
  14. {
  15. public UIM070060()
  16. {
  17. InitializeComponent();
  18. }
  19. public override void ToolBar_Click(object sender, string ToolbarKey)
  20. {
  21. switch (ToolbarKey)
  22. {
  23. case "Query":
  24. this.DoQuery();
  25. break;
  26. case "Export":
  27. this.Export();
  28. break;
  29. case "Save":
  30. this.DoSave();
  31. break;
  32. }
  33. }
  34. /// <summary>
  35. /// 查询原料库库存数据
  36. /// </summary>
  37. private void DoQuery()
  38. {
  39. try
  40. {
  41. this.dataSet1.Tables[0].Clear();
  42. string startTime = this.ultraDateTimeEditor1.Value != null ? ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") : "";//入库开始时间
  43. string endTime = this.ultraDateTimeEditor2.Value != null ? ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd") : "";//入库结束时间
  44. string coil_no = this.textBox1.Text;
  45. string ord_no = this.textBox2.Text;
  46. string[] queryParams = new string[] { startTime, endTime, coil_no, ord_no };
  47. List<string[]> list = new List<String[]>();
  48. list.Add(queryParams);
  49. CoreClientParam ccp = new CoreClientParam();
  50. ccp.ServerName = "UIM.UIM07.UIM070010";
  51. ccp.MethodName = "queryHYardSpmdETAL";
  52. ccp.ServerParams = new object[] { list };
  53. ccp.SourceDataTable = this.dataSet1.Tables[0];
  54. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  55. }
  56. catch (Exception EX)
  57. {
  58. MessageBox.Show(EX.ToString());
  59. }
  60. }
  61. /// <summary>
  62. /// 导出EXCEL
  63. /// </summary>
  64. private void Export()
  65. {
  66. try
  67. {
  68. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  69. {
  70. string fileName = this.saveFileDialog1.FileName;
  71. this.ultraGridExcelExporter1.Export(ultraGrid3, fileName);
  72. System.Diagnostics.Process.Start(fileName);
  73. }
  74. }
  75. catch (Exception ex)
  76. {
  77. MessageBox.Show(ex.ToString());
  78. }
  79. }
  80. private void UIM070060_Load(object sender, EventArgs e)
  81. {
  82. this.ultraDateTimeEditor1.Value = "" ;
  83. this.ultraDateTimeEditor2.Value = "";
  84. }
  85. private void DoSave()
  86. {
  87. Infragistics.Win.UltraWinGrid.RowsCollection rs = null;
  88. ArrayList list = new ArrayList();
  89. string[] param = null;
  90. CoreClientParam ccp = new CoreClientParam();
  91. rs = this.ultraGrid1.Rows;
  92. for (int i = 0; i < rs.Count; i++)
  93. {
  94. if ("TRUE".Equals(rs[i].Cells["CHK"].Text.ToUpperInvariant()))
  95. {
  96. param = new string[2];
  97. param[0] = rs[i].Cells["LZBZ"].Text.ToString().Trim();
  98. param[1] = rs[i].Cells["OLD_SAMPL_NO"].Value.ToString().Trim();
  99. list.Add(param);
  100. }
  101. }
  102. ccp.ServerName = "UIM.UIM070060";
  103. ccp.MethodName = "addLzbz";
  104. ccp.ServerParams = new Object[] { list };
  105. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  106. }
  107. }
  108. }