frmJobPlanInfo.cs.svn-base 8.8 KB

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