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.Mes.Client.Common;
namespace Core.LgMes.Client.LgIntegrationQuery
{
///
/// Department 的摘要说明。
///
public class frmMaintenance : Core.Mes.Client.Common.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 Infragistics.Win.Misc.UltraGroupBox ultraGroupBox3;
private DataColumn XMType;
private DataColumn GWName;
private Infragistics.Win.UltraWinEditors.UltraComboEditor uce_XMType;
private Label label2;
private Infragistics.Win.UltraWinEditors.UltraComboEditor uce_GWName;
private Label label3;
private CheckBox chkGWName;
private CheckBox chkItemType;
private Infragistics.Win.UltraWinEditors.UltraComboEditor cmbPosition;
private Infragistics.Win.UltraWinEditors.UltraComboEditor ultcboItemType;
private Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter ultraGridExcelExporter1;
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()
{
this.components = new System.ComponentModel.Container();
Infragistics.Win.UltraWinGrid.UltraGridBand ultraGridBand1 = new Infragistics.Win.UltraWinGrid.UltraGridBand("Table1", -1);
Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn1 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("ItemCode", -1, null, 0, Infragistics.Win.UltraWinGrid.SortIndicator.Ascending, false);
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("Description");
Infragistics.Win.Appearance appearance1 = new Infragistics.Win.Appearance();
Infragistics.Win.Appearance appearance2 = new Infragistics.Win.Appearance();
Infragistics.Win.ValueListItem valueListItem18 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem19 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem20 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem21 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem22 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem23 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem24 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem25 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem26 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem27 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem28 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem29 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem30 = new Infragistics.Win.ValueListItem();
Infragistics.Win.Appearance appearance3 = new Infragistics.Win.Appearance();
Infragistics.Win.ValueListItem valueListItem1 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem2 = new Infragistics.Win.ValueListItem();
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 valueListItem9 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem10 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem11 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem12 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem13 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem14 = 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.Appearance appearance5 = new Infragistics.Win.Appearance();
Infragistics.Win.ValueListItem valueListItem3 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem4 = 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.ultraGrid2 = new Infragistics.Win.UltraWinGrid.UltraGrid();
this.ultraExpandableGroupBox1 = new Infragistics.Win.Misc.UltraExpandableGroupBox();
this.ultraExpandableGroupBoxPanel1 = new Infragistics.Win.Misc.UltraExpandableGroupBoxPanel();
this.ultraGroupBox3 = new Infragistics.Win.Misc.UltraGroupBox();
this.uce_GWName = new Infragistics.Win.UltraWinEditors.UltraComboEditor();
this.tb_XMCODE = new System.Windows.Forms.TextBox();
this.tb_XMNAME = new System.Windows.Forms.TextBox();
this.uce_XMType = new Infragistics.Win.UltraWinEditors.UltraComboEditor();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.Lb_GWCODE = new System.Windows.Forms.Label();
this.cmbPosition = new Infragistics.Win.UltraWinEditors.UltraComboEditor();
this.ultcboItemType = 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();
this.ultraGridExcelExporter1 = new Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter(this.components);
((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();
((System.ComponentModel.ISupportInitialize)(this.ultraGroupBox3)).BeginInit();
this.ultraGroupBox3.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.ultcboItemType)).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.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 = "Description";
//
// ultraGrid2
//
this.ultraGrid2.DataMember = "Table1";
this.ultraGrid2.DataSource = this.dataSet1;
ultraGridColumn1.CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
ultraGridColumn1.Header.VisiblePosition = 0;
ultraGridColumn2.CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
ultraGridColumn2.Header.VisiblePosition = 1;
ultraGridColumn3.CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
ultraGridColumn3.Header.VisiblePosition = 2;
ultraGridColumn4.CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
ultraGridColumn4.Header.VisiblePosition = 3;
ultraGridBand1.Columns.AddRange(new object[] {
ultraGridColumn1,
ultraGridColumn2,
ultraGridColumn3,
ultraGridColumn4});
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, 330);
this.ultraGrid2.TabIndex = 0;
this.ultraGrid2.Click += new System.EventHandler(this.ultraGrid2_Click);
this.ultraGrid2.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ultraGrid2_KeyDown);
//
// 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, 83);
this.ultraExpandableGroupBox1.Location = new System.Drawing.Point(0, 370);
this.ultraExpandableGroupBox1.Name = "ultraExpandableGroupBox1";
this.ultraExpandableGroupBox1.Size = new System.Drawing.Size(888, 83);
this.ultraExpandableGroupBox1.TabIndex = 1;
this.ultraExpandableGroupBox1.Text = "编辑区";
this.ultraExpandableGroupBox1.ViewStyle = Infragistics.Win.Misc.GroupBoxViewStyle.VisualStudio2005;
//
// ultraExpandableGroupBoxPanel1
//
this.ultraExpandableGroupBoxPanel1.Controls.Add(this.ultraGroupBox3);
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, 61);
this.ultraExpandableGroupBoxPanel1.TabIndex = 0;
//
// ultraGroupBox3
//
this.ultraGroupBox3.Controls.Add(this.uce_GWName);
this.ultraGroupBox3.Controls.Add(this.tb_XMCODE);
this.ultraGroupBox3.Controls.Add(this.tb_XMNAME);
this.ultraGroupBox3.Controls.Add(this.uce_XMType);
this.ultraGroupBox3.Controls.Add(this.label1);
this.ultraGroupBox3.Controls.Add(this.label2);
this.ultraGroupBox3.Controls.Add(this.label3);
this.ultraGroupBox3.Controls.Add(this.Lb_GWCODE);
this.ultraGroupBox3.Dock = System.Windows.Forms.DockStyle.Fill;
this.ultraGroupBox3.Location = new System.Drawing.Point(0, 0);
this.ultraGroupBox3.Name = "ultraGroupBox3";
this.ultraGroupBox3.Size = new System.Drawing.Size(884, 61);
this.ultraGroupBox3.TabIndex = 3;
//
// uce_GWName
//
appearance2.BorderAlpha = Infragistics.Win.Alpha.UseAlphaLevel;
appearance2.BorderColor = System.Drawing.Color.Black;
this.uce_GWName.Appearance = appearance2;
this.uce_GWName.BorderStyle = Infragistics.Win.UIElementBorderStyle.Solid;
this.uce_GWName.DropDownStyle = Infragistics.Win.DropDownStyle.DropDownList;
this.uce_GWName.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
valueListItem18.DataValue = "HMP01";
valueListItem18.DisplayText = "1#脱硫";
valueListItem19.DataValue = "HMP02";
valueListItem19.DisplayText = "2#脱硫";
valueListItem20.DataValue = "BOF01";
valueListItem20.DisplayText = "1#转炉";
valueListItem21.DataValue = "BOF02";
valueListItem21.DisplayText = "2#转炉";
valueListItem22.DataValue = "CAS01";
valueListItem22.DisplayText = "1#吹氩";
valueListItem23.DataValue = "CAS02";
valueListItem23.DisplayText = "2#吹氩";
valueListItem24.DataValue = "LFS01";
valueListItem24.DisplayText = "1#精炼";
valueListItem25.DataValue = "LFS02";
valueListItem25.DisplayText = "2#精炼";
valueListItem26.DataValue = "RHS01";
valueListItem26.DisplayText = "1#RH";
valueListItem27.DataValue = "VDS01";
valueListItem27.DisplayText = "1#VD";
valueListItem28.DataValue = "CCM01";
valueListItem28.DisplayText = "1#连铸机";
valueListItem29.DataValue = "CCM02";
valueListItem29.DisplayText = "2#连铸机";
valueListItem30.DataValue = "CCM03";
valueListItem30.DisplayText = "3#连铸机";
this.uce_GWName.Items.AddRange(new Infragistics.Win.ValueListItem[] {
valueListItem18,
valueListItem19,
valueListItem20,
valueListItem21,
valueListItem22,
valueListItem23,
valueListItem24,
valueListItem25,
valueListItem26,
valueListItem27,
valueListItem28,
valueListItem29,
valueListItem30});
this.uce_GWName.Location = new System.Drawing.Point(719, 21);
this.uce_GWName.Name = "uce_GWName";
this.uce_GWName.Size = new System.Drawing.Size(123, 21);
this.uce_GWName.TabIndex = 6;
this.uce_GWName.UseFlatMode = Infragistics.Win.DefaultableBoolean.True;
//
// tb_XMCODE
//
this.tb_XMCODE.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.tb_XMCODE.Location = new System.Drawing.Point(101, 21);
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.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.tb_XMCODE_KeyPress);
//
// tb_XMNAME
//
this.tb_XMNAME.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.tb_XMNAME.Location = new System.Drawing.Point(307, 21);
this.tb_XMNAME.Name = "tb_XMNAME";
this.tb_XMNAME.Size = new System.Drawing.Size(123, 21);
this.tb_XMNAME.TabIndex = 2;
//
// uce_XMType
//
appearance3.BorderAlpha = Infragistics.Win.Alpha.UseAlphaLevel;
appearance3.BorderColor = System.Drawing.Color.Black;
this.uce_XMType.Appearance = appearance3;
this.uce_XMType.BorderStyle = Infragistics.Win.UIElementBorderStyle.Solid;
this.uce_XMType.DropDownStyle = Infragistics.Win.DropDownStyle.DropDownList;
this.uce_XMType.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
valueListItem1.DataValue = "0";
valueListItem1.DisplayText = "耗材消耗";
valueListItem2.DataValue = "1";
valueListItem2.DisplayText = "设备运行";
this.uce_XMType.Items.AddRange(new Infragistics.Win.ValueListItem[] {
valueListItem1,
valueListItem2});
this.uce_XMType.Location = new System.Drawing.Point(513, 21);
this.uce_XMType.Name = "uce_XMType";
this.uce_XMType.Size = new System.Drawing.Size(123, 21);
this.uce_XMType.TabIndex = 4;
this.uce_XMType.UseFlatMode = Infragistics.Win.DefaultableBoolean.True;
//
// label1
//
this.label1.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.Location = new System.Drawing.Point(229, 21);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(79, 21);
this.label1.TabIndex = 1;
this.label1.Text = "项目名称";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label2
//
this.label2.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label2.Location = new System.Drawing.Point(434, 21);
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;
//
// label3
//
this.label3.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label3.Location = new System.Drawing.Point(639, 21);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(79, 21);
this.label3.TabIndex = 5;
this.label3.Text = "岗位名称";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// 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(24, 21);
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;
//
// cmbPosition
//
appearance4.BorderAlpha = Infragistics.Win.Alpha.UseAlphaLevel;
appearance4.BorderColor = System.Drawing.Color.Black;
this.cmbPosition.Appearance = appearance4;
this.cmbPosition.BorderStyle = Infragistics.Win.UIElementBorderStyle.Solid;
this.cmbPosition.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.OfficeXP;
this.cmbPosition.DropDownStyle = Infragistics.Win.DropDownStyle.DropDownList;
this.cmbPosition.Enabled = false;
this.cmbPosition.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
valueListItem5.DataValue = "HMP01";
valueListItem5.DisplayText = "1#脱硫";
valueListItem6.DataValue = "HMP02";
valueListItem6.DisplayText = "2#脱硫";
valueListItem7.DataValue = "BOF01";
valueListItem7.DisplayText = "1#转炉";
valueListItem8.DataValue = "BOF02";
valueListItem8.DisplayText = "2#转炉";
valueListItem9.DataValue = "CAS01";
valueListItem9.DisplayText = "1#吹氩";
valueListItem10.DataValue = "CAS02";
valueListItem10.DisplayText = "2#吹氩";
valueListItem11.DataValue = "LFS01";
valueListItem11.DisplayText = "1#精炼";
valueListItem12.DataValue = "LFS02";
valueListItem12.DisplayText = "2#精炼";
valueListItem13.DataValue = "RHS01";
valueListItem13.DisplayText = "1#RH";
valueListItem14.DataValue = "VDS01";
valueListItem14.DisplayText = "1#VD";
valueListItem15.DataValue = "CCM01";
valueListItem15.DisplayText = "1#连铸机";
valueListItem16.DataValue = "CCM02";
valueListItem16.DisplayText = "2#连铸机";
valueListItem17.DataValue = "CCM03";
valueListItem17.DisplayText = "3#连铸机";
this.cmbPosition.Items.AddRange(new Infragistics.Win.ValueListItem[] {
valueListItem5,
valueListItem6,
valueListItem7,
valueListItem8,
valueListItem9,
valueListItem10,
valueListItem11,
valueListItem12,
valueListItem13,
valueListItem14,
valueListItem15,
valueListItem16,
valueListItem17});
this.cmbPosition.Location = new System.Drawing.Point(317, 10);
this.cmbPosition.Name = "cmbPosition";
this.cmbPosition.Size = new System.Drawing.Size(115, 21);
this.cmbPosition.TabIndex = 79;
this.cmbPosition.ValueChanged += new System.EventHandler(this.ultcboGWName_ValueChanged);
//
// ultcboItemType
//
appearance5.BorderAlpha = Infragistics.Win.Alpha.UseAlphaLevel;
appearance5.BorderColor = System.Drawing.Color.Black;
this.ultcboItemType.Appearance = appearance5;
this.ultcboItemType.BorderStyle = Infragistics.Win.UIElementBorderStyle.Solid;
this.ultcboItemType.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.OfficeXP;
this.ultcboItemType.DropDownStyle = Infragistics.Win.DropDownStyle.DropDownList;
this.ultcboItemType.Enabled = false;
this.ultcboItemType.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
valueListItem3.DataValue = "0";
valueListItem3.DisplayText = "耗材消耗";
valueListItem4.DataValue = "1";
valueListItem4.DisplayText = "设备运行";
this.ultcboItemType.Items.AddRange(new Infragistics.Win.ValueListItem[] {
valueListItem3,
valueListItem4});
this.ultcboItemType.Location = new System.Drawing.Point(103, 10);
this.ultcboItemType.Name = "ultcboItemType";
this.ultcboItemType.Size = new System.Drawing.Size(103, 21);
this.ultcboItemType.TabIndex = 78;
this.ultcboItemType.ValueChanged += new System.EventHandler(this.ultcboItemType_ValueChanged);
//
// chkGWName
//
this.chkGWName.AutoSize = true;
this.chkGWName.BackColor = System.Drawing.Color.Transparent;
this.chkGWName.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.chkGWName.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chkGWName.Location = new System.Drawing.Point(234, 11);
this.chkGWName.Name = "chkGWName";
this.chkGWName.Size = new System.Drawing.Size(79, 18);
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.Flat;
this.chkItemType.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chkItemType.Location = new System.Drawing.Point(18, 11);
this.chkItemType.Name = "chkItemType";
this.chkItemType.Size = new System.Drawing.Size(79, 18);
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.cmbPosition);
this.ultraGroupBox1.Controls.Add(this.ultcboItemType);
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);
this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.GWBM_KeyPress);
((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);
((System.ComponentModel.ISupportInitialize)(this.ultraGroupBox3)).EndInit();
this.ultraGroupBox3.ResumeLayout(false);
this.ultraGroupBox3.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.uce_GWName)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.uce_XMType)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.cmbPosition)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.ultcboItemType)).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;
ultcboItemType.SelectedIndex = 0;
//初始化UltraDropDown控件
//InitUltraDropDown();
cmbPosition.SelectedIndex = 0;
uce_GWName.SelectedIndex = 0;
GetHCXMData();
}
///
/// 初始化UltraDropDown控件
///
private void InitUltraDropDown()
{
string strErr = "";
//定义一个ArrayList集合存储变量[参数]值
ArrayList arry = new ArrayList();
arry.Add("FrmYCJJB_Process.select");
CommonClientToServer cctos = new CommonClientToServer();
cctos.ob = this.ob;
DataSet ds = cctos.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery",
"doSimpleQuery", arry, out strErr);
if (strErr == "" && ds != null)
{
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
cmbPosition.Items.Add(i);
cmbPosition.Items[i].DisplayText = ds.Tables[0].Rows[i]["DESCRIPTION"].ToString();
cmbPosition.Items[i].DataValue = ds.Tables[0].Rows[i]["NAME_"].ToString();
uce_GWName.Items.Add(i);
uce_GWName.Items[i].DisplayText = ds.Tables[0].Rows[i]["DESCRIPTION"].ToString();
uce_GWName.Items[i].DataValue = ds.Tables[0].Rows[i]["NAME_"].ToString();
}
}
}
///
/// 读取耗材项目数据
///
private void GetHCXMData()
{
string strWhere = "";
try
{
if (chkItemType.Checked == true && ultcboItemType.SelectedItem !=null)
strWhere = " and a.itemtype='" + ultcboItemType.SelectedItem.DisplayText + "'";
if (chkGWName.Checked == true && cmbPosition.SelectedItem != null)
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.ExecuteQueryToDataTable(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();
}
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
{
string StrfileName = string.Format(System.Windows.Forms.Application.StartupPath + "\\Report\\{0}.xls", "耗材项目维护表");
this.ultraGridExcelExporter1.Export(this.ultraGrid2, StrfileName);
System.Diagnostics.ProcessStartInfo p = new System.Diagnostics.ProcessStartInfo(StrfileName);
p.WorkingDirectory = System.IO.Path.GetDirectoryName(StrfileName);
System.Diagnostics.Process.Start(p);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message + "\n处理方法:查看(" + System.Windows.Forms.Application.StartupPath + ")目录下是否有[ Report文件夹 ],如果没有请手动创建!");
}
break;
case "Exit":
this.Close();
break;
default:
break;
}
}
///
/// 新增耗材项目编码数据
///
public void AddHCXMData()
{
try
{
string strErrS = "";
//根据项目编码判断表是否已存在次记录
ArrayList arryS = new ArrayList();
arryS.Add("frmJJBBase.select");
arryS.Add(tb_XMCODE.Text.Trim());
CommonClientToServer cctos1 = new CommonClientToServer();
cctos1.ob = this.ob;
DataSet dc = cctos1.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery",
"doSimpleQuery", arryS, out strErrS);
if (dc.Tables[0].Rows.Count < 1)
{
//耗材项目代码
string strXMCODE = null;
if (string.IsNullOrEmpty(tb_XMCODE.Text.Trim()))
{
MessageBox.Show("耗材项目编码不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
return;
}
else
{
strXMCODE = tb_XMCODE.Text.Trim();
}
//耗材项目名称
string strXMNAME = null;
if (string.IsNullOrEmpty(tb_XMNAME.Text.Trim()))
{
MessageBox.Show("耗材项目名称不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
return;
}
else
strXMNAME = tb_XMNAME.Text.Trim();
//项目类型
string strXMType = uce_XMType.SelectedItem.DisplayText.Trim();
//岗位编码
string strGWName = "";
try
{
strGWName = uce_GWName.SelectedItem.DataValue.ToString();
}
catch { strGWName = "0"; }
string strErr = "";
//定义一个ArrayList集合存储变量[参数]值
ArrayList arry = new ArrayList();
arry.Add("frmJJBBase_Add.select");
arry.Add(strXMCODE);
arry.Add(strXMType);
arry.Add(strXMNAME);
arry.Add(strGWName);
CommonClientToServer cctos = new CommonClientToServer();
cctos.ob = this.ob;
DataSet ds = cctos.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBSave",
"doSimpleSave", arry, out strErr);
if (strErr != "" || ds == null)
{
MessageBox.Show("交接班项目配置新增失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}
else
MessageBox.Show("交接班项目配置新增成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}
else
MessageBox.Show("新增失败!项目编码违反唯一约束条件!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}//end try
catch (System.Exception exp)
{
WriteLog(exp.Message);
}
finally
{
}
}
///
/// 修改耗材项目,设备状况数据
///
public void UpdateHCXMData()
{
try
{
//耗材项目代码
string strXMCODE = null;
if (tb_XMCODE.Text.Trim() == null)
{
MessageBox.Show("耗材项目编码不能为空!");
return;
}
else
{
strXMCODE = tb_XMCODE.Text.Trim();
}
//耗材项目名称
string strXMNAME = tb_XMNAME.Text.Trim();
//项目类型
string strXMType = uce_XMType.SelectedItem.DisplayText;
//岗位编码
string strGWName="";
try
{
strGWName = uce_GWName.SelectedItem.DataValue.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(strXMCODE);
CommonClientToServer cctos = new CommonClientToServer();
cctos.ob = this.ob;
DataSet ds = cctos.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBSave",
"doSimpleSave", arry, out strErr);
if (strErr != "" || ds == null)
{
MessageBox.Show(strErr);
}
else
{
MessageBox.Show("项目编码不能修改,交接班项目配置修改成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
dataTable1.Clear();
}
}//end try
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;
DataSet ds = cctos.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBSave",
"doSimpleSave", arry, out strErr);
if (strErr != "" || ds == null)
{
MessageBox.Show(strErr);
}
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 ultraGrid2_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
{
GridKeyDown(e.KeyValue, ultraGrid2);
}
public void GridKeyDown(int RowId, Infragistics.Win.UltraWinGrid.UltraGrid GRID)
{
switch (RowId)
{
case 38:
GRID.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.ExitEditMode);
GRID.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.AboveCell);
GRID.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode);
break;
case 37:
GRID.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.ExitEditMode);
GRID.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.PrevCellByTab);
GRID.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode);
break;
case 39:
GRID.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.ExitEditMode);
GRID.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.NextCellByTab);
GRID.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode);
break;
case 40:
GRID.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.ExitEditMode);
GRID.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.BelowCell);
GRID.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode);
break;
case 13://回车
GRID.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.ExitEditMode);
GRID.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.NextCellByTab);
GRID.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode);
break;
}
}
private void ultraGrid2_Click(object sender, System.EventArgs e)
{
if(ultraGrid2.ActiveRow == null || ultraGrid2.ActiveRow.Index < 0)
{
return;
}
else if (ultraGrid2.ActiveRow.Index >= 0)
{
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["ItemCODE"].Text.Trim();
this.ultraGrid2.ActiveRow.Selected = true;
}
}
private void GWBM_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
if (e.KeyChar == (char)13)
{
Control c = GetNextControl(this.ActiveControl, true);
bool ok = SelectNextControl(this.ActiveControl, true, true, true, true);
if (ok && c != null)
{
if (c is System.Windows.Forms.TextBox)
{
((System.Windows.Forms.TextBox)c).SelectAll();
}
}
}
}
public void GoToLastRow()
{
if (ultraGrid2.Rows.Count <= 0)
{
return;
}
Infragistics.Win.UltraWinGrid.UltraGridRow aRow = ultraGrid2.GetRow(Infragistics.Win.UltraWinGrid.ChildRow.Last);
while (aRow.HasChild() == true)
{
aRow = aRow.GetChild(Infragistics.Win.UltraWinGrid.ChildRow.Last);
}
Infragistics.Win.UltraWinGrid.UltraGridRow topRow = aRow;
for (int i = 0; i < 20 && topRow.HasPrevSibling(); i++)
{
topRow = topRow.GetSibling(Infragistics.Win.UltraWinGrid.SiblingRow.Previous);
}
ultraGrid2.ActiveRow = topRow;
ultraGrid2.ActiveRow = aRow;
}
private void chkItemType_CheckedChanged(object sender, EventArgs e)
{
ultcboItemType.Enabled = chkItemType.Checked;
}
private void chkGWName_CheckedChanged(object sender, EventArgs e)
{
cmbPosition.Enabled = chkGWName.Checked;
}
private void tb_XMCODE_KeyPress(object sender, KeyPressEventArgs e)
{
if (!(Char.IsNumber(e.KeyChar) || e.KeyChar == '.' || e.KeyChar == '\b' || e.KeyChar == '-'))
{
e.Handled = true;
}
}
private void ultcboItemType_ValueChanged(object sender, EventArgs e)
{
GetHCXMData();
}
private void ultcboGWName_ValueChanged(object sender, EventArgs e)
{
GetHCXMData();
}
}
}