FrmMatGpInfo.cs 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. using Core.Mes.Client.Comm.Format;
  2. using Core.Mes.Client.Comm.Server;
  3. using Core.Mes.Client.Comm.Tool;
  4. using Core.StlMes.Client.PlnSaleOrd.炉计划.Entity;
  5. using CoreFS.CA06;
  6. using Infragistics.Win.UltraWinGrid;
  7. using System;
  8. using System.Collections;
  9. using System.Collections.Generic;
  10. using System.ComponentModel;
  11. using System.Data;
  12. using System.Drawing;
  13. using System.Linq;
  14. using System.Text;
  15. using System.Windows.Forms;
  16. namespace Core.StlMes.Client.PlnSaleOrd.Controls
  17. {
  18. public partial class FrmMatGpInfo : FrmBase
  19. {
  20. public string matNo = "";
  21. public string flag = "";
  22. private UltraGridRow row = null;
  23. private OpeBase _ob;
  24. public int count = 0;
  25. public FrmMatGpInfo(UltraGridRow uRow, OpeBase ob)
  26. {
  27. this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
  28. InitializeComponent();
  29. row = uRow;
  30. _ob = ob;
  31. }
  32. private void FrmMatGpInfo_Load(object sender, EventArgs e)
  33. {
  34. EntityHelper.ShowGridCaption<MatGpMEntityLk>(ultraGrid1.DisplayLayout.Bands[0]);
  35. doQueryMatGpInfo(row);
  36. }
  37. /// <summary>
  38. /// 查询库存信息
  39. /// </summary>
  40. /// <param name="row"></param>
  41. private void doQueryMatGpInfo(UltraGridRow row)
  42. {
  43. MatGpMEntity matGpEntity = (MatGpMEntity)row.ListObject;
  44. string matGpTity = JSONFormat.Format(matGpEntity);
  45. List<MatGpMEntityLk> listSource = EntityHelper.GetData<MatGpMEntityLk>("com.steering.pss.plnsaleord.planStove.FrmPlanMaterialSelection.queryMatGpInfo", new object[] { matGpTity }, _ob);
  46. matGpMEntityBindingSource.DataSource = listSource;
  47. }
  48. private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
  49. {
  50. switch (e.Tool.Key)
  51. {
  52. case "doFrim":
  53. doFrim();
  54. break;
  55. case "Close":
  56. closeFrm();
  57. break;
  58. }
  59. }
  60. /// <summary>
  61. /// 关闭
  62. /// </summary>
  63. private void closeFrm()
  64. {
  65. flag = "0";
  66. this.Close();
  67. }
  68. /// <summary>
  69. /// 确认
  70. /// </summary>
  71. private void doFrim()
  72. {
  73. this.ultraGrid1.UpdateData();
  74. IQueryable<UltraGridRow> checkMagRows = this.ultraGrid1.Rows.AsQueryable().Where(" CHK = 'True'");
  75. foreach(UltraGridRow uRow in checkMagRows)
  76. {
  77. MatGpMEntityLk matGpTity = (MatGpMEntityLk)uRow.ListObject;
  78. string matGpEntity = JSONFormat.Format(matGpTity);
  79. DataTable ds = ServerHelper.GetData("com.steering.pss.plnsaleord.planStove.FrmPlanMaterialSelection.queryGpMatNo", new object[] { matGpEntity }, _ob);
  80. for (int i = 0; i < ds.Rows.Count; i++)
  81. {
  82. matNo = matNo + ds.Rows[i]["MAT_NO"].ToString2()+",";
  83. count = count + 1;
  84. }
  85. }
  86. flag = "1";
  87. this.Close();
  88. }
  89. }
  90. }