HeatPlanControl.cs 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Drawing;
  5. using System.Data;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using com.steering.mes.mcp.entity;
  10. using Core.Mes.Client.Comm.Control;
  11. using Core.Mes.Client.Comm.Server;
  12. using Core.Mes.Client.Comm.Tool;
  13. using Core.StlMes.Client.Mcp.Control.Entity;
  14. using CoreFS.CA06;
  15. using Infragistics.Win.UltraWinEditors;
  16. namespace Core.StlMes.Client.Mcp.Control.Common
  17. {
  18. public delegate void AfterRowActivateHandler(object sender, PlnZyRclCEntity e);
  19. public partial class HeatPlanControl : UserControl
  20. {
  21. public event AfterRowActivateHandler AfterRowActivateHandler;
  22. public HeatPlanControl()
  23. {
  24. InitializeComponent();
  25. EntityHelper.ShowGridCaption<PlnZyRclCEntity>(ultraGrid1.DisplayLayout.Bands[0]);
  26. commHelper.RefreshAndAutoSize(ultraGrid1);
  27. commHelper.setOtherColumnReadOnly(ultraGrid1,new string[]{});
  28. }
  29. public OpeBase Ob { get; set; }
  30. public string Gx { get; set; }
  31. public bool Status1
  32. {
  33. get { return contorlPlanStatus1.Status1; }
  34. set { contorlPlanStatus1.Status1 = value; }
  35. }
  36. public bool Status2
  37. {
  38. get { return contorlPlanStatus1.Status2; }
  39. set { contorlPlanStatus1.Status2 = value; }
  40. }
  41. public bool Status3
  42. {
  43. get { return contorlPlanStatus1.Status3; }
  44. set { contorlPlanStatus1.Status3 = value; }
  45. }
  46. public bool Status4
  47. {
  48. get { return contorlPlanStatus1.Status4; }
  49. set { contorlPlanStatus1.Status4= value; }
  50. }
  51. public bool Status5
  52. {
  53. get { return contorlPlanStatus1.Status5; }
  54. set { contorlPlanStatus1.Status5 = value; }
  55. }
  56. /// <summary>
  57. /// 只显示主表数据
  58. /// </summary>
  59. public bool ShowMain { get; set; }
  60. public void Query(string[] PlineCodes)
  61. {
  62. var starts = "";
  63. var plnNo = "";
  64. var judgeStoveNo = "";
  65. var start = contorlPlanStatus1.statusArr;
  66. if (chkPlnNo.Checked)
  67. if (string.IsNullOrEmpty(txtRollBatchId.Text.Trim()))
  68. {
  69. MessageUtil.ShowTips("请输入炉次计划号!");
  70. return;
  71. }
  72. else
  73. {
  74. plnNo = txtRollBatchId.Text.Trim();
  75. start = new string[5] {"00", "10", "20", "30", "40"};
  76. }
  77. if (chkJuNo.Checked)
  78. if (string.IsNullOrEmpty(txtZyBatchId.Text.Trim()))
  79. {
  80. MessageUtil.ShowTips("请输入炉号!");
  81. return;
  82. }
  83. else
  84. {
  85. judgeStoveNo = txtZyBatchId.Text.Trim();
  86. start = new string[5] { "00", "10", "20", "30", "40" };
  87. }
  88. plnZyRclCEntityBindingSource.DataSource = EntityHelper.GetData<PlnZyRclCEntity>(
  89. "com.steering.mes.mcp.common.PlanService.getSingleRclPlan", new object[] { ShowMain, plnNo, judgeStoveNo, PlineCodes, start, Gx, ultraOptionSet2.Value.ToString2() }, Ob);
  90. commHelper.RefreshAndAutoSize(ultraGrid1);
  91. }
  92. public PlnZyRclCEntity ActiveRow
  93. {
  94. get
  95. {
  96. if (ultraGrid1.ActiveRow == null) return null;
  97. return ultraGrid1.ActiveRow.ListObject as PlnZyRclCEntity;
  98. }
  99. }
  100. private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
  101. {
  102. PlnZyRclCEntity PlnZyRclCEntity = ultraGrid1.ActiveRow.ListObject as PlnZyRclCEntity;
  103. if(PlnZyRclCEntity==null) return;
  104. var handler = AfterRowActivateHandler;
  105. if (handler != null) handler(this, PlnZyRclCEntity);
  106. }
  107. private void ultraGrid1_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e)
  108. {
  109. PlnZyRclCEntity PlnZyRclCEntity = e.Row.ListObject as PlnZyRclCEntity;
  110. if(PlnZyRclCEntity==null) return;
  111. if (PlnZyRclCEntity.Planstatus == "20")
  112. {
  113. e.Row.Cells["PLANSTATUS"].Appearance.BackColor = Color.LightGreen;
  114. }
  115. else if(PlnZyRclCEntity.Planstatus == "30" ||PlnZyRclCEntity.Planstatus == "40")
  116. {
  117. e.Row.Cells["PLANSTATUS"].Appearance.BackColor = Color.Red;
  118. }
  119. }
  120. private void craftImg_EditorButtonClick(object sender, EditorButtonEventArgs e)
  121. {
  122. var row = ultraGrid1.ActiveRow;
  123. var craftPath = YdmBaseClass.getQueryCraftNoRCL(row.Cells["CRAFT_FILE_NO"].Text, row.Cells["CRAFT_SEQ"].Text,
  124. Ob);
  125. if (e.Button.Key.ToLower().Equals("select"))
  126. {
  127. var down = new FormFileDown(Ob, craftPath);
  128. down.CtrlFileDown1.Button3.Visible = false;
  129. down.ShowDialog();
  130. }
  131. }
  132. private void chkStarts_CheckedChanged(object sender, EventArgs e)
  133. {
  134. if (chkPlnNo.Checked) txtRollBatchId.Enabled = true;
  135. else txtRollBatchId.Enabled = false;
  136. if (chkJuNo.Checked) txtZyBatchId.Enabled = true;
  137. else txtZyBatchId.Enabled = false;
  138. }
  139. }
  140. }