frmSetMaterialName.cs 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Data;
  5. using System.Windows.Forms;
  6. using Core.Mes.Client.Comm.Tool;
  7. using Core.StlMes.Client.LgClassModel;
  8. using CoreFS.CA06;
  9. using Infragistics.Win;
  10. namespace Core.StlMes.Client.LgCommon
  11. {
  12. public partial class frmSetMaterialName : Form
  13. {
  14. private OpeBase ob;
  15. private List<CostBaseMetalTypeEntity> CostBaseMetalTypeEntityList;
  16. public frmSetMaterialName(string szWLM, string szLX, OpeBase ob)
  17. {
  18. InitializeComponent();
  19. this.m_szLX = szLX;
  20. this.ob = ob;
  21. this.label1.Text = "当前物料名:" + szWLM;
  22. ClsControlPack.SetUltraGridAppearance(this);
  23. ulgridMtrInfo.DisplayLayout.Override.RowSelectors = DefaultableBoolean.False;
  24. }
  25. private DataTable m_dtMain = null;
  26. private string m_szLX = "1";
  27. public bool bChange = false;
  28. // public string m_szWLMC = ""; //物料名称
  29. public string m_szWLBM = ""; //物料编码
  30. //public string m_szWLLX = ""; //物料类型
  31. private void frmSetMaterialName_Load(object sender, EventArgs e)
  32. {
  33. GetDataSource();
  34. }
  35. private void GetDataSource()
  36. {
  37. ClsControlPack.SetReadOnly(ulgridMtrInfo);
  38. EntityHelper.ShowGridCaption<CostBaseMetalTypeEntity>(ulgridMtrInfo.DisplayLayout.Bands[0]);
  39. string strMsg = "";
  40. bool bSuccess = false;
  41. CostBaseMetalTypeEntityList = EntityHelper.GetData<CostBaseMetalTypeEntity>(
  42. "Core.LgMes.Server.LgDeviceManager.StlAdditive.GetMaterialData", null, ob);
  43. costBaseMetalTypeEntityBindingSource.DataSource = CostBaseMetalTypeEntityList;
  44. ClsControlPack.RefreshAndAutoSize(ulgridMtrInfo);
  45. }
  46. private void rbFZL_Click(object sender, EventArgs e)
  47. {
  48. }
  49. private void rbHJ_Click(object sender, EventArgs e)
  50. {
  51. }
  52. private void btOK_Click(object sender, EventArgs e)
  53. {
  54. if (this.ulgridMtrInfo.ActiveRow != null)
  55. {
  56. var CostBaseMetalTypeEntity = ulgridMtrInfo.ActiveRow.ListObject as CostBaseMetalTypeEntity;
  57. if (CostBaseMetalTypeEntity == null) return;
  58. this.bChange = true;
  59. m_szWLBM = CostBaseMetalTypeEntity.ItemCode;
  60. }
  61. this.Close();
  62. }
  63. private void btReset_Click(object sender, EventArgs e)
  64. {
  65. try
  66. {
  67. this.bChange = true;
  68. m_szWLBM = "";
  69. /* m_szWLMC = "";
  70. m_szWLLX = "";*/
  71. this.Close();
  72. }
  73. catch { }
  74. }
  75. private void btClose_Click(object sender, EventArgs e)
  76. {
  77. this.Close();
  78. }
  79. private void rbWS_Click(object sender, EventArgs e)
  80. {
  81. }
  82. private void ulgridMtrInfo_DoubleClickRow(object sender, Infragistics.Win.UltraWinGrid.DoubleClickRowEventArgs e)
  83. {
  84. if (e.Row != null && e.Row.Index > -1)
  85. {
  86. var CostBaseMetalTypeEntity = ulgridMtrInfo.ActiveRow.ListObject as CostBaseMetalTypeEntity;
  87. if (CostBaseMetalTypeEntity == null) return;
  88. this.bChange = true;
  89. m_szWLBM = CostBaseMetalTypeEntity.ItemCode;
  90. this.Close();
  91. }
  92. }
  93. }
  94. }