AddPhyRItems.cs 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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 Core.Mes.Client.Comm.Tool;
  11. using Infragistics.Win.UltraWinEditors;
  12. using Core.Mes.Client.Comm.Server;
  13. using System.Collections;
  14. using Core.Mes.Client.Comm.Control;
  15. using Infragistics.Win.UltraWinGrid;
  16. namespace Core.StlMes.Client.Lims.Port
  17. {
  18. public partial class AddPhyRItems : FrmBase
  19. {
  20. private OpeBase _ob;
  21. public OpeBase Ob
  22. {
  23. get { return _ob; }
  24. set { _ob = value; }
  25. }
  26. private string strMaxItems;//大项代码
  27. public string StrMaxItems
  28. {
  29. get { return strMaxItems; }
  30. set { strMaxItems = value; }
  31. }
  32. private string strMinItems;//检验项代码
  33. public string StrMinItems
  34. {
  35. get { return strMinItems; }
  36. set { strMinItems = value; }
  37. }
  38. private UltraGridRow ugRow;//选择的Row 返回AddPhyItems
  39. public UltraGridRow UgRow
  40. {
  41. get { return ugRow; }
  42. set { ugRow = value; }
  43. }
  44. public AddPhyRItems()
  45. {
  46. InitializeComponent();
  47. }
  48. public AddPhyRItems(OpeBase ob, string strMaxItems, string strMinItems)
  49. {
  50. InitializeComponent();
  51. this._ob = ob;
  52. this.strMaxItems = strMaxItems;
  53. this.strMinItems = strMinItems;
  54. }
  55. private void AddPhyRItems_Load(object sender, EventArgs e)
  56. {
  57. QueryPhyRItems();
  58. QueryPhyItems();//查询检验项补充项
  59. }
  60. //查询理化项目方向、温度、尺寸信息
  61. private void QueryPhyRItems()
  62. {
  63. try
  64. {
  65. ArrayList al = new ArrayList();
  66. al.Add(strMaxItems);
  67. al.Add(strMinItems);
  68. DataTable dt = PublicServer.GetData("com.steering.mes.port.mil.FrmMilConfirmItems.QueryPhyRItems",
  69. new Object[] { al }, this._ob);
  70. if (dt.Rows.Count == 0)
  71. {
  72. return;
  73. }
  74. GridHelper.CopyDataToDatatable(dt, dataTable1, true);
  75. //GridHelper.RefreshAndAutoSize(ultraGrid1);
  76. }
  77. catch (Exception ex)
  78. {
  79. MessageUtil.ShowError(ex.Message);
  80. }
  81. }
  82. //查询检验项补充项
  83. private void QueryPhyItems()
  84. {
  85. QueryPhyItems_sub("A", ultraF);
  86. QueryPhyItems_sub("B", ultraW);
  87. QueryPhyItems_sub("C", ultraC);
  88. }
  89. private void QueryPhyItems_sub(string itemStyle, UltraComboEditor cmb)
  90. {
  91. try
  92. {
  93. ArrayList list = new ArrayList();
  94. list.Add(itemStyle);
  95. DataTable dt = PublicServer.GetData("com.steering.mes.port.mil.FrmMilConfirmItems.QueryPhyItems",
  96. new object[] { list }, this._ob);
  97. cmb.DataSource = dt;
  98. cmb.DisplayMember = "ITEM_NAME";
  99. cmb.ValueMember = "ITEM_CODE";
  100. ClsBaseInfo.SetComboItemHeight(cmb);
  101. }
  102. catch (Exception ex)
  103. {
  104. MessageUtil.ShowWarning(ex.Message);
  105. }
  106. }
  107. private void ultraGrid1_DoubleClick(object sender, EventArgs e)
  108. {
  109. this.ugRow = ultraGrid1.ActiveRow;
  110. this.DialogResult = DialogResult.OK;
  111. }
  112. }
  113. }