FrmEnterMaterialDialog.cs 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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 Core.StlMes.Client.YdmPipeManage.Entity;
  10. using CoreFS.CA06;
  11. using Infragistics.Win.UltraWinGrid;
  12. using Core.Mes.Client.Comm.Tool;
  13. using Core.StlMes.Client.YdmPipeManage.Tool;
  14. namespace Core.StlMes.Client.YdmPipeManage.Dialog
  15. {
  16. public partial class FrmEnterMaterialDialog : FrmBase
  17. {
  18. //private string _materialNo;
  19. private OpeBase _ob;
  20. private ComPscEntity pscEntity = null;
  21. public ComPscEntity PscEntity
  22. {
  23. get { return pscEntity; }
  24. set { pscEntity = value; }
  25. }
  26. public FrmEnterMaterialDialog(OpeBase ob)
  27. {
  28. this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
  29. InitializeComponent();
  30. // _materialNo = materialNo;
  31. _ob = ob;
  32. }
  33. private void FrmMaterialDialog_Load(object sender, EventArgs e)
  34. {
  35. EntityHelper.ShowGridCaption<ComPscEntity>(UltraGridPsc.DisplayLayout.Bands[0]);
  36. BaseMethod.setOtherColumnReadOnly(UltraGridPsc, new string[] { "Chc" });
  37. DoQueryPsc();
  38. }
  39. private void DoQueryPsc()
  40. {
  41. List<ComPscEntity> listSource = EntityHelper.GetData<ComPscEntity>(
  42. "com.steering.pss.ydm.pipemanage.FrmPipeInventoryIn.getPsc", new object[] { }, _ob);
  43. comPscEntityBindingSource.DataSource = listSource;
  44. }
  45. //private void ActiveRow()
  46. //{
  47. // if (_materialNo.Length == 0)
  48. // {
  49. // return;
  50. // }
  51. // foreach (UltraGridRow ugr in UltraGridMaterial.Rows)
  52. // {
  53. // if (ugr.Cells[""].Value.ToString().Equals(_materialNo))
  54. // {
  55. // ugr.Activate();
  56. // ugr.Appearance.BackColor = Color.GreenYellow;
  57. // }
  58. // }
  59. //}
  60. //private void UltraGridPsc_AfterRowActivate(object sender, EventArgs e)
  61. //{
  62. // UltraGridRow ugr = UltraGridPsc.ActiveRow;
  63. // if (ugr == null)
  64. // {
  65. // //DoQueryMaterial("", "", "");
  66. // return;
  67. // }
  68. // string producCode = ugr.Cells["Produccode"].Text;
  69. // string steelCode = ugr.Cells["Steelcode"].Text;
  70. // string stdStyle = ugr.Cells["StdStyle"].Text;
  71. // //DoQueryMaterial(producCode, steelCode, stdStyle);
  72. //}
  73. private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
  74. {
  75. switch (e.Tool.Key)
  76. {
  77. case "Ensure":
  78. ensureData();
  79. break;
  80. case"Close":
  81. CloseForm();
  82. break;
  83. }
  84. }
  85. /// <summary>
  86. /// 关闭
  87. /// </summary>
  88. private void CloseForm()
  89. {
  90. pscEntity = null;
  91. this.Close();
  92. }
  93. /// <summary>
  94. /// 确认选择数据
  95. /// </summary>
  96. private void ensureData()
  97. {
  98. UltraGridRow ugrP = UltraGridPsc.ActiveRow;
  99. if (ugrP == null)
  100. {
  101. MessageUtil.ShowTips("请选择相应物料信息!");
  102. return;
  103. }
  104. pscEntity = (ComPscEntity)ugrP.ListObject;
  105. this.Close();
  106. }
  107. private void UltraGridPsc_DoubleClick(object sender, EventArgs e)
  108. {
  109. UltraGridRow ugrP = UltraGridPsc.ActiveRow;
  110. if (ugrP == null)
  111. {
  112. MessageUtil.ShowTips("请选择相应物料信息!");
  113. return;
  114. }
  115. pscEntity = (ComPscEntity)ugrP.ListObject;
  116. this.Close();
  117. }
  118. }
  119. }