QCM0303.cs 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617
  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 Infragistics.Win;
  11. using System.Collections;
  12. using Infragistics.Win.UltraWinGrid;
  13. using System.Diagnostics;
  14. namespace Core.LZMes.Client.QCM
  15. {
  16. public partial class QCM0303 : FrmBase
  17. {
  18. public QCM0303()
  19. {
  20. InitializeComponent();
  21. }
  22. public override void ToolBar_Click(object sender, string ToolbarKey)
  23. {
  24. switch (ToolbarKey)
  25. {
  26. case "Query":
  27. this.DoQuery();
  28. break;
  29. case "Export":
  30. this.DoExport();
  31. break;
  32. }
  33. }
  34. private void DoQuery()
  35. {
  36. if (this.ultraTabControl1.Tabs[0].Selected) //待判信息
  37. {
  38. DoQueryMe();
  39. }
  40. if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
  41. {
  42. DoQueryRe();
  43. }
  44. }
  45. //查询待判信息
  46. private void DoQueryMe()
  47. {
  48. try
  49. {
  50. this.dataSet2.Clear();
  51. string starttime ="";
  52. string endtime = "";
  53. if (checkBox2.Checked)
  54. {
  55. starttime = this.dateTimePicker1.Value.ToString("yyyyMMdd");
  56. endtime = this.dateTimePicker2.Value.AddDays(1).ToString("yyyyMMdd");
  57. }
  58. string sbatchno = "";
  59. string ebatchno = "";
  60. if (checkBox3.Checked)
  61. {
  62. sbatchno = this.textBox1.Text.Trim();
  63. if (textBox2.Text.ToString() == "")
  64. {
  65. ebatchno = this.textBox1.Text.Trim();
  66. }
  67. else
  68. {
  69. ebatchno = this.textBox2.Text.Trim();
  70. }
  71. }
  72. if (!checkBox2.Checked && !checkBox3.Checked)
  73. {
  74. MessageBox.Show("时间与轧批号必须选择其中一个条件!");
  75. return;
  76. }
  77. string orderno = this.textBox3.Text.Trim();// 订单号
  78. string psc = textBox4.Text.Trim(); //产品描述
  79. string prodline = this.comboBox3.Text.ToString();
  80. string isjudge = this.comboBox4.Text.ToString();
  81. //string steelname = this.textBox7.Text.ToString();
  82. CoreClientParam ccp = new CoreClientParam();
  83. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  84. ccp.MethodName = "doQueryMaterialDetailsJ";
  85. ccp.ServerParams = new object[] { starttime, endtime, sbatchno, ebatchno, orderno, psc,"M" ,prodline,isjudge};
  86. ccp.SourceDataTable = this.dataSet2.Tables[0];
  87. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  88. }
  89. catch (Exception ex)
  90. {
  91. System.Diagnostics.Debug.WriteLine(ex.ToString());
  92. MessageBox.Show("系统出错,请联系管理人员", "警告");
  93. }
  94. }
  95. //查询判定记录
  96. private void DoQueryRe()
  97. {
  98. try
  99. {
  100. this.dataSet5.Clear();
  101. string starttime = "";
  102. string endtime = "";
  103. if (checkBox2.Checked)
  104. {
  105. starttime = this.dateTimePicker1.Value.ToString("yyyyMMdd");
  106. endtime = this.dateTimePicker2.Value.ToString("yyyyMMdd");
  107. }
  108. string sbatchno = "";
  109. string ebatchno = "";
  110. if (checkBox3.Checked)
  111. {
  112. sbatchno = this.textBox1.Text.Trim();
  113. if (textBox2.Text.ToString() == "")
  114. {
  115. ebatchno = this.textBox1.Text.Trim();
  116. }
  117. else
  118. {
  119. ebatchno = this.textBox2.Text.Trim();
  120. }
  121. }
  122. if (!checkBox2.Checked && !checkBox3.Checked)
  123. {
  124. MessageBox.Show("时间与轧批号必须选择其中一个条件!");
  125. return;
  126. }
  127. string orderno = this.textBox3.Text.Trim();// 订单号
  128. string psc = textBox4.Text.Trim(); //产品描述
  129. string stellname = this.textBox7.Text.Trim();
  130. string prodline = this.comboBox3.Text.ToString();
  131. CoreClientParam ccp = new CoreClientParam();
  132. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  133. ccp.MethodName = "GetMeasureInfoJ";
  134. ccp.ServerParams = new object[] { starttime, endtime, sbatchno, ebatchno, orderno, psc, prodline, stellname };
  135. ccp.SourceDataTable = this.dataSet5.Tables[0];
  136. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  137. }
  138. catch (Exception ex)
  139. {
  140. System.Diagnostics.Debug.WriteLine(ex.ToString());
  141. MessageBox.Show("系统出错,请联系管理人员", "警告");
  142. }
  143. }
  144. private void ultraGrid2_AfterRowActivate(object sender, EventArgs e)
  145. {
  146. try
  147. {
  148. UltraGridRow ugr = this.ultraGrid2.ActiveRow;
  149. if (ugr == null)
  150. return;
  151. this.dataSet3.Clear();
  152. string design_key = ugr.Cells["DESIGN_KEY"].Value.ToString();
  153. string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString();
  154. CoreClientParam ccp = new CoreClientParam();
  155. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  156. ccp.MethodName = "getToleranceJ";
  157. ccp.ServerParams = new object[] { design_key, material_no };
  158. ccp.SourceDataTable = this.dataSet3.Tables[0];
  159. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  160. this.dataSet4.Clear();
  161. string sic_id = ugr.Cells["SIZEID"].Value.ToString();
  162. if (sic_id != "")
  163. {
  164. ccp = new CoreClientParam();
  165. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  166. ccp.MethodName = "getQcmJudgeMeasureJ";
  167. ccp.ServerParams = new object[] { sic_id };
  168. ccp.SourceDataTable = this.dataSet4.Tables[0];
  169. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  170. }
  171. if (design_key != "")
  172. {
  173. ccp = new CoreClientParam();
  174. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  175. ccp.MethodName = "GetMemo";
  176. ccp.ServerParams = new object[] { design_key };
  177. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  178. if (ccp.SourceDataTable.Rows.Count == 0)
  179. {
  180. this.textBox6.Text = "";
  181. }
  182. else
  183. {
  184. this.textBox6.Text = ccp.SourceDataTable.Rows[0]["MEMO"].ToString();
  185. }
  186. }
  187. }
  188. catch (Exception ex)
  189. {
  190. System.Diagnostics.Debug.WriteLine(ex.ToString());
  191. MessageBox.Show("系统出错,请联系管理人员", "警告");
  192. }
  193. }
  194. private void QCM0303_Load(object sender, EventArgs e)
  195. {
  196. this.comboBox3.SelectedIndex = 0;
  197. ValueList VFLAW_SIZE_DESC = new ValueList();
  198. VFLAW_SIZE_DESC.ValueListItems.Add("0", "传动侧");
  199. VFLAW_SIZE_DESC.ValueListItems.Add("1", "中间");
  200. VFLAW_SIZE_DESC.ValueListItems.Add("2", "操作侧");
  201. this.ultraGrid5.DisplayLayout.Bands[0].Columns["THICK_TYPE"].ValueList = VFLAW_SIZE_DESC;
  202. ValueList vsflv = new ValueList();
  203. CoreClientParam ccp = new CoreClientParam(); ccp = new CoreClientParam();
  204. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  205. ccp.MethodName = "findSfLv";
  206. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  207. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  208. {
  209. vsflv.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  210. }
  211. this.comboBox2.DataSource = vsflv.ValueListItems;
  212. this.ultraGrid2.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
  213. this.ultraGrid4.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
  214. this.dateTimePicker1.Value = System.DateTime.Now.AddDays(-7);
  215. this.comboBox3.SelectedIndex = 0;
  216. this.comboBox4.SelectedIndex = 0;
  217. DoQuery();
  218. }
  219. private void ultraGrid4_AfterRowActivate(object sender, EventArgs e)
  220. {
  221. try
  222. {
  223. UltraGridRow ugr = this.ultraGrid4.ActiveRow;
  224. if (ugr == null)
  225. return;
  226. this.dataSet6.Clear();
  227. string sic = ugr.Cells["SIC_ID"].Value.ToString();
  228. CoreClientParam ccp = new CoreClientParam();
  229. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  230. ccp.MethodName = "getToleranceInfoNew";
  231. ccp.ServerParams = new object[] { sic };
  232. ccp.SourceDataTable = this.dataSet6.Tables[0];
  233. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  234. this.dataSet7.Clear();
  235. ccp = new CoreClientParam();
  236. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  237. ccp.MethodName = "getQcmJudgeMeasureJ";
  238. ccp.ServerParams = new object[] { sic };
  239. ccp.SourceDataTable = this.dataSet7.Tables[0];
  240. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  241. }
  242. catch (Exception ex)
  243. {
  244. System.Diagnostics.Debug.WriteLine(ex.ToString());
  245. MessageBox.Show("系统出错,请联系管理人员", "警告");
  246. }
  247. }
  248. private void button1_Click(object sender, EventArgs e)
  249. {
  250. try
  251. {
  252. int count = 0;
  253. foreach (UltraGridRow ugr in this.ultraGrid2.Rows)
  254. {
  255. if (ugr.Cells["CHECK"].Text.ToString() == "True")
  256. {
  257. count++;
  258. }
  259. }
  260. List<UltraGridRow> lists = new List<UltraGridRow>();
  261. foreach (UltraGridRow ugr in this.ultraGrid2.Rows)
  262. {
  263. if (ugr.Cells["CHECK"].Text.ToString() == "True")
  264. {
  265. if (count == 1)
  266. {
  267. ArrayList list1 = new ArrayList();
  268. List<ArrayList> list2 = new List<ArrayList>();
  269. List<ArrayList> list3 = new List<ArrayList>();
  270. list1.Add(ugr.Cells["DESIGN_KEY"].Value.ToString());
  271. list1.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
  272. if (comboBox1.Text.ToString() == "")
  273. {
  274. MessageBox.Show("请输入登记结果!");
  275. return;
  276. }
  277. else
  278. {
  279. if (comboBox1.Text.ToString() == "合格")
  280. {
  281. list1.Add("1");
  282. list1.Add("合格");
  283. }
  284. else if (comboBox1.Text.ToString() == "不合格")
  285. {
  286. list1.Add("2");
  287. list1.Add("不合格");
  288. }
  289. else
  290. {
  291. list1.Add("0");
  292. list1.Add("待判");
  293. }
  294. }
  295. string is_zl = "";
  296. if (comboBox2.Text.ToString() == "正品")
  297. {
  298. is_zl = "512601";
  299. }
  300. else if (comboBox2.Text.ToString() == "次品")
  301. {
  302. is_zl = "512602";
  303. }
  304. else if (comboBox2.Text.ToString() == "废品")
  305. {
  306. is_zl = "512603";
  307. }
  308. else if (comboBox2.Text.ToString() == "协议品")
  309. {
  310. is_zl = "512604";
  311. }
  312. else if (comboBox2.Text.ToString() == "订单外")
  313. {
  314. is_zl = "512605";
  315. }
  316. list1.Add(textBox5.Text.Trim().ToString());
  317. list1.Add(this.UserInfo.GetUserName());
  318. list1.Add(this.UserInfo.GetUserOrderText());
  319. list1.Add(this.UserInfo.GetUserGroupText());
  320. list1.Add(is_zl);//质量等级代码
  321. list1.Add(comboBox2.Text.Trim().ToString());//质量等级名称
  322. foreach (UltraGridRow ugrs in this.ultraGrid3.Rows)
  323. {
  324. ArrayList list = new ArrayList();
  325. list.Add(ugrs.Cells["bias_code"].Text.ToString());
  326. //if (ugrs.Cells["val"].Text.ToString() == "")
  327. //{
  328. // MessageBox.Show("请输入判定值");
  329. // return;
  330. //}
  331. list.Add(ugrs.Cells["val"].Text.ToString());
  332. list.Add(ugrs.Cells["bias_name"].Text.ToString());
  333. list.Add(ugrs.Cells["plan"].Text.ToString());
  334. list2.Add(list);
  335. }
  336. foreach (UltraGridRow ugr1 in this.ultraGrid5.Rows)
  337. {
  338. if (ugr1.Cells["CHECK"].Text.ToString() == "True")
  339. {
  340. ArrayList listc = new ArrayList();
  341. listc.Add(ugr1.Cells["THICK_TYPE"].Text.ToString());
  342. listc.Add(ugr1.Cells["THICK_VAL"].Text.ToString());
  343. listc.Add(ugr1.Cells["H_VAL"].Value.ToString());
  344. listc.Add(ugr1.Cells["M_VAL"].Value.ToString());
  345. listc.Add(ugr1.Cells["R_VAL"].Value.ToString());
  346. list3.Add(listc);
  347. }
  348. }
  349. if ((comboBox1.Text.ToString() == "合格" && comboBox2.Text.ToString() != "正品") || (comboBox1.Text.ToString() == "不合格" && comboBox2.Text.ToString() == "正品"))
  350. {
  351. MessageBox.Show("检验结果与质量等级不一致!");
  352. return;
  353. }
  354. CoreClientParam ccp = new CoreClientParam();
  355. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  356. ccp.MethodName = "judgeByHuman2";
  357. ccp.ServerParams = new object[] { list1, list2, list3 };
  358. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  359. if (ccp.ReturnCode == -1)
  360. {
  361. return;
  362. }
  363. lists.Add(ugr);
  364. }
  365. else
  366. {
  367. ArrayList list1 = new ArrayList();
  368. List<ArrayList> list3 = new List<ArrayList>();
  369. list1.Add(ugr.Cells["DESIGN_KEY"].Value.ToString());
  370. list1.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
  371. if (comboBox1.Text.ToString() == "")
  372. {
  373. MessageBox.Show("请输入登记结果!");
  374. return;
  375. }
  376. else
  377. {
  378. if (comboBox1.Text.ToString() == "合格")
  379. {
  380. list1.Add("1");
  381. list1.Add("合格");
  382. }
  383. else if (comboBox1.Text.ToString() == "待判")
  384. {
  385. list1.Add("0");
  386. list1.Add("待判");
  387. }
  388. else
  389. {
  390. list1.Add("2");
  391. list1.Add("不合格");
  392. }
  393. }
  394. string is_zl = "";
  395. if (comboBox2.Text.ToString() == "正品")
  396. {
  397. is_zl = "512601";
  398. }
  399. else if (comboBox2.Text.ToString() == "次品")
  400. {
  401. is_zl = "512602";
  402. }
  403. else if (comboBox2.Text.ToString() == "废品")
  404. {
  405. is_zl = "512603";
  406. }
  407. else if (comboBox2.Text.ToString() == "协议品")
  408. {
  409. is_zl = "512604";
  410. }
  411. else if (comboBox2.Text.ToString() == "订单外")
  412. {
  413. is_zl = "512605";
  414. }
  415. list1.Add(textBox5.Text.Trim().ToString());
  416. list1.Add(this.UserInfo.GetUserName());
  417. list1.Add(this.UserInfo.GetUserOrderText());
  418. list1.Add(this.UserInfo.GetUserGroupText());
  419. list1.Add(is_zl);//质量等级代码
  420. list1.Add(comboBox2.Text.Trim().ToString());//质量等级名称
  421. foreach (UltraGridRow ugr1 in this.ultraGrid5.Rows)
  422. {
  423. if (ugr1.Cells["CHECK"].Text.ToString() == "True")
  424. {
  425. ArrayList listc = new ArrayList();
  426. listc.Add(ugr1.Cells["THICK_TYPE"].Text.ToString());
  427. listc.Add(ugr1.Cells["THICK_VAL"].Text.ToString());
  428. listc.Add(ugr1.Cells["H_VAL"].Value.ToString());
  429. listc.Add(ugr1.Cells["M_VAL"].Value.ToString());
  430. listc.Add(ugr1.Cells["R_VAL"].Value.ToString());
  431. list3.Add(listc);
  432. }
  433. }
  434. if ((comboBox1.Text.ToString() == "合格" && comboBox2.Text.ToString() != "正品") || (comboBox1.Text.ToString() == "不合格" && comboBox2.Text.ToString() == "正品"))
  435. {
  436. MessageBox.Show("检验结果与质量等级不一致!");
  437. return;
  438. }
  439. CoreClientParam ccp = new CoreClientParam();
  440. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  441. ccp.MethodName = "judgeByHumanJ";
  442. ccp.ServerParams = new object[] { list1,list3 };
  443. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  444. if (ccp.ReturnCode == -1)
  445. {
  446. return;
  447. }
  448. lists.Add(ugr);
  449. }
  450. }
  451. }
  452. for (int i = 0; i < lists.Count; i++)
  453. {
  454. lists[i].Delete(false);
  455. }
  456. MessageBox.Show("检验登记成功!");
  457. }
  458. catch (Exception EX)
  459. {
  460. MessageBox.Show(EX.ToString());
  461. }
  462. //DoQuery();
  463. }
  464. private void checkBox1_CheckedChanged(object sender, EventArgs e)
  465. {
  466. foreach (UltraGridRow ugr in this.ultraGrid2.Rows.Where(p => p.IsFilteredOut == false).ToList())
  467. {
  468. if (checkBox1.Checked)
  469. {
  470. ugr.Cells["CHECK"].Value = "True";
  471. }
  472. else
  473. {
  474. ugr.Cells["CHECK"].Value = "False";
  475. }
  476. }
  477. }
  478. private void ultraGrid3_KeyDown(object sender, KeyEventArgs e)
  479. {
  480. UltraGrid grid = (UltraGrid)sender;
  481. if (e.KeyCode == Keys.Enter)
  482. {
  483. //Go down one row
  484. grid.PerformAction(UltraGridAction.EnterEditMode);
  485. grid.PerformAction(UltraGridAction.BelowCell);
  486. foreach (UltraGridRow ugrs in this.ultraGrid3.Rows)
  487. {
  488. ArrayList list = new ArrayList();
  489. ugrs.Appearance.BackColor = Color.White;
  490. double val1 = Convert.ToDouble(ugrs.Cells["val"].Text.ToString()) - Convert.ToDouble(ugrs.Cells["plan"].Text.ToString());
  491. if (ugrs.Cells["std_min_val"].Text.ToString() != "" && Convert.ToDouble(ugrs.Cells["std_min_val"].Text.ToString()) - val1 > 0)
  492. {
  493. ugrs.Appearance.BackColor = Color.Yellow;
  494. this.comboBox1.SelectedIndex = 0;
  495. }
  496. if (ugrs.Cells["std_max_val"].Text.ToString() != "" && Convert.ToDouble(ugrs.Cells["std_max_val"].Text.ToString()) - val1 < 0)
  497. {
  498. ugrs.Appearance.BackColor = Color.Yellow;
  499. this.comboBox1.SelectedIndex = 0;
  500. }
  501. if (ugrs.Cells["std_min_val_k"].Text.ToString() != "" && Convert.ToDouble(ugrs.Cells["std_min_val_k"].Text.ToString()) - val1 > 0)
  502. {
  503. ugrs.Appearance.BackColor = Color.Yellow;
  504. this.comboBox1.SelectedIndex = 0;
  505. }
  506. if (ugrs.Cells["std_max_val_k"].Text.ToString() != "" && Convert.ToDouble(ugrs.Cells["std_max_val_k"].Text.ToString()) - val1 < 0)
  507. {
  508. ugrs.Appearance.BackColor = Color.Yellow;
  509. this.comboBox1.SelectedIndex = 0;
  510. }
  511. if (ugrs.Cells["std_min_val_n"].Text.ToString() != "" && Convert.ToDouble(ugrs.Cells["std_min_val_n"].Text.ToString()) - val1 > 0)
  512. {
  513. ugrs.Appearance.BackColor = Color.Yellow;
  514. this.comboBox1.SelectedIndex = 0;
  515. }
  516. if (ugrs.Cells["std_max_val_n"].Text.ToString() != "" && Convert.ToDouble(ugrs.Cells["std_max_val_n"].Text.ToString()) - val1 < 0)
  517. {
  518. ugrs.Appearance.BackColor = Color.Yellow;
  519. this.comboBox1.SelectedIndex = 0;
  520. }
  521. }
  522. }
  523. }
  524. private void ultraTabControl1_Click(object sender, EventArgs e)
  525. {
  526. if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
  527. {
  528. this.label11.Visible = false;
  529. this.comboBox4.Visible = false;
  530. this.label12.Text = "判定时间";
  531. }
  532. if (this.ultraTabControl1.Tabs[0].Selected) //判定记录
  533. {
  534. this.label11.Visible = true;
  535. this.comboBox4.Visible = true;
  536. this.label12.Text = "生产时间";
  537. }
  538. }
  539. private void ultraGrid5_KeyDown(object sender, KeyEventArgs e)
  540. {
  541. switch (e.KeyCode)
  542. {
  543. case Keys.Up:
  544. this.ultraGrid5.PerformAction(UltraGridAction.ExitEditMode, false, false);
  545. this.ultraGrid5.PerformAction(UltraGridAction.AboveCell, false, false);
  546. e.Handled = true;
  547. this.ultraGrid5.PerformAction(UltraGridAction.EnterEditMode, false, false);
  548. break;
  549. case Keys.Down:
  550. this.ultraGrid5.PerformAction(UltraGridAction.ExitEditMode, false, false);
  551. this.ultraGrid5.PerformAction(UltraGridAction.BelowCell, false, false);
  552. e.Handled = true;
  553. this.ultraGrid5.PerformAction(UltraGridAction.EnterEditMode, false, false);
  554. break;
  555. case Keys.Right:
  556. this.ultraGrid5.PerformAction(UltraGridAction.ExitEditMode, false, false);
  557. this.ultraGrid5.PerformAction(UltraGridAction.NextCellByTab, false, false);
  558. e.Handled = true;
  559. this.ultraGrid5.PerformAction(UltraGridAction.EnterEditMode, false, false);
  560. break;
  561. case Keys.Left:
  562. this.ultraGrid5.PerformAction(UltraGridAction.ExitEditMode, false, false);
  563. this.ultraGrid5.PerformAction(UltraGridAction.PrevCellByTab, false, false);
  564. e.Handled = true;
  565. this.ultraGrid5.PerformAction(UltraGridAction.EnterEditMode, false, false);
  566. break;
  567. }
  568. }
  569. private void DoExport()
  570. {
  571. try
  572. {
  573. if (this.ultraGrid4.Rows.Count == 0)
  574. {
  575. MessageBox.Show("没有可以导出的数据", "提示");
  576. return;
  577. }
  578. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  579. {
  580. string fName = this.saveFileDialog1.FileName;
  581. this.ultraGridExcelExporter1.Export(this.ultraGrid4, fName);
  582. Process.Start(fName);
  583. }
  584. }
  585. catch (Exception ex)
  586. {
  587. System.Diagnostics.Debug.WriteLine(ex.ToString());
  588. }
  589. }
  590. }
  591. }