15b48aaf31e9617b4a70b7ba8040a38bbbcc3ea5.svn-base 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Data;
  6. using System.Drawing;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Windows.Forms;
  10. using CoreFS.CA06;
  11. namespace Core.LZMes.Client.UIM
  12. {
  13. public partial class UIM070030 : FrmBase
  14. {
  15. private string opTime = "";
  16. private string shift = "";
  17. private string group = "";
  18. private string stockNo = "";
  19. int queryType = 0;
  20. public UIM070030()
  21. {
  22. InitializeComponent();
  23. }
  24. private void UIM070030_Load(object sender, EventArgs e)
  25. {
  26. //默认查询入库记录
  27. this.ddlQueryType.Value = 0;
  28. this.QueryCustomers();//查询并显示收货单位
  29. // this.ExportColumnsInit();//初始化导出字段设定
  30. }
  31. public override void ToolBar_Click(object sender, string ToolbarKey)
  32. {
  33. switch (ToolbarKey)
  34. {
  35. case "Query":
  36. this.label1.Focus();
  37. this.DoQuery();
  38. break;
  39. case "Exit":
  40. this.Close();
  41. break;
  42. case "":
  43. break;
  44. }
  45. }
  46. public void DoQuery()
  47. {
  48. try
  49. {
  50. ArrayList al = new ArrayList();
  51. if (this.ddlQueryType.Text == "入库时间查询")
  52. {
  53. al.Add("UIM070030_01.SELECT");
  54. }
  55. else
  56. {
  57. al.Add("UIM070030_02.SELECT");
  58. }
  59. al.Add( this.dteStartDate.DateTime.ToString("yyyyMMdd"));//开始时间 1
  60. opTime = this.dteStartDate.DateTime.ToString("yyyy年MM月dd日");
  61. al.Add(this.dteEndDate.DateTime.ToString("yyyyMMdd"));//结束时间 2
  62. al.Add(this.txtOLD_SAMPL_NO.Text);//钢卷号 9
  63. al.Add(this.txtThick_1.Text);//厚度最小值 6
  64. al.Add(this.txtThick_2.Text);//厚度最大值 7
  65. al.Add(this.txtWidth_1.Text);//宽度最小值 4
  66. al.Add(this.txtWidth_2.Text);//宽度最大值 5
  67. al.Add(this.txtCUR_LOAD_LOC.Text);//垛位 8
  68. al.Add(this.txtSPEC_STL_GRD.Text);//牌号 3
  69. shift = (-1 >= this.ddlShift.SelectedIndex) ? "" : this.ddlShift.Text.ToString();//班次 10
  70. group = (-1 >= this.ddlWKGroup.SelectedIndex) ? "" : this.ddlWKGroup.Text.ToString();//班组 11
  71. al.Add(shift);//牌号 3
  72. al.Add(group);//牌号 3
  73. al.Add(this.txtCZR.Text);//作业人12
  74. al.Add(this.textBox3.Text);//车号
  75. al.Add(this.txtORD_NO.Text);//订单号14
  76. al.Add(this.txtORD_SQE.Text);//合同号15
  77. al.Add(this.textBox4.Text);//合同号15
  78. string custCd = (-1 == this.ddlDLIV_tp.SelectedIndex) ? "" : this.ddlDLIV_tp.Value.ToString();//客户编号13
  79. al.Add(custCd);//客户编号13 ultraComboEditor2
  80. string dilvtp = (-1 == this.ultraComboEditor2.SelectedIndex) ? "" : this.ultraComboEditor2.Value.ToString();//运输方式
  81. al.Add(dilvtp);
  82. string ordFl = (-1 >= this.ddlSEQType.SelectedIndex || this.ddlSEQType.Value == null) ? "" : this.ddlSEQType.Value.ToString();//订单区分16
  83. al.Add(ordFl);
  84. al.Add((-1 >= this.ddlSEQType.SelectedIndex || this.ddlSEQType.Value == null) ? "" : this.ddlSEQType.Value.ToString());//是否二级库存
  85. string deldatefr = this.ultraDateTimeEditor4.Value != null ? ultraDateTimeEditor4.DateTime.ToString("yyyyMMdd") : "";//入库开始时间
  86. string deldateto = this.ultraDateTimeEditor3.Value != null ? ultraDateTimeEditor3.DateTime.ToString("yyyyMMdd") : "";//入库结束时间
  87. al.Add(deldatefr);
  88. al.Add(deldateto);
  89. this.dataSet1.Tables[0].Clear();
  90. CoreClientParam ccp = new CoreClientParam();
  91. ccp.ServerName = "UIB.COM.ComDBQuery";
  92. ccp.MethodName = "doSimpleQuery";
  93. ccp.ServerParams = new object[] { al };
  94. ccp.SourceDataTable = this.dataSet1.Tables[0];
  95. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  96. DataRowCollection drs = this.dataSet1.Tables[0].Rows;
  97. int coilCount = 0;
  98. double wgtCount = 0;
  99. int drsSize = drs.Count;
  100. coilCount = drsSize;
  101. for (int i = 0; i < drsSize; i++)
  102. {
  103. double actWgt = 0;
  104. try
  105. {
  106. actWgt = double.Parse(drs[i]["ACT_WGT"].ToString());
  107. }
  108. catch (Exception e)
  109. {
  110. }
  111. wgtCount += actWgt;
  112. }
  113. if (coilCount == 0)
  114. {
  115. this.textBox1.Text = "";
  116. this.textBox2.Text = "";
  117. }
  118. else
  119. {
  120. this.textBox1.Text = coilCount.ToString();
  121. this.textBox2.Text = (wgtCount / 1000).ToString();
  122. }
  123. }
  124. catch (Exception ex)
  125. {
  126. }
  127. }
  128. /// <summary>
  129. /// 查询并显示收货单位
  130. /// </summary>
  131. private void QueryCustomers()
  132. {
  133. CoreClientParam ccp = new CoreClientParam();
  134. ccp.ServerName = "UIM.UIM010060";
  135. ccp.MethodName = "queryCustomers";
  136. ccp = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
  137. ArrayList custList = (ArrayList)ccp.ReturnObject;
  138. int listSize = custList.Count;
  139. Infragistics.Win.ValueListItem[] valueListItems = new Infragistics.Win.ValueListItem[listSize];
  140. for (int i = 0; i < listSize; i++)
  141. {
  142. Infragistics.Win.ValueListItem item = new Infragistics.Win.ValueListItem();
  143. Hashtable ht = (Hashtable)custList[i];
  144. item.DataValue = ht["VALUE"].ToString();
  145. object obj = ht["LABEL"];
  146. if (obj != null)
  147. {
  148. item.DisplayText = ht["LABEL"].ToString();
  149. }
  150. else
  151. {
  152. item.DisplayText = "";
  153. }
  154. valueListItems[i] = item;
  155. }
  156. this.ddlDLIV_tp.Items.AddRange(valueListItems);
  157. }
  158. private string GetThickBySize(string coilSize)
  159. {
  160. string thick = string.Empty;
  161. if (!string.IsNullOrEmpty(coilSize) && coilSize.Contains("*"))
  162. {
  163. thick = coilSize.Substring(0, coilSize.IndexOf("*"));
  164. }
  165. return thick;
  166. }
  167. private void button1_Click(object sender, EventArgs e)
  168. {
  169. try
  170. {
  171. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  172. {
  173. string fileName = this.saveFileDialog1.FileName;
  174. this.ultraGridExcelExporter1.Export(ultraGrid1, fileName);
  175. System.Diagnostics.Process.Start(fileName);
  176. }
  177. }
  178. catch (Exception ex)
  179. {
  180. MessageBox.Show(ex.ToString());
  181. }
  182. }
  183. }
  184. }