using System;
using System.Data;
using System.Drawing;
using System.Collections.Generic;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using CoreFS.CA06;
using Core.StlMes.Client.LgCommon;
namespace Core.StlMes.Client.LgResMgt
{
///
/// Department 的摘要说明。
///
public class frmMaintenance : frmStyleBase
{
private System.Data.DataSet dataSet1;
private System.Data.DataTable dataTable1;
private Infragistics.Win.UltraWinGrid.UltraGrid ultraGrid2;
private System.ComponentModel.IContainer components;
private Infragistics.Win.Misc.UltraExpandableGroupBox ultraExpandableGroupBox1;
private Infragistics.Win.Misc.UltraExpandableGroupBoxPanel ultraExpandableGroupBoxPanel1;
private System.Windows.Forms.Panel FrmBase_Fill_Panel;
private System.Windows.Forms.Label Lb_GWCODE;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox tb_XMCODE;
private System.Windows.Forms.TextBox tb_XMNAME;
private string strError = null;
private Infragistics.Win.Misc.UltraGroupBox ultraGroupBox1;
private System.Data.DataColumn XMCode;
private System.Data.DataColumn XMName;
private DataColumn XMType;
private DataColumn GWName;
private Infragistics.Win.UltraWinEditors.UltraComboEditor uce_XMType;
private Label label2;
private Label label3;
private CheckBox chkGWName;
private CheckBox chkItemType;
private Infragistics.Win.UltraWinEditors.UltraComboEditor cmbPosition;
private Infragistics.Win.UltraWinEditors.UltraComboEditor cmbType;
private Infragistics.Win.Misc.UltraPanel ultraPanel1;
private Infragistics.Win.UltraWinEditors.UltraComboEditor uce_GWName;
private DataColumn dataColumn1;
string strLG_ZG = "LG"; //判断是炼钢还是轧钢
///
///
///
public frmMaintenance()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
///
/// 清理所有正在使用的资源。
///
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows 窗体设计器生成的代码
///
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
///
private void InitializeComponent()
{
Infragistics.Win.UltraWinGrid.UltraGridBand ultraGridBand1 = new Infragistics.Win.UltraWinGrid.UltraGridBand("Table1", -1);
Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn1 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("ItemCode");
Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn2 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("ItemName");
Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn3 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("ItemType");
Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn4 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("STATIONCODE");
Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn5 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("DESCRIPTION");
Infragistics.Win.Appearance appearance1 = new Infragistics.Win.Appearance();
Infragistics.Win.Appearance appearance4 = new Infragistics.Win.Appearance();
Infragistics.Win.ValueListItem valueListItem5 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem6 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem7 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem8 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem31 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem32 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem33 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem9 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem10 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem34 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem35 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem36 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem11 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem12 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem37 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem15 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem16 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem17 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem38 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem39 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem2 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem1 = new Infragistics.Win.ValueListItem();
Infragistics.Win.Appearance appearance6 = new Infragistics.Win.Appearance();
Infragistics.Win.ValueListItem valueListItem13 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem14 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem40 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem41 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem42 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem43 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem44 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem45 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem46 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem47 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem48 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem49 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem50 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem51 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem52 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem53 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem54 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem55 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem56 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem57 = new Infragistics.Win.ValueListItem();
Infragistics.Win.Appearance appearance5 = new Infragistics.Win.Appearance();
Infragistics.Win.ValueListItem valueListItem4 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem3 = new Infragistics.Win.ValueListItem();
this.dataSet1 = new System.Data.DataSet();
this.dataTable1 = new System.Data.DataTable();
this.XMCode = new System.Data.DataColumn();
this.XMName = new System.Data.DataColumn();
this.XMType = new System.Data.DataColumn();
this.GWName = new System.Data.DataColumn();
this.dataColumn1 = new System.Data.DataColumn();
this.ultraGrid2 = new Infragistics.Win.UltraWinGrid.UltraGrid();
this.ultraExpandableGroupBox1 = new Infragistics.Win.Misc.UltraExpandableGroupBox();
this.ultraExpandableGroupBoxPanel1 = new Infragistics.Win.Misc.UltraExpandableGroupBoxPanel();
this.ultraPanel1 = new Infragistics.Win.Misc.UltraPanel();
this.uce_GWName = new Infragistics.Win.UltraWinEditors.UltraComboEditor();
this.tb_XMNAME = new System.Windows.Forms.TextBox();
this.tb_XMCODE = new System.Windows.Forms.TextBox();
this.Lb_GWCODE = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.uce_XMType = new Infragistics.Win.UltraWinEditors.UltraComboEditor();
this.label2 = new System.Windows.Forms.Label();
this.cmbPosition = new Infragistics.Win.UltraWinEditors.UltraComboEditor();
this.cmbType = new Infragistics.Win.UltraWinEditors.UltraComboEditor();
this.chkGWName = new System.Windows.Forms.CheckBox();
this.chkItemType = new System.Windows.Forms.CheckBox();
this.FrmBase_Fill_Panel = new System.Windows.Forms.Panel();
this.ultraGroupBox1 = new Infragistics.Win.Misc.UltraGroupBox();
((System.ComponentModel.ISupportInitialize)(this.dataSet1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dataTable1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.ultraGrid2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.ultraExpandableGroupBox1)).BeginInit();
this.ultraExpandableGroupBox1.SuspendLayout();
this.ultraExpandableGroupBoxPanel1.SuspendLayout();
this.ultraPanel1.ClientArea.SuspendLayout();
this.ultraPanel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.uce_GWName)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.uce_XMType)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.cmbPosition)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.cmbType)).BeginInit();
this.FrmBase_Fill_Panel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.ultraGroupBox1)).BeginInit();
this.ultraGroupBox1.SuspendLayout();
this.SuspendLayout();
//
// dataSet1
//
this.dataSet1.DataSetName = "NewDataSet";
this.dataSet1.Locale = new System.Globalization.CultureInfo("zh-CN");
this.dataSet1.Tables.AddRange(new System.Data.DataTable[] {
this.dataTable1});
//
// dataTable1
//
this.dataTable1.Columns.AddRange(new System.Data.DataColumn[] {
this.XMCode,
this.XMName,
this.XMType,
this.GWName,
this.dataColumn1});
this.dataTable1.TableName = "Table1";
//
// XMCode
//
this.XMCode.Caption = "项目编码";
this.XMCode.ColumnName = "ItemCode";
this.XMCode.ReadOnly = true;
//
// XMName
//
this.XMName.Caption = "项目名称";
this.XMName.ColumnName = "ItemName";
//
// XMType
//
this.XMType.Caption = "项目类型";
this.XMType.ColumnName = "ItemType";
//
// GWName
//
this.GWName.Caption = "岗位名称";
this.GWName.ColumnName = "STATIONCODE";
//
// dataColumn1
//
this.dataColumn1.ColumnName = "DESCRIPTION";
//
// ultraGrid2
//
this.ultraGrid2.DataMember = "Table1";
this.ultraGrid2.DataSource = this.dataSet1;
ultraGridColumn1.CellActivation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
ultraGridColumn1.Header.VisiblePosition = 0;
ultraGridColumn1.Hidden = true;
ultraGridColumn2.CellActivation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
ultraGridColumn2.Header.VisiblePosition = 1;
ultraGridColumn2.Width = 164;
ultraGridColumn3.CellActivation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
ultraGridColumn3.Header.VisiblePosition = 2;
ultraGridColumn3.Width = 147;
ultraGridColumn4.Header.VisiblePosition = 3;
ultraGridColumn5.Header.Caption = "描述";
ultraGridColumn5.Header.VisiblePosition = 4;
ultraGridColumn5.Hidden = true;
ultraGridBand1.Columns.AddRange(new object[] {
ultraGridColumn1,
ultraGridColumn2,
ultraGridColumn3,
ultraGridColumn4,
ultraGridColumn5});
this.ultraGrid2.DisplayLayout.BandsSerializer.Add(ultraGridBand1);
this.ultraGrid2.DisplayLayout.GroupByBox.Hidden = true;
this.ultraGrid2.DisplayLayout.ViewStyleBand = Infragistics.Win.UltraWinGrid.ViewStyleBand.OutlookGroupBy;
this.ultraGrid2.Dock = System.Windows.Forms.DockStyle.Fill;
this.ultraGrid2.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.ultraGrid2.Location = new System.Drawing.Point(0, 40);
this.ultraGrid2.Name = "ultraGrid2";
this.ultraGrid2.Size = new System.Drawing.Size(888, 313);
this.ultraGrid2.TabIndex = 0;
this.ultraGrid2.AfterRowActivate += new System.EventHandler(this.ultraGrid2_AfterRowActivate);
//
// ultraExpandableGroupBox1
//
appearance1.BackColor = System.Drawing.SystemColors.Control;
this.ultraExpandableGroupBox1.Appearance = appearance1;
this.ultraExpandableGroupBox1.Controls.Add(this.ultraExpandableGroupBoxPanel1);
this.ultraExpandableGroupBox1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.ultraExpandableGroupBox1.ExpandedSize = new System.Drawing.Size(888, 100);
this.ultraExpandableGroupBox1.Location = new System.Drawing.Point(0, 353);
this.ultraExpandableGroupBox1.Name = "ultraExpandableGroupBox1";
this.ultraExpandableGroupBox1.Size = new System.Drawing.Size(888, 100);
this.ultraExpandableGroupBox1.TabIndex = 1;
this.ultraExpandableGroupBox1.Text = "编辑区";
this.ultraExpandableGroupBox1.ViewStyle = Infragistics.Win.Misc.GroupBoxViewStyle.VisualStudio2005;
//
// ultraExpandableGroupBoxPanel1
//
this.ultraExpandableGroupBoxPanel1.Controls.Add(this.ultraPanel1);
this.ultraExpandableGroupBoxPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.ultraExpandableGroupBoxPanel1.Location = new System.Drawing.Point(2, 20);
this.ultraExpandableGroupBoxPanel1.Name = "ultraExpandableGroupBoxPanel1";
this.ultraExpandableGroupBoxPanel1.Size = new System.Drawing.Size(884, 78);
this.ultraExpandableGroupBoxPanel1.TabIndex = 0;
//
// ultraPanel1
//
this.ultraPanel1.AutoScroll = true;
//
// ultraPanel1.ClientArea
//
this.ultraPanel1.ClientArea.Controls.Add(this.uce_GWName);
this.ultraPanel1.ClientArea.Controls.Add(this.tb_XMNAME);
this.ultraPanel1.ClientArea.Controls.Add(this.tb_XMCODE);
this.ultraPanel1.ClientArea.Controls.Add(this.Lb_GWCODE);
this.ultraPanel1.ClientArea.Controls.Add(this.label1);
this.ultraPanel1.ClientArea.Controls.Add(this.label3);
this.ultraPanel1.ClientArea.Controls.Add(this.uce_XMType);
this.ultraPanel1.ClientArea.Controls.Add(this.label2);
this.ultraPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.ultraPanel1.Location = new System.Drawing.Point(0, 0);
this.ultraPanel1.Name = "ultraPanel1";
this.ultraPanel1.Size = new System.Drawing.Size(884, 78);
this.ultraPanel1.TabIndex = 4;
//
// uce_GWName
//
appearance4.BorderAlpha = Infragistics.Win.Alpha.UseAlphaLevel;
appearance4.BorderColor = System.Drawing.Color.Black;
this.uce_GWName.Appearance = appearance4;
this.uce_GWName.BorderStyle = Infragistics.Win.UIElementBorderStyle.Solid;
this.uce_GWName.DropDownStyle = Infragistics.Win.DropDownStyle.DropDownList;
this.uce_GWName.Font = new System.Drawing.Font("宋体", 9F);
valueListItem5.DataValue = "HMP01";
valueListItem5.DisplayText = "1#脱硫";
valueListItem6.DataValue = "HMP02";
valueListItem6.DisplayText = "2#脱硫";
valueListItem7.DataValue = "BOF01";
valueListItem7.DisplayText = "1#转炉";
valueListItem8.DataValue = "BOF02";
valueListItem8.DisplayText = "2#转炉";
valueListItem31.DataValue = "BOF03";
valueListItem31.DisplayText = "3#转炉";
valueListItem32.DataValue = "BOF04";
valueListItem32.DisplayText = "4#转炉";
valueListItem33.DataValue = "BOF05";
valueListItem33.DisplayText = "5#转炉";
valueListItem9.DataValue = "CAS01";
valueListItem9.DisplayText = "1#吹氩";
valueListItem10.DataValue = "CAS02";
valueListItem10.DisplayText = "2#吹氩";
valueListItem34.DataValue = "CAS03";
valueListItem34.DisplayText = "3#吹氩";
valueListItem35.DataValue = "CAS04";
valueListItem35.DisplayText = "4#吹氩";
valueListItem36.DataValue = "CAS05";
valueListItem36.DisplayText = "5#吹氩";
valueListItem11.DataValue = "LFS01";
valueListItem11.DisplayText = "1#精炼";
valueListItem12.DataValue = "LFS02";
valueListItem12.DisplayText = "2#精炼";
valueListItem37.DataValue = "LFS03";
valueListItem37.DisplayText = "3#精炼";
valueListItem15.DataValue = "CCM01";
valueListItem15.DisplayText = "1#连铸机";
valueListItem16.DataValue = "CCM02";
valueListItem16.DisplayText = "2#连铸机";
valueListItem17.DataValue = "CCM03";
valueListItem17.DisplayText = "3#连铸机";
valueListItem38.DataValue = "CCM04";
valueListItem38.DisplayText = "4#连铸机";
valueListItem39.DataValue = "CCM05";
valueListItem39.DisplayText = "5#连铸机";
this.uce_GWName.Items.AddRange(new Infragistics.Win.ValueListItem[] {
valueListItem5,
valueListItem6,
valueListItem7,
valueListItem8,
valueListItem31,
valueListItem32,
valueListItem33,
valueListItem9,
valueListItem10,
valueListItem34,
valueListItem35,
valueListItem36,
valueListItem11,
valueListItem12,
valueListItem37,
valueListItem15,
valueListItem16,
valueListItem17,
valueListItem38,
valueListItem39});
this.uce_GWName.Location = new System.Drawing.Point(624, 23);
this.uce_GWName.Name = "uce_GWName";
this.uce_GWName.Size = new System.Drawing.Size(115, 19);
this.uce_GWName.TabIndex = 80;
//
// tb_XMNAME
//
this.tb_XMNAME.Location = new System.Drawing.Point(127, 22);
this.tb_XMNAME.MaxLength = 10;
this.tb_XMNAME.Name = "tb_XMNAME";
this.tb_XMNAME.Size = new System.Drawing.Size(123, 21);
this.tb_XMNAME.TabIndex = 2;
//
// tb_XMCODE
//
this.tb_XMCODE.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.tb_XMCODE.Location = new System.Drawing.Point(778, 37);
this.tb_XMCODE.MaxLength = 9;
this.tb_XMCODE.Name = "tb_XMCODE";
this.tb_XMCODE.Size = new System.Drawing.Size(123, 21);
this.tb_XMCODE.TabIndex = 1;
this.tb_XMCODE.Visible = false;
//
// Lb_GWCODE
//
this.Lb_GWCODE.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Lb_GWCODE.Location = new System.Drawing.Point(802, 13);
this.Lb_GWCODE.Name = "Lb_GWCODE";
this.Lb_GWCODE.Size = new System.Drawing.Size(79, 21);
this.Lb_GWCODE.TabIndex = 0;
this.Lb_GWCODE.Text = "项目编码";
this.Lb_GWCODE.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.Lb_GWCODE.Visible = false;
//
// label1
//
this.label1.Font = new System.Drawing.Font("宋体", 9F);
this.label1.Location = new System.Drawing.Point(54, 22);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(67, 21);
this.label1.TabIndex = 1;
this.label1.Text = "项目名称";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label3
//
this.label3.Font = new System.Drawing.Font("宋体", 9F);
this.label3.Location = new System.Drawing.Point(553, 22);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(65, 21);
this.label3.TabIndex = 5;
this.label3.Text = "岗位名称";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// uce_XMType
//
this.uce_XMType.BorderStyle = Infragistics.Win.UIElementBorderStyle.Solid;
this.uce_XMType.DropDownStyle = Infragistics.Win.DropDownStyle.DropDownList;
this.uce_XMType.Font = new System.Drawing.Font("宋体", 9F);
valueListItem2.DataValue = "0";
valueListItem2.DisplayText = "设备运行";
valueListItem1.DataValue = "1";
valueListItem1.DisplayText = "耗材消耗";
this.uce_XMType.Items.AddRange(new Infragistics.Win.ValueListItem[] {
valueListItem2,
valueListItem1});
this.uce_XMType.Location = new System.Drawing.Point(380, 22);
this.uce_XMType.Name = "uce_XMType";
this.uce_XMType.Size = new System.Drawing.Size(123, 19);
this.uce_XMType.TabIndex = 4;
this.uce_XMType.UseFlatMode = Infragistics.Win.DefaultableBoolean.True;
//
// label2
//
this.label2.Font = new System.Drawing.Font("宋体", 9F);
this.label2.Location = new System.Drawing.Point(301, 22);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(79, 21);
this.label2.TabIndex = 3;
this.label2.Text = "项目类型";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// cmbPosition
//
appearance6.BorderAlpha = Infragistics.Win.Alpha.UseAlphaLevel;
appearance6.BorderColor = System.Drawing.Color.Black;
this.cmbPosition.Appearance = appearance6;
this.cmbPosition.BorderStyle = Infragistics.Win.UIElementBorderStyle.Solid;
this.cmbPosition.DropDownStyle = Infragistics.Win.DropDownStyle.DropDownList;
this.cmbPosition.Enabled = false;
this.cmbPosition.Font = new System.Drawing.Font("宋体", 9F);
valueListItem13.DataValue = "HMP01";
valueListItem13.DisplayText = "1#脱硫";
valueListItem14.DataValue = "HMP02";
valueListItem14.DisplayText = "2#脱硫";
valueListItem40.DataValue = "BOF01";
valueListItem40.DisplayText = "1#转炉";
valueListItem41.DataValue = "BOF02";
valueListItem41.DisplayText = "2#转炉";
valueListItem42.DataValue = "BOF03";
valueListItem42.DisplayText = "3#转炉";
valueListItem43.DataValue = "BOF04";
valueListItem43.DisplayText = "4#转炉";
valueListItem44.DataValue = "BOF05";
valueListItem44.DisplayText = "5#转炉";
valueListItem45.DataValue = "CAS01";
valueListItem45.DisplayText = "1#吹氩";
valueListItem46.DataValue = "CAS02";
valueListItem46.DisplayText = "2#吹氩";
valueListItem47.DataValue = "CAS03";
valueListItem47.DisplayText = "3#吹氩";
valueListItem48.DataValue = "CAS04";
valueListItem48.DisplayText = "4#吹氩";
valueListItem49.DataValue = "CAS05";
valueListItem49.DisplayText = "5#吹氩";
valueListItem50.DataValue = "LFS01";
valueListItem50.DisplayText = "1#精炼";
valueListItem51.DataValue = "LFS02";
valueListItem51.DisplayText = "2#精炼";
valueListItem52.DataValue = "LFS03";
valueListItem52.DisplayText = "3#精炼";
valueListItem53.DataValue = "CCM01";
valueListItem53.DisplayText = "1#连铸机";
valueListItem54.DataValue = "CCM02";
valueListItem54.DisplayText = "2#连铸机";
valueListItem55.DataValue = "CCM03";
valueListItem55.DisplayText = "3#连铸机";
valueListItem56.DataValue = "CCM04";
valueListItem56.DisplayText = "4#连铸机";
valueListItem57.DataValue = "CCM05";
valueListItem57.DisplayText = "5#连铸机";
this.cmbPosition.Items.AddRange(new Infragistics.Win.ValueListItem[] {
valueListItem13,
valueListItem14,
valueListItem40,
valueListItem41,
valueListItem42,
valueListItem43,
valueListItem44,
valueListItem45,
valueListItem46,
valueListItem47,
valueListItem48,
valueListItem49,
valueListItem50,
valueListItem51,
valueListItem52,
valueListItem53,
valueListItem54,
valueListItem55,
valueListItem56,
valueListItem57});
this.cmbPosition.Location = new System.Drawing.Point(317, 10);
this.cmbPosition.Name = "cmbPosition";
this.cmbPosition.Size = new System.Drawing.Size(115, 19);
this.cmbPosition.TabIndex = 79;
this.cmbPosition.ValueChanged += new System.EventHandler(this.ultcbo_ValueChanged);
//
// cmbType
//
appearance5.BorderAlpha = Infragistics.Win.Alpha.UseAlphaLevel;
appearance5.BorderColor = System.Drawing.Color.Black;
this.cmbType.Appearance = appearance5;
this.cmbType.BorderStyle = Infragistics.Win.UIElementBorderStyle.Solid;
this.cmbType.DropDownStyle = Infragistics.Win.DropDownStyle.DropDownList;
this.cmbType.Enabled = false;
this.cmbType.Font = new System.Drawing.Font("宋体", 9F);
valueListItem4.DataValue = "0";
valueListItem4.DisplayText = "设备运行";
valueListItem3.DataValue = "1";
valueListItem3.DisplayText = "耗材消耗";
this.cmbType.Items.AddRange(new Infragistics.Win.ValueListItem[] {
valueListItem4,
valueListItem3});
this.cmbType.Location = new System.Drawing.Point(103, 10);
this.cmbType.Name = "cmbType";
this.cmbType.Size = new System.Drawing.Size(103, 19);
this.cmbType.TabIndex = 78;
this.cmbType.ValueChanged += new System.EventHandler(this.ultcbo_ValueChanged);
//
// chkGWName
//
this.chkGWName.AutoSize = true;
this.chkGWName.BackColor = System.Drawing.Color.Transparent;
this.chkGWName.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.chkGWName.Font = new System.Drawing.Font("宋体", 9F);
this.chkGWName.Location = new System.Drawing.Point(240, 11);
this.chkGWName.Name = "chkGWName";
this.chkGWName.Size = new System.Drawing.Size(84, 17);
this.chkGWName.TabIndex = 77;
this.chkGWName.Text = " 岗位名称";
this.chkGWName.UseVisualStyleBackColor = false;
this.chkGWName.CheckedChanged += new System.EventHandler(this.chkGWName_CheckedChanged);
//
// chkItemType
//
this.chkItemType.AutoSize = true;
this.chkItemType.BackColor = System.Drawing.Color.Transparent;
this.chkItemType.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.chkItemType.Font = new System.Drawing.Font("宋体", 9F);
this.chkItemType.Location = new System.Drawing.Point(26, 11);
this.chkItemType.Name = "chkItemType";
this.chkItemType.Size = new System.Drawing.Size(84, 17);
this.chkItemType.TabIndex = 76;
this.chkItemType.Text = " 项目类型";
this.chkItemType.UseVisualStyleBackColor = false;
this.chkItemType.CheckedChanged += new System.EventHandler(this.chkItemType_CheckedChanged);
//
// FrmBase_Fill_Panel
//
this.FrmBase_Fill_Panel.Controls.Add(this.ultraGrid2);
this.FrmBase_Fill_Panel.Controls.Add(this.ultraExpandableGroupBox1);
this.FrmBase_Fill_Panel.Controls.Add(this.ultraGroupBox1);
this.FrmBase_Fill_Panel.Cursor = System.Windows.Forms.Cursors.Default;
this.FrmBase_Fill_Panel.Dock = System.Windows.Forms.DockStyle.Fill;
this.FrmBase_Fill_Panel.Location = new System.Drawing.Point(0, 0);
this.FrmBase_Fill_Panel.Name = "FrmBase_Fill_Panel";
this.FrmBase_Fill_Panel.Size = new System.Drawing.Size(888, 453);
this.FrmBase_Fill_Panel.TabIndex = 0;
//
// ultraGroupBox1
//
this.ultraGroupBox1.Controls.Add(this.cmbType);
this.ultraGroupBox1.Controls.Add(this.cmbPosition);
this.ultraGroupBox1.Controls.Add(this.chkGWName);
this.ultraGroupBox1.Controls.Add(this.chkItemType);
this.ultraGroupBox1.Dock = System.Windows.Forms.DockStyle.Top;
this.ultraGroupBox1.Location = new System.Drawing.Point(0, 0);
this.ultraGroupBox1.Name = "ultraGroupBox1";
this.ultraGroupBox1.Size = new System.Drawing.Size(888, 40);
this.ultraGroupBox1.TabIndex = 2;
//
// frmMaintenance
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.ClientSize = new System.Drawing.Size(888, 453);
this.Controls.Add(this.FrmBase_Fill_Panel);
this.KeyPreview = true;
this.Name = "frmMaintenance";
this.Text = "交接班耗材和设备项目维护";
this.Load += new System.EventHandler(this.GWBM_Load);
((System.ComponentModel.ISupportInitialize)(this.dataSet1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dataTable1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.ultraGrid2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.ultraExpandableGroupBox1)).EndInit();
this.ultraExpandableGroupBox1.ResumeLayout(false);
this.ultraExpandableGroupBoxPanel1.ResumeLayout(false);
this.ultraPanel1.ClientArea.ResumeLayout(false);
this.ultraPanel1.ClientArea.PerformLayout();
this.ultraPanel1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.uce_GWName)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.uce_XMType)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.cmbPosition)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.cmbType)).EndInit();
this.FrmBase_Fill_Panel.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.ultraGroupBox1)).EndInit();
this.ultraGroupBox1.ResumeLayout(false);
this.ultraGroupBox1.PerformLayout();
this.ResumeLayout(false);
}
#endregion
///
/// 初始化函数
///
///
///
private void GWBM_Load(object sender, System.EventArgs e)
{
//判断是炼钢还是轧钢
if(this.Key.IndexOf('@')>0)
strLG_ZG = this.Key.Substring(this.Key.IndexOf('@')+1,2);
uce_XMType.SelectedIndex = 0;
cmbType.SelectedIndex = 0;
//初始化UltraDropDown控件
//InitUltraDropDown();
cmbPosition.SelectedIndex = 0;
uce_GWName.SelectedIndex = 0;
GetHCXMData();
}
// 设置岗位信息
///
/// 设置岗位信息
///
private string getPos(string key)
{
try
{
if(key.Length<5) return "未知";
string gw=key.Substring(0,3);
string no=key.Substring(4,1);
string pos = "";
switch (gw)
{
case "HMP":
pos = no + "#脱硫";
break;
case "BOF":
pos = no + "#转炉";
break;
case "CAS":
pos = no + "#吹氩";
break;
case "LFS":
pos = no + "#精炼";
break;
case "CCM":
pos = no + "#连铸机";
break;
}
return pos;
}
catch { return "未知"; }
}
// 交接班项目配置数据查询
///
/// 交接班项目配置数据查询
///
private void GetHCXMData()
{
string strWhere = "";
try
{
if (chkItemType.Checked == true)
{
if (cmbType.SelectedIndex < 0)
{
MessageBox.Show("查询条件项目类型不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
cmbType.Focus();
return;
}
else
{
strWhere = " and a.itemtype='" + cmbType.Value.ToString() + "'";
}
}
if (chkGWName.Checked == true)
{
if (cmbPosition.SelectedIndex < 0)
{
MessageBox.Show("查询条件岗位名称不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
cmbType.Focus();
return;
}
else
{
strWhere += " and a.stationcode = '" + cmbPosition.SelectedItem.DataValue.ToString() + "'";
}
}
dataTable1.Rows.Clear();
string strErr = "";
//获取交接班耗材,设备数据
DataSet ds = new DataSet();
//定义一个ArrayList集合存储变量[参数]值
ArrayList arry = new ArrayList();
ArrayList sqlList = new ArrayList();
arry.Add("frmJJBBase_Query.select");//此ID为XML文件ID
sqlList.Add(strWhere);
//调用服务端方法
CoreClientParam CCP_JJBQuery = new CoreClientParam();
DataTable dt = new DataTable();
CCP_JJBQuery.ServerName = "Core.LgMes.Server.Common.ComDBQuery";
CCP_JJBQuery.MethodName = "doQuery";
CCP_JJBQuery.ServerParams = new object[] { arry ,sqlList};
CCP_JJBQuery.SourceDataTable = dt;
this.ExecuteSortResultByQueryToDataTable(CCP_JJBQuery, CoreInvokeType.Internal);
ds.Tables.Add(dt);
if (strErr != "")
{
MessageBox.Show(strErr);
}
else
{
if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
{
int RowId = 1;
foreach (DataRow Drow in ds.Tables[0].Rows)
{
DataRow newRow = dataTable1.NewRow();
foreach (DataColumn dataColumn in ds.Tables[0].Columns)
{
if(dataColumn.ColumnName!="STATIONCODE")
{
newRow[dataColumn.ColumnName] = Drow[dataColumn.ColumnName].ToString();
}
if (dataColumn.ColumnName == "STATIONCODE")
{
newRow[dataColumn.ColumnName] = getPos(Drow[dataColumn.ColumnName].ToString().Trim());
}
}
dataTable1.Rows.Add(newRow);
RowId++;
}
dataTable1.AcceptChanges();
}
}
}
catch (System.Exception exp)
{
WriteLog(exp.Message);
}
finally
{
}
}
///
/// 写日志信息到日志文件
///
///
private void WriteLog(string str)
{
string strDate = System.DateTime.Now.Year.ToString() + System.DateTime.Now.Month.ToString() + System.DateTime.Now.Day.ToString();
this.WriteLog(str, this.UserInfo.GetUserName(), "frmMaintenance" + strDate, LogInfoLevel.Message);
}
public override void ToolBar_Click(object sender, string ToolbarKey)
{
DialogResult result;
switch (ToolbarKey)
{
case "Query": //显示数据
GetHCXMData();
break;
case "Add"://新增
AddHCXMData();
GetHCXMData();
break;
case "Update":
result = MessageBox.Show(this, "您确定要修改此项目配置吗?", "提示", MessageBoxButtons.YesNo,
MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
if (result == DialogResult.Yes)
{
UpdateHCXMData();
GetHCXMData();
}
break;
case "Delete":
string mk = "确定要删除此项目配置吗?";
result = MessageBox.Show(this, mk, "提示", MessageBoxButtons.YesNo,
MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
if (result == DialogResult.Yes)
{
DeleteHCXMData();
GetHCXMData();
}
break;
case "Export":
try
{
Core.Mes.Client.Comm.Globals.ulGridToExcel(ultraGrid2, Text);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
break;
case "Exit":
this.Close();
break;
default:
break;
}
}
// 新增耗材项目编码数据
///
/// 新增耗材项目编码数据
///
public void AddHCXMData()
{
try
{
//耗材项目名称
string strXMNAME = null;
if (string.IsNullOrEmpty(tb_XMNAME.Text.Trim()))
{
MessageBox.Show("项目名称不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
return;
}
else
strXMNAME = tb_XMNAME.Text.Trim();
//项目类型
if (uce_XMType.SelectedIndex<0)
{
MessageBox.Show("项目类型不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
return;
}
string strXMType = uce_XMType.Value.ToString();
//岗位编码
string strGWName = "";
if (uce_GWName.SelectedIndex < 0)
{
MessageBox.Show("岗位名称不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
return;
}
try
{
strGWName = uce_GWName.Value.ToString();
}
catch { strGWName = "0"; }
string strErr = "";
//定义一个ArrayList集合存储变量[参数]值
ArrayList sArgs = new ArrayList();
sArgs.Add(strXMNAME);
sArgs.Add(strXMType);
sArgs.Add(strGWName);
ClsDataAccessPack.DoProcedure("frmMaintenance_AddToPos.select", sArgs, out strErr, ob);
if (strErr != "")
{
MessageBox.Show("交接班项目配置新增失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}
else
MessageBox.Show("交接班项目配置新增成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}
catch (System.Exception exp)
{
WriteLog(exp.Message);
}
finally
{
}
}
// 修改耗材项目,设备状况数据
///
/// 修改耗材项目,设备状况数据
///
public void UpdateHCXMData()
{
try
{
//耗材项目名称
string strXMNAME = null;
if (string.IsNullOrEmpty(tb_XMNAME.Text.Trim()))
{
MessageBox.Show("项目名称不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
return;
}
else
strXMNAME = tb_XMNAME.Text.Trim();
//项目类型
if (uce_XMType.SelectedIndex < 0)
{
MessageBox.Show("项目类型不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
return;
}
string strXMType = uce_XMType.Value.ToString();
//岗位编码
string strGWName = "";
if (uce_GWName.SelectedIndex < 0)
{
MessageBox.Show("岗位名称不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
return;
}
try
{
strGWName = uce_GWName.Value.ToString();
}
catch { strGWName = "0"; }
string strErr = "";
//定义一个ArrayList集合存储变量[参数]值
ArrayList arry = new ArrayList();
arry.Add("frmJJBBase_Update.select");
arry.Add(strXMNAME);
arry.Add(strXMType);
arry.Add(strGWName);
arry.Add(ultraGrid2.ActiveRow.Cells["ItemCode"].Value.ToString().Trim());
CommonClientToServer cctos = new CommonClientToServer();
cctos.ob = this.ob;
string info = cctos.NoQueryFunctions("Core.LgMes.Server.Common.ComDBSave",
"doSimpleSave", arry, out strErr);
if (strErr != "")
{
MessageBox.Show("交接班项目配置修改失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); ;
}
else
{
MessageBox.Show("交接班项目配置修改成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
dataTable1.Clear();
}
}
catch (System.Exception exp)
{
WriteLog(exp.Message);
MessageBox.Show("修改失败!");
}
finally
{
}
}
// 删除耗材项目,设备状况数据
///
/// 删除耗材项目,设备状况数据
///
public void DeleteHCXMData()
{
try
{
string strErr = "";
string strXMCODE = ultraGrid2.ActiveRow.Cells["ItemCODE"].Text.Trim();
//定义一个ArrayList集合存储变量[参数]值
ArrayList arry = new ArrayList();
arry.Add("frmJJBBase_Del.select");
arry.Add(strXMCODE);
CommonClientToServer cctos = new CommonClientToServer();
cctos.ob = this.ob;
string info = cctos.NoQueryFunctions("Core.LgMes.Server.Common.ComDBSave",
"doSimpleSave", arry, out strErr);
if (strErr != "")
{
MessageBox.Show("交接班项目配置删除失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}
else
{
tb_XMCODE.Text = "";
tb_XMNAME.Text = "";
MessageBox.Show("交接班项目配置删除成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}
}//end try
catch (System.Exception exp)
{
WriteLog(exp.Message);
}
finally
{
}
}
private void chkItemType_CheckedChanged(object sender, EventArgs e)
{
cmbType.Enabled = chkItemType.Checked;
}
private void chkGWName_CheckedChanged(object sender, EventArgs e)
{
cmbPosition.Enabled = chkGWName.Checked;
}
private void ultcbo_ValueChanged(object sender, EventArgs e)
{
GetHCXMData();
}
private void ultraGrid2_AfterRowActivate(object sender, EventArgs e)
{
try
{
if (ultraGrid2.ActiveRow == null || ultraGrid2.Rows.Count==0)
{
return;
}
tb_XMCODE.Text = ultraGrid2.ActiveRow.Cells["ItemCODE"].Text.Trim();
tb_XMNAME.Text = ultraGrid2.ActiveRow.Cells["ItemNAME"].Text.Trim();
uce_XMType.Text = ultraGrid2.ActiveRow.Cells["ItemTYPE"].Text.Trim();
uce_GWName.Text = ultraGrid2.ActiveRow.Cells["STATIONCODE"].Text.Trim();
this.ultraGrid2.ActiveRow.Selected = true;
}
catch { }
}
}
}