c0a0bdd6c75205f1cb61f66534967430bd3e7f9e.svn-base 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035
  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 QCM0403 : FrmBase
  17. {
  18. #region 窗体初始化
  19. public QCM0403()
  20. {
  21. InitializeComponent();
  22. }
  23. private void QCM0403_Load(object sender, EventArgs e)
  24. {
  25. dateTimePicker1.Value = DateTime.Now.Date.AddDays(-1);
  26. dateTimePicker2.Value = DateTime.Now.Date.AddDays(1);
  27. //这个字段 代表 材质初判 材质没有判 未初检 判了分为合格和不合格
  28. ValueList v1 = new ValueList();
  29. v1.ValueListItems.Add("0", "未初检");
  30. v1.ValueListItems.Add("1", "合格");
  31. v1.ValueListItems.Add("2", "不合格");
  32. ultraGrid1.DisplayLayout.Bands[0].Columns["PHYFSTSRESULT"].ValueList = v1.Clone();
  33. ultraGrid5.DisplayLayout.Bands[0].Columns["PHYFSTSRESULT"].ValueList = v1.Clone();
  34. ultraGrid2.DisplayLayout.Bands[0].Columns["PHYFSTSRESULT"].ValueList = v1.Clone();
  35. //this.PLINE_NAME.SelectedIndex = 0;
  36. // ValueList v2 = new ValueList();
  37. //v2.ValueListItems.Add("00", "待提报");
  38. //v2.ValueListItems.Add("10", "待确认");
  39. //v2.ValueListItems.Add("20", "审批中");
  40. //v2.ValueListItems.Add("30", "审批拒绝");
  41. //v2.ValueListItems.Add("40", "审批退回");
  42. //v2.ValueListItems.Add("50", "审批通过");
  43. //ultraGrid2.DisplayLayout.Bands[0].Columns["CERT_STATUS"].ValueList = v2.Clone();
  44. //v2 = new ValueList();
  45. //v2.ValueListItems.Add("0", "已发送");
  46. //v2.ValueListItems.Add("1", "未发送");
  47. //ultraGrid2.DisplayLayout.Bands[0].Columns["SEND_FLAG"].ValueList = v2.Clone();
  48. // doCertInstCode();
  49. //this.DoQuery();//查询
  50. }
  51. #endregion
  52. #region 功能
  53. public override void ToolBar_Click(object sender, string ToolbarKey)
  54. {
  55. switch (ToolbarKey)
  56. {
  57. case "Query":
  58. this.DoQuery();//查询
  59. break;
  60. case "Add":
  61. // this.DoAdd1();
  62. this.DoAdd2();//认证申报
  63. break;
  64. case "UnAdd":
  65. this.DoUnAdd();//撤销认证申报
  66. break;
  67. case "Del":
  68. this.DoDelz();//剔除子板 (作废)
  69. break;
  70. case "Excel":
  71. this.Excel();//导出
  72. //ClsControlPack.ExportDataWithSaveDialog2(ref ultraGrid1, this.Text);
  73. break;
  74. case "DoQuote":
  75. doQuote();
  76. break;
  77. case "Excel2":
  78. ClsControlPack.ExportDataWithSaveDialog2(ref ultraGrid1, this.Text);//导出
  79. break;
  80. }
  81. }
  82. private void doQuote()
  83. {
  84. try
  85. {
  86. if (this.ultraGrid5.Selected.Rows.Count == 0)
  87. this.ultraGrid5.ActiveRow.Selected = true;
  88. List<UltraGridRow> lists = new List<UltraGridRow>();
  89. foreach (UltraGridRow ugr in this.ultraGrid5.Selected.Rows)
  90. {
  91. string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString();
  92. string PHYFSTSRESULT1 = ugr.Cells["PHYFSTSRESULT1"].Text.ToString();
  93. if (PHYFSTSRESULT1.Equals("待判"))
  94. {
  95. string username = this.UserInfo.GetUserName();
  96. CoreClientParam ccp = new CoreClientParam();
  97. ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
  98. ccp.MethodName = "doQuote";
  99. ccp.ServerParams = new object[] { material_no, username };
  100. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  101. if (ccp.ReturnCode == -1)
  102. {
  103. return;
  104. }
  105. }
  106. }
  107. // DoQuery();
  108. this.alert("已引用,稍等10秒再刷新查询!正在综判中");
  109. }
  110. catch (Exception EX)
  111. {
  112. MessageBox.Show(EX.ToString());
  113. }
  114. }
  115. #endregion
  116. #region 功能事件
  117. #region 导出
  118. private void Excel()
  119. {
  120. try
  121. {
  122. String STARTTIME = this.dateTimePicker1.Value.ToString("yyyy-MM-dd");
  123. String ENDTIME = this.dateTimePicker2.Value.ToString("yyyy-MM-dd");
  124. String CERT_INST_NAME = this.textBox2.Text.Trim();//认证机构
  125. String BATCH_NO = this.textBox1.Text.Trim();//轧批号
  126. String shordh = this.textBox4.Text.Trim();//销售订单号
  127. String PROD_NAMEMOME = this.textBox3.Text.Trim();//产品规范描述
  128. if (this.ultraTabControl1.Tabs[3].Selected) //库存信息
  129. {
  130. KsQueryExcel(STARTTIME, ENDTIME, CERT_INST_NAME, BATCH_NO, shordh, PROD_NAMEMOME);//库存信息
  131. }
  132. else
  133. {
  134. this.alert("请选择【申报记录】!再点击导出");
  135. }
  136. }
  137. catch (Exception ex)
  138. {
  139. System.Diagnostics.Debug.WriteLine(ex.ToString());
  140. MessageBox.Show("系统出错,请联系管理人员", "警告");
  141. }
  142. }
  143. #region 导出 库存信息
  144. public void KsQueryExcel(String starttime, String endtime, String cert_inst_name, String batch_no, String shordh, String prod_namemome)
  145. {
  146. try
  147. {
  148. String plineName = this.PLINE_NAME.Text;
  149. if (String.IsNullOrEmpty(plineName))
  150. {
  151. plineName = "";
  152. }
  153. this.dataSet5.Clear();
  154. CoreClientParam ccp = new CoreClientParam();
  155. ccp.ServerName = "QCM.JHY01.JHY0103.QuerryThirdInfo";
  156. ccp.MethodName = "KsQueryExcel";
  157. ccp.ServerParams = new object[] { starttime, endtime, batch_no, cert_inst_name, shordh, prod_namemome, plineName };
  158. ccp.SourceDataTable = this.dataSet5.Tables[0];
  159. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  160. //导出是否加订单备注
  161. if (this.checkBox3.Checked)
  162. {
  163. this.ultraGrid4.DisplayLayout.Bands[0].Columns["订单备注"].Hidden = false;
  164. }
  165. else
  166. {
  167. this.ultraGrid4.DisplayLayout.Bands[0].Columns["订单备注"].Hidden = true;
  168. }
  169. ClsControlPack.ExportDataWithSaveDialog2(ref ultraGrid4, "船检导出清单");
  170. }
  171. catch (Exception ex)
  172. {
  173. System.Diagnostics.Debug.WriteLine(ex.ToString());
  174. MessageBox.Show("系统出错,请联系管理人员", "警告");
  175. }
  176. }
  177. #endregion
  178. #endregion
  179. #region 查询
  180. private void DoQuery()
  181. {
  182. try
  183. {
  184. String STARTTIME = this.dateTimePicker1.Value.ToString("yyyy-MM-dd");
  185. String ENDTIME = this.dateTimePicker2.Value.ToString("yyyy-MM-dd");
  186. String CERT_INST_NAME = this.textBox2.Text.Trim();//认证机构
  187. if (CERT_INST_NAME.Equals("全部"))
  188. {
  189. CERT_INST_NAME = "";
  190. }
  191. String BATCH_NO = this.textBox1.Text.Trim();//轧批号
  192. String shordh = this.textBox4.Text.Trim();//销售订单号
  193. String PROD_NAMEMOME = this.textBox3.Text.Trim();//产品规范描述
  194. String radio = "全部";
  195. if (radio1.Checked)
  196. {
  197. radio = "全部";
  198. }
  199. else if (radio2.Checked)
  200. {
  201. radio = "1";
  202. }
  203. else if (radio3.Checked)
  204. {
  205. radio = "0";
  206. }
  207. if (this.checkBox1.Checked)
  208. {
  209. STARTTIME = "";
  210. ENDTIME = "";
  211. }
  212. else
  213. {
  214. BATCH_NO = "";
  215. }
  216. if (this.ultraTabControl1.Tabs[0].Selected) //库存信息
  217. {
  218. KsQuery(STARTTIME, ENDTIME, CERT_INST_NAME, BATCH_NO, shordh, PROD_NAMEMOME,radio);//库存信息
  219. }
  220. if (this.ultraTabControl1.Tabs[1].Selected) //申报轧批
  221. {
  222. SbQuery(STARTTIME, ENDTIME, CERT_INST_NAME, BATCH_NO, shordh, PROD_NAMEMOME);//申报记录
  223. }
  224. if (this.ultraTabControl1.Tabs[3].Selected) //申报记录合并
  225. {
  226. SbQueryhb(STARTTIME, ENDTIME, CERT_INST_NAME, BATCH_NO, shordh, PROD_NAMEMOME);//申报记录
  227. }
  228. }
  229. catch (Exception ex)
  230. {
  231. System.Diagnostics.Debug.WriteLine(ex.ToString());
  232. MessageBox.Show("系统出错,请联系管理人员", "警告");
  233. }
  234. }
  235. #region 库存信息
  236. public void KsQuery(String starttime, String endtime, String cert_inst_name, String batch_no, String shordh, String prod_namemome, String radio)
  237. {
  238. try {
  239. this.dataSet1.Clear();
  240. CoreClientParam ccp = new CoreClientParam();
  241. String radioYN = "全部";
  242. if (radioYN1.Checked)
  243. {
  244. radioYN = "全部";
  245. }
  246. else if (radioYN2.Checked)
  247. {
  248. radioYN = "1";
  249. }
  250. else if (radioYN3.Checked)
  251. {
  252. radioYN = "0";
  253. }
  254. ccp.ServerName = "QCM.JHY01.JHY0103.QuerryThirdInfo";
  255. if (this.PLINE_NAME.Text.ToString().Trim().Equals("中板线"))
  256. {
  257. ccp.MethodName = "QueryKczInfo";
  258. }
  259. else if (this.PLINE_NAME.Text.ToString().Trim().Equals("厚板线"))
  260. {
  261. ccp.MethodName = "QueryKSInfo";
  262. }
  263. else
  264. {
  265. ccp.MethodName = "QueryKSAllInfo";
  266. }
  267. ccp.ServerParams = new object[] { starttime, endtime, batch_no, cert_inst_name, shordh, prod_namemome, radio, radioYN };
  268. ccp.SourceDataTable = this.dataSet1.Tables[0];
  269. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  270. if (this.ultraTabControl1.Tabs[0].Selected)
  271. {
  272. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  273. {
  274. if (ugr.Cells["PHYFSTSRESULT"].Value.ToString().Equals("0"))
  275. {
  276. ugr.Cells["初检时间"].Value = "";
  277. }
  278. }
  279. }
  280. ClsControlPack.RefreshAndAutoSize(ultraGrid1);
  281. }
  282. catch (Exception ex)
  283. {
  284. System.Diagnostics.Debug.WriteLine(ex.ToString());
  285. MessageBox.Show("系统出错,请联系管理人员", "警告");
  286. }
  287. }
  288. #endregion
  289. #region 申报记录
  290. //按轧批
  291. public void SbQuery(String starttime, String endtime, String cert_inst_name, String batch_no, String shordh, String prod_namemome)
  292. {
  293. try {
  294. this.dataSet6.Clear();
  295. CoreClientParam ccp = new CoreClientParam();
  296. ccp.ServerName = "QCM.JHY01.JHY0103.QuerryThirdInfo";
  297. ccp.MethodName = "QueryBatchNo";
  298. ccp.ServerParams = new object[] { starttime, endtime, cert_inst_name, batch_no, shordh };
  299. ccp.SourceDataTable = this.dataSet6.Tables[0];
  300. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  301. }
  302. catch (Exception ex)
  303. {
  304. System.Diagnostics.Debug.WriteLine(ex.ToString());
  305. MessageBox.Show("系统出错,请联系管理人员", "警告");
  306. }
  307. }
  308. //按子板 申报记录
  309. public void SbQueryhb(String starttime, String endtime, String cert_inst_name, String batch_no, String shordh, String prod_namemome)
  310. {
  311. try
  312. {
  313. String plineName = this.PLINE_NAME.Text;
  314. if (String.IsNullOrEmpty(plineName) || plineName.Equals("全部"))
  315. {
  316. plineName = "";
  317. }
  318. String certNo = this.CERT_NO.Text.Trim().ToString();
  319. this.dataSet4.Clear();
  320. CoreClientParam ccp = new CoreClientParam();
  321. ccp.ServerName = "QCM.JHY01.JHY0103.QuerryThirdInfo";
  322. ccp.MethodName = "QueryMainInfoHb";
  323. ccp.ServerParams = new object[] { starttime, endtime, cert_inst_name, batch_no, shordh, prod_namemome, plineName, certNo };
  324. ccp.SourceDataTable = this.dataSet4.Tables[0];
  325. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  326. if (this.ultraTabControl1.Tabs[3].Selected) //申报记录
  327. {
  328. foreach (UltraGridRow ugr in this.ultraGrid5.Rows)
  329. {
  330. if (ugr.Cells["备注"].Value.ToString().Equals("已脱单"))
  331. {
  332. ugr.Appearance.BackColor = Color.Aquamarine;
  333. }
  334. if (ugr.Cells["VALIDFLAG"].Value.ToString().Equals("1"))
  335. {
  336. ugr.Appearance.BackColor = Color.Red;
  337. }
  338. if (ugr.Cells["PHYFSTSRESULT1"].Value.ToString().Equals("船检合格"))
  339. {
  340. ugr.Cells["PHYFSTSRESULT"].Value = 1;
  341. }
  342. }
  343. }
  344. ClsControlPack.RefreshAndAutoSize(ultraGrid5);
  345. }
  346. catch (Exception ex)
  347. {
  348. System.Diagnostics.Debug.WriteLine(ex.ToString());
  349. MessageBox.Show("系统出错,请联系管理人员", "警告");
  350. }
  351. }
  352. #endregion
  353. #region 认证机构
  354. public void doCertInstCode()
  355. {
  356. this.dataSet7.Clear();
  357. CoreClientParam ccp = new CoreClientParam();
  358. ccp.ServerName = "QCM.JHY01.JHY0103.QuerryThirdInfo";//调用java地址
  359. ccp.MethodName = "getCertInstCode";//调用的方法
  360. //ccp.ServerParams = new object[] { };
  361. ccp.SourceDataTable = this.dataSet7.Tables[0];
  362. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  363. DataTable dt = new DataTable();
  364. dt.Columns.Add("CERT_INST_NAME");
  365. dt.Columns.Add("CERT_INST_CODE");
  366. DataRow dr0 = dt.NewRow();
  367. dr0[0] = "全部";
  368. dr0[1] = "全部";
  369. dt.Rows.Add(dr0);
  370. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  371. {
  372. DataRow dr = dt.NewRow();
  373. dr[0] = ccp.SourceDataTable.Rows[i]["CERT_INST_NAME"].ToString();
  374. dr[1] = ccp.SourceDataTable.Rows[i]["CERT_INST_CODE"].ToString();
  375. dt.Rows.Add(dr);
  376. }
  377. this.textBox2.DataSource = dt;
  378. this.textBox2.DisplayMember = "CERT_INST_NAME";
  379. this.textBox2.ValueMember = "CERT_INST_CODE";
  380. }
  381. #endregion
  382. #endregion
  383. #region 认证申报 已报废
  384. private void DoAdd1()
  385. {
  386. ultraGrid1.UpdateData();
  387. if (ultraGrid1.Rows.Count == 0)
  388. {
  389. MessageBox.Show("库存信息为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  390. return;
  391. }
  392. ArrayList CERT_INST_CODE = new ArrayList();
  393. ArrayList CERT_INST_NAME = new ArrayList();
  394. ArrayList MEMO = new ArrayList();
  395. ArrayList CREATE_ID = new ArrayList();
  396. ArrayList CREATE_NAME = new ArrayList();
  397. ArrayList CERT_NO = new ArrayList(); //认证申报编号
  398. ArrayList CERT_STATUS = new ArrayList();
  399. ArrayList APPLY_ORG_NO = new ArrayList();
  400. ArrayList APPLY_ORG_DESC = new ArrayList();
  401. ArrayList DEP_TYPE_CODE = new ArrayList();
  402. ArrayList DUTY_ID = new ArrayList();
  403. ArrayList INSTANCE_ID = new ArrayList();
  404. ArrayList material_no = new ArrayList(); //产品序号
  405. ArrayList design_key = new ArrayList(); //DESIGN_KEY
  406. ArrayList psc = new ArrayList(); //产品规范代码
  407. ArrayList prod_code = new ArrayList(); //产品名称代码
  408. ArrayList prod_name = new ArrayList(); //产品名称描述
  409. ArrayList steel_code = new ArrayList(); //产品牌号代码
  410. ArrayList steel_name = new ArrayList(); //产品牌号名称
  411. ArrayList std_code = new ArrayList(); //执行标准代码
  412. ArrayList std_name = new ArrayList(); //执行标准名称
  413. ArrayList delivery_state_code = new ArrayList(); //交货状态代码
  414. ArrayList delivery_state_desc = new ArrayList(); //交货状态描述
  415. ArrayList delivery_date = new ArrayList(); //交货日期
  416. ArrayList cut_type = new ArrayList(); //切边状态
  417. ArrayList heat_no = new ArrayList(); //炉号
  418. ArrayList batch_no = new ArrayList(); //轧批号
  419. ArrayList inspection_lot = new ArrayList(); //检验号
  420. ArrayList board_no = new ArrayList(); //母板号
  421. ArrayList thick = new ArrayList(); //厚度(mm)
  422. ArrayList width = new ArrayList(); //宽度(mm)
  423. ArrayList length = new ArrayList(); //长度
  424. ArrayList mat_weight = new ArrayList(); //重量
  425. ArrayList pline_code = new ArrayList(); //产线代码
  426. ArrayList pline_name = new ArrayList(); //产线名称
  427. for (int i = 0; i < ultraGrid1.Rows.Count; i++)
  428. {
  429. if (ultraGrid1.Rows[i].Cells["check"].Value.ToString() == "True")
  430. {
  431. CERT_INST_CODE.Add(ultraGrid1.Rows[i].Cells["CERT_INST_CODE"].Value.ToString());
  432. CERT_INST_NAME.Add(ultraGrid1.Rows[i].Cells["CERT_INST_NAME"].Value.ToString());
  433. MEMO.Add(ultraGrid1.Rows[i].Cells["MEMO"].Value.ToString());
  434. CREATE_ID.Add(ultraGrid1.Rows[i].Cells["CREATE_ID"].Value.ToString());
  435. CREATE_NAME.Add(ultraGrid1.Rows[i].Cells["CREATE_NAME"].Value.ToString());
  436. CERT_NO.Add(ultraGrid1.Rows[i].Cells["CERT_NO"].Value.ToString());
  437. CERT_STATUS.Add(ultraGrid1.Rows[i].Cells["CERT_STATUS"].Value.ToString());
  438. APPLY_ORG_NO.Add(ultraGrid1.Rows[i].Cells["APPLY_ORG_NO"].Value.ToString());
  439. APPLY_ORG_DESC.Add(ultraGrid1.Rows[i].Cells["APPLY_ORG_DESC"].Value.ToString());
  440. DEP_TYPE_CODE.Add(ultraGrid1.Rows[i].Cells["DEP_TYPE_CODE"].Value.ToString());
  441. DUTY_ID.Add(ultraGrid1.Rows[i].Cells["DUTY_ID"].Value.ToString());
  442. INSTANCE_ID.Add(ultraGrid1.Rows[i].Cells["INSTANCE_ID"].Value.ToString());
  443. material_no.Add(ultraGrid1.Rows[i].Cells["MATERIAL_NO"].Value.ToString());
  444. design_key.Add(ultraGrid1.Rows[i].Cells["DESIGN_KEY"].Value.ToString());
  445. psc.Add(ultraGrid1.Rows[i].Cells["PSC"].Value.ToString());
  446. prod_code.Add(ultraGrid1.Rows[i].Cells["PROD_CODE"].Value.ToString());
  447. prod_name.Add(ultraGrid1.Rows[i].Cells["PROD_NAME"].Value.ToString());
  448. steel_code.Add(ultraGrid1.Rows[i].Cells["STEEL_CODE"].Value.ToString());
  449. steel_name.Add(ultraGrid1.Rows[i].Cells["STEEL_NAME"].Value.ToString());
  450. std_code.Add(ultraGrid1.Rows[i].Cells["STD_CODE"].Value.ToString());
  451. std_name.Add(ultraGrid1.Rows[i].Cells["STD_NAME"].Value.ToString());
  452. delivery_state_code.Add(ultraGrid1.Rows[i].Cells["DELIVERY_STATE_CODE"].Value.ToString());
  453. delivery_state_desc.Add(ultraGrid1.Rows[i].Cells["DELIVERY_STATE_DESC"].Value.ToString());
  454. delivery_date.Add(ultraGrid1.Rows[i].Cells["DELIVERY_DATE"].Value.ToString());
  455. cut_type.Add(ultraGrid1.Rows[i].Cells["CUT_TYPE"].Value.ToString());
  456. heat_no.Add(ultraGrid1.Rows[i].Cells["HEAT_NO"].Value.ToString());
  457. batch_no.Add(ultraGrid1.Rows[i].Cells["BATCH_NO"].Value.ToString());
  458. inspection_lot.Add(ultraGrid1.Rows[i].Cells["INSPECTION_LOT"].Value.ToString());
  459. board_no.Add(ultraGrid1.Rows[i].Cells["BOARD_NO"].Value.ToString());
  460. thick.Add(ultraGrid1.Rows[i].Cells["THICK"].Value.ToString());
  461. width.Add(ultraGrid1.Rows[i].Cells["WIDTH"].Value.ToString());
  462. length.Add(ultraGrid1.Rows[i].Cells["LENGTH"].Value.ToString());
  463. mat_weight.Add(ultraGrid1.Rows[i].Cells["MAT_WEIGHT"].Value.ToString());
  464. pline_code.Add(ultraGrid1.Rows[i].Cells["PLINE_CODE"].Value.ToString());
  465. pline_name.Add(ultraGrid1.Rows[i].Cells["PLINE_NAME"].Value.ToString());
  466. }
  467. }
  468. CoreClientParam ccp = new CoreClientParam();
  469. ccp.ServerName = "QCM.JHY01.JHY0103.AddThirdInfo";
  470. ccp.MethodName = "addList";
  471. ccp.ServerParams = new object[] { CERT_INST_CODE, CERT_INST_NAME, MEMO, CREATE_ID, CREATE_NAME, CERT_NO, CERT_STATUS,
  472. APPLY_ORG_NO, APPLY_ORG_DESC,DEP_TYPE_CODE,DUTY_ID,INSTANCE_ID,
  473. material_no,
  474. design_key,
  475. psc,
  476. prod_code,
  477. prod_name,
  478. steel_code,
  479. steel_name,
  480. std_code,
  481. std_name,
  482. delivery_state_code,
  483. delivery_state_desc,
  484. delivery_date,
  485. cut_type,
  486. heat_no,
  487. batch_no,
  488. inspection_lot,
  489. board_no,
  490. thick,
  491. width,
  492. length,
  493. mat_weight,
  494. pline_code,
  495. pline_name,this.UserInfo.GetUserID(),this.UserInfo.GetUserName() };
  496. ccp.SourceDataTable = this.dataSet1.Tables[0];
  497. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  498. if (ccp.ReturnCode != -1)
  499. {
  500. MessageBox.Show("认证申报成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);
  501. }
  502. this.DoQuery();
  503. }
  504. #endregion
  505. #region 认证申报
  506. private void DoAdd2()
  507. {
  508. try
  509. {
  510. ultraGrid1.UpdateData();
  511. //判断是否存在初检结果为未初检的数据
  512. //DataView dvDown = this.dataTable1.DefaultView;
  513. //dvDown.RowFilter = "PHYFSTSRESULT = '未初检'";
  514. //DataTable selectedTb = dvDown.ToTable();
  515. //if (selectedTb != null && selectedTb.Rows != null && selectedTb.Rows.Count > 0)
  516. //{
  517. // if (MessageBox.Show("存在初检结果为未初检的数据,请确认是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) != DialogResult.Yes)
  518. // {
  519. // return;
  520. // }
  521. //}
  522. ////判断是否存在相同的轧批号,同一个认证机构同时申报
  523. //dvDown.RowFilter = "";
  524. //var query = from data in dataTable1.AsEnumerable()
  525. // where "true" == data.Field<string>("check")
  526. // group data by new { t1 = data.Field<string>("BATCH_NO"), t2 = data.Field<string>("CERT_INST_NAME") }
  527. // into r
  528. // select new
  529. // {
  530. // count = r.Count(),
  531. // batch_no = r.Key.t1,
  532. // cert_inst_name = r.Key.t2,
  533. // };
  534. //if (query.ToList().Count > 0)
  535. //{
  536. // query.ToList().ForEach(q =>
  537. // {
  538. // if (q.count > 1)
  539. // {
  540. // if (MessageBox.Show("存在" + q.count + "条轧批号【" + q.batch_no + "】认证机构【" + q.cert_inst_name + "】的记录,请确认是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) != DialogResult.Yes)
  541. // {
  542. // return;
  543. // }
  544. // }
  545. // });
  546. //}
  547. if (ultraGrid1.Rows.Count == 0)
  548. {
  549. MessageBox.Show("库存信息为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  550. return;
  551. }
  552. StringBuilder sb = new StringBuilder("[");
  553. Dictionary<string, string> openWith = new Dictionary<string, string>();
  554. int tf = 0;
  555. foreach (UltraGridRow row in this.ultraGrid1.Rows)
  556. {
  557. if (row.Cells["check"].Value.ToString().ToLower() == "true")
  558. {
  559. if (!row.Cells["PHYFSTSRESULT"].Value.ToString().Equals("1") || !row.Cells["PHYFSTSRESULT"].Text.ToString().Equals("合格"))
  560. {
  561. MessageBox.Show(row.Cells["MATERIAL_NO"].Value.ToString()+"还未初检合格不可申报!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  562. return;
  563. }
  564. if (tf == 0)
  565. {
  566. openWith.Add("CERT_INST_CODE", row.Cells["CERT_INST_CODE"].Value.ToString());//认证机构代码
  567. openWith.Add("CERT_INST_NAME", row.Cells["CERT_INST_NAME"].Value.ToString());//认证机构
  568. openWith.Add("MEMO", row.Cells["MEMO"].Value.ToString());//备注
  569. openWith.Add("CREATE_ID", row.Cells["CREATE_ID"].Value.ToString());
  570. openWith.Add("CREATE_NAME", row.Cells["CREATE_NAME"].Value.ToString());
  571. openWith.Add("CERT_NO", row.Cells["CERT_NO"].Value.ToString());//认证申报编号
  572. openWith.Add("CERT_STATUS", row.Cells["CERT_STATUS"].Value.ToString());//确认状态
  573. openWith.Add("APPLY_ORG_NO", row.Cells["APPLY_ORG_NO"].Value.ToString());//申请机构编码
  574. openWith.Add("APPLY_ORG_DESC", row.Cells["APPLY_ORG_DESC"].Value.ToString());//申请机构
  575. openWith.Add("DEP_TYPE_CODE", row.Cells["DEP_TYPE_CODE"].Value.ToString());//部门级别
  576. openWith.Add("DUTY_ID", row.Cells["DUTY_ID"].Value.ToString());//岗位id
  577. openWith.Add("INSTANCE_ID", row.Cells["INSTANCE_ID"].Value.ToString());//流程实例id
  578. openWith.Add("MATERIAL_NO", row.Cells["MATERIAL_NO"].Value.ToString());//产品序号
  579. openWith.Add("DESIGN_KEY", row.Cells["DESIGN_KEY"].Value.ToString());//订单号
  580. openWith.Add("PSC", row.Cells["PSC"].Value.ToString());//产品规范代码
  581. openWith.Add("PROD_CODE", row.Cells["PROD_CODE"].Value.ToString());//产品名称代码
  582. openWith.Add("PROD_NAME", row.Cells["PROD_NAME"].Value.ToString());//产品名称
  583. openWith.Add("STEEL_CODE", row.Cells["STEEL_CODE"].Value.ToString());//产品牌号代码
  584. openWith.Add("STEEL_NAME", row.Cells["STEEL_NAME"].Value.ToString());//产品牌号
  585. openWith.Add("STD_CODE", row.Cells["STD_CODE"].Value.ToString());//执行标准代码
  586. openWith.Add("STD_NAME", row.Cells["STD_NAME"].Value.ToString());//执行标准
  587. openWith.Add("DELIVERY_STATE_CODE", row.Cells["DELIVERY_STATE_CODE"].Value.ToString());//交货状态代码
  588. openWith.Add("DELIVERY_STATE_DESC", row.Cells["DELIVERY_STATE_DESC"].Value.ToString());//交货状态
  589. openWith.Add("DELIVERY_DATE", row.Cells["DELIVERY_DATE"].Value.ToString());//交货日期
  590. openWith.Add("CUT_TYPE", row.Cells["CUT_TYPE"].Value.ToString());//切边状态
  591. openWith.Add("HEAT_NO", row.Cells["HEAT_NO"].Value.ToString());//炉号
  592. openWith.Add("BATCH_NO", row.Cells["BATCH_NO"].Value.ToString());//轧批号
  593. openWith.Add("INSPECTION_LOT", row.Cells["INSPECTION_LOT"].Value.ToString());//检验号
  594. openWith.Add("BOARD_NO", row.Cells["BOARD_NO"].Value.ToString());//母板号
  595. openWith.Add("THICK", row.Cells["THICK"].Value.ToString());//厚度
  596. openWith.Add("WIDTH", row.Cells["WIDTH"].Value.ToString());//宽度
  597. openWith.Add("LENGTH", row.Cells["LENGTH"].Value.ToString());//长度
  598. openWith.Add("MAT_WEIGHT", row.Cells["MAT_WEIGHT"].Value.ToString());//重量
  599. openWith.Add("PLINE_CODE", row.Cells["PLINE_CODE"].Value.ToString());//产线代码
  600. openWith.Add("PLINE_NAME", row.Cells["PLINE_NAME"].Value.ToString());//产线名称
  601. openWith.Add("PSC_DESC", row.Cells["PSC_DESC"].Value.ToString());//产品规范
  602. openWith.Add("finalResults", row.Cells["判定结果"].Value.ToString());//判定结果
  603. openWith.Add("APPROACH", row.Cells["approach"].Value.ToString());//定尺方式
  604. openWith.Add("storageTime", row.Cells["storageTime"].Value.ToString());//入库时间
  605. openWith.Add("PHYFSTSRESULT", row.Cells["PHYFSTSRESULT"].Value.ToString());//初检结果
  606. openWith.Add("PHYFSTSRESULT1", row.Cells["PHYFSTSRESULT1"].Value.ToString());//是否已船检
  607. openWith.Add("INCEPTCORPCODE", row.Cells["INCEPTCORPCODE"].Value.ToString());//收货单位
  608. openWith.Add("BUYERCODE", row.Cells["BUYERCODE"].Value.ToString());//合同单位
  609. openWith.Add("CONTRACTNO", row.Cells["合同号"].Value.ToString());//合同号
  610. openWith.Add("VESSEL", row.Cells["VESSEL"].Value.ToString());//类别
  611. sb.Append(JsonConvert.SerializeObject(openWith));
  612. }
  613. if (tf != 0)
  614. {
  615. sb.Append(",");
  616. openWith["CERT_INST_CODE"] = row.Cells["CERT_INST_CODE"].Value.ToString();
  617. openWith["CERT_INST_NAME"] = row.Cells["CERT_INST_NAME"].Value.ToString();
  618. openWith["MEMO"] = row.Cells["MEMO"].Value.ToString();
  619. openWith["CREATE_ID"] = row.Cells["CREATE_ID"].Value.ToString();
  620. openWith["CREATE_NAME"] = row.Cells["CREATE_NAME"].Value.ToString();
  621. openWith["CERT_NO"] = row.Cells["CERT_NO"].Value.ToString();
  622. openWith["CERT_STATUS"] = row.Cells["CERT_STATUS"].Value.ToString();
  623. openWith["APPLY_ORG_NO"] = row.Cells["APPLY_ORG_NO"].Value.ToString();
  624. openWith["APPLY_ORG_DESC"] = row.Cells["APPLY_ORG_DESC"].Value.ToString();
  625. openWith["DEP_TYPE_CODE"] = row.Cells["DEP_TYPE_CODE"].Value.ToString();
  626. openWith["DUTY_ID"] = row.Cells["DUTY_ID"].Value.ToString();
  627. openWith["INSTANCE_ID"] = row.Cells["INSTANCE_ID"].Value.ToString();
  628. openWith["MATERIAL_NO"] = row.Cells["MATERIAL_NO"].Value.ToString();
  629. openWith["DESIGN_KEY"] = row.Cells["DESIGN_KEY"].Value.ToString();
  630. openWith["PSC"] = row.Cells["PSC"].Value.ToString();
  631. openWith["PROD_CODE"] = row.Cells["PROD_CODE"].Value.ToString();
  632. openWith["PROD_NAME"] = row.Cells["PROD_NAME"].Value.ToString();
  633. openWith["STEEL_CODE"] = row.Cells["STEEL_CODE"].Value.ToString();
  634. openWith["STEEL_NAME"] = row.Cells["STEEL_NAME"].Value.ToString();
  635. openWith["STD_CODE"] = row.Cells["STD_CODE"].Value.ToString();
  636. openWith["STD_NAME"] = row.Cells["STD_NAME"].Value.ToString();
  637. openWith["DELIVERY_STATE_CODE"] = row.Cells["DELIVERY_STATE_CODE"].Value.ToString();
  638. openWith["DELIVERY_STATE_DESC"] = row.Cells["DELIVERY_STATE_DESC"].Value.ToString();
  639. openWith["DELIVERY_DATE"] = row.Cells["DELIVERY_DATE"].Value.ToString();
  640. openWith["CUT_TYPE"] = row.Cells["CUT_TYPE"].Value.ToString();
  641. openWith["HEAT_NO"] = row.Cells["HEAT_NO"].Value.ToString();
  642. openWith["BATCH_NO"] = row.Cells["BATCH_NO"].Value.ToString();
  643. openWith["INSPECTION_LOT"] = row.Cells["INSPECTION_LOT"].Value.ToString();
  644. openWith["BOARD_NO"] = row.Cells["BOARD_NO"].Value.ToString();
  645. openWith["THICK"] = row.Cells["THICK"].Value.ToString();
  646. openWith["WIDTH"] = row.Cells["WIDTH"].Value.ToString();
  647. openWith["LENGTH"] = row.Cells["LENGTH"].Value.ToString();
  648. openWith["MAT_WEIGHT"] = row.Cells["MAT_WEIGHT"].Value.ToString();
  649. openWith["PLINE_CODE"] = row.Cells["PLINE_CODE"].Value.ToString();
  650. openWith["PLINE_NAME"] = row.Cells["PLINE_NAME"].Value.ToString();
  651. openWith["PSC_DESC"] = row.Cells["PSC_DESC"].Value.ToString();//产品规范
  652. openWith["finalResults"] = row.Cells["判定结果"].Value.ToString();//判定结果
  653. openWith["APPROACH"] = row.Cells["approach"].Value.ToString();//定尺方式
  654. openWith["storageTime"] = row.Cells["storageTime"].Value.ToString();//入库时间
  655. openWith["PHYFSTSRESULT"] = row.Cells["PHYFSTSRESULT"].Value.ToString();//初检结果
  656. openWith["PHYFSTSRESULT1"] = row.Cells["PHYFSTSRESULT1"].Value.ToString();//是否已船检
  657. openWith["INCEPTCORPCODE"] = row.Cells["INCEPTCORPCODE"].Value.ToString();//收货单位
  658. openWith["BUYERCODE"] = row.Cells["BUYERCODE"].Value.ToString();//合同单位
  659. openWith["CONTRACTNO"] = row.Cells["合同号"].Value.ToString();//合同号
  660. openWith["VESSEL"] = row.Cells["VESSEL"].Value.ToString();//类别
  661. sb.Append(JsonConvert.SerializeObject(openWith));
  662. }
  663. tf = tf + 1;
  664. }
  665. }
  666. sb.Append("]");
  667. string sbb = sb.ToString();
  668. //JArray jo = (JArray)JsonConvert.DeserializeObject(sbb);
  669. //查询数据库里的数据
  670. CoreClientParam ccp = new CoreClientParam();
  671. DataTable datatable = new DataTable();
  672. ccp.ServerName = "QCM.JHY01.JHY0103.AddThirdInfo";
  673. ccp.MethodName = "addList2";
  674. ccp.ServerParams = new object[] { sbb, this.UserInfo.GetUserID(), this.UserInfo.GetUserName() };
  675. ccp.SourceDataTable = this.dataSet1.Tables[0];
  676. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  677. if (ccp.ReturnCode != -1)
  678. {
  679. MessageBox.Show("认证申报成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);
  680. }
  681. this.DoQuery();
  682. }
  683. catch (Exception ex)
  684. {
  685. System.Diagnostics.Debug.WriteLine(ex.ToString());
  686. MessageBox.Show("系统出错,请联系管理人员", "警告");
  687. }
  688. }
  689. #endregion
  690. #region 撤销认证申报
  691. private void DoUnAdd()
  692. {
  693. try
  694. {
  695. if (this.ultraTabControl1.Tabs[0].Selected)
  696. {
  697. MessageBox.Show("请选择申报记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  698. return;
  699. }
  700. if (MessageBox.Show("确认撤销申报?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
  701. {
  702. return;
  703. }
  704. if (this.ultraTabControl1.Tabs[3].Selected)
  705. {
  706. foreach (UltraGridRow ugr in this.ultraGrid5.Rows)
  707. {
  708. if (ugr.Cells["CHECK"].Value.ToString().ToLower() == "true")
  709. {
  710. string cert_no = ugr.Cells["认证申报编号"].Value.ToString();
  711. string batch_no = ugr.Cells["BATCH_NO"].Value.ToString();
  712. string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString();
  713. string cert_inst_code = ugr.Cells["认证机构代码"].Value.ToString();
  714. Hashtable ht = new Hashtable();
  715. ht.Add("CERT_NO", cert_no);
  716. ht.Add("BATCH_NO", batch_no);
  717. ht.Add("MATERIAL_NO", material_no);
  718. ht.Add("USER_NAME", this.UserInfo.GetUserName());
  719. ht.Add("CERT_INST_CODE", cert_inst_code);
  720. CoreClientParam ccp = new CoreClientParam();
  721. ccp.ServerName = "QCM.JHY01.JHY0103.DeleteMaterialInfo";
  722. ccp.MethodName = "deleteMD";
  723. ccp.ServerParams = new object[] { ht };
  724. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  725. if (ccp.ReturnCode == -1)
  726. {
  727. return;
  728. }
  729. }
  730. }
  731. }
  732. this.DoQuery();
  733. }
  734. catch (Exception ex)
  735. {
  736. System.Diagnostics.Debug.WriteLine(ex.ToString());
  737. MessageBox.Show("系统出错,请联系管理人员", "警告");
  738. }
  739. }
  740. #endregion
  741. #region 剔除子板
  742. private void DoDelz()
  743. {
  744. try
  745. {
  746. if (this.ultraTabControl1.Tabs[0].Selected)
  747. {
  748. MessageBox.Show("请选择申报记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  749. return;
  750. }
  751. if (MessageBox.Show("确认剔除子板?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
  752. {
  753. return;
  754. }
  755. String CERT_NO = "";
  756. String MATERIAL_NO = "";
  757. int num = 0;
  758. string fh = "";
  759. if (this.ultraTabControl1.Tabs[1].Selected)
  760. {
  761. UltraGridRow row = ultraGrid2.ActiveRow;
  762. CERT_NO = row.Cells["CERT_NO"].Value.ToString();//认证申报编号
  763. MATERIAL_NO = row.Cells["MATERIAL_NO"].Value.ToString();//产品序号
  764. }
  765. else if (this.ultraTabControl1.Tabs[3].Selected)
  766. {
  767. foreach (UltraGridRow ugr in this.ultraGrid5.Rows)
  768. {
  769. if (ugr.Cells["CHECK"].Value.ToString().ToLower() == "true")
  770. {
  771. num = num + 1;
  772. if (num <= 1)
  773. {
  774. CERT_NO = ugr.Cells["认证申报编号"].Value.ToString();
  775. MATERIAL_NO = ugr.Cells["MATERIAL_NO"].Value.ToString();
  776. fh = ",";
  777. }
  778. else
  779. {
  780. CERT_NO = CERT_NO + fh + ugr.Cells["认证申报编号"].Value.ToString();
  781. MATERIAL_NO = MATERIAL_NO + fh + ugr.Cells["MATERIAL_NO"].Value.ToString();
  782. }
  783. }
  784. }
  785. }
  786. Hashtable columnMap = new Hashtable();
  787. this.dataSet3.Clear();
  788. CoreClientParam ccp = new CoreClientParam();
  789. ccp.ServerName = "QCM.JHY01.JHY0103.DeleteMaterialInfo";
  790. ccp.MethodName = "delete2";
  791. ccp.ServerParams = new object[] { CERT_NO,MATERIAL_NO, this.UserInfo.GetUserName() };
  792. ccp.SourceDataTable = this.dataSet3.Tables[0];
  793. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  794. //ultraGrid2AfterRowActivate();
  795. this.DoQuery();//查询
  796. }
  797. catch (Exception ex)
  798. {
  799. System.Diagnostics.Debug.WriteLine(ex.ToString());
  800. MessageBox.Show("系统出错,请联系管理人员", "警告");
  801. }
  802. }
  803. #endregion
  804. #region 申报记录 事件
  805. private void ultraGrid2_AfterRowActivate(object sender, EventArgs e)
  806. {
  807. ultraGrid2AfterRowActivate();
  808. }
  809. public void ultraGrid2AfterRowActivate()
  810. {
  811. try
  812. {
  813. UltraGridRow row = ultraGrid2.ActiveRow;
  814. if (row == null)
  815. {
  816. this.dataSet3.Clear();
  817. }
  818. String CERT_NO = row.Cells["CERT_NO"].Value.ToString();//认证申报编号
  819. String BATCH_NO = "";//轧批号
  820. String design_key = "";//design_key
  821. this.dataSet3.Clear();
  822. CoreClientParam ccp = new CoreClientParam();
  823. ccp.ServerName = "QCM.JHY01.JHY0103.QuerryThirdInfo";
  824. ccp.MethodName = "QueryDetailInfo";
  825. ccp.ServerParams = new object[] { CERT_NO, BATCH_NO, design_key };
  826. ccp.SourceDataTable = this.dataSet3.Tables[0];
  827. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  828. }
  829. catch (Exception ex)
  830. {
  831. System.Diagnostics.Debug.WriteLine(ex.ToString());
  832. MessageBox.Show("系统出错,请联系管理人员", "警告");
  833. }
  834. }
  835. #endregion
  836. #endregion
  837. #region 其它事件
  838. #region 更新
  839. private void ultraGrid1_AfterHeaderCheckStateChanged(object sender, AfterHeaderCheckStateChangedEventArgs e)
  840. {
  841. ultraGrid1.UpdateData();
  842. }
  843. private void ultraGrid1_CellChange(object sender, CellEventArgs e)
  844. {
  845. ultraGrid1.UpdateData();
  846. }
  847. private void ultraGrid5_AfterHeaderCheckStateChanged(object sender, AfterHeaderCheckStateChangedEventArgs e)
  848. {
  849. ultraGrid5.UpdateData();
  850. }
  851. private void ultraGrid5_CellChange(object sender, CellEventArgs e)
  852. {
  853. ultraGrid5.UpdateData();
  854. }
  855. #endregion
  856. #endregion
  857. #region 按钮是否显示
  858. private void ultraTabControl1_SelectedTabChanged(object sender, Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventArgs e)
  859. {
  860. if (ultraTabControl1.SelectedTab.Text == "库存信息")
  861. {
  862. this.ToolBarItemEnable(this, "UnAdd", false);
  863. this.ToolBarItemEnable(this, "Del", false);
  864. this.ToolBarItemEnable(this, "Add", true);
  865. this.ToolBarItemEnable(this, "Excel", false);
  866. this.ToolBarItemEnable(this, "DoQuote", false);
  867. this.ToolBarItemEnable(this, "Excel2", true);
  868. checkBox2.Checked = false;
  869. }
  870. if (ultraTabControl1.SelectedTab.Index == 1)
  871. {
  872. this.ToolBarItemEnable(this, "Add", false);
  873. this.ToolBarItemEnable(this, "UnAdd", false);
  874. this.ToolBarItemEnable(this, "Del", false);
  875. this.ToolBarItemEnable(this, "Excel", false);
  876. this.ToolBarItemEnable(this, "DoQuote", false);
  877. this.ToolBarItemEnable(this, "Excel2", false);
  878. //this.PLINE_NAME.Hide();
  879. checkBox2.Checked = false;
  880. }
  881. if (ultraTabControl1.SelectedTab.Index == 3)
  882. {
  883. this.ToolBarItemEnable(this, "Add", false);
  884. this.ToolBarItemEnable(this, "UnAdd", true);
  885. this.ToolBarItemEnable(this, "Del", true);
  886. this.ToolBarItemEnable(this, "Excel", true);
  887. this.ToolBarItemEnable(this, "DoQuote", true);
  888. this.ToolBarItemEnable(this, "Excel2", false);
  889. checkBox2.Checked = false;
  890. }
  891. }
  892. #endregion
  893. private void ultraGrid1_InitializeRow(object sender, InitializeRowEventArgs e)
  894. {
  895. if (e.Row.Cells["PHYFSTSRESULT1"].Value.ToString().Equals("船检合格"))
  896. {
  897. e.Row.Appearance.ForeColor = Color.Red;
  898. }
  899. }
  900. private void checkBox1_Click(object sender, EventArgs e)
  901. {
  902. if (this.checkBox1.Checked)
  903. {
  904. this.dateTimePicker1.Enabled = false;
  905. this.dateTimePicker2.Enabled = false;
  906. this.textBox1.Enabled = true;
  907. }
  908. else
  909. {
  910. this.dateTimePicker1.Enabled = true;
  911. this.dateTimePicker2.Enabled = true;
  912. this.textBox1.Enabled = false;
  913. }
  914. }
  915. #region 全选
  916. private void checkBox2_CheckedChanged(object sender, EventArgs e)
  917. {
  918. if (this.ultraTabControl1.Tabs[0].Selected) //待申报
  919. {
  920. foreach (UltraGridRow ugr in this.ultraGrid1.Rows.Where(p => p.IsFilteredOut == false).ToList())
  921. {
  922. if (checkBox2.Checked)
  923. {
  924. ugr.Cells["check"].Value = "True";
  925. }
  926. else
  927. {
  928. ugr.Cells["check"].Value = "False";
  929. }
  930. }
  931. }
  932. else if (this.ultraTabControl1.Tabs[3].Selected) //申报记录
  933. {
  934. foreach (UltraGridRow ugr in this.ultraGrid5.Rows.Where(p => p.IsFilteredOut == false).ToList())
  935. {
  936. if (checkBox2.Checked)
  937. {
  938. ugr.Cells["check"].Value = "True";
  939. }
  940. else
  941. {
  942. ugr.Cells["check"].Value = "False";
  943. }
  944. }
  945. }
  946. }
  947. #endregion
  948. }
  949. }