UIN060230.cs 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  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.UIN
  12. {
  13. public partial class UIN060230 : FrmBase
  14. {
  15. public UIN060230()
  16. {
  17. InitializeComponent();
  18. }
  19. /// <summary>
  20. /// ToolBar Event事件
  21. /// </summary>
  22. /// <param name="sender"></param>
  23. /// <param name="ToolbarKey"></param>
  24. #region "ToolBar Event"
  25. public override void ToolBar_Click(object sender, string ToolbarKey)
  26. {
  27. switch (ToolbarKey)
  28. {
  29. case "Query":
  30. this.DoQuery();
  31. break;
  32. case "Save":
  33. this.Save();
  34. this.DoQuery();
  35. break;
  36. case "Add":
  37. this.Add();
  38. break;
  39. case "Cancel":
  40. this.Save();
  41. this.Cancel();
  42. break;
  43. }
  44. }
  45. private void DoQuery()
  46. {
  47. try
  48. {
  49. string coilNO = Convert.ToString(Common.FixDBManager.CheckNullStr(this.CombCAL_COIL_NO.Value));
  50. this.dataSet1.Tables[0].Clear();
  51. CoreClientParam ccp = new CoreClientParam();
  52. ccp.ServerName = "UIB.COM.ComDBQuery";
  53. ccp.MethodName = "doSimpleQuery";
  54. ArrayList paramArray = new ArrayList();
  55. paramArray.Add("UIN060230_REEL_NO.Select");
  56. paramArray.Add(coilNO);
  57. ccp.ServerParams = new object[] { paramArray };
  58. ccp.SourceDataTable = this.dataSet1.Tables[0];
  59. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  60. //System.Diagnostics.Debug.WriteLine(this.dataSet1.Tables[0].ToString());
  61. ccp = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
  62. ArrayList list = (ArrayList)ccp.ReturnObject;
  63. if (list != null && 0 < list.Count)
  64. {
  65. Hashtable ht = (Hashtable)list[0];
  66. DataRow dr = dataSet1.Tables[0].NewRow();
  67. for (int i = 0; i < dataSet1.Tables[0].Columns.Count; i++)
  68. {
  69. object obj = ht[dataSet1.Tables[0].Columns[i].ColumnName];
  70. if (null == obj)
  71. {
  72. continue;
  73. }
  74. if (obj.GetType().Equals(typeof(Hashtable)))
  75. {
  76. dr[i] = ((Hashtable)obj)["value"];
  77. }
  78. else
  79. {
  80. dr[i] = obj;
  81. }
  82. }
  83. dataSet1.Tables[0].Rows.Add(dr);
  84. ultraGrid1.Rows[0].Cells["EXIT_COIL_NO"].Activation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  85. }
  86. else
  87. {
  88. dataTable1.Rows.Add(dataTable1.NewRow());
  89. //ultraGrid1.Rows[0].Cells["CHK"].Activation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
  90. ultraGrid1.Rows[0].Cells["CHK"].Value = "true";
  91. //ultraGrid1.Rows[0].Cells["EXIT_COIL_NO"].Activation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
  92. //ultraGrid1.Rows[0].Cells["EN_COIL_NO"].Activation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
  93. }
  94. }
  95. catch (Exception EX)
  96. {
  97. MessageBox.Show(EX.ToString());
  98. }
  99. }
  100. public void Add()
  101. {
  102. try
  103. {
  104. int rowCnt = this.dataSet1.Tables[0].Rows.Count;
  105. DataRow rowt = this.dataSet1.Tables[0].Rows[rowCnt - 1];
  106. //rowt["COIL_CUT_SEQ"] = "0" + (sq + 1);
  107. DataTable dt = this.dataSet1.Tables[0];
  108. DataRow dr = dt.NewRow();
  109. dr["EN_COIL_NO"] = rowt["EN_COIL_NO"].ToString();
  110. dr["MILL_DTIME"] = "";
  111. dr["EXIT_COIL_NO"] = rowt["EXIT_COIL_NO"].ToString();
  112. dr["ACT_WGT"] = "";
  113. dr["COIL_LEN"] = "";
  114. dr["COIL_WTH"] = "";
  115. dr["COIL_THK"] = "";
  116. dr["COIL_INDIA"] = "";
  117. dr["COIL_OUTDIA"] = "";
  118. dt.Rows.InsertAt(dr, rowCnt);
  119. this.ultraGrid1.Refresh();
  120. System.Diagnostics.Debug.WriteLine(this.dataSet1.Tables[0].ToString());
  121. }
  122. catch (Exception EX)
  123. {
  124. MessageBox.Show(EX.ToString());
  125. }
  126. }
  127. public void Cancel()
  128. {
  129. try
  130. {
  131. int rowCnt = this.dataSet1.Tables[0].Rows.Count;
  132. this.dataSet1.Tables[0].Rows.Add(this.dataSet1.Tables[0].Rows[1]);
  133. }
  134. catch (Exception EX)
  135. {
  136. MessageBox.Show(EX.ToString());
  137. }
  138. }
  139. public void Save()
  140. {
  141. try
  142. {
  143. Hashtable paramHsmp = new Hashtable();
  144. StringBuilder strBf = new StringBuilder();
  145. this.ultraGrid1.UpdateData();
  146. int rowCount = 0;
  147. string coilNo = "";
  148. string enCoilNo = "";
  149. string coilCutSEQ = "";
  150. string actWgt = "";
  151. string coilLen = "";
  152. string coilWth = "";
  153. string coilThk = "";
  154. string coilIndia = "";
  155. string coilOutdia = "";
  156. string ordno = "";
  157. string regID = this.UserInfo.GetUserID();
  158. string regShift = this.UserInfo.GetUserOrder();
  159. string regGroup = this.UserInfo.GetUserGroup();
  160. if (regShift == "" || regGroup == "")
  161. {
  162. System.Windows.Forms.MessageBox.Show("班次、班组不能为空!");
  163. return;
  164. }
  165. string errorMsg = "";
  166. Infragistics.Win.UltraWinGrid.RowsCollection rs = this.ultraGrid1.Rows;
  167. if (rs.Count > 0)
  168. {
  169. for (int i = 0; i < rs.Count; i++)
  170. {
  171. if (rs[i].Cells["CHK"].Text.Trim() == "false")
  172. {
  173. continue;
  174. }
  175. else if (rs[i].Cells["ACT_WGT"].Text.Trim() == null || rs[i].Cells["ACT_WGT"].Text.Trim() == "")
  176. {
  177. continue;
  178. }
  179. else
  180. {
  181. paramHsmp = new Hashtable();
  182. coilNo = rs[i].Cells["EXIT_COIL_NO"].Text.Trim();//+ "|";
  183. //coilCutSEQ = coilCutSEQ + rs[i].Cells["COIL_CUT_SEQ"].Text.Trim() + "|";
  184. enCoilNo = rs[i].Cells["EN_COIL_NO"].Text.Trim(); //+ "|";
  185. actWgt = rs[i].Cells["ACT_WGT"].Text.Trim(); //+ "|";
  186. coilLen = rs[i].Cells["COIL_LEN"].Text.Trim();// + "|";
  187. coilWth = rs[i].Cells["COIL_WTH"].Text.Trim();// + "|";
  188. coilThk = rs[i].Cells["COIL_THK"].Text.Trim(); //+ "|";
  189. coilIndia = rs[i].Cells["COIL_INDIA"].Text.Trim();//+ "|";
  190. coilOutdia = rs[i].Cells["COIL_OUTDIA"].Text.Trim();// + "|";
  191. ordno = rs[i].Cells["ORDNO"].Text.Trim();// + "|";
  192. paramHsmp.Add("i1", enCoilNo);
  193. paramHsmp.Add("i2", coilNo);
  194. paramHsmp.Add("i3", "");
  195. paramHsmp.Add("i4", actWgt);
  196. paramHsmp.Add("i5", coilLen);
  197. paramHsmp.Add("i6", coilWth);
  198. paramHsmp.Add("i7", coilThk);
  199. paramHsmp.Add("i8", coilIndia);
  200. paramHsmp.Add("i9", coilOutdia);
  201. paramHsmp.Add("i10", regID);
  202. paramHsmp.Add("i11", "MAN");
  203. paramHsmp.Add("o12", "");
  204. CoreClientParam ccp = new CoreClientParam();
  205. ccp.ServerName = "UIB.COM.ComDBProcedure";
  206. ccp.MethodName = "doXmlProcedure";
  207. ccp.ServerParams = new Object[] { "UIN060230_PLTCMREEL_RESULT_NEW.call", paramHsmp };
  208. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  209. //提示
  210. ArrayList all = ccp.ReturnObject as ArrayList;
  211. if (all[0].ToString() != "YY")//确认是否存在问题
  212. {
  213. MessageBox.Show(all[0].ToString(), "提示");
  214. }
  215. else
  216. {
  217. // MessageBox.Show(all[1].ToString(), "提示");
  218. }
  219. }
  220. rowCount += 1;
  221. }
  222. //操作人
  223. //paramHsmp.Add("i1", regID);
  224. //paramHsmp.Add("i2", regShift);
  225. //paramHsmp.Add("i3", regGroup);
  226. //paramHsmp.Add("i4", rowCount);
  227. //paramHsmp.Add("i5", enCoilNo);
  228. //paramHsmp.Add("i6", coilNo);
  229. //paramHsmp.Add("i7", coilCutSEQ);
  230. //paramHsmp.Add("i8", ordno);
  231. //paramHsmp.Add("i9", actWgt);
  232. //paramHsmp.Add("i10", coilLen);
  233. //paramHsmp.Add("i11", coilWth);
  234. //paramHsmp.Add("i12", coilThk);
  235. //paramHsmp.Add("i13", coilIndia);
  236. //paramHsmp.Add("i14", coilOutdia);
  237. //paramHsmp.Add("o15", errorMsg);
  238. //paramHsmp.Add("i1", coilNo);
  239. //paramHsmp.Add("i2", enCoilNo);
  240. //paramHsmp.Add("i3", "");
  241. //paramHsmp.Add("i4", actWgt);
  242. //paramHsmp.Add("i5", coilLen);
  243. //paramHsmp.Add("i6", coilWth);
  244. //paramHsmp.Add("i7", coilThk);
  245. //paramHsmp.Add("i8", coilIndia);
  246. //paramHsmp.Add("i9", coilOutdia);
  247. //paramHsmp.Add("i10", regID);
  248. //paramHsmp.Add("i11", "MAN");
  249. //paramHsmp.Add("i12", "");
  250. //CoreClientParam ccp = new CoreClientParam();
  251. //ccp.ServerName = "UIB.COM.ComDBProcedure";
  252. //ccp.MethodName = "doXmlProcedure";
  253. //ccp.ServerParams = new Object[] { "UIN060210_REEL_RESULT_NEW.call", paramHsmp };
  254. //this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  255. ////提示
  256. //ArrayList all = ccp.ReturnObject as ArrayList;
  257. //if (all[0].ToString() != "YY")//确认是否存在问题
  258. //{
  259. // MessageBox.Show(all[0].ToString(), "提示");
  260. //}
  261. }
  262. }
  263. catch (Exception EX)
  264. {
  265. MessageBox.Show(EX.ToString());
  266. }
  267. }
  268. #endregion
  269. #region "Init"
  270. public void init()
  271. {
  272. DataTable dt = new DataTable();
  273. CoreClientParam ccp = new CoreClientParam();
  274. ccp.ServerName = "UIB.COM.ComDBQuery";
  275. ccp.MethodName = "doSimpleQuery";
  276. ArrayList paramArray = new ArrayList();
  277. paramArray.Add("UIECOMM00_SELECT.RECOIL_NO");
  278. ccp.ServerParams = new object[] { paramArray };
  279. ccp.SourceDataTable = dt;
  280. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  281. Core.LZMes.Client.UIE.UIE041.UIEBase.Init_ComboControl(this.CombCAL_COIL_NO, ref dt, "REEL_NO");
  282. }
  283. private void UIN060210_Load_1(object sender, EventArgs e)
  284. {
  285. init();
  286. }
  287. #endregion
  288. private void CombCAL_COIL_NO_ValueChanged(object sender, EventArgs e)
  289. {
  290. this.DoQuery();
  291. }
  292. private void button1_Click(object sender, EventArgs e)
  293. {
  294. try
  295. {
  296. Hashtable ht = new Hashtable();
  297. ht.Add("i1", this.CombCAL_COIL_NO.Text.Trim());
  298. CoreClientParam ccp = new CoreClientParam();
  299. ccp.ServerName = "UIB.COM.ComDBProcedure";
  300. ccp.MethodName = "doXmlProcedure";
  301. ccp.ServerParams = new Object[] { "UIN060110_CAL_RESULT_NEW_TEMP.call", ht };
  302. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  303. }
  304. catch (Exception ex)
  305. {
  306. MessageBox.Show("系统发生未知异常", "提示");
  307. }
  308. }
  309. private void UIN060230_Load(object sender, EventArgs e)
  310. {
  311. init();
  312. }
  313. }
  314. }