| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078 |
- 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
- {
- /// <summary>
- /// Department 的摘要说明。
- /// </summary>
- 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"; //判断是炼钢还是轧钢
- /// <summary>
- ///
- /// </summary>
- public frmMaintenance()
- {
- //
- // Windows 窗体设计器支持所必需的
- //
- InitializeComponent();
- //
- // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
- //
- }
- /// <summary>
- /// 清理所有正在使用的资源。
- /// </summary>
- protected override void Dispose( bool disposing )
- {
- if( disposing )
- {
- if(components != null)
- {
- components.Dispose();
- }
- }
- base.Dispose( disposing );
-
- }
- #region Windows 窗体设计器生成的代码
- /// <summary>
- /// 设计器支持所需的方法 - 不要使用代码编辑器修改
- /// 此方法的内容。
- /// </summary>
- 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
- /// <summary>
- /// 初始化函数
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- 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();
- }
- /// <summary>
- /// 初始化UltraDropDown控件
- /// </summary>
- 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();
-
- }
- }
- }
- /// <summary>
- /// 读取耗材项目数据
- /// </summary>
- 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
- {
- }
- }
- /// <summary>
- /// 写日志信息到日志文件
- /// </summary>
- /// <param name="str"></param>
- 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;
- }
-
- }
- /// <summary>
- /// 新增耗材项目编码数据
- /// </summary>
- 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
- {
- }
- }
- /// <summary>
- /// 修改耗材项目,设备状况数据
- /// </summary>
- 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
- {
- }
- }
- /// <summary>
- /// 删除耗材项目,设备状况数据
- /// </summary>
- 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();
- }
- }
- }
|