FrmPopStandards.cs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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;
  10. using Pur.Entity.configureEntity;
  11. using Core.Mes.Client.Comm.Control;
  12. using com.hnshituo.pur.vo;
  13. using Core.Mes.Client.Comm.Tool;
  14. using Infragistics.Win.UltraWinGrid;
  15. using Pur.Entity;
  16. namespace Pur.Pop_upWindow
  17. {
  18. public partial class FrmPopStandards : FrmPmsBase
  19. {
  20. public string QstrStandardsId = "";//标准编号ID
  21. public string QstrStandardsCode = "";//标准编号编码
  22. public FrmPopStandards(OpeBase ob)
  23. {
  24. InitializeComponent();
  25. this.ob = ob;
  26. }
  27. /// <summary>
  28. /// 查询标准编号
  29. /// </summary>
  30. /// <param name="PurPlanMEntity"></param>
  31. public void get_PurStandards()
  32. {
  33. PurStandardsEntity StandardsEntity = new PurStandardsEntity();
  34. StandardsEntity.Validflag = "1";
  35. DataTable dt = this.execute<DataTable>("com.hnshituo.pur.configure.service.StandardsService", "find", new object[] { StandardsEntity, 0, 0 });
  36. //按创建时间降序
  37. if (dt.Rows.Count > 0)
  38. {
  39. dt.DefaultView.Sort = "CREATETIME DESC";
  40. dt = dt.DefaultView.ToTable();
  41. }
  42. GridHelper.CopyDataToDatatable(ref dt, ref dataTable1, true);//绑定物料分类表
  43. }
  44. /// <summary>
  45. /// 筛选单位代码
  46. /// </summary>
  47. /// <param name="sender"></param>
  48. /// <param name="e"></param>
  49. private void txt_ITEM_UOM_CONEFFICIENT_TextChanged(object sender, EventArgs e)
  50. {
  51. foreach (UltraGridRow ugr in ultraGrid1.Rows)
  52. {
  53. if (ugr.Cells["VALIDFLAG"].Value.ToString().Equals("1"))
  54. {
  55. if (ugr.Cells["STANDARDSID"].Value.ToString().Contains(txt_STANDARDS_ID.Text) && ugr.Cells["STANDARDSCODE"].Value.ToString().Contains(txt_STANDARDS_CODE.Text))
  56. {
  57. ugr.Hidden = false; //显示行
  58. }
  59. else
  60. {
  61. ugr.Hidden = true; //隐藏行
  62. }
  63. }
  64. }
  65. }
  66. private void FrmPopStandards_Load(object sender, EventArgs e)
  67. {
  68. get_PurStandards();
  69. }
  70. /// <summary>
  71. /// 按钮控件
  72. /// </summary>
  73. /// <param name="sender"></param>
  74. /// <param name="e"></param>
  75. private void barsManagerButon_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
  76. {
  77. switch (e.Tool.Key.ToString())
  78. {
  79. case "conFirmation":
  80. {
  81. if (ultraGrid1.ActiveRow != null)
  82. {
  83. if (ultraGrid1.ActiveRow == null || ultraGrid1.ActiveRow.Hidden == true)
  84. {
  85. MessageUtil.ShowTips("请选择一条数据");
  86. return;
  87. }
  88. QstrStandardsId = ultraGrid1.ActiveRow.Cells["StandardsId"].Value.ToString();
  89. QstrStandardsCode = ultraGrid1.ActiveRow.Cells["StandardsCode"].Value.ToString();
  90. this.Close();
  91. }
  92. }
  93. break;
  94. case "ESC":
  95. {
  96. this.Close();
  97. }
  98. break;
  99. }
  100. }
  101. }
  102. }