FrmPop-upChem.cs 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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;using Pur.Entity;using Pur.Entity;
  10. using Infragistics.Win.UltraWinGrid;
  11. using Core.Mes.Client.Comm.Control;
  12. using Core.Mes.Client.Comm;
  13. using Core.Mes.Client.Comm.Tool;
  14. using Pur.Entity.configureEntity;
  15. using Infragistics.Win;
  16. using com.hnshituo.com.vo;
  17. namespace Pur.Pop_upWindow
  18. {
  19. public partial class FrmPop_upChem : FrmPmsBase
  20. {
  21. public FrmPop_upChem()
  22. {
  23. InitializeComponent();
  24. }
  25. public FrmPop_upChem(OpeBase ob)
  26. {
  27. this.ob = ob;
  28. InitializeComponent();
  29. }
  30. /** 元素编码 */
  31. private string chemCode;
  32. public string ChemCode
  33. {
  34. get { return chemCode; }
  35. set { chemCode = value; }
  36. }
  37. /** 元素名称 */
  38. private string chemName;
  39. public string ChemName
  40. {
  41. get { return chemName; }
  42. set { chemName = value; }
  43. }
  44. private void FrmPop_upChem_Load(object sender, EventArgs e)
  45. {
  46. doQuery();
  47. }
  48. private void doConfirm()
  49. {
  50. UltraGridRow uge = ultraGrid1.ActiveRow;
  51. this.chemCode = uge.Cells["chemCode"].Value.ToString();
  52. this.chemName = uge.Cells["chemName"].Value.ToString();
  53. this.Close();
  54. }
  55. private void doClose()
  56. {
  57. this.Close();
  58. }
  59. private void doQuery()
  60. {
  61. try
  62. {
  63. BaseChem bc = new BaseChem();
  64. bc.Validflag = "1";
  65. bc.ChemCode = QchemCode.Text.ToString().Trim();
  66. bc.ChemName = QchemName.Text.ToString().Trim();
  67. DataTable dt = this.execute<DataTable>("com.hnshituo.pur.configure.service.BaseChemService", "find", new object[] { bc, 0, 0 });
  68. GridHelper.CopyDataToDatatable(dt, dataTable1, true);
  69. }
  70. catch (Exception ex)
  71. {
  72. MessageBox.Show("查询失败:" + ex.Message, "提示");
  73. return;
  74. }
  75. }
  76. private void barsManagerButon_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
  77. {
  78. switch (e.Tool.Key.ToString())
  79. {
  80. case "Query":
  81. {
  82. doQuery();
  83. }
  84. break;
  85. case "conFirmation":
  86. {
  87. doConfirm();
  88. }
  89. break;
  90. case "ESC":
  91. {
  92. this.Close();
  93. }
  94. break;
  95. }
  96. }
  97. private void ultraGrid1_DoubleClickRow(object sender, DoubleClickRowEventArgs e)
  98. {
  99. UltraGridRow uge = e.Row;
  100. this.chemCode = uge.Cells["chemCode"].Value.ToString();
  101. this.chemName = uge.Cells["chemName"].Value.ToString();
  102. this.Close();
  103. }
  104. }
  105. }