FrmHttBase.cs 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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 Core.Mes.Client.Comm.Control;
  10. using Core.Mes.Client.Comm.Tool;
  11. using Core.StlMes.Client.Mcp.Control.Entity;
  12. using CoreFS.CA06;
  13. using Infragistics.Win.UltraWinEditors;
  14. using Infragistics.Win.UltraWinGrid;
  15. namespace Core.StlMes.Client.Mcp.Control.Common
  16. {
  17. public partial class FrmHttBase : FrmBase
  18. {
  19. public FrmHttBase()
  20. {
  21. InitializeComponent();
  22. // EntityHelper.ShowGridCaption<PlnZyRclCEntity>(ultraGrid1.DisplayLayout.Bands[0]);
  23. /* commHelper.RefreshAndAutoSize(ultraGrid1);*/
  24. commHelper.setOtherColumnReadOnly(ultraGrid1, new string[] { });
  25. }
  26. protected override void OnLoad(EventArgs e)
  27. {
  28. base.OnLoad(e);
  29. EntityHelper.ShowGridCaption<PlnZyRclCEntity>(ultraGrid1.DisplayLayout.Bands[0]);
  30. commHelper.RefreshAndAutoSize(ultraGrid1);
  31. ultraGrid1.DisplayLayout.Bands[0].Override.HeaderClickAction = HeaderClickAction.Select;
  32. /* commHelper.setOtherColumnReadOnly(ultraGrid1, new string[] { });*/
  33. }
  34. public string Gx { get; set; }
  35. /// <summary>
  36. /// 只显示主表数据
  37. /// </summary>
  38. public bool ShowMain { get; set; }
  39. public void Query(string[] PlineCodes)
  40. {
  41. var starts = "";
  42. var plnNo = "";
  43. var judgeStoveNo = "";
  44. var feedStoveNo = "";
  45. var start = contorlPlanStatus1.statusArr;
  46. if (chkPlnNo.Checked)
  47. if (string.IsNullOrEmpty(txtRollBatchId.Text.Trim()))
  48. {
  49. MessageUtil.ShowTips("请输入炉次计划号!");
  50. return;
  51. }
  52. else
  53. {
  54. plnNo = txtRollBatchId.Text.Trim();
  55. start = new string[4] { "10", "20", "30", "40" };
  56. }
  57. if (chkJuNo.Checked)
  58. if (string.IsNullOrEmpty(txtZyBatchId.Text.Trim()))
  59. {
  60. MessageUtil.ShowTips("请输入炉号!");
  61. return;
  62. }
  63. else
  64. {
  65. judgeStoveNo = txtZyBatchId.Text.Trim();
  66. start = new string[4] { "10", "20", "30", "40" };
  67. }
  68. if (chkFeedNo.Checked)
  69. if (string.IsNullOrEmpty(txtFeedNo.Text.Trim()))
  70. {
  71. MessageUtil.ShowTips("请输入上料炉号!");
  72. return;
  73. }
  74. else
  75. {
  76. feedStoveNo = txtFeedNo.Text.Trim();
  77. start = new string[4] { "10", "20", "30", "40" };
  78. }
  79. plnZyRclCEntityBindingSource.DataSource = EntityHelper.GetData<PlnZyRclCEntity>(
  80. "com.steering.mes.mcp.common.PlanService.getSingleRclPlan", new object[] { ShowMain, plnNo, judgeStoveNo,feedStoveNo, PlineCodes, start, Gx, ultraOptionSet2.Value.ToString2() }, ob);
  81. commHelper.RefreshAndAutoSize(ultraGrid1);
  82. }
  83. public PlnZyRclCEntity ActiveRow
  84. {
  85. get
  86. {
  87. if (ultraGrid1.ActiveRow == null) return null;
  88. return ultraGrid1.ActiveRow.ListObject as PlnZyRclCEntity;
  89. }
  90. }
  91. private void ultraGrid1_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e)
  92. {
  93. PlnZyRclCEntity PlnZyRclCEntity = e.Row.ListObject as PlnZyRclCEntity;
  94. if (PlnZyRclCEntity == null) return;
  95. if (PlnZyRclCEntity.Planstatus == "20")
  96. {
  97. e.Row.Cells["Planstatus"].Appearance.BackColor = Color.LightGreen;
  98. }
  99. else if (PlnZyRclCEntity.Planstatus == "30" || PlnZyRclCEntity.Planstatus == "40")
  100. {
  101. e.Row.Cells["Planstatus"].Appearance.BackColor = Color.Red;
  102. e.Row.Appearance.BackColor = Color.LightGray;
  103. }
  104. if (PlnZyRclCEntity.ActCount > 0)
  105. {
  106. e.Row.Cells["ActCount"].Appearance.BackColor = Color.LightGreen;
  107. }
  108. if (!string.IsNullOrEmpty(PlnZyRclCEntity.CycleBatch))
  109. {
  110. e.Row.Cells["CycleBatch"].Appearance.BackColor = Color.Red;
  111. PlnZyRclCEntity.CycleBatch = "批号:" + PlnZyRclCEntity.CycleBatch + "不合,要求重新热处理";
  112. }
  113. }
  114. private void craftImg_EditorButtonClick(object sender, EditorButtonEventArgs e)
  115. {
  116. if(ActiveRow==null) return;
  117. var craftPath = YdmBaseClass.getQueryCraftNoRCL(ActiveRow.CraftFileNo, ActiveRow.CraftSeq.ToString3(),
  118. ob);
  119. if (e.Button.Key.ToLower().Equals("select"))
  120. {
  121. var down = new FormFileDown(ob, craftPath);
  122. down.CtrlFileDown1.Button3.Visible = false;
  123. down.ShowDialog();
  124. }
  125. }
  126. private void chkStarts_CheckedChanged(object sender, EventArgs e)
  127. {
  128. if (chkPlnNo.Checked) txtRollBatchId.Enabled = true;
  129. else txtRollBatchId.Enabled = false;
  130. if (chkJuNo.Checked) txtZyBatchId.Enabled = true;
  131. else txtZyBatchId.Enabled = false;
  132. if (chkFeedNo.Checked) txtFeedNo.Enabled = true;
  133. else txtFeedNo.Enabled = false;
  134. }
  135. private void uteCraft2_EditorButtonClick(object sender, EditorButtonEventArgs e)
  136. {
  137. if (ActiveRow==null) return;
  138. if (e.Button.Key.ToLower().Equals("select"))
  139. {
  140. var down = new FormFileDown(ob, "Qcm/CraftLv2/" + ActiveRow.OrderNoSeq + "/" + ActiveRow.SecCraftFileNo);
  141. down.CtrlFileDown1.Button3.Visible = false;
  142. down.ShowDialog();
  143. }
  144. }
  145. }
  146. }