frmJobPlanInfo.cs 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Text;
  7. using System.Windows.Forms;
  8. using CoreFS.CA06;
  9. using Core.Mes.Client.Common;
  10. using System.Collections;
  11. using Core.LgMes.Client.Comm;
  12. namespace Core.LgMes.Client.LgJobMgt
  13. {
  14. public partial class frmJobPlanInfo : Form
  15. {
  16. /// <summary>
  17. ///
  18. /// </summary>
  19. /// <param name="rg"></param>
  20. /// <param name="szGW">岗位名称</param>
  21. /// <param name="szDev">岗位</param>
  22. /// <param name="Van">是否是提钒</param>
  23. public frmJobPlanInfo(string szGW, string szDev)
  24. {
  25. InitializeComponent();
  26. this.m_szStationName = szGW;
  27. _DevicePos = szDev;
  28. }
  29. #region " Variable"
  30. private string m_szStationName = ""; // 岗位名称
  31. private string _DevicePos = ""; // 设备位置
  32. public string _currSmeltingID = "";
  33. public string deviceName = "";
  34. public string Van="";
  35. public string strVanStatus = "";
  36. public OpeBase ob = null;
  37. #endregion
  38. #region " Init"
  39. private void frmJobPlanInfo_Load(object sender, EventArgs e)
  40. {
  41. this.Text = this.m_szStationName + this.Text;
  42. GetPlaningInfo();
  43. if (_DevicePos.Length < 3 || _DevicePos.Substring(0, 3) != "BOF")
  44. this.btnOk.Enabled = false;
  45. else
  46. this.btnOk.Enabled = true;
  47. }
  48. #endregion
  49. private void SetCaption()
  50. {
  51. this.ultraGrid1.DisplayLayout.Bands[0].Columns["rownum"].Width = 40;
  52. this.ultraGrid1.DisplayLayout.Bands[0].Columns["rownum"].Header.Caption = "ID";
  53. this.ultraGrid1.DisplayLayout.Bands[0].Columns["rownum"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  54. this.ultraGrid1.DisplayLayout.Bands[0].Columns["rownum"].Header.VisiblePosition = 1;
  55. this.ultraGrid1.DisplayLayout.Bands[0].Columns["ORD_GON_ID"].Width = 70;
  56. this.ultraGrid1.DisplayLayout.Bands[0].Columns["ORD_GON_ID"].Header.Caption = "订单行号";
  57. this.ultraGrid1.DisplayLayout.Bands[0].Columns["ORD_GON_ID"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  58. this.ultraGrid1.DisplayLayout.Bands[0].Columns["ORD_GON_ID"].Header.VisiblePosition = 2;
  59. this.ultraGrid1.DisplayLayout.Bands[0].Columns["HEATNO"].Width = 85;
  60. this.ultraGrid1.DisplayLayout.Bands[0].Columns["HEATNO"].Header.Caption = "熔炼号";
  61. this.ultraGrid1.DisplayLayout.Bands[0].Columns["HEATNO"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  62. this.ultraGrid1.DisplayLayout.Bands[0].Columns["HEATNO"].Header.VisiblePosition = 3;
  63. this.ultraGrid1.DisplayLayout.Bands[0].Columns["AIM_GRADE_CODE"].Width = 60;
  64. this.ultraGrid1.DisplayLayout.Bands[0].Columns["AIM_GRADE_CODE"].Header.Caption = "目标钢号";
  65. this.ultraGrid1.DisplayLayout.Bands[0].Columns["AIM_GRADE_CODE"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  66. this.ultraGrid1.DisplayLayout.Bands[0].Columns["AIM_GRADE_CODE"].Header.VisiblePosition = 4;
  67. this.ultraGrid1.DisplayLayout.Bands[0].Columns["CAST_ID"].Width = 70;
  68. this.ultraGrid1.DisplayLayout.Bands[0].Columns["CAST_ID"].Header.Caption = "铸机号";
  69. this.ultraGrid1.DisplayLayout.Bands[0].Columns["CAST_ID"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  70. this.ultraGrid1.DisplayLayout.Bands[0].Columns["CAST_ID"].Header.VisiblePosition = 5;
  71. this.ultraGrid1.DisplayLayout.Bands[0].Columns["CAST_NO"].Width = 70;
  72. this.ultraGrid1.DisplayLayout.Bands[0].Columns["CAST_NO"].Header.Caption = "浇次号";
  73. this.ultraGrid1.DisplayLayout.Bands[0].Columns["CAST_NO"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  74. this.ultraGrid1.DisplayLayout.Bands[0].Columns["CAST_NO"].Header.VisiblePosition = 6;
  75. this.ultraGrid1.DisplayLayout.Bands[0].Columns["HEAT_NUM"].Width = 70;
  76. this.ultraGrid1.DisplayLayout.Bands[0].Columns["HEAT_NUM"].Header.Caption = "浇次内炉数";
  77. this.ultraGrid1.DisplayLayout.Bands[0].Columns["HEAT_NUM"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  78. this.ultraGrid1.DisplayLayout.Bands[0].Columns["HEAT_NUM"].Header.VisiblePosition = 7;
  79. this.ultraGrid1.DisplayLayout.Bands[0].Columns["CAST_SEQ"].Width = 60;
  80. this.ultraGrid1.DisplayLayout.Bands[0].Columns["CAST_SEQ"].Header.Caption = "浇次内炉顺序";
  81. this.ultraGrid1.DisplayLayout.Bands[0].Columns["CAST_SEQ"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  82. this.ultraGrid1.DisplayLayout.Bands[0].Columns["CAST_SEQ"].Header.VisiblePosition = 8;
  83. this.ultraGrid1.DisplayLayout.Bands[0].Columns["PLAN_CCM_STR_TIME"].Width = 70;
  84. this.ultraGrid1.DisplayLayout.Bands[0].Columns["PLAN_CCM_STR_TIME"].Header.Caption = "开浇时间";
  85. this.ultraGrid1.DisplayLayout.Bands[0].Columns["PLAN_CCM_STR_TIME"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  86. this.ultraGrid1.DisplayLayout.Bands[0].Columns["PLAN_CCM_STR_TIME"].Header.VisiblePosition = 9;
  87. this.ultraGrid1.DisplayLayout.Bands[0].Columns["STD_NAME"].Width = 70;
  88. this.ultraGrid1.DisplayLayout.Bands[0].Columns["STD_NAME"].Header.Caption = "说明";
  89. this.ultraGrid1.DisplayLayout.Bands[0].Columns["STD_NAME"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  90. this.ultraGrid1.DisplayLayout.Bands[0].Columns["STD_NAME"].Header.VisiblePosition = 10;
  91. this.ultraGrid1.DisplayLayout.Bands[0].Columns["HEAT_STATE"].Hidden = true;
  92. }
  93. /// <summary>
  94. /// 获取计划信息
  95. /// </summary>
  96. private void GetPlaningInfo()
  97. {
  98. string szWhere = "";
  99. szWhere = "where t.aim_grade_code=t1.steelcode and HEAT_STATE='03' AND (substr(heatno,3,1)='" + _DevicePos.Substring(4, 1) + "' "
  100. +" OR INSTR(FACT_ROUTE,'C" + _DevicePos.Substring(4, 1) + "') > 0)"; //and substr(heatno,3,1)='" + _DevicePos.Substring(4, 1) + "'";// and t.HEAT_STATE = '03' and substr(t.heatno,3,1)='" + _DevicePos.Substring(4, 1) + "'";
  101. string strErr = "";
  102. ArrayList arry = new ArrayList();
  103. arry.Add("GetPlaningInfo.Select");//此ID为XML文件ID
  104. arry.Add(_DevicePos.Substring(4, 1));
  105. arry.Add(_DevicePos.Substring(4, 1));
  106. CommonClientToServer cctos = new CommonClientToServer();
  107. cctos.ob = ob;
  108. //查询作业计划信息
  109. DataSet ds = cctos.ExecuteQueryFunctions("Core.LgMes.Server.LgJobMgt.ClassBofJob",
  110. "GetPlaningInfo", arry, out strErr);
  111. if (strErr == "" && ds != null)
  112. {
  113. this.ultraGrid1.DataSource = ds.Tables[0];
  114. if (ds.Tables != null && ds.Tables[0].Rows.Count > 0)
  115. SetCaption();
  116. //analysPlanPath();
  117. }
  118. }
  119. /// <summary>
  120. /// 解析作业路线
  121. /// </summary>
  122. private void analysPlanPath()
  123. {
  124. foreach(Infragistics.Win.UltraWinGrid.UltraGridRow rw in this.ultraGrid1.Rows )
  125. {
  126. rw.Cells["PLAN_ROUTE"].Value = CStaticMethod.analysPath(rw.Cells["PLAN_ROUTE"].Value.ToString());
  127. }
  128. }
  129. private void btnOk_Click(object sender, EventArgs e)
  130. {
  131. if (_currSmeltingID != string.Empty) this.Close();
  132. if (this.ultraGrid1.ActiveRow == null)
  133. {
  134. MessageBox.Show("请选择一个熔炼号!", "提示");
  135. return;
  136. }
  137. string strSmetingID = "";
  138. strSmetingID = this.ultraGrid1.ActiveRow.Cells["HEATNO"].Value.ToString();
  139. //如果熔炼号没有变化,则返回空串,主窗体不做处理,
  140. //否则将新的熔炼号返回。
  141. if (_currSmeltingID == strSmetingID)
  142. {
  143. _currSmeltingID = "";
  144. }
  145. else
  146. {
  147. switch (MessageBox.Show("您选择了新的熔炼号,是否确认?", "提示", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question))
  148. {
  149. case DialogResult.Yes:
  150. _currSmeltingID = strSmetingID;
  151. break;
  152. case DialogResult.No:
  153. _currSmeltingID = "";
  154. break;
  155. case DialogResult.Cancel:
  156. break;
  157. }
  158. }
  159. this.Close();
  160. }
  161. private void btnNo_Click(object sender, EventArgs e)
  162. {
  163. this._currSmeltingID = string.Empty;
  164. this.Close();
  165. }
  166. }
  167. }