887be762c552377d7529631aec03862c283a0d42.svn-base 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  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. using Infragistics.Win.UltraWinGrid;
  12. namespace Core.LZMes.Client.UIK
  13. {
  14. public partial class UIK050102 : FrmBase
  15. {
  16. public UIK050102()
  17. {
  18. InitializeComponent();
  19. }
  20. public override void ToolBar_Click(object sender, string ToolbarKey)
  21. {
  22. switch (ToolbarKey)
  23. {
  24. case "query"://查询
  25. this.DoQuery();
  26. break;
  27. case "Update"://下发换下轧辊实绩
  28. this.DoUpdate();
  29. break;
  30. }
  31. }
  32. private void DoQuery()
  33. {
  34. try
  35. {
  36. string zgNum = "";
  37. string beginTime = "";
  38. string endTime = "";
  39. CoreClientParam ccp = new CoreClientParam();
  40. CoreClientParam ccp2 = new CoreClientParam();
  41. DataTable dt = new DataTable();
  42. DataTable dt2 = new DataTable();
  43. if (this.ultraCheckEditor1.Checked)
  44. {
  45. this.dataSet1.Clear();
  46. zgNum = this.ultraTextzgNum.Text;
  47. if (zgNum == "")
  48. {
  49. MessageBox.Show("请输入轧辊编号");
  50. return;
  51. }
  52. this.ultraTextzgNum.Clear();
  53. this.ultraCheckEditor1.Checked = false;
  54. ccp.ServerName = "UIK.UIK05.UIK050101";
  55. ccp.MethodName = "DoQuerydetailwithno";
  56. ccp.ServerParams = new object[] { zgNum };
  57. ccp.SourceDataTable = this.dataSet1.Tables[0];
  58. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  59. }
  60. else
  61. {
  62. //flag = true;
  63. zgNum = this.ultraTextzgNum.Text;
  64. beginTime = ultraDateTimeEditor1.Value != null ? ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") : "";
  65. endTime = ultraDateTimeEditor2.Value != null ? ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd") : "";
  66. this.dataSet1.Clear();
  67. this.ultraTextzgNum.Clear();
  68. this.ultraCheckEditor1.Checked = false;
  69. ccp.ServerName = "UIK.UIK05.UIK050101";
  70. //ccp.MethodName = "DoQueryShang";
  71. ccp.MethodName = "DoQuerydetail";
  72. ccp.ServerParams = new object[] { zgNum, beginTime, endTime };
  73. ccp.SourceDataTable = this.dataSet1.Tables[0];
  74. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  75. }
  76. }
  77. catch (Exception Ex)
  78. {
  79. MessageBox.Show(Ex.ToString());
  80. }
  81. }
  82. private void ultraCheckEditor1_CheckedChanged(object sender, EventArgs e)
  83. {
  84. try
  85. {
  86. if (this.ultraCheckEditor1.Checked)
  87. {
  88. this.ultraDateTimeEditor1.Enabled = false;
  89. this.ultraDateTimeEditor2.Enabled = false;
  90. }
  91. if (!this.ultraCheckEditor1.Checked)
  92. {
  93. this.ultraDateTimeEditor1.Enabled = true;
  94. this.ultraDateTimeEditor2.Enabled = true;
  95. }
  96. }
  97. catch (Exception Ex)
  98. {
  99. MessageBox.Show(Ex.ToString());
  100. }
  101. }
  102. private void DoUpdate()
  103. {
  104. try
  105. {
  106. //Infragistics.Win.UltraWinGrid.UltraGridRow ugr = this.ultraGrid1.ActiveRow;
  107. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  108. {
  109. if (ugr.Cells["SELECT_ITME"].Text.ToString() == "True")
  110. {
  111. //if (ugr.Cells["MEG_FLAG"].Value.ToString() == "是")
  112. //{
  113. // MessageBox.Show("该计划已下发!");
  114. // ugr.Cells["SELECT_ITME"].Value = false;
  115. //}
  116. //else
  117. //{
  118. // string spec_No, sand_Id, roll_Type, roll_Area, roll_Id_up, roll_Id_lo, z_time, reason, banci, banbie, s_chang, s_liang, s_shi, x_chang, x_liang, x_shi, create_time;
  119. // string uid = "Core.LZMes.Client.UIK.UIK050030";
  120. string number = ugr.Cells["SPEC_NO"].Value.ToString();
  121. string create_time = ugr.Cells["REG_DTIME"].Value.ToString();
  122. //DataTable dt = new DataTable();
  123. //CoreClientParam ccp = new CoreClientParam();
  124. //ccp.ServerName = "UIK.UIK05.UIK050030";
  125. //ccp.MethodName = "DoSelect";
  126. //ccp.ServerParams = new object[] { create_time };
  127. //ccp.SourceDataTable = dt;
  128. //this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  129. //foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  130. //{
  131. string reason = ugr.Cells["REASON_CODE"].Text.Trim().ToString();
  132. CoreClientParam ccp2 = new CoreClientParam();
  133. ccp2.ServerName = "UIK.UIK05.UIK050030";
  134. ccp2.MethodName = "DoUpdate";
  135. //ccp2.ServerParams = new object[] { spec_No, sand_Id, roll_Type, roll_Area, roll_Id_up, roll_Id_lo, z_time, reason, banci, banbie, s_chang, s_liang, s_shi, x_chang, x_liang, x_shi, create_time, uid };
  136. ccp2.ServerParams = new object[] { reason,number, create_time };
  137. ccp2 = this.ExecuteNonQuery(ccp2, CoreInvokeType.Internal);
  138. if (0 != ccp2.ReturnCode)
  139. {
  140. MessageBox.Show("保存失败!");
  141. }
  142. else
  143. {
  144. MessageBox.Show("保存成功!");
  145. //CoreClientParam ccp3 = new CoreClientParam();
  146. //ccp3.ServerName = "UIK.UIK05.UIK050030";
  147. //ccp3.MethodName = "DoUpdate";
  148. //ccp3.ServerParams = new object[] { create_time };
  149. //ccp3 = this.ExecuteNonQuery(ccp3, CoreInvokeType.Internal);
  150. //if (0 != ccp3.ReturnCode)
  151. //{
  152. // MessageBox.Show("修改失败!");
  153. //}
  154. //else
  155. //{
  156. // MessageBox.Show("修改成功!");
  157. //}
  158. }
  159. // }
  160. //}
  161. }
  162. else
  163. {
  164. continue;
  165. }
  166. }
  167. }
  168. catch (Exception Ex)
  169. {
  170. MessageBox.Show(Ex.ToString());
  171. }
  172. }
  173. private void UIK050102_Load(object sender, EventArgs e)
  174. {
  175. }
  176. private void ultraGrid1_DoubleClick(object sender, EventArgs e)
  177. {
  178. try
  179. {
  180. if (this.ultraGrid1.ActiveCell == null)
  181. return;
  182. //string gridValue = this.ultraGrid1.ActiveCell.Column.Key;//== "ZHIBIAO";
  183. // string s1 = this.ultraComboEditor1.Text;
  184. string s2 = this.ultraGrid1.ActiveRow.Cells["FLAG"].Text;
  185. //if (s1 == "酸轧")
  186. //{
  187. // CUIC030110 CWindow = new CUIC030110();
  188. // CWindow.ob = this.ob;
  189. // CWindow.pLine = this.ultraComboEditor1.Text;
  190. // CWindow.sTime = this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd");
  191. // CWindow.eTime = this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd");
  192. // CWindow.flag = this.ultraGrid1.ActiveRow.Cells["ZHIBIAO"].Text;
  193. // if (s2 == "酸轧非计划总量(t)" || s2 == "酸轧卷一次命中率(%)" || s2 == "酸轧表面缺陷量(t)" || s2 == "1.原料类(t)" || s2 == "待判(未判定)(t)" || s2 == "2.酸轧类(t)" || s2 == "3.钢质类(t)" || s2 == "2.1酸轧辊印(t)" || s2 == "2.2酸轧擦划伤(t)" || s2 == "2.3酸轧振动纹(t)" || s2 == "2.4酸轧其它(t)")
  194. // {
  195. // CWindow.StartPosition = FormStartPosition.CenterScreen;
  196. // if (CWindow.ShowDialog() == DialogResult.OK)
  197. // {
  198. // //null;
  199. // }
  200. // CWindow.Dispose();
  201. // }
  202. //}
  203. }
  204. catch (Exception ex)
  205. {
  206. System.Diagnostics.Debug.WriteLine(ex.ToString());
  207. }
  208. }
  209. }
  210. }