ComMscPilneCtrl.cs 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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;
  10. using Core.Mes.Client.Comm.Control;
  11. using Infragistics.Win.UltraWinGrid;
  12. namespace Core.StlMes.Client.Plan.Order
  13. {
  14. public partial class ComMscPilneCtrl : UserControl
  15. {
  16. /// <summary>
  17. /// 质量设计
  18. /// </summary>
  19. private string desginKey = "";
  20. /// <summary>
  21. /// 制程
  22. /// </summary>
  23. private string cheMscPline = "";
  24. private ComMscPilneBLL mscPilneBLL;
  25. public ComMscPilneCtrl()
  26. {
  27. InitializeComponent();
  28. }
  29. public void ComBLL(OpeBase ob)
  30. {
  31. mscPilneBLL = new ComMscPilneBLL(ob);
  32. }
  33. /// <summary>
  34. /// 查询制程
  35. /// </summary>
  36. public void DoQuery()
  37. {
  38. DataTable dt = mscPilneBLL.Query(desginKey);
  39. GridHelper.CopyDataToDatatable(dt, this.dataTable1, true);
  40. PlanComm.setGridActivation(this.ultraGridMscPline.DisplayLayout.Bands[0], "CHC");
  41. if (!cheMscPline.Equals("") && ultraGridMscPline.Rows.Count > 0)
  42. {
  43. foreach (UltraGridRow uRow in this.ultraGridMscPline.Rows)
  44. {
  45. if (uRow.Cells["MSC_PLINE"].Value.ToString().Equals(cheMscPline))
  46. {
  47. uRow.Cells["CHC"].Value = true;
  48. ultraGridMscPline.ActiveRow = uRow;
  49. }
  50. }
  51. }
  52. }
  53. /// <summary>
  54. /// 查询制程信息
  55. /// </summary>
  56. public void DoQueryInfo(string mscPline)
  57. {
  58. DataTable dtPrc = mscPilneBLL.QueryPrc(desginKey, mscPline);
  59. DataTable dtGrade = mscPilneBLL.QueryGrade(desginKey, mscPline);
  60. lblStationPath.Value = mscPilneBLL.QueryStation(desginKey, mscPline);
  61. GridHelper.CopyDataToDatatable(dtPrc, this.dataTable2, true);
  62. GridHelper.CopyDataToDatatable(dtGrade, this.dataTable3, true);
  63. PlanComm.setGridActivation(this.ultraGridProcess.DisplayLayout.Bands[0]);
  64. PlanComm.setGridActivation(this.ultraGridGrade.DisplayLayout.Bands[0]);
  65. }
  66. private void ultraGridMscPline_AfterRowActivate(object sender, EventArgs e)
  67. {
  68. string mscPline = ultraGridMscPline.ActiveRow.Cells["MSC_PLINE"].Value.ToString();
  69. DoQueryInfo(mscPline);
  70. }
  71. private void ultraGridMscPline_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
  72. {
  73. if (e.Cell.Column.Key.Equals("CHC"))
  74. {
  75. if (Convert.ToBoolean(e.Cell.Row.Cells["CHC"].Text))
  76. {
  77. cheMscPline = e.Cell.Row.Cells["MSC_PLINE"].Value.ToString();
  78. foreach (UltraGridRow uRow in ultraGridMscPline.Rows)
  79. {
  80. if (uRow != e.Cell.Row)
  81. {
  82. uRow.Cells["CHC"].Value = false;
  83. }
  84. }
  85. }
  86. else
  87. {
  88. e.Cell.Row.Cells["CHC"].Value = true;
  89. }
  90. }
  91. }
  92. /// <summary>
  93. /// 质量设计
  94. /// </summary>
  95. public string DesginKey
  96. {
  97. get { return desginKey; }
  98. set { desginKey = value; }
  99. }
  100. /// <summary>
  101. /// 制程
  102. /// </summary>
  103. public string CheMscPline
  104. {
  105. get { return cheMscPline; }
  106. set { cheMscPline = value; }
  107. }
  108. /// <summary>
  109. /// 制程grid
  110. /// </summary>
  111. public Infragistics.Win.UltraWinGrid.UltraGrid UltraGridMscPline
  112. {
  113. get { return ultraGridMscPline; }
  114. set { ultraGridMscPline = value; }
  115. }
  116. }
  117. }