FrmBcStoveStore.cs 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  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 Core.Mes.Client.Comm.Server;
  11. using Core.Mes.Client.Comm.Control;
  12. using Core.Mes.Client.Comm.Tool;
  13. using System.Collections;
  14. using Core.StlMes.Client.YdmBcPipeManage;
  15. namespace Core.StlMes.Client.YdmBcPipeManage
  16. {
  17. public partial class FrmBcStoveStore : FrmBase
  18. {
  19. public FrmBcStoveStore()
  20. {
  21. InitializeComponent();
  22. }
  23. private string[] belongArr = null;//所属权
  24. private void FrmStuffStoveStore_Load(object sender, EventArgs e)
  25. {
  26. StatTime.Value = DateTime.Parse(DateTime.Now.ToString("yyyy-MM") + "-01" + " 00:00:00");
  27. endTime.Value = DateTime.Today.AddDays(1).AddSeconds(-1);
  28. belongArr = this.ValidDataPurviewIds;
  29. //getStoreAll();
  30. }
  31. private void getStoreAll()
  32. {
  33. string storeNo = "800201";
  34. //string[] arr = BaseMethod.
  35. //DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.Stuffmanage.FrmStuffBase.getStoreAll", new object[] { storeNo, arr }, this.ob);
  36. //if (dt.Rows.Count > 0)
  37. //{
  38. // cmbStorgeNo.DataSource = dt;
  39. // cmbStorgeNo.DisplayMember = "STORAGE_NAME";
  40. // cmbStorgeNo.ValueMember = "STORAGE_NO";
  41. //}
  42. }
  43. /// <summary>
  44. /// 重写基类方法
  45. /// </summary>
  46. /// <param name="sender"></param>
  47. /// <param name="ToolbarKey"></param>
  48. public override void ToolBar_Click(object sender, string ToolbarKey)
  49. {
  50. switch (ToolbarKey)
  51. {
  52. case "Query":
  53. QueryData();
  54. break;
  55. case"InsertInal":
  56. insertInal();
  57. break;
  58. case "Export":
  59. ExportData();
  60. break;
  61. case "Close":
  62. this.Close();
  63. break;
  64. }
  65. }
  66. /// <summary>
  67. /// 结转
  68. /// </summary>
  69. private void insertInal()
  70. {
  71. }
  72. /// <summary>
  73. /// 查询
  74. /// </summary>
  75. private void QueryData()
  76. {
  77. //string[] arr = BaseMethod.WarehousePermissions(this.CustomInfo,this.ValidDataPurviewIds, ob);
  78. if (this.StatTime.Value > this.endTime.Value)
  79. {
  80. MessageUtil.ShowTips("起始年月不能大于结束日期!");
  81. this.endTime.Focus();
  82. return;
  83. }
  84. string strDateFrom = this.StatTime.Value.ToString("yyyyMM");
  85. string strDateTo = this.endTime.Value.ToString("yyyyMMdd");
  86. string time = this.StatTime.Value.ToString("yyyyMM");
  87. string nextStartTime = this.StatTime.Value.AddMonths(1).ToString("yyyyMMdd");
  88. string nextEndTime = this.endTime.Value.AddMonths(1).ToString("yyyyMMdd");
  89. try
  90. {
  91. this.Cursor = Cursors.WaitCursor; //控制鼠标的样式为等待
  92. if (Constant.WaitingForm == null)
  93. {
  94. Constant.WaitingForm = new WaitingForm();
  95. }
  96. Constant.WaitingForm.ShowToUser = true;
  97. Constant.WaitingForm.Show();
  98. Constant.WaitingForm.Update();
  99. string strOriginal = this.StatTime.Value.ToString("yyyyMM");
  100. string strOriginalLast = this.endTime.Value.ToString("yyyyMMdd");
  101. DataTable dt = ServerHelper.GetData("com.steering.ydm.bc.report.FrmBcStoveStore.queryData", new object[] { strOriginal, strOriginalLast, time, belongArr, nextStartTime, nextEndTime }, ob);
  102. GridHelper.CopyDataToDatatable(ref dt, ref dataTable1, true);
  103. this.SetStaticsInfo();
  104. CommonMethod.SetGridSumArea(this.ultraGrid1);
  105. this.Cursor = Cursors.Default;
  106. Constant.WaitingForm.ShowToUser = false;
  107. Constant.WaitingForm.Close();
  108. Constant.WaitingForm = null;
  109. }
  110. catch (Exception e)
  111. {
  112. this.Cursor = Cursors.Default;
  113. Constant.WaitingForm.ShowToUser = false;
  114. Constant.WaitingForm.Close();
  115. Constant.WaitingForm = null;
  116. }
  117. }
  118. private void SetStaticsInfo()
  119. {
  120. try
  121. {
  122. if (this.ultraGrid1.Rows.Count == 0)
  123. {
  124. this.ultraGrid1.DisplayLayout.Bands[0].Summaries.Clear();
  125. }
  126. else
  127. {
  128. ArrayList alist = new ArrayList();
  129. alist.Add("ORIGINAL_AMOUNT");
  130. alist.Add("ORIGINAL_COUNT");
  131. alist.Add("DAY_1");
  132. alist.Add("DAY_1COUNT");
  133. alist.Add("MONTH_1");
  134. alist.Add("MONTH_1COUNT");
  135. //alist.Add("YEAR_1");
  136. alist.Add("DAY_2");
  137. alist.Add("DAY_2COUNT");
  138. alist.Add("MONTH_2");
  139. alist.Add("MONTH_2COUNT");
  140. //alist.Add("YEAR_2");
  141. //alist.Add("AWEIGHT");
  142. alist.Add("END_AMOUNT");
  143. alist.Add("END_COUNT");
  144. alist.Add("MATWGT");
  145. alist.Add("MATCOUNT");
  146. alist.Add("QUANTITYCOUNT");
  147. alist.Add("QUANTITYWGT");
  148. alist.Add("NEXTMOTH_COUNT");
  149. alist.Add("NEXTMOTH_WEIGHT");
  150. alist.Add("CNEXTMOTH_COUNT");
  151. alist.Add("CNEXTMOTH_WEIGHT");
  152. CommonMethod.SetStaticsInfoSum(ref this.ultraGrid1, alist, true);
  153. }
  154. }
  155. catch { }
  156. }
  157. /// <summary>
  158. /// 导出
  159. /// </summary>
  160. private void ExportData()
  161. {
  162. GridHelper.ulGridToExcel(ultraGrid1, "半成品收发存汇总");
  163. }
  164. }
  165. }