581f7e0c75f1c544ca751e1cfb0e2c3d585473c2.svn-base 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408
  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.UIB
  13. {
  14. public partial class UIB030340 : FrmBase
  15. {
  16. public UIB030340()
  17. {
  18. InitializeComponent();
  19. }
  20. private void UIB030340_Load(object sender, EventArgs e)
  21. {
  22. this.ultraComboEditor1.Text = "";
  23. try
  24. {
  25. ArrayList alt = new ArrayList();
  26. alt.Add("UIB030340_01.INITSELECT");
  27. this.dataSet3.Tables[1].Clear();
  28. CoreClientParam ccp = new CoreClientParam();
  29. ccp.ServerName = "UIB.COM.ComDBQuery";
  30. ccp.MethodName = "doSimpleQuery";
  31. ccp.ServerParams = new object[] { alt };
  32. ccp.SourceDataTable = this.dataSet3.Tables[1];
  33. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  34. }
  35. catch (Exception ex)
  36. {
  37. System.Diagnostics.Debug.WriteLine(ex.ToString());
  38. }
  39. }
  40. public override void ToolBar_Click(object sender, string ToolbarKey)
  41. {
  42. switch (ToolbarKey)
  43. {
  44. case "Query":
  45. this.DoQuery();
  46. break;
  47. case "Save":
  48. this.DoSave();
  49. break;
  50. case "Delete":
  51. this.DoDelete();
  52. break;
  53. }
  54. }
  55. public void DoQuery()
  56. {
  57. try
  58. {
  59. ArrayList al = new ArrayList();
  60. DataTable dt = null;
  61. if (this.ultraTabControl1.Tabs[0].Selected)//订单信息管理
  62. {
  63. if (this.textBoxORD.Text.Trim() == "" && this.textBoxSTLGRD.Text == "")
  64. {
  65. MessageBox.Show("请输入查询条件!", "提示");
  66. return;
  67. }
  68. al.Add("UIB030340_03.SELECT");
  69. al.Add(this.textBoxORD.Text.Trim());
  70. al.Add(this.textBoxSTLGRD.Text.Trim());
  71. al.Add(this.ultraDateTimeEditor1.DateTime.ToString("yyyy"));
  72. //al.Add(this.textBoxORD.Text.Trim());
  73. //al.Add(this.textBoxSTLGRD.Text.Trim());
  74. //al.Add(this.ultraDateTimeEditor1.DateTime.ToString("yyyy"));
  75. this.dataSet3.Tables[0].Clear();
  76. dt = this.dataSet3.Tables[0];
  77. }
  78. else if (this.ultraTabControl1.Tabs[1].Selected)//图片、模板号管理
  79. {
  80. al.Add("UIB030340_02.SELECT");
  81. this.dataSet2.Tables[0].Clear();
  82. dt = this.dataSet2.Tables[0];
  83. }
  84. else if (this.ultraTabControl1.Tabs[2].Selected)//编码管理
  85. {
  86. al.Add("UIB030340_01.SELECT");
  87. this.dataSet1.Tables[0].Clear();
  88. dt = this.dataSet1.Tables[0];
  89. }
  90. else if (this.ultraTabControl1.Tabs[3].Selected)//备注管理
  91. {
  92. al.Add("UIB030340_04.SELECT");
  93. this.dataSet4.Tables[0].Clear();
  94. dt = this.dataSet4.Tables[0];
  95. }
  96. else
  97. {
  98. return;
  99. }
  100. // this.dataSet1.Tables[0].Clear();
  101. CoreClientParam ccp = new CoreClientParam();
  102. ccp.ServerName = "UIB.COM.ComDBQuery";
  103. ccp.MethodName = "doSimpleQuery";
  104. ccp.SourceDataTable = dt;
  105. ccp.ServerParams = new object[] { al };
  106. // ccp.SourceDataTable = this.dataSet1.Tables[0];
  107. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  108. }
  109. catch (Exception ex)
  110. {
  111. System.Diagnostics.Debug.Write(ex.ToString());
  112. }
  113. }
  114. public void DoSave()
  115. {
  116. try
  117. {
  118. if (MessageBox.Show("确定保存?", "提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
  119. return;
  120. ArrayList al = new ArrayList();
  121. if (this.ultraTabControl1.Tabs[0].Selected)
  122. {
  123. foreach (UltraGridRow ugr in this.ultraGrid3.Rows)
  124. {
  125. if (Convert.ToBoolean(ugr.Cells["CHK"].Text))
  126. {
  127. CoreClientParam ccp = new CoreClientParam();
  128. Hashtable ht = new Hashtable();
  129. ht.Add("i1", ugr.Cells["ORD_NO"].Text);
  130. ht.Add("i2", ugr.Cells["ORD_SEQ"].Text);
  131. ht.Add("i3", this.textBoxTNO.Text);
  132. ht.Add("i4", this.textBoxRMK.Text);
  133. if (this.ultraComboEditor1.Text == "")
  134. {
  135. ht.Add("i5", "");
  136. }
  137. else
  138. {
  139. ht.Add("i5", this.ultraComboEditor1.Value.ToString());
  140. }
  141. ht.Add("i6", this.UserInfo.GetUserName());
  142. ht.Add("o7", "");
  143. ccp.ServerName = "UIB.COM.ComDBProcedure";
  144. ccp.MethodName = "doXmlProcedure";
  145. ccp.ServerParams = new object[] { "UIB030340_01.CALL", ht };
  146. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  147. //if (ugr.Cells["ORD_TP"].Text == "热冷轧")//热轧及冷轧
  148. //{
  149. // al = new ArrayList();
  150. // al.Add("UIB030340_03.UPDATE");
  151. // al.Add(this.textBoxRMK.Text);
  152. // al.Add(this.textBoxTNO.Text);
  153. // al.Add(ugr.Cells["ORD_NO"].Text);
  154. // al.Add(ugr.Cells["ORD_SEQ"].Text);
  155. //}
  156. //else if (ugr.Cells["ORD_TP"].Text == "板加")//板加
  157. //{
  158. // al = new ArrayList();
  159. // al.Add("UIB030340_04.UPDATE");
  160. // al.Add(this.textBoxRMK.Text);
  161. // al.Add(this.textBoxTNO.Text);
  162. // al.Add(ugr.Cells["ORD_NO"].Text);
  163. // al.Add(ugr.Cells["ORD_SEQ"].Text);
  164. //}
  165. //CoreClientParam ccpp = new CoreClientParam();
  166. //ccpp.ServerName = "UIB.COM.ComDBSave";
  167. //ccpp.MethodName = "doXmlSave";
  168. //ccpp.ServerParams = new object[] { al };
  169. //this.ExecuteNonQuery(ccpp, CoreInvokeType.Internal);
  170. ////品质设计结果修改
  171. //al = new ArrayList();
  172. //al.Add("UIB030340_05.UPDATE");
  173. //al.Add(this.textBoxTNO.Text);
  174. //al.Add(ugr.Cells["ORD_NO"].Text);
  175. //al.Add(ugr.Cells["ORD_SEQ"].Text);
  176. //ccpp = new CoreClientParam();
  177. //ccpp.ServerName = "UIB.COM.ComDBSave";
  178. //ccpp.MethodName = "doXmlSave";
  179. //ccpp.ServerParams = new object[] { al };
  180. //this.ExecuteNonQuery(ccpp, CoreInvokeType.Internal);
  181. }
  182. }
  183. return;
  184. }
  185. else if (this.ultraTabControl1.Tabs[1].Selected)
  186. {
  187. if (this.ultraGrid2.ActiveRow.Cells["EXIT_YN"].Text == "N")
  188. {
  189. al = new ArrayList();
  190. al.Add("UIB030340_01.INSERT");
  191. al.Add(this.ultraGrid2.ActiveRow.Cells["PRDNM_CD"].Text);
  192. al.Add(this.ultraGrid2.ActiveRow.Cells["SPEC_ABBSYM"].Text);
  193. al.Add(this.ultraGrid2.ActiveRow.Cells["SPEC_STL_GRD"].Text);
  194. al.Add(this.ultraGrid2.ActiveRow.Cells["ORD_USE_TP_HIDEN"].Text);
  195. al.Add(this.ultraGrid2.ActiveRow.Cells["THK_MIN"].Text);
  196. al.Add(this.ultraGrid2.ActiveRow.Cells["THK_MAX"].Text);
  197. al.Add(this.ultraGrid2.ActiveRow.Cells["WTH_MIN"].Text);
  198. al.Add(this.ultraGrid2.ActiveRow.Cells["WTH_MAX"].Text);
  199. al.Add(this.textBoxPic1.Text);
  200. al.Add(this.textBoxPic2.Text);
  201. al.Add(this.textBoxPic3.Text);
  202. al.Add(this.textBoxtemplno.Text);
  203. al.Add(this.textBoxLICENSE.Text);
  204. }
  205. else
  206. {
  207. if ((this.textBoxPic3.Text.Length > 0) && (!this.textBoxPic3.Text.Equals("qr.png")))
  208. {
  209. MessageBox.Show("二维码图片名称输入有误", "提示");
  210. return;
  211. }
  212. CoreClientParam ccp = new CoreClientParam();
  213. Hashtable ht = new Hashtable();
  214. ht.Add("i1", this.textBoxPic1.Text);
  215. ht.Add("i2", this.textBoxPic2.Text);
  216. ht.Add("i3", this.textBoxPic3.Text);
  217. ht.Add("i4", this.textBoxtemplno.Text);
  218. ht.Add("i5", this.textBoxLICENSE.Text);
  219. ht.Add("i6", this.ultraGrid2.ActiveRow.Cells["PRDNM_CD"].Text);
  220. ht.Add("i7", this.ultraGrid2.ActiveRow.Cells["SPEC_ABBSYM"].Text);
  221. ht.Add("i8", this.ultraGrid2.ActiveRow.Cells["SPEC_STL_GRD"].Text);
  222. ht.Add("i9", this.ultraGrid2.ActiveRow.Cells["ORD_USE_TP_HIDEN"].Text);
  223. ht.Add("o10", "");
  224. ccp.ServerName = "UIB.COM.ComDBProcedure";
  225. ccp.MethodName = "doXmlProcedure";
  226. ccp.ServerParams = new object[] { "UIB030340_02.CALL", ht };
  227. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  228. return;
  229. }
  230. }
  231. else if (this.ultraTabControl1.Tabs[2].Selected)//编码管理
  232. {
  233. al = new ArrayList();
  234. al.Add("UIB030340_01.UPDATE");
  235. al.Add(this.textSEQ.Text);
  236. al.Add(this.textDIR.Text);
  237. al.Add(this.textSIZE.Text);
  238. al.Add(this.textTEMP.Text);
  239. al.Add(this.textBigC.Text);
  240. al.Add(this.textBigE.Text);
  241. al.Add(this.textSmallC.Text);
  242. al.Add(this.textSmallE.Text);
  243. al.Add(this.textEXT.Text);
  244. al.Add(this.UserInfo.GetUserID());//操作人
  245. al.Add(this.textCD.Text);
  246. }
  247. else if (this.ultraTabControl1.Tabs[3].Selected)
  248. {
  249. ArrayList list = null;
  250. foreach (UltraGridRow ugr in this.ultraGrid4.Rows)
  251. {
  252. if (Convert.ToBoolean(ugr.Cells["CHK"].Text))
  253. {
  254. list = new ArrayList();
  255. if (ugr.Cells["MS_SEQ_1"].Text == "")//增加
  256. {
  257. list.Add("UIB030340_02.INSERT");
  258. list.Add(ugr.Cells["MS_SEQ"].Text);
  259. list.Add(ugr.Cells["MS_DESC"].Text);
  260. list.Add(ugr.Cells["DIS_SEQ"].Text);
  261. list.Add(ugr.Cells["FIXED_PRO"].Text);
  262. list.Add(this.UserInfo.GetUserName());
  263. }
  264. else//修改
  265. {
  266. list.Add("UIB030340_03.UPDATE");
  267. list.Add(ugr.Cells["MS_SEQ"].Text);
  268. list.Add(ugr.Cells["MS_DESC"].Text);
  269. list.Add(ugr.Cells["DIS_SEQ"].Text);
  270. list.Add(ugr.Cells["FIXED_PRO"].Text);
  271. list.Add(this.UserInfo.GetUserName());
  272. list.Add(ugr.Cells["MS_SEQ_1"].Text);
  273. }
  274. al.Add(list);
  275. }//if end
  276. }//for end
  277. }
  278. if (al.Count == 0) return;
  279. CoreClientParam cp = new CoreClientParam();
  280. cp.ServerName = "UIB.COM.ComDBSave";
  281. cp.MethodName = "doXmlSave";
  282. cp.ServerParams = new object[] { al };
  283. this.ExecuteNonQuery(cp, CoreInvokeType.Internal);
  284. this.DoQuery();
  285. }
  286. catch (Exception ex)
  287. {
  288. System.Diagnostics.Debug.Write(ex.ToString());
  289. }
  290. }
  291. public void DoDelete()
  292. {
  293. try
  294. {
  295. if (MessageBox.Show("确定删除?", "提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
  296. return;
  297. ArrayList al = new ArrayList();
  298. ArrayList list = null;
  299. foreach (UltraGridRow ugr in this.ultraGrid4.Rows)
  300. {
  301. if (Convert.ToBoolean(ugr.Cells["CHK"].Text))
  302. {
  303. list = new ArrayList();
  304. list.Add("UIB030340_01.DELETE");
  305. list.Add(ugr.Cells["MS_SEQ"].Text);
  306. al.Add(list);
  307. }
  308. }
  309. if (al.Count == 0) return;
  310. CoreClientParam cp = new CoreClientParam();
  311. cp.ServerName = "UIB.COM.ComDBSave";
  312. cp.MethodName = "doXmlSave";
  313. cp.ServerParams = new object[] { al };
  314. this.ExecuteNonQuery(cp, CoreInvokeType.Internal);
  315. this.DoQuery();
  316. }
  317. catch (Exception ex)
  318. {
  319. }
  320. }
  321. private void ultraExpandableGroupBoxPanel2_Paint(object sender, PaintEventArgs e)
  322. {
  323. }
  324. private void ultraGrid2_AfterRowActivate(object sender, EventArgs e)
  325. {
  326. try
  327. {
  328. this.textBoxPic1.Text = this.ultraGrid2.ActiveRow.Cells["PIC1"].Text;
  329. this.textBoxPic2.Text = this.ultraGrid2.ActiveRow.Cells["PIC2"].Text;
  330. this.textBoxPic3.Text = this.ultraGrid2.ActiveRow.Cells["PIC3"].Text;
  331. this.textBoxtemplno.Text = this.ultraGrid2.ActiveRow.Cells["TMPL_NO"].Text;
  332. this.textBoxLICENSE.Text = this.ultraGrid2.ActiveRow.Cells["LICENSE_NO"].Text;
  333. }
  334. catch (Exception ex)
  335. {
  336. System.Diagnostics.Debug.Write(ex.ToString());
  337. }
  338. }
  339. private void textBox3_TextChanged(object sender, EventArgs e)
  340. {
  341. }
  342. private void ultraGrid3_AfterRowActivate(object sender, EventArgs e)
  343. {
  344. this.textBoxRMK.Text = this.ultraGrid3.ActiveRow.Cells["CRET_NO_RMK"].Text;
  345. this.textBoxTNO.Text = this.ultraGrid3.ActiveRow.Cells["TMPL_NO"].Text;
  346. }
  347. private void ultraGrid1_AfterRowActivate_1(object sender, EventArgs e)
  348. {
  349. if (this.ultraGrid1.ActiveRow == null) return;
  350. this.textCD.Text = this.ultraGrid1.ActiveRow.Cells["QLTY_CD"].Text;
  351. this.textSEQ.Text = this.ultraGrid1.ActiveRow.Cells["DISPLAY_SEQ"].Text;
  352. this.textDIR.Text = this.ultraGrid1.ActiveRow.Cells["MS_QLTY_DIR"].Text;
  353. this.textSIZE.Text = this.ultraGrid1.ActiveRow.Cells["MS_QLTY_SIZ"].Text;
  354. this.textTEMP.Text = this.ultraGrid1.ActiveRow.Cells["MS_QLTY_TEM"].Text;
  355. this.textBigC.Text = this.ultraGrid1.ActiveRow.Cells["MS_BIG_CFNM"].Text;
  356. this.textBigE.Text = this.ultraGrid1.ActiveRow.Cells["MS_BIG_EFNM"].Text;
  357. this.textSmallC.Text = this.ultraGrid1.ActiveRow.Cells["MS_SMALL_CFNM"].Text;
  358. this.textSmallE.Text = this.ultraGrid1.ActiveRow.Cells["MS_SMALL_EFNM"].Text;
  359. this.textEXT.Text = this.ultraGrid1.ActiveRow.Cells["MS_EXT_CODE"].Text;
  360. }
  361. private void checkBox1_Click(object sender, EventArgs e)
  362. {
  363. try
  364. {
  365. foreach (UltraGridRow ugr in this.ultraGrid3.Rows)
  366. {
  367. ugr.Cells["CHK"].Value = this.checkBox1.Checked;
  368. ugr.Update();
  369. }
  370. }
  371. catch (Exception ex)
  372. {
  373. System.Diagnostics.Debug.WriteLine(ex.ToString());
  374. }
  375. }
  376. }
  377. }