f834e4a1f2872df68c429d25220b04720ea48991.svn-base 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  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 Infragistics.Win.UltraWinGrid;
  8. using System.Text;
  9. using System.Windows.Forms;
  10. using CoreFS.CA06;
  11. using System.Collections;
  12. namespace Core.LZMes.Client.UIB
  13. {
  14. public partial class UIB030240 : FrmBase
  15. {
  16. public UIB030240()
  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 "Send":
  28. this.DoSend();
  29. break;
  30. case "Save":
  31. this.DoSave();
  32. break;
  33. case "Cancer":
  34. this.DoCancer();
  35. break;
  36. }
  37. }
  38. public void DoQuery()
  39. {
  40. try
  41. {
  42. ArrayList al = new ArrayList();
  43. if (this.comboBox3.Text == "连退")
  44. {
  45. al.Add("UIB030230_YC_02.SELECT");
  46. }
  47. else
  48. {
  49. al.Add("UIB030240_YC_02.SELECT");
  50. }
  51. //al.Add("UIB030230_YC_02.SELECT");
  52. al.Add("");
  53. this.dataSet1.Tables[0].Clear();
  54. CoreClientParam ccp = new CoreClientParam();
  55. ccp.ServerName = "UIB.COM.ComDBQuery";
  56. ccp.MethodName = "doSimpleQuery";
  57. ccp.ServerParams = new object[] { al };
  58. ccp.SourceDataTable = this.dataSet1.Tables[0];
  59. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  60. }
  61. catch (Exception ex)
  62. {
  63. }
  64. }
  65. public void DoSend()
  66. {
  67. try
  68. {
  69. if (MessageBox.Show("确定发送指示到检化验中心?", "提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
  70. return;
  71. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  72. {
  73. if (ugr.Cells["CHK"].Text.ToLower() == "true")
  74. {
  75. //发送
  76. CoreClientParam ccp = new CoreClientParam();
  77. Hashtable ht = new Hashtable();
  78. ht.Add("i1", ugr.Cells["SMP_NO"].Text);
  79. ht.Add("o2", "");
  80. ccp.ServerName = "UIB.COM.ComDBProcedure";
  81. ccp.MethodName = "doXmlProcedure";
  82. if (this.comboBox3.Text == "连退")
  83. {
  84. ccp.ServerParams = new object[] { "UIB030230_YCCD_FS.CALL", ht };
  85. }
  86. else
  87. {
  88. ccp.ServerParams = new object[] { "UIB030240_YCCD_FS.CALL", ht };
  89. }
  90. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  91. System.Collections.ArrayList err = ccp.ReturnObject as System.Collections.ArrayList;
  92. if (err != null && err.Count > 0 && err[0] != null)
  93. {
  94. string retInfo = err[0].ToString().Trim();
  95. if (!"YY".Equals(retInfo))
  96. {
  97. System.Windows.Forms.MessageBox.Show(retInfo);
  98. }
  99. }
  100. }
  101. }
  102. this.DoQuery();
  103. }
  104. catch (Exception ex)
  105. {
  106. }
  107. }
  108. public void DoSave()
  109. {
  110. try
  111. {
  112. if (MessageBox.Show("确定做材质判定?", "提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
  113. return;
  114. //判定
  115. CoreClientParam ccp = new CoreClientParam();
  116. Hashtable ht = new Hashtable();
  117. //ht.Add("i1", ugr.Cells["OLD_SAMPL_NO"].Text);
  118. ht.Add("i1", this.UserInfo.GetUserID());
  119. ht.Add("o2", "");
  120. ccp.ServerName = "UIB.COM.ComDBProcedure";
  121. ccp.MethodName = "doXmlProcedure";
  122. if (this.comboBox3.Text == "连退")
  123. {
  124. ccp.ServerParams = new object[] { "UIB030230_CDGP_DCS.CALL", ht };
  125. }
  126. else
  127. {
  128. ccp.ServerParams = new object[] { "UIB030240_CDGP_DCS.CALL", ht };
  129. }
  130. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  131. System.Collections.ArrayList err = ccp.ReturnObject as System.Collections.ArrayList;
  132. if (err != null && err.Count > 0 && err[0] != null)
  133. {
  134. string retInfo = err[0].ToString().Trim();
  135. if (!"YY".Equals(retInfo))
  136. {
  137. System.Windows.Forms.MessageBox.Show(retInfo);
  138. return;
  139. }
  140. }
  141. this.DoQuery();
  142. }
  143. catch (Exception ex)
  144. {
  145. }
  146. }
  147. public void DoCancer()
  148. {
  149. try
  150. {
  151. if (MessageBox.Show("确定要取消钢卷改判吗?", "提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
  152. return;
  153. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  154. {
  155. if (ugr.Cells["CHK"].Text.ToLower() == "true")
  156. {
  157. if (ugr.Cells["SMP_STATS"].Text == "1")
  158. {
  159. CoreClientParam ccp = new CoreClientParam();
  160. Hashtable ht = new Hashtable();
  161. ht.Add("i1", ugr.Cells["OLD_SAMPL_NO"].Value.ToString());
  162. ht.Add("i2", ugr.Cells["SMP_NO"].Value.ToString());
  163. ht.Add("i3", ugr.Cells["ORG_SMP_NO"].Value.ToString());
  164. ht.Add("i4", ugr.Cells["ORG_SMP_CUT_LOC"].Value.ToString());
  165. ht.Add("i5", ugr.Cells["OLD_PRDNM_CD"].Value.ToString());
  166. ht.Add("i6", ugr.Cells["OLD_SPEC_ABBSYM"].Value.ToString());
  167. ht.Add("i7", ugr.Cells["OLD_SPEC_STL_GRD"].Value.ToString());
  168. ht.Add("i8", ugr.Cells["OLD_ORD_USE_CD"].Value.ToString());
  169. ht.Add("i9", this.UserInfo.GetUserID());
  170. ht.Add("o10", "");
  171. ccp.ServerName = "UIB.COM.ComDBProcedure";
  172. ccp.MethodName = "doXmlProcedure";
  173. if (this.comboBox3.Text == "连退")
  174. {
  175. ccp.ServerParams = new object[] { "UIB030230_YCCD_CANCER.CALL", ht };
  176. }
  177. else
  178. {
  179. ccp.ServerParams = new object[] { "UIB030240_YCCD_CANCER.CALL", ht };
  180. }
  181. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  182. System.Collections.ArrayList err = ccp.ReturnObject as System.Collections.ArrayList;
  183. if (err != null && err.Count > 0 && err[0] != null)
  184. {
  185. string retInfo = err[0].ToString().Trim();
  186. if (!"YY".Equals(retInfo))
  187. {
  188. System.Windows.Forms.MessageBox.Show(retInfo);
  189. }
  190. }
  191. }
  192. else
  193. {
  194. MessageBox.Show("请选择改判状态为1的钢卷!", "提示");
  195. break;
  196. }
  197. }
  198. }
  199. this.DoQuery();
  200. }
  201. catch (Exception ex)
  202. {
  203. }
  204. }
  205. private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
  206. {
  207. try
  208. {
  209. //钢卷原始检验信息
  210. if (this.ultraGrid1.ActiveRow == null) return;
  211. ArrayList al = new ArrayList();
  212. al.Add("UIB030230_04.SELECT");
  213. al.Add(this.ultraGrid1.ActiveRow.Cells["ORG_SMP_NO"].Text.ToString());
  214. al.Add(this.ultraGrid1.ActiveRow.Cells["ORG_SMP_CUT_LOC"].Text.ToString());
  215. this.dataSet2.Tables[0].Clear();
  216. CoreClientParam ccp = new CoreClientParam();
  217. ccp.ServerName = "UIB.COM.ComDBQuery";
  218. ccp.MethodName = "doSimpleQuery";
  219. ccp.ServerParams = new object[] { al };
  220. ccp.SourceDataTable = this.dataSet2.Tables[0];
  221. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  222. this.grid3Data();
  223. }
  224. catch (Exception ex)
  225. {
  226. }
  227. }
  228. public void grid3Data()
  229. {
  230. //钢卷改判后的检验信息
  231. ArrayList al1 = new ArrayList();
  232. al1.Add("UIB030230_04.SELECT");
  233. al1.Add(this.ultraGrid1.ActiveRow.Cells["SMP_NO"].Text.ToString());
  234. al1.Add(this.ultraGrid1.ActiveRow.Cells["SMP_CUT_LOC"].Text.ToString());
  235. this.dataSet3.Tables[0].Clear();
  236. CoreClientParam ccp1 = new CoreClientParam();
  237. ccp1.ServerName = "UIB.COM.ComDBQuery";
  238. ccp1.MethodName = "doSimpleQuery";
  239. ccp1.ServerParams = new object[] { al1 };
  240. ccp1.SourceDataTable = this.dataSet3.Tables[0];
  241. this.ExecuteQueryToDataTable(ccp1, CoreInvokeType.Internal);
  242. }
  243. private void ultraGrid3_ClickCell_1(object sender, ClickCellEventArgs e)
  244. {
  245. try
  246. {
  247. if (this.ultraGrid1.ActiveRow == null || this.ultraGrid3.ActiveRow == null) return;
  248. string clickColumnID = this.ultraGrid3.ActiveCell.Column.Key;
  249. if (clickColumnID.Equals("XMTH"))
  250. {
  251. //弹出界面选择要替换的项目值
  252. CUIB030240 CWindow = new CUIB030240();
  253. CWindow.ob = this.ob;
  254. CWindow.Text = "可供替换的检验项目值(被替换项目:" + this.ultraGrid3.ActiveRow.Cells["QLTY_CD_CFNM"].Text + ")";
  255. CWindow.ORG_SMP_NO = this.ultraGrid1.ActiveRow.Cells["ORG_SMP_NO"].Text.ToString();
  256. CWindow.ORG_SMP_NO_LOT = this.ultraGrid1.ActiveRow.Cells["ORG_SMP_CUT_LOC"].Text.ToString();
  257. CWindow.QLTY_CD_GP = this.ultraGrid3.ActiveRow.Cells["QLTY_CD"].Text.ToString();
  258. CWindow.QLTY_CD_GPN = this.ultraGrid3.ActiveRow.Cells["QLTY_CD_CFNM"].Text.ToString();
  259. //CWindow.frmdoquery += new CUIB030110.ddd(CWindow_frmdoquery);//委托
  260. if (CWindow.ShowDialog() == DialogResult.OK)
  261. {
  262. string qlty_cd_val = CWindow.al.GetByIndex(0).ToString();
  263. string qlty_cd_0 = CWindow.al.GetKey(0).ToString();
  264. //发送
  265. CoreClientParam ccp = new CoreClientParam();
  266. Hashtable ht = new Hashtable();
  267. ht.Add("i1", this.ultraGrid1.ActiveRow.Cells["OLD_SAMPL_NO"].Text.ToString());
  268. ht.Add("i2", this.ultraGrid3.ActiveRow.Cells["QLTY_CD"].Text); //原来的材质
  269. ht.Add("i3", qlty_cd_0); //替换的材质项目
  270. ht.Add("i4", qlty_cd_val); //替换的材质项目值
  271. ht.Add("o5", "");
  272. ccp.ServerName = "UIB.COM.ComDBProcedure";
  273. ccp.MethodName = "doXmlProcedure";
  274. if (this.comboBox3.Text == "连退")
  275. {
  276. ccp.ServerParams = new object[] { "UIB030230_YCCD_XMTH.CALL", ht };
  277. }
  278. else
  279. {
  280. ccp.ServerParams = new object[] { "UIB030240_YCCD_XMTH.CALL", ht };
  281. }
  282. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  283. System.Collections.ArrayList err = ccp.ReturnObject as System.Collections.ArrayList;
  284. if (err != null && err.Count > 0 && err[0] != null)
  285. {
  286. string retInfo = err[0].ToString().Trim();
  287. if ("YY".Equals(retInfo))
  288. {
  289. this.grid3Data();
  290. }
  291. else if ("OK".Equals(retInfo))
  292. {
  293. this.DoQuery();
  294. } else
  295. {
  296. System.Windows.Forms.MessageBox.Show(retInfo);
  297. this.DoQuery();
  298. }
  299. }
  300. }
  301. CWindow.Dispose();
  302. }
  303. }
  304. catch (Exception ex)
  305. {
  306. System.Diagnostics.Debug.WriteLine(ex.ToString());
  307. }
  308. }
  309. private void UIB030240_Load(object sender, EventArgs e)
  310. {
  311. this.comboBox3.SelectedIndex = 0;
  312. }
  313. }
  314. }