FrmMatByMrIdChk.cs 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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 Pur.Entity.configureEntity;
  10. using Core.Mes.Client.Comm.Control;
  11. using CoreFS.CA06;using Pur.Entity;
  12. using Core.Mes.Client.Comm.Tool;
  13. using Infragistics.Win;
  14. using Pur.Entity;
  15. namespace Pur.Pop_upWindow
  16. {
  17. public partial class FrmMatByMrIdChk : FrmPmsBase
  18. {
  19. private DataTable q_dt = null;
  20. public DataTable Q_dt
  21. {
  22. get { return q_dt; }
  23. }
  24. public FrmMatByMrIdChk(OpeBase ob, string MrId)
  25. {
  26. InitializeComponent();
  27. this.ob = ob;
  28. GridHelper.SetExcludeColumnsActive(ultraGrid1.DisplayLayout.Bands[0], "Check");
  29. getMat(MrId);
  30. }
  31. /// <summary>
  32. /// 查询物料
  33. /// </summary>
  34. private void getMat(string MrId)
  35. {
  36. EntityPurPlanD eppd = new EntityPurPlanD();
  37. //eppd = this.execute<EntityPurPlanD>("com.hnshituo.pur.purplan.service.PurPlanDService", "findById", new object[] { MrLineId });
  38. eppd = new EntityPurPlanD();
  39. eppd.MrId = MrId;
  40. eppd.Validflag = "1";
  41. DataTable dt_mat = this.execute<DataTable>("com.hnshituo.pur.purplan.service.PurPlanDService", "find", new object[] { eppd, 0, 0 });
  42. GridHelper.CopyDataToDatatable(ref dt_mat, ref dataTable2, true);//绑定物料分类表
  43. }
  44. /// <summary>
  45. /// 选中物料
  46. /// </summary>
  47. /// <param name="sender"></param>
  48. /// <param name="e"></param>
  49. private void getPurPlanD()
  50. {
  51. ultraGrid1.UpdateData();
  52. DataTable dt = dataTable2.Clone();
  53. for (int i = 0; i < ultraGrid1.Rows.Count; i++)
  54. {
  55. if ((bool)ultraGrid1.Rows[i].Cells["Check"].Value)
  56. {
  57. for (int j = 0; j < dataTable2.Rows.Count; j++)
  58. {
  59. if (ultraGrid1.Rows[i].Cells["ITEMCODE"].Value.ToString() == dataTable2.Rows[j]["ITEMCODE"].ToString())
  60. {
  61. DataRow dr = dataTable2.Rows[j];
  62. dt.Rows.Add(dr.ItemArray);
  63. break;
  64. }
  65. }
  66. }
  67. }
  68. if (dt.Rows.Count > 0)
  69. {
  70. q_dt = dt;
  71. }
  72. else
  73. {
  74. MessageUtil.ShowTips("请选择物料");
  75. return;
  76. }
  77. this.Close();
  78. }
  79. /// <summary>
  80. /// 按钮控件
  81. /// </summary>
  82. /// <param name="sender"></param>
  83. /// <param name="e"></param>
  84. private void barsManagerButon_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
  85. {
  86. switch (e.Tool.Key.ToString())
  87. {
  88. case "Query":
  89. {
  90. }
  91. break;
  92. case "conFirmation":
  93. {
  94. getPurPlanD();
  95. }
  96. break;
  97. case "ESC":
  98. {
  99. this.Close();
  100. }
  101. break;
  102. }
  103. }
  104. /// <summary>
  105. /// 初始化界面加载数据
  106. /// </summary>
  107. /// <param name="sender"></param>
  108. /// <param name="e"></param>
  109. private void FrmMatByMrIdChk_Load(object sender, EventArgs e)
  110. {
  111. }
  112. }
  113. }