QCM0401.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507
  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. using Infragistics.Win;
  13. using Newtonsoft.Json;
  14. namespace Core.LZMes.Client.QCM
  15. {
  16. public partial class QCM0401 : FrmBase
  17. {
  18. #region 窗体初始化
  19. public QCM0401()
  20. {
  21. InitializeComponent();
  22. }
  23. private void QCM0401_Load(object sender, EventArgs e)
  24. {
  25. ValueList v2 = new ValueList();
  26. v2.ValueListItems.Add("00", "待提报");
  27. v2.ValueListItems.Add("10", "待确认");
  28. v2.ValueListItems.Add("20", "审批中");
  29. v2.ValueListItems.Add("30", "审批拒绝");
  30. v2.ValueListItems.Add("40", "审批退回");
  31. v2.ValueListItems.Add("50", "审批通过");
  32. ultraGrid2.DisplayLayout.Bands[0].Columns["CERT_STATUS"].ValueList = v2.Clone();
  33. }
  34. #endregion
  35. #region 申报记录
  36. #region 查询申报记录
  37. private void button2_Click(object sender, EventArgs e)
  38. {
  39. Query();
  40. }
  41. private void Query()
  42. {
  43. try
  44. {
  45. String STARTTIME = this.dateTimePicker4.Value.ToString("yyyy-MM-dd");
  46. String ENDTIME = this.dateTimePicker3.Value.ToString("yyyy-MM-dd");
  47. String CERT_INST_NAME = this.textBox6.Text.Trim();//认证机构
  48. String BATCH_NO = this.textBox5.Text.Trim();//轧批号
  49. String shordh = this.textBox4.Text.Trim();//销售订单号
  50. this.dataSet2.Clear();
  51. CoreClientParam ccp = new CoreClientParam();
  52. ccp.ServerName = "QCM.JHY01.JHY0103.QuerryThirdInfo";
  53. ccp.MethodName = "QueryMainInfo";
  54. ccp.ServerParams = new object[] { STARTTIME, ENDTIME, CERT_INST_NAME, BATCH_NO, shordh };
  55. ccp.SourceDataTable = this.dataSet2.Tables[0];
  56. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  57. DataTable table = this.dataTable2;
  58. if (table == null)
  59. {
  60. this.dataSet3.Clear();
  61. }
  62. }
  63. catch (Exception ex)
  64. {
  65. System.Diagnostics.Debug.WriteLine(ex.ToString());
  66. MessageBox.Show("系统出错,请联系管理人员", "警告");
  67. }
  68. }
  69. #endregion
  70. #region 申报记录事件
  71. private void ultraGrid2_AfterRowActivate(object sender, EventArgs e)
  72. {
  73. ultraGrid2AfterRowActivate();
  74. }
  75. public void ultraGrid2AfterRowActivate()
  76. {
  77. try
  78. {
  79. UltraGridRow row = ultraGrid2.ActiveRow;
  80. if (row == null)
  81. {
  82. this.dataSet3.Clear();
  83. }
  84. String CERT_NO = row.Cells["CERT_NO"].Value.ToString();//认证申报编号
  85. String BATCH_NO = "";//轧批号
  86. String design_key = "";//design_key
  87. this.dataSet3.Clear();
  88. CoreClientParam ccp = new CoreClientParam();
  89. ccp.ServerName = "QCM.JHY01.JHY0103.QuerryThirdInfo";
  90. ccp.MethodName = "QueryDetailInfo";
  91. ccp.ServerParams = new object[] { CERT_NO, BATCH_NO, design_key };
  92. ccp.SourceDataTable = this.dataSet3.Tables[0];
  93. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  94. }
  95. catch (Exception ex)
  96. {
  97. System.Diagnostics.Debug.WriteLine(ex.ToString());
  98. MessageBox.Show("系统出错,请联系管理人员", "警告");
  99. }
  100. }
  101. #endregion
  102. #region 剔除子板
  103. private void button3_Click(object sender, EventArgs e)
  104. {
  105. try
  106. {
  107. if (MessageBox.Show("确认剔除子板?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
  108. {
  109. return;
  110. }
  111. UltraGridRow row = ultraGrid3.ActiveRow;
  112. String CERT_NO = row.Cells["CERT_NO"].Value.ToString();//认证申报编号
  113. String MATERIAL_NO = row.Cells["MATERIAL_NO"].Value.ToString();//产品序号
  114. Hashtable columnMap = new Hashtable();
  115. string cm = CERT_NO + "," + MATERIAL_NO;
  116. this.dataSet3.Clear();
  117. CoreClientParam ccp = new CoreClientParam();
  118. ccp.ServerName = "QCM.JHY01.JHY0103.DeleteMaterialInfo";
  119. ccp.MethodName = "delete2";
  120. ccp.ServerParams = new object[] { cm };
  121. ccp.SourceDataTable = this.dataSet3.Tables[0];
  122. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  123. ultraGrid2AfterRowActivate();
  124. }
  125. catch (Exception ex)
  126. {
  127. System.Diagnostics.Debug.WriteLine(ex.ToString());
  128. MessageBox.Show("系统出错,请联系管理人员", "警告");
  129. }
  130. }
  131. #endregion
  132. #region 撤销申报
  133. private void button4_Click(object sender, EventArgs e)
  134. {
  135. try
  136. {
  137. if (MessageBox.Show("确认撤销申报?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
  138. {
  139. return;
  140. }
  141. UltraGridRow row = ultraGrid2.ActiveRow;
  142. String CERT_NO = row.Cells["CERT_NO"].Value.ToString();//认证申报编号
  143. String CERT_STATUS = row.Cells["CERT_STATUS"].Value.ToString();//确认状态
  144. if (CERT_STATUS.Equals("50"))
  145. {
  146. MessageBox.Show("已申报确认!不可撤销!!","提示",MessageBoxButtons.OK);
  147. return;
  148. }
  149. this.dataSet2.Clear();
  150. CoreClientParam ccp = new CoreClientParam();
  151. ccp.ServerName = "QCM.JHY01.JHY0103.DeleteMaterialInfo";
  152. ccp.MethodName = "deleteMD";
  153. ccp.ServerParams = new object[] { CERT_NO };
  154. ccp.SourceDataTable = this.dataSet2.Tables[0];
  155. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  156. Query();
  157. UltraGridRow row1 = ultraGrid2.ActiveRow;
  158. if (row1 == null)
  159. {
  160. this.dataSet3.Clear();
  161. }
  162. }
  163. catch (Exception ex)
  164. {
  165. System.Diagnostics.Debug.WriteLine(ex.ToString());
  166. MessageBox.Show("系统出错,请联系管理人员", "警告");
  167. }
  168. }
  169. #endregion
  170. #endregion
  171. #region 库存信息
  172. #region 认证申报
  173. private void button5_Click(object sender, EventArgs e)
  174. {
  175. // DoAdd1();//认证申报 调用接口方法1
  176. DoAdd2();//认证申报 调用接口方法2
  177. }
  178. private void DoAdd1()
  179. {
  180. ultraGrid1.UpdateData();
  181. if (ultraGrid1.Rows.Count == 0)
  182. {
  183. MessageBox.Show("库存信息为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  184. return;
  185. }
  186. ArrayList CERT_INST_CODE = new ArrayList();
  187. ArrayList CERT_INST_NAME = new ArrayList();
  188. ArrayList MEMO = new ArrayList();
  189. ArrayList CREATE_ID = new ArrayList();
  190. ArrayList CREATE_NAME = new ArrayList();
  191. ArrayList CERT_NO = new ArrayList(); //认证申报编号
  192. ArrayList CERT_STATUS = new ArrayList();
  193. ArrayList APPLY_ORG_NO = new ArrayList();
  194. ArrayList APPLY_ORG_DESC = new ArrayList();
  195. ArrayList DEP_TYPE_CODE = new ArrayList();
  196. ArrayList DUTY_ID = new ArrayList();
  197. ArrayList INSTANCE_ID = new ArrayList();
  198. ArrayList material_no = new ArrayList(); //产品序号
  199. ArrayList design_key = new ArrayList(); //DESIGN_KEY
  200. ArrayList psc = new ArrayList(); //产品规范代码
  201. ArrayList prod_code = new ArrayList(); //产品名称代码
  202. ArrayList prod_name = new ArrayList(); //产品名称描述
  203. ArrayList steel_code = new ArrayList(); //产品牌号代码
  204. ArrayList steel_name = new ArrayList(); //产品牌号名称
  205. ArrayList std_code = new ArrayList(); //执行标准代码
  206. ArrayList std_name = new ArrayList(); //执行标准名称
  207. ArrayList delivery_state_code = new ArrayList(); //交货状态代码
  208. ArrayList delivery_state_desc = new ArrayList(); //交货状态描述
  209. ArrayList delivery_date = new ArrayList(); //交货日期
  210. ArrayList cut_type = new ArrayList(); //切边状态
  211. ArrayList heat_no = new ArrayList(); //炉号
  212. ArrayList batch_no = new ArrayList(); //轧批号
  213. ArrayList inspection_lot = new ArrayList(); //检验号
  214. ArrayList board_no = new ArrayList(); //母板号
  215. ArrayList thick = new ArrayList(); //厚度(mm)
  216. ArrayList width = new ArrayList(); //宽度(mm)
  217. ArrayList length = new ArrayList(); //长度
  218. ArrayList mat_weight = new ArrayList(); //重量
  219. ArrayList pline_code = new ArrayList(); //产线代码
  220. ArrayList pline_name = new ArrayList(); //产线名称
  221. for (int i = 0; i < ultraGrid1.Rows.Count; i++)
  222. {
  223. if (ultraGrid1.Rows[i].Cells["check"].Value.ToString() == "True")
  224. {
  225. CERT_INST_CODE.Add(ultraGrid1.Rows[i].Cells["CERT_INST_CODE"].Value.ToString());
  226. CERT_INST_NAME.Add(ultraGrid1.Rows[i].Cells["CERT_INST_NAME"].Value.ToString());
  227. MEMO.Add(ultraGrid1.Rows[i].Cells["MEMO"].Value.ToString());
  228. CREATE_ID.Add(ultraGrid1.Rows[i].Cells["CREATE_ID"].Value.ToString());
  229. CREATE_NAME.Add(ultraGrid1.Rows[i].Cells["CREATE_NAME"].Value.ToString());
  230. CERT_NO.Add(ultraGrid1.Rows[i].Cells["CERT_NO"].Value.ToString());
  231. CERT_STATUS.Add(ultraGrid1.Rows[i].Cells["CERT_STATUS"].Value.ToString());
  232. APPLY_ORG_NO.Add(ultraGrid1.Rows[i].Cells["APPLY_ORG_NO"].Value.ToString());
  233. APPLY_ORG_DESC.Add(ultraGrid1.Rows[i].Cells["APPLY_ORG_DESC"].Value.ToString());
  234. DEP_TYPE_CODE.Add(ultraGrid1.Rows[i].Cells["DEP_TYPE_CODE"].Value.ToString());
  235. DUTY_ID.Add(ultraGrid1.Rows[i].Cells["DUTY_ID"].Value.ToString());
  236. INSTANCE_ID.Add(ultraGrid1.Rows[i].Cells["INSTANCE_ID"].Value.ToString());
  237. material_no.Add(ultraGrid1.Rows[i].Cells["MATERIAL_NO"].Value.ToString());
  238. design_key.Add(ultraGrid1.Rows[i].Cells["DESIGN_KEY"].Value.ToString());
  239. psc.Add(ultraGrid1.Rows[i].Cells["PSC"].Value.ToString());
  240. prod_code.Add(ultraGrid1.Rows[i].Cells["PROD_CODE"].Value.ToString());
  241. prod_name.Add(ultraGrid1.Rows[i].Cells["PROD_NAME"].Value.ToString());
  242. steel_code.Add(ultraGrid1.Rows[i].Cells["STEEL_CODE"].Value.ToString());
  243. steel_name.Add(ultraGrid1.Rows[i].Cells["STEEL_NAME"].Value.ToString());
  244. std_code.Add(ultraGrid1.Rows[i].Cells["STD_CODE"].Value.ToString());
  245. std_name.Add(ultraGrid1.Rows[i].Cells["STD_NAME"].Value.ToString());
  246. delivery_state_code.Add(ultraGrid1.Rows[i].Cells["DELIVERY_STATE_CODE"].Value.ToString());
  247. delivery_state_desc.Add(ultraGrid1.Rows[i].Cells["DELIVERY_STATE_DESC"].Value.ToString());
  248. delivery_date.Add(ultraGrid1.Rows[i].Cells["DELIVERY_DATE"].Value.ToString());
  249. cut_type.Add(ultraGrid1.Rows[i].Cells["CUT_TYPE"].Value.ToString());
  250. heat_no.Add(ultraGrid1.Rows[i].Cells["HEAT_NO"].Value.ToString());
  251. batch_no.Add(ultraGrid1.Rows[i].Cells["BATCH_NO"].Value.ToString());
  252. inspection_lot.Add(ultraGrid1.Rows[i].Cells["INSPECTION_LOT"].Value.ToString());
  253. board_no.Add(ultraGrid1.Rows[i].Cells["BOARD_NO"].Value.ToString());
  254. thick.Add(ultraGrid1.Rows[i].Cells["THICK"].Value.ToString());
  255. width.Add(ultraGrid1.Rows[i].Cells["WIDTH"].Value.ToString());
  256. length.Add(ultraGrid1.Rows[i].Cells["LENGTH"].Value.ToString());
  257. mat_weight.Add(ultraGrid1.Rows[i].Cells["MAT_WEIGHT"].Value.ToString());
  258. pline_code.Add(ultraGrid1.Rows[i].Cells["PLINE_CODE"].Value.ToString());
  259. pline_name.Add(ultraGrid1.Rows[i].Cells["PLINE_NAME"].Value.ToString());
  260. }
  261. }
  262. CoreClientParam ccp = new CoreClientParam();
  263. ccp.ServerName = "QCM.JHY01.JHY0103.AddThirdInfo";
  264. ccp.MethodName = "addList";
  265. ccp.ServerParams = new object[] { CERT_INST_CODE, CERT_INST_NAME, MEMO, CREATE_ID, CREATE_NAME, CERT_NO, CERT_STATUS,
  266. APPLY_ORG_NO, APPLY_ORG_DESC,DEP_TYPE_CODE,DUTY_ID,INSTANCE_ID,
  267. material_no,
  268. design_key,
  269. psc,
  270. prod_code,
  271. prod_name,
  272. steel_code,
  273. steel_name,
  274. std_code,
  275. std_name,
  276. delivery_state_code,
  277. delivery_state_desc,
  278. delivery_date,
  279. cut_type,
  280. heat_no,
  281. batch_no,
  282. inspection_lot,
  283. board_no,
  284. thick,
  285. width,
  286. length,
  287. mat_weight,
  288. pline_code,
  289. pline_name,this.UserInfo.GetUserID(),this.UserInfo.GetUserName() };
  290. ccp.SourceDataTable = this.dataSet1.Tables[0];
  291. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  292. if (ccp.ReturnCode != -1)
  293. {
  294. MessageBox.Show("认证申报成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);
  295. }
  296. QueryKs();
  297. }
  298. private void DoAdd2()
  299. {
  300. try
  301. {
  302. ultraGrid1.UpdateData();
  303. if (ultraGrid1.Rows.Count == 0)
  304. {
  305. MessageBox.Show("库存信息为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  306. return;
  307. }
  308. StringBuilder sb = new StringBuilder("[");
  309. Dictionary<string, string> openWith = new Dictionary<string, string>();
  310. int tf = 0;
  311. foreach (UltraGridRow row in this.ultraGrid1.Rows)
  312. {
  313. if (row.Cells["check"].Value.ToString().ToLower() == "true")
  314. {
  315. if (tf == 0)
  316. {
  317. openWith.Add("CERT_INST_CODE", row.Cells["CERT_INST_CODE"].Value.ToString());
  318. openWith.Add("CERT_INST_NAME", row.Cells["CERT_INST_NAME"].Value.ToString());
  319. openWith.Add("MEMO", row.Cells["MEMO"].Value.ToString());
  320. openWith.Add("CREATE_ID", row.Cells["CREATE_ID"].Value.ToString());
  321. openWith.Add("CREATE_NAME", row.Cells["CREATE_NAME"].Value.ToString());
  322. openWith.Add("CERT_NO", row.Cells["CERT_NO"].Value.ToString());
  323. openWith.Add("CERT_STATUS", row.Cells["CERT_STATUS"].Value.ToString());
  324. openWith.Add("APPLY_ORG_NO", row.Cells["APPLY_ORG_NO"].Value.ToString());
  325. openWith.Add("APPLY_ORG_DESC", row.Cells["APPLY_ORG_DESC"].Value.ToString());
  326. openWith.Add("DEP_TYPE_CODE", row.Cells["DEP_TYPE_CODE"].Value.ToString());
  327. openWith.Add("DUTY_ID", row.Cells["DUTY_ID"].Value.ToString());
  328. openWith.Add("INSTANCE_ID", row.Cells["INSTANCE_ID"].Value.ToString());
  329. openWith.Add("MATERIAL_NO", row.Cells["MATERIAL_NO"].Value.ToString());
  330. openWith.Add("DESIGN_KEY", row.Cells["DESIGN_KEY"].Value.ToString());
  331. openWith.Add("PSC", row.Cells["PSC"].Value.ToString());
  332. openWith.Add("PROD_CODE", row.Cells["PROD_CODE"].Value.ToString());
  333. openWith.Add("PROD_NAME", row.Cells["PROD_NAME"].Value.ToString());
  334. openWith.Add("STEEL_CODE", row.Cells["STEEL_CODE"].Value.ToString());
  335. openWith.Add("STEEL_NAME", row.Cells["STEEL_NAME"].Value.ToString());
  336. openWith.Add("STD_CODE", row.Cells["STD_CODE"].Value.ToString());
  337. openWith.Add("STD_NAME", row.Cells["STD_NAME"].Value.ToString());
  338. openWith.Add("DELIVERY_STATE_CODE", row.Cells["DELIVERY_STATE_CODE"].Value.ToString());
  339. openWith.Add("DELIVERY_STATE_DESC", row.Cells["DELIVERY_STATE_DESC"].Value.ToString());
  340. openWith.Add("DELIVERY_DATE", row.Cells["DELIVERY_DATE"].Value.ToString());
  341. openWith.Add("CUT_TYPE", row.Cells["CUT_TYPE"].Value.ToString());
  342. openWith.Add("HEAT_NO", row.Cells["HEAT_NO"].Value.ToString());
  343. openWith.Add("BATCH_NO", row.Cells["BATCH_NO"].Value.ToString());
  344. openWith.Add("INSPECTION_LOT", row.Cells["INSPECTION_LOT"].Value.ToString());
  345. openWith.Add("BOARD_NO", row.Cells["BOARD_NO"].Value.ToString());
  346. openWith.Add("THICK", row.Cells["THICK"].Value.ToString());
  347. openWith.Add("WIDTH", row.Cells["WIDTH"].Value.ToString());
  348. openWith.Add("LENGTH", row.Cells["LENGTH"].Value.ToString());
  349. openWith.Add("MAT_WEIGHT", row.Cells["MAT_WEIGHT"].Value.ToString());
  350. openWith.Add("PLINE_CODE", row.Cells["PLINE_CODE"].Value.ToString());
  351. openWith.Add("PLINE_NAME", row.Cells["PLINE_NAME"].Value.ToString());
  352. sb.Append(JsonConvert.SerializeObject(openWith));
  353. }
  354. if (tf != 0)
  355. {
  356. sb.Append(",");
  357. openWith["CERT_INST_CODE"] = row.Cells["CERT_INST_CODE"].Value.ToString();
  358. openWith["CERT_INST_NAME"] = row.Cells["CERT_INST_NAME"].Value.ToString();
  359. openWith["MEMO"] = row.Cells["MEMO"].Value.ToString();
  360. openWith["CREATE_ID"] = row.Cells["CREATE_ID"].Value.ToString();
  361. openWith["CREATE_NAME"] = row.Cells["CREATE_NAME"].Value.ToString();
  362. openWith["CERT_NO"] = row.Cells["CERT_NO"].Value.ToString();
  363. openWith["CERT_STATUS"] = row.Cells["CERT_STATUS"].Value.ToString();
  364. openWith["APPLY_ORG_NO"] = row.Cells["APPLY_ORG_NO"].Value.ToString();
  365. openWith["APPLY_ORG_DESC"] = row.Cells["APPLY_ORG_DESC"].Value.ToString();
  366. openWith["DEP_TYPE_CODE"] = row.Cells["DEP_TYPE_CODE"].Value.ToString();
  367. openWith["DUTY_ID"] = row.Cells["DUTY_ID"].Value.ToString();
  368. openWith["INSTANCE_ID"] = row.Cells["INSTANCE_ID"].Value.ToString();
  369. openWith["MATERIAL_NO"] = row.Cells["MATERIAL_NO"].Value.ToString();
  370. openWith["DESIGN_KEY"] = row.Cells["DESIGN_KEY"].Value.ToString();
  371. openWith["PSC"] = row.Cells["PSC"].Value.ToString();
  372. openWith["PROD_CODE"] = row.Cells["PROD_CODE"].Value.ToString();
  373. openWith["PROD_NAME"] = row.Cells["PROD_NAME"].Value.ToString();
  374. openWith["STEEL_CODE"] = row.Cells["STEEL_CODE"].Value.ToString();
  375. openWith["STEEL_NAME"] = row.Cells["STEEL_NAME"].Value.ToString();
  376. openWith["STD_CODE"] = row.Cells["STD_CODE"].Value.ToString();
  377. openWith["STD_NAME"] = row.Cells["STD_NAME"].Value.ToString();
  378. openWith["DELIVERY_STATE_CODE"] = row.Cells["DELIVERY_STATE_CODE"].Value.ToString();
  379. openWith["DELIVERY_STATE_DESC"] = row.Cells["DELIVERY_STATE_DESC"].Value.ToString();
  380. openWith["DELIVERY_DATE"] = row.Cells["DELIVERY_DATE"].Value.ToString();
  381. openWith["CUT_TYPE"] = row.Cells["CUT_TYPE"].Value.ToString();
  382. openWith["HEAT_NO"] = row.Cells["HEAT_NO"].Value.ToString();
  383. openWith["BATCH_NO"] = row.Cells["BATCH_NO"].Value.ToString();
  384. openWith["INSPECTION_LOT"] = row.Cells["INSPECTION_LOT"].Value.ToString();
  385. openWith["BOARD_NO"] = row.Cells["BOARD_NO"].Value.ToString();
  386. openWith["THICK"] = row.Cells["THICK"].Value.ToString();
  387. openWith["WIDTH"] = row.Cells["WIDTH"].Value.ToString();
  388. openWith["LENGTH"] = row.Cells["LENGTH"].Value.ToString();
  389. openWith["MAT_WEIGHT"] = row.Cells["MAT_WEIGHT"].Value.ToString();
  390. openWith["PLINE_CODE"] = row.Cells["PLINE_CODE"].Value.ToString();
  391. openWith["PLINE_NAME"] = row.Cells["PLINE_NAME"].Value.ToString();
  392. sb.Append(JsonConvert.SerializeObject(openWith));
  393. }
  394. tf = tf + 1;
  395. }
  396. }
  397. sb.Append("]");
  398. string sbb = sb.ToString();
  399. //JArray jo = (JArray)JsonConvert.DeserializeObject(sbb);
  400. //查询数据库里的数据
  401. CoreClientParam ccp = new CoreClientParam();
  402. DataTable datatable = new DataTable();
  403. ccp.ServerName = "QCM.JHY01.JHY0103.AddThirdInfo";
  404. ccp.MethodName = "addList2";
  405. ccp.ServerParams = new object[] { sbb, this.UserInfo.GetUserID(), this.UserInfo.GetUserName() };
  406. ccp.SourceDataTable = this.dataSet1.Tables[0];
  407. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  408. if (ccp.ReturnCode != -1)
  409. {
  410. MessageBox.Show("认证申报成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);
  411. }
  412. this.QueryKs();
  413. }
  414. catch (Exception ex)
  415. {
  416. System.Diagnostics.Debug.WriteLine(ex.ToString());
  417. MessageBox.Show("系统出错,请联系管理人员", "警告");
  418. }
  419. }
  420. #endregion
  421. #region 查询
  422. private void button1_Click(object sender, EventArgs e)
  423. {
  424. QueryKs();
  425. }
  426. private void QueryKs()
  427. {
  428. try
  429. {
  430. String STARTTIME = this.dateTimePicker1.Value.ToString("yyyy-MM-dd");
  431. String ENDTIME = this.dateTimePicker2.Value.ToString("yyyy-MM-dd");
  432. String BATCH_NO1 = this.textBox1.Text.Trim();//轧批号1
  433. String ORG_NAME = this.textBox2.Text.Trim();//认证机构
  434. String PROD_NAMEMOME = this.textBox3.Text.Trim();//产品规范描述
  435. this.dataSet1.Clear();
  436. CoreClientParam ccp = new CoreClientParam();
  437. ccp.ServerName = "QCM.JHY01.JHY0103.QuerryThirdInfo";
  438. ccp.MethodName = "QueryKSInfo";
  439. ccp.ServerParams = new object[] { STARTTIME, ENDTIME, BATCH_NO1, ORG_NAME, PROD_NAMEMOME };
  440. ccp.SourceDataTable = this.dataSet1.Tables[0];
  441. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  442. }
  443. catch (Exception ex)
  444. {
  445. System.Diagnostics.Debug.WriteLine(ex.ToString());
  446. MessageBox.Show("系统出错,请联系管理人员", "警告");
  447. }
  448. }
  449. #endregion
  450. #endregion
  451. #region 其它事件
  452. private void ultraGrid1_AfterHeaderCheckStateChanged(object sender, AfterHeaderCheckStateChangedEventArgs e)
  453. {
  454. ultraGrid1.UpdateData();
  455. }
  456. private void ultraGrid1_CellChange(object sender, CellEventArgs e)
  457. {
  458. ultraGrid1.UpdateData();
  459. }
  460. #endregion
  461. }
  462. }