| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Text;
- using System.Windows.Forms;
- using CoreFS.CA06;
- using Core.Mes.Client.Common;
- using System.Collections;
- namespace Core.LgMes.Client.LgJobMgt
- {
- public partial class frmJobPlanInfo : Form
- {
- /// <summary>
- ///
- /// </summary>
- /// <param name="rg"></param>
- /// <param name="szGW">岗位名称</param>
- /// <param name="szDev">岗位</param>
- /// <param name="Van">是否是提钒</param>
- public frmJobPlanInfo(string szGW, string szDev)
- {
- InitializeComponent();
- this.m_szStationName = szGW;
- _DevicePos = szDev;
- }
- #region " Variable"
- private string m_szStationName = ""; // 岗位名称
- private string _DevicePos = ""; // 设备位置
- public string _currSmeltingID = "";
- public string deviceName = "";
- public string Van="";
- public string strVanStatus = "";
- public OpeBase ob = null;
- #endregion
- #region " Init"
- private void frmJobPlanInfo_Load(object sender, EventArgs e)
- {
- this.Text = this.m_szStationName + this.Text;
- GetPlaningInfo();
- if (_DevicePos.Length < 3 || _DevicePos.Substring(0, 3) != "BOF")
- this.btnOk.Enabled = false;
- else
- this.btnOk.Enabled = true;
- }
- #endregion
- private void SetCaption()
- {
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["rownum"].Width = 40;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["rownum"].Header.Caption = "ID";
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["rownum"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["rownum"].Header.VisiblePosition = 1;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["ORD_GON_ID"].Width = 70;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["ORD_GON_ID"].Header.Caption = "订单行号";
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["ORD_GON_ID"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["ORD_GON_ID"].Header.VisiblePosition = 2;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["HEATNO"].Width = 85;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["HEATNO"].Header.Caption = "熔炼号";
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["HEATNO"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["HEATNO"].Header.VisiblePosition = 3;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["AIM_GRADE_CODE"].Width = 60;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["AIM_GRADE_CODE"].Header.Caption = "目标钢号";
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["AIM_GRADE_CODE"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["AIM_GRADE_CODE"].Header.VisiblePosition = 4;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["CAST_ID"].Width = 70;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["CAST_ID"].Header.Caption = "铸机号";
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["CAST_ID"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["CAST_ID"].Header.VisiblePosition = 5;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["CAST_NO"].Width = 70;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["CAST_NO"].Header.Caption = "浇次号";
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["CAST_NO"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["CAST_NO"].Header.VisiblePosition = 6;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["HEAT_NUM"].Width = 70;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["HEAT_NUM"].Header.Caption = "浇次内炉数";
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["HEAT_NUM"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["HEAT_NUM"].Header.VisiblePosition = 7;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["CAST_SEQ"].Width = 60;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["CAST_SEQ"].Header.Caption = "浇次内炉顺序";
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["CAST_SEQ"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["CAST_SEQ"].Header.VisiblePosition = 8;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["PLAN_CCM_STR_TIME"].Width = 70;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["PLAN_CCM_STR_TIME"].Header.Caption = "开浇时间";
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["PLAN_CCM_STR_TIME"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["PLAN_CCM_STR_TIME"].Header.VisiblePosition = 9;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["STD_NAME"].Width = 70;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["STD_NAME"].Header.Caption = "说明";
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["STD_NAME"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["STD_NAME"].Header.VisiblePosition = 10;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["HEAT_STATE"].Hidden = true;
-
- }
- /// <summary>
- /// 获取计划信息
- /// </summary>
- private void GetPlaningInfo()
- {
- string szWhere = "";
- 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) + "'";
-
- string strErr = "";
- ArrayList arry = new ArrayList();
- arry.Add("GetPlaningInfo.Select");//此ID为XML文件ID
- arry.Add(_DevicePos.Substring(4, 1));
- CommonClientToServer cctos = new CommonClientToServer();
- cctos.ob = ob;
- //查询作业计划信息
- DataSet ds = cctos.ExecuteQueryFunctions("Core.LgMes.Server.LgJobMgt.ClassBofJob",
- "GetPlaningInfo", arry, out strErr);
-
- if (strErr == "" && ds != null)
- {
- this.ultraGrid1.DataSource = ds.Tables[0];
- if (ds.Tables != null && ds.Tables[0].Rows.Count > 0)
- SetCaption();
- //analysPlanPath();
- }
- }
- /// <summary>
- /// 解析作业路线
- /// </summary>
- private void analysPlanPath()
- {
- foreach(Infragistics.Win.UltraWinGrid.UltraGridRow rw in this.ultraGrid1.Rows )
- {
- rw.Cells["PLAN_ROUTE"].Value = CStaticMethod.analysPath(rw.Cells["PLAN_ROUTE"].Value.ToString());
- }
- }
- private void btnOk_Click(object sender, EventArgs e)
- {
- if (_currSmeltingID != string.Empty) this.Close();
- if (this.ultraGrid1.ActiveRow == null)
- {
- MessageBox.Show("请选择一个熔炼号!", "提示");
- return;
- }
- string strSmetingID = "";
- strSmetingID = this.ultraGrid1.ActiveRow.Cells["HEATNO"].Value.ToString();
- //如果熔炼号没有变化,则返回空串,主窗体不做处理,
- //否则将新的熔炼号返回。
- if (_currSmeltingID == strSmetingID)
- {
- _currSmeltingID = "";
- }
- else
- {
- switch (MessageBox.Show("您选择了新的熔炼号,是否确认?", "提示", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question))
- {
- case DialogResult.Yes:
- _currSmeltingID = strSmetingID;
- break;
- case DialogResult.No:
- _currSmeltingID = "";
- break;
- case DialogResult.Cancel:
- break;
- }
- }
- this.Close();
- }
- private void btnNo_Click(object sender, EventArgs e)
- {
- this._currSmeltingID = string.Empty;
- this.Close();
- }
- }
- }
|