using System; using System.Data; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using CoreFS.CA06; using System.Diagnostics; using Infragistics.Win.UltraWinMaskedEdit; using Infragistics.Win.UltraWinGrid; using Infragistics.Win; using System.IO; using Core.StlMes.Client.LgCommon; using Core.Mes.Client.Comm.Control; namespace Core.StlMes.Client.LgIntegrationQuery { /// /// FrmAdditStat 的摘要说明。 /// public class frmAdditStat : frmStyleBase { #region " Construct "系统自动生成的 窗口结构代码 private System.Windows.Forms.Panel panel1; private Infragistics.Win.Misc.UltraGroupBox ultraGroupBox1; private Infragistics.Win.UltraWinTabControl.UltraTabControl ultraTabControl1; private Infragistics.Win.UltraWinTabControl.UltraTabSharedControlsPage ultraTabSharedControlsPage1; private Infragistics.Win.UltraWinTabControl.UltraTabPageControl ultraTabPageControl1; private Infragistics.Win.UltraWinTabControl.UltraTabPageControl ultraTabPageControl2; private System.Windows.Forms.Label label2; private Infragistics.Win.UltraWinGrid.UltraGrid ultraGrid1; private Infragistics.Win.UltraWinGrid.UltraGrid ultraGrid2; private System.Windows.Forms.Label label6; private System.Windows.Forms.CheckBox chk_HeaNo; private System.Windows.Forms.CheckBox checkBox3; private System.Windows.Forms.CheckBox chk_Staticode; private Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter GridExcelExporter; private CheckBox chkSteel; private TextBox txtSteel; private Infragistics.Win.UltraWinEditors.UltraDateTimeEditor uldtEndTime; private Infragistics.Win.UltraWinEditors.UltraDateTimeEditor uldtBeginTime; private Infragistics.Win.UltraWinEditors.UltraComboEditor cboStaticode; private Infragistics.Win.UltraWinEditors.UltraComboEditor cboGW; private Infragistics.Win.UltraWinEditors.UltraComboEditor cboGWID; private Infragistics.Win.UltraWinEditors.UltraCheckEditor uCkEditorForFilter; private Label label1; private TextBox ultraMaskedEdit2; private TextBox ultraMaskedEdit1; private Label label3; private System.ComponentModel.IContainer components; public frmAdditStat() { // // 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.Appearance appearance1 = new Infragistics.Win.Appearance(); Infragistics.Win.Appearance appearance2 = new Infragistics.Win.Appearance(); Infragistics.Win.Appearance appearance3 = new Infragistics.Win.Appearance(); Infragistics.Win.Appearance appearance4 = new Infragistics.Win.Appearance(); Infragistics.Win.Appearance appearance5 = new Infragistics.Win.Appearance(); Infragistics.Win.Appearance appearance6 = new Infragistics.Win.Appearance(); Infragistics.Win.Appearance appearance7 = new Infragistics.Win.Appearance(); Infragistics.Win.Appearance appearance8 = new Infragistics.Win.Appearance(); Infragistics.Win.Appearance appearance9 = new Infragistics.Win.Appearance(); Infragistics.Win.Appearance appearance10 = new Infragistics.Win.Appearance(); Infragistics.Win.Appearance appearance11 = new Infragistics.Win.Appearance(); Infragistics.Win.Appearance appearance12 = new Infragistics.Win.Appearance(); Infragistics.Win.Appearance appearance19 = new Infragistics.Win.Appearance(); Infragistics.Win.UltraWinTabControl.UltraTab ultraTab1 = new Infragistics.Win.UltraWinTabControl.UltraTab(); Infragistics.Win.UltraWinTabControl.UltraTab ultraTab2 = new Infragistics.Win.UltraWinTabControl.UltraTab(); Infragistics.Win.Appearance appearance13 = new Infragistics.Win.Appearance(); Infragistics.Win.Appearance appearance14 = new Infragistics.Win.Appearance(); Infragistics.Win.Appearance appearance15 = new Infragistics.Win.Appearance(); Infragistics.Win.ValueListItem valueListItem1 = new Infragistics.Win.ValueListItem(); Infragistics.Win.ValueListItem valueListItem2 = new Infragistics.Win.ValueListItem(); Infragistics.Win.ValueListItem valueListItem3 = new Infragistics.Win.ValueListItem(); Infragistics.Win.ValueListItem valueListItem12 = new Infragistics.Win.ValueListItem(); Infragistics.Win.Appearance appearance16 = 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(); this.ultraTabPageControl1 = new Infragistics.Win.UltraWinTabControl.UltraTabPageControl(); this.ultraGrid1 = new Infragistics.Win.UltraWinGrid.UltraGrid(); this.ultraTabPageControl2 = new Infragistics.Win.UltraWinTabControl.UltraTabPageControl(); this.ultraGrid2 = new Infragistics.Win.UltraWinGrid.UltraGrid(); this.panel1 = new System.Windows.Forms.Panel(); this.ultraTabControl1 = new Infragistics.Win.UltraWinTabControl.UltraTabControl(); this.ultraTabSharedControlsPage1 = new Infragistics.Win.UltraWinTabControl.UltraTabSharedControlsPage(); this.ultraGroupBox1 = new Infragistics.Win.Misc.UltraGroupBox(); this.label3 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); this.ultraMaskedEdit2 = new System.Windows.Forms.TextBox(); this.ultraMaskedEdit1 = new System.Windows.Forms.TextBox(); this.uCkEditorForFilter = new Infragistics.Win.UltraWinEditors.UltraCheckEditor(); this.cboGWID = new Infragistics.Win.UltraWinEditors.UltraComboEditor(); this.cboGW = new Infragistics.Win.UltraWinEditors.UltraComboEditor(); this.cboStaticode = new Infragistics.Win.UltraWinEditors.UltraComboEditor(); this.uldtEndTime = new Infragistics.Win.UltraWinEditors.UltraDateTimeEditor(); this.uldtBeginTime = new Infragistics.Win.UltraWinEditors.UltraDateTimeEditor(); this.txtSteel = new System.Windows.Forms.TextBox(); this.chkSteel = new System.Windows.Forms.CheckBox(); this.chk_Staticode = new System.Windows.Forms.CheckBox(); this.checkBox3 = new System.Windows.Forms.CheckBox(); this.chk_HeaNo = new System.Windows.Forms.CheckBox(); this.label6 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.GridExcelExporter = new Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter(this.components); this.ultraTabPageControl1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.ultraGrid1)).BeginInit(); this.ultraTabPageControl2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.ultraGrid2)).BeginInit(); this.panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.ultraTabControl1)).BeginInit(); this.ultraTabControl1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.ultraGroupBox1)).BeginInit(); this.ultraGroupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.uCkEditorForFilter)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.cboGWID)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.cboGW)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.cboStaticode)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.uldtEndTime)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.uldtBeginTime)).BeginInit(); this.SuspendLayout(); // // ultraTabPageControl1 // this.ultraTabPageControl1.Controls.Add(this.ultraGrid1); this.ultraTabPageControl1.Location = new System.Drawing.Point(2, 21); this.ultraTabPageControl1.Name = "ultraTabPageControl1"; this.ultraTabPageControl1.Size = new System.Drawing.Size(900, 349); // // ultraGrid1 // appearance1.TextHAlignAsString = "Left"; this.ultraGrid1.DisplayLayout.CaptionAppearance = appearance1; appearance2.BackColor = System.Drawing.SystemColors.ActiveBorder; appearance2.BackColor2 = System.Drawing.SystemColors.ControlDark; appearance2.BackGradientStyle = Infragistics.Win.GradientStyle.Vertical; appearance2.BorderColor = System.Drawing.SystemColors.Window; this.ultraGrid1.DisplayLayout.GroupByBox.Appearance = appearance2; appearance3.ForeColor = System.Drawing.SystemColors.GrayText; this.ultraGrid1.DisplayLayout.GroupByBox.BandLabelAppearance = appearance3; this.ultraGrid1.DisplayLayout.GroupByBox.BorderStyle = Infragistics.Win.UIElementBorderStyle.Solid; this.ultraGrid1.DisplayLayout.GroupByBox.Hidden = true; appearance4.BackColor = System.Drawing.SystemColors.ControlLightLight; appearance4.BackColor2 = System.Drawing.SystemColors.Control; appearance4.BackGradientStyle = Infragistics.Win.GradientStyle.Horizontal; appearance4.ForeColor = System.Drawing.SystemColors.GrayText; this.ultraGrid1.DisplayLayout.GroupByBox.PromptAppearance = appearance4; this.ultraGrid1.DisplayLayout.MaxColScrollRegions = 1; this.ultraGrid1.DisplayLayout.MaxRowScrollRegions = 1; appearance5.FontData.SizeInPoints = 10F; this.ultraGrid1.DisplayLayout.Override.CellAppearance = appearance5; this.ultraGrid1.DisplayLayout.Override.CellPadding = 0; appearance6.FontData.SizeInPoints = 9F; appearance6.TextHAlignAsString = "Center"; this.ultraGrid1.DisplayLayout.Override.HeaderAppearance = appearance6; this.ultraGrid1.DisplayLayout.Override.HeaderClickAction = Infragistics.Win.UltraWinGrid.HeaderClickAction.SortMulti; this.ultraGrid1.DisplayLayout.Override.HeaderStyle = Infragistics.Win.HeaderStyle.Standard; this.ultraGrid1.DisplayLayout.Override.RowSelectorNumberStyle = Infragistics.Win.UltraWinGrid.RowSelectorNumberStyle.RowIndex; this.ultraGrid1.DisplayLayout.ScrollBounds = Infragistics.Win.UltraWinGrid.ScrollBounds.ScrollToFill; this.ultraGrid1.DisplayLayout.ScrollStyle = Infragistics.Win.UltraWinGrid.ScrollStyle.Immediate; this.ultraGrid1.Dock = System.Windows.Forms.DockStyle.Fill; this.ultraGrid1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.ultraGrid1.Location = new System.Drawing.Point(0, 0); this.ultraGrid1.Name = "ultraGrid1"; this.ultraGrid1.Size = new System.Drawing.Size(900, 349); this.ultraGrid1.TabIndex = 20; // // ultraTabPageControl2 // this.ultraTabPageControl2.Controls.Add(this.ultraGrid2); this.ultraTabPageControl2.Location = new System.Drawing.Point(-10000, -10000); this.ultraTabPageControl2.Name = "ultraTabPageControl2"; this.ultraTabPageControl2.Size = new System.Drawing.Size(900, 349); // // ultraGrid2 // appearance7.TextHAlignAsString = "Left"; this.ultraGrid2.DisplayLayout.CaptionAppearance = appearance7; appearance8.BackColor = System.Drawing.SystemColors.ActiveBorder; appearance8.BackColor2 = System.Drawing.SystemColors.ControlDark; appearance8.BackGradientStyle = Infragistics.Win.GradientStyle.Vertical; appearance8.BorderColor = System.Drawing.SystemColors.Window; this.ultraGrid2.DisplayLayout.GroupByBox.Appearance = appearance8; appearance9.ForeColor = System.Drawing.SystemColors.GrayText; this.ultraGrid2.DisplayLayout.GroupByBox.BandLabelAppearance = appearance9; this.ultraGrid2.DisplayLayout.GroupByBox.BorderStyle = Infragistics.Win.UIElementBorderStyle.Solid; this.ultraGrid2.DisplayLayout.GroupByBox.Hidden = true; appearance10.BackColor = System.Drawing.SystemColors.ControlLightLight; appearance10.BackColor2 = System.Drawing.SystemColors.Control; appearance10.BackGradientStyle = Infragistics.Win.GradientStyle.Horizontal; appearance10.ForeColor = System.Drawing.SystemColors.GrayText; this.ultraGrid2.DisplayLayout.GroupByBox.PromptAppearance = appearance10; this.ultraGrid2.DisplayLayout.MaxColScrollRegions = 1; this.ultraGrid2.DisplayLayout.MaxRowScrollRegions = 1; appearance11.FontData.SizeInPoints = 10F; this.ultraGrid2.DisplayLayout.Override.CellAppearance = appearance11; this.ultraGrid2.DisplayLayout.Override.CellPadding = 0; appearance12.FontData.SizeInPoints = 9F; appearance12.TextHAlignAsString = "Center"; this.ultraGrid2.DisplayLayout.Override.HeaderAppearance = appearance12; this.ultraGrid2.DisplayLayout.Override.HeaderClickAction = Infragistics.Win.UltraWinGrid.HeaderClickAction.SortMulti; this.ultraGrid2.DisplayLayout.Override.HeaderStyle = Infragistics.Win.HeaderStyle.Standard; this.ultraGrid2.DisplayLayout.Override.RowSelectorNumberStyle = Infragistics.Win.UltraWinGrid.RowSelectorNumberStyle.RowIndex; this.ultraGrid2.DisplayLayout.ScrollBounds = Infragistics.Win.UltraWinGrid.ScrollBounds.ScrollToFill; this.ultraGrid2.DisplayLayout.ScrollStyle = Infragistics.Win.UltraWinGrid.ScrollStyle.Immediate; this.ultraGrid2.Dock = System.Windows.Forms.DockStyle.Fill; this.ultraGrid2.Font = new System.Drawing.Font("宋体", 9F); this.ultraGrid2.Location = new System.Drawing.Point(0, 0); this.ultraGrid2.Name = "ultraGrid2"; this.ultraGrid2.Size = new System.Drawing.Size(900, 349); this.ultraGrid2.TabIndex = 21; // // panel1 // this.panel1.Controls.Add(this.ultraTabControl1); this.panel1.Controls.Add(this.ultraGroupBox1); this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; this.panel1.Location = new System.Drawing.Point(0, 0); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(904, 437); this.panel1.TabIndex = 0; // // ultraTabControl1 // appearance19.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(213)))), ((int)(((byte)(228)))), ((int)(((byte)(242))))); this.ultraTabControl1.Appearance = appearance19; this.ultraTabControl1.Controls.Add(this.ultraTabSharedControlsPage1); this.ultraTabControl1.Controls.Add(this.ultraTabPageControl1); this.ultraTabControl1.Controls.Add(this.ultraTabPageControl2); this.ultraTabControl1.Dock = System.Windows.Forms.DockStyle.Fill; this.ultraTabControl1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.ultraTabControl1.Location = new System.Drawing.Point(0, 65); this.ultraTabControl1.MinTabWidth = 100; this.ultraTabControl1.Name = "ultraTabControl1"; this.ultraTabControl1.SharedControlsPage = this.ultraTabSharedControlsPage1; this.ultraTabControl1.Size = new System.Drawing.Size(904, 372); this.ultraTabControl1.TabIndex = 5; ultraTab1.TabPage = this.ultraTabPageControl1; ultraTab1.Text = "金属料"; ultraTab2.TabPage = this.ultraTabPageControl2; ultraTab2.Text = "辅料"; this.ultraTabControl1.Tabs.AddRange(new Infragistics.Win.UltraWinTabControl.UltraTab[] { ultraTab1, ultraTab2}); this.ultraTabControl1.ViewStyle = Infragistics.Win.UltraWinTabControl.ViewStyle.VisualStudio2005; this.ultraTabControl1.SelectedTabChanged += new Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventHandler(this.ultraTabControl1_SelectedTabChanged); // // ultraTabSharedControlsPage1 // this.ultraTabSharedControlsPage1.Location = new System.Drawing.Point(-10000, -10000); this.ultraTabSharedControlsPage1.Name = "ultraTabSharedControlsPage1"; this.ultraTabSharedControlsPage1.Size = new System.Drawing.Size(900, 349); // // ultraGroupBox1 // this.ultraGroupBox1.Controls.Add(this.txtSteel); this.ultraGroupBox1.Controls.Add(this.label3); this.ultraGroupBox1.Controls.Add(this.label1); this.ultraGroupBox1.Controls.Add(this.ultraMaskedEdit2); this.ultraGroupBox1.Controls.Add(this.ultraMaskedEdit1); this.ultraGroupBox1.Controls.Add(this.uCkEditorForFilter); this.ultraGroupBox1.Controls.Add(this.cboGWID); this.ultraGroupBox1.Controls.Add(this.cboGW); this.ultraGroupBox1.Controls.Add(this.cboStaticode); this.ultraGroupBox1.Controls.Add(this.uldtEndTime); this.ultraGroupBox1.Controls.Add(this.uldtBeginTime); this.ultraGroupBox1.Controls.Add(this.chkSteel); this.ultraGroupBox1.Controls.Add(this.chk_Staticode); this.ultraGroupBox1.Controls.Add(this.checkBox3); this.ultraGroupBox1.Controls.Add(this.chk_HeaNo); this.ultraGroupBox1.Controls.Add(this.label6); this.ultraGroupBox1.Controls.Add(this.label2); 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(904, 65); this.ultraGroupBox1.TabIndex = 4; // // label3 // this.label3.AutoSize = true; this.label3.Location = new System.Drawing.Point(367, 15); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(53, 12); this.label3.TabIndex = 296; this.label3.Text = " 岗 位"; // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(21, 14); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(41, 12); this.label1.TabIndex = 295; this.label1.Text = "时间从"; // // ultraMaskedEdit2 // this.ultraMaskedEdit2.Enabled = false; this.ultraMaskedEdit2.Location = new System.Drawing.Point(221, 37); this.ultraMaskedEdit2.MaxLength = 8; this.ultraMaskedEdit2.Name = "ultraMaskedEdit2"; this.ultraMaskedEdit2.Size = new System.Drawing.Size(128, 21); this.ultraMaskedEdit2.TabIndex = 294; // // ultraMaskedEdit1 // this.ultraMaskedEdit1.Enabled = false; this.ultraMaskedEdit1.Location = new System.Drawing.Point(91, 38); this.ultraMaskedEdit1.MaxLength = 8; this.ultraMaskedEdit1.Name = "ultraMaskedEdit1"; this.ultraMaskedEdit1.Size = new System.Drawing.Size(104, 21); this.ultraMaskedEdit1.TabIndex = 293; // // uCkEditorForFilter // appearance13.BackColor = System.Drawing.Color.LimeGreen; appearance13.TextVAlignAsString = "Middle"; this.uCkEditorForFilter.Appearance = appearance13; this.uCkEditorForFilter.BackColor = System.Drawing.Color.LimeGreen; this.uCkEditorForFilter.BackColorInternal = System.Drawing.Color.Transparent; this.uCkEditorForFilter.Location = new System.Drawing.Point(830, 7); this.uCkEditorForFilter.Name = "uCkEditorForFilter"; this.uCkEditorForFilter.Size = new System.Drawing.Size(46, 20); this.uCkEditorForFilter.TabIndex = 292; this.uCkEditorForFilter.Text = "过滤"; this.uCkEditorForFilter.Visible = false; this.uCkEditorForFilter.CheckedChanged += new System.EventHandler(this.uCkEditorForFilter_CheckedChanged); // // cboGWID // appearance14.BorderAlpha = Infragistics.Win.Alpha.UseAlphaLevel; appearance14.BorderColor = System.Drawing.Color.Black; this.cboGWID.Appearance = appearance14; this.cboGWID.BorderStyle = Infragistics.Win.UIElementBorderStyle.Solid; this.cboGWID.DropDownStyle = Infragistics.Win.DropDownStyle.DropDownList; this.cboGWID.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.cboGWID.Location = new System.Drawing.Point(502, 11); this.cboGWID.Name = "cboGWID"; this.cboGWID.Size = new System.Drawing.Size(146, 19); this.cboGWID.TabIndex = 285; this.cboGWID.UseFlatMode = Infragistics.Win.DefaultableBoolean.True; // // cboGW // appearance15.BorderAlpha = Infragistics.Win.Alpha.UseAlphaLevel; appearance15.BorderColor = System.Drawing.Color.Black; this.cboGW.Appearance = appearance15; this.cboGW.BorderStyle = Infragistics.Win.UIElementBorderStyle.Solid; this.cboGW.DropDownStyle = Infragistics.Win.DropDownStyle.DropDownList; this.cboGW.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); valueListItem1.DataValue = "0"; valueListItem1.DisplayText = "转炉"; valueListItem2.DataValue = "1"; valueListItem2.DisplayText = "吹氩站"; valueListItem3.DataValue = "2"; valueListItem3.DisplayText = "精炼炉"; valueListItem12.DataValue = "6"; valueListItem12.DisplayText = "连铸"; this.cboGW.Items.AddRange(new Infragistics.Win.ValueListItem[] { valueListItem1, valueListItem2, valueListItem3, valueListItem12}); this.cboGW.Location = new System.Drawing.Point(425, 10); this.cboGW.Name = "cboGW"; this.cboGW.Size = new System.Drawing.Size(65, 19); this.cboGW.TabIndex = 284; this.cboGW.UseFlatMode = Infragistics.Win.DefaultableBoolean.True; this.cboGW.SelectionChanged += new System.EventHandler(this.cboGW_SelectionChanged); // // cboStaticode // appearance16.BorderAlpha = Infragistics.Win.Alpha.UseAlphaLevel; appearance16.BorderColor = System.Drawing.Color.Black; this.cboStaticode.Appearance = appearance16; this.cboStaticode.BorderStyle = Infragistics.Win.UIElementBorderStyle.Solid; this.cboStaticode.DropDownStyle = Infragistics.Win.DropDownStyle.DropDownList; this.cboStaticode.Enabled = false; this.cboStaticode.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); valueListItem5.DataValue = "0"; valueListItem5.DisplayText = "全部"; valueListItem6.DataValue = "1"; valueListItem6.DisplayText = "甲班"; valueListItem7.DataValue = "2"; valueListItem7.DisplayText = "乙班"; valueListItem8.DataValue = "3"; valueListItem8.DisplayText = "丙班"; valueListItem9.DataValue = "4"; valueListItem9.DisplayText = "丁班"; this.cboStaticode.Items.AddRange(new Infragistics.Win.ValueListItem[] { valueListItem5, valueListItem6, valueListItem7, valueListItem8, valueListItem9}); this.cboStaticode.Location = new System.Drawing.Point(725, 10); this.cboStaticode.Name = "cboStaticode"; this.cboStaticode.Size = new System.Drawing.Size(65, 19); this.cboStaticode.TabIndex = 283; this.cboStaticode.UseFlatMode = Infragistics.Win.DefaultableBoolean.True; // // uldtEndTime // this.uldtEndTime.DateTime = new System.DateTime(2008, 11, 24, 0, 0, 0, 0); this.uldtEndTime.FormatProvider = new System.Globalization.CultureInfo("en-US"); this.uldtEndTime.FormatString = ""; this.uldtEndTime.Location = new System.Drawing.Point(221, 11); this.uldtEndTime.MaskInput = "yyyy-mm-dd hh:mm"; this.uldtEndTime.Name = "uldtEndTime"; this.uldtEndTime.Size = new System.Drawing.Size(128, 21); this.uldtEndTime.TabIndex = 282; this.uldtEndTime.Value = new System.DateTime(2008, 11, 24, 0, 0, 0, 0); // // uldtBeginTime // this.uldtBeginTime.DateTime = new System.DateTime(2008, 11, 24, 0, 0, 0, 0); this.uldtBeginTime.FormatProvider = new System.Globalization.CultureInfo("en-US"); this.uldtBeginTime.FormatString = ""; this.uldtBeginTime.Location = new System.Drawing.Point(68, 11); this.uldtBeginTime.MaskInput = "yyyy-mm-dd hh:mm"; this.uldtBeginTime.Name = "uldtBeginTime"; this.uldtBeginTime.Size = new System.Drawing.Size(128, 21); this.uldtBeginTime.TabIndex = 281; this.uldtBeginTime.Value = new System.DateTime(2008, 11, 24, 0, 0, 0, 0); // // txtSteel // this.txtSteel.Enabled = false; this.txtSteel.Location = new System.Drawing.Point(425, 35); this.txtSteel.MaxLength = 50; this.txtSteel.Name = "txtSteel"; this.txtSteel.Size = new System.Drawing.Size(223, 21); this.txtSteel.TabIndex = 88; // // chkSteel // this.chkSteel.Font = new System.Drawing.Font("宋体", 9F); this.chkSteel.Location = new System.Drawing.Point(370, 34); this.chkSteel.Name = "chkSteel"; this.chkSteel.Size = new System.Drawing.Size(66, 24); this.chkSteel.TabIndex = 87; this.chkSteel.Text = "牌 号"; this.chkSteel.CheckedChanged += new System.EventHandler(this.chkSteel_CheckedChanged); // // chk_Staticode // this.chk_Staticode.Font = new System.Drawing.Font("宋体", 9F); this.chk_Staticode.Location = new System.Drawing.Point(664, 8); this.chk_Staticode.Name = "chk_Staticode"; this.chk_Staticode.Size = new System.Drawing.Size(60, 24); this.chk_Staticode.TabIndex = 63; this.chk_Staticode.Text = " 班 组"; this.chk_Staticode.CheckedChanged += new System.EventHandler(this.chk_Staticode_CheckedChanged); // // checkBox3 // this.checkBox3.Enabled = false; this.checkBox3.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.checkBox3.Location = new System.Drawing.Point(852, 42); this.checkBox3.Name = "checkBox3"; this.checkBox3.Size = new System.Drawing.Size(82, 24); this.checkBox3.TabIndex = 62; this.checkBox3.Text = "工序位置"; this.checkBox3.Visible = false; this.checkBox3.CheckedChanged += new System.EventHandler(this.checkBox3_CheckedChanged); // // chk_HeaNo // this.chk_HeaNo.Font = new System.Drawing.Font("宋体", 9F); this.chk_HeaNo.Location = new System.Drawing.Point(12, 35); this.chk_HeaNo.Name = "chk_HeaNo"; this.chk_HeaNo.Size = new System.Drawing.Size(73, 24); this.chk_HeaNo.TabIndex = 60; this.chk_HeaNo.Text = "熔炼号从"; this.chk_HeaNo.CheckedChanged += new System.EventHandler(this.chk_HeaNo_CheckedChanged); // // label6 // this.label6.AutoSize = true; this.label6.Font = new System.Drawing.Font("宋体", 9F); this.label6.Location = new System.Drawing.Point(201, 14); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(17, 12); this.label6.TabIndex = 59; this.label6.Text = "到"; // // label2 // this.label2.AutoSize = true; this.label2.Font = new System.Drawing.Font("宋体", 9F); this.label2.Location = new System.Drawing.Point(201, 42); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(17, 12); this.label2.TabIndex = 50; this.label2.Text = "到"; // // frmAdditStat // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.ClientSize = new System.Drawing.Size(904, 437); this.Controls.Add(this.panel1); this.Name = "frmAdditStat"; this.Text = "物料消耗查询"; this.Load += new System.EventHandler(this.frmAdditStat_Load); this.ultraTabPageControl1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.ultraGrid1)).EndInit(); this.ultraTabPageControl2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.ultraGrid2)).EndInit(); this.panel1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.ultraTabControl1)).EndInit(); this.ultraTabControl1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.ultraGroupBox1)).EndInit(); this.ultraGroupBox1.ResumeLayout(false); this.ultraGroupBox1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.uCkEditorForFilter)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.cboGWID)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.cboGW)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.cboStaticode)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.uldtEndTime)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.uldtBeginTime)).EndInit(); this.ResumeLayout(false); } #endregion #endregion private DataSet _dsHj = new DataSet(); private DataSet _dsPL = new DataSet(); private DataSet _dsFl = new DataSet(); private Hashtable tabSteel = new Hashtable(); public string _strWhere = " where to_char(jobtime, 'yyyy-MM-dd') = to_char(sysdate, 'yyyy-MM-dd')"; public string _strCob1 = ""; public string _strCob2 = ""; private DataSet _dsGridInfo = new DataSet(); private void frmAdditStat_Load(object sender, System.EventArgs e) { this.uldtBeginTime.Text = System.DateTime.Today.ToString("yyyy-MM-dd") + " 00:00:00"; this.uldtEndTime.Text = System.DateTime.Today.ToString("yyyy-MM-dd") + " 23:59:59"; initGW(); initBZ(); InitSteel(); //GetGridInfo(); } // 初始化Grind牌号 /// /// 初始化Grind牌号 /// private void InitSteel() { try { string strErr = ""; ultraGrid1.DisplayLayout.ValueLists.Add("SteelCode"); ultraGrid2.DisplayLayout.ValueLists.Add("SteelCode1"); ArrayList arry = new ArrayList(); arry.Add("ElementsSteel.Query");//此ID为XML文件ID CommonClientToServer cctos = new CommonClientToServer(); cctos.ob = this.ob; DataSet dsSteel = cctos.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr); if (strErr == "" && dsSteel != null) { //初始经Grid牌号字段数据集 for (int i = 0; i < dsSteel.Tables[0].Rows.Count; i++) { // ultraGrid1.DisplayLayout.ValueLists["SteelCode"].ValueListItems.Add(dsSteel.Tables[0].Rows[i]["SteelCode"].ToString(), dsSteel.Tables[0].Rows[i]["Steel"].ToString()); // ultraGrid2.DisplayLayout.ValueLists["SteelCode1"].ValueListItems.Add(dsSteel.Tables[0].Rows[i]["SteelCode"].ToString(), dsSteel.Tables[0].Rows[i]["Steel"].ToString()); tabSteel.Add(dsSteel.Tables[0].Rows[i]["SteelCode"].ToString(), dsSteel.Tables[0].Rows[i]["Steel"].ToString()); } //绑定单位 //ultraGrid1.DisplayLayout.Bands[0].Columns["STEEL"].ValueList = ultraGrid1.DisplayLayout.ValueLists["SteelCode"]; //ultraGrid2.DisplayLayout.Bands[0].Columns["STEEL"].ValueList = ultraGrid2.DisplayLayout.ValueLists["SteelCode1"]; } } catch { } } // 金属料初始化 /// /// 金属料初始化 /// private void InitData1() { try { UltraGridBand band = this.ultraGrid1.DisplayLayout.Bands[0]; band.Columns[0].Header.Caption = "加热处理号"; band.Columns[0].Width = 80; band.Columns[0].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; band.Columns[0].Hidden = true; band.Columns[1].Header.Caption = "熔炼号"; band.Columns[1].Width = 100; band.Columns[1].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; band.Columns[2].Header.Caption = "牌号"; band.Columns[2].Width = 100; band.Columns[2].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; band.Columns[3].Header.Caption = "设备号"; band.Columns[3].Width = 60; band.Columns[3].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; //band.Columns[2].Hidden = true; band.Columns[4].Header.Caption = "班组"; band.Columns[4].Width = 60; band.Columns[4].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; //band.Columns[2].Hidden = true; int intIronWsteel = 0; if (cboGW.Text == "转炉" && this.ultraTabControl1.Tabs[0].Selected == true) { band.Columns[5].Header.Caption = "铁水"; band.Columns[5].Width = 60; band.Columns[5].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; band.Columns[6].Header.Caption = "生铁"; band.Columns[6].Width = 60; band.Columns[6].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; band.Columns[7].Header.Caption = "废钢"; band.Columns[7].Width = 60; band.Columns[7].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; intIronWsteel = 3; } string strSel = ""; if (this.checkBox3.Checked) strSel = string.Format("MATERIELTYPE='HJ'"); ///, "BOF0" + Convert.ToString(this.cboGWID.SelectedIndex + 1)); else strSel = "MATERIELTYPE='HJ'"; DataRow[] drs = _dsGridInfo.Tables[0].Select(strSel);//, "wlbm ASC"); int count = drs.Length; for (int i = 0; i < count; i++) { DataRow dr = drs[i]; band.Columns[5 + intIronWsteel + i].Header.Caption = dr["materielforshort"].ToString(); band.Columns[5 + intIronWsteel + i].Width = 70; band.Columns[5 + intIronWsteel + i].CellAppearance.TextHAlign = Infragistics.Win.HAlign.Right; band.Columns[5 + intIronWsteel + i].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; band.Columns[5 + intIronWsteel + i].Format = "#########.00"; } this.ultraGrid1.DisplayLayout.Override.RowSelectorNumberStyle = RowSelectorNumberStyle.RowIndex; if (band.Summaries.Count > 0 && band.Summaries.Count == count) return; band.Summaries.Clear(); SummarySettings summary = band.Summaries.Add(SummaryType.Count, band.Columns[1]); summary.SummaryPosition = SummaryPosition.UseSummaryPositionColumn; summary.DisplayFormat = "合计:"; summary = band.Summaries.Add(SummaryType.Count, band.Columns[1]); summary.SummaryPosition = SummaryPosition.UseSummaryPositionColumn; summary.DisplayFormat = "平均:"; for (int i = 5; i < 5 + count + intIronWsteel; i++) { summary = band.Summaries.Add(SummaryType.Sum, band.Columns[i]); summary.SummaryPosition = SummaryPosition.UseSummaryPositionColumn; if (i > 4) summary.DisplayFormat = " {0:#####}"; else summary.DisplayFormat = " {0:#####.000}"; summary.Appearance.TextHAlign = HAlign.Right; summary.Appearance.ForeColor = Color.DarkBlue; summary.Appearance.BackColor = Color.White; summary = band.Summaries.Add(SummaryType.Average, band.Columns[i]); summary.SummaryPosition = SummaryPosition.UseSummaryPositionColumn; if (i > 4) summary.DisplayFormat = " {0:#####}"; else summary.DisplayFormat = " {0:#####.000}"; summary.Appearance.TextHAlign = HAlign.Right; summary.Appearance.ForeColor = Color.DarkBlue; summary.Appearance.BackColor = Color.White; } band.Override.SummaryFooterCaptionVisible = DefaultableBoolean.False; } catch { } } // 散装料初始化 /// /// 散装料初始化 /// private void InitData2() { try { UltraGridBand band = this.ultraGrid2.DisplayLayout.Bands[0]; band.Columns[0].Header.Caption = "加热处理号"; band.Columns[0].Width = 80; band.Columns[0].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; band.Columns[0].Hidden = true; band.Columns[1].Header.Caption = "熔炼号"; band.Columns[1].Width = 100; band.Columns[1].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; band.Columns[2].Header.Caption = "牌号"; band.Columns[2].Width = 100; band.Columns[2].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; band.Columns[3].Header.Caption = "设备号"; band.Columns[3].Width = 60; band.Columns[3].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; //band.Columns[2].Hidden = true; band.Columns[4].Header.Caption = "班组"; band.Columns[4].Width = 60; band.Columns[4].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; //band.Columns[2].Hidden = true; string strSel = ""; if (this.checkBox3.Checked) strSel = "MATERIELTYPE='FL'"; else strSel = "MATERIELTYPE='FL'"; DataRow[] drs = _dsGridInfo.Tables[0].Select(strSel); int count = drs.Length; for (int i = 0; i < count; i++) { DataRow dr = drs[i]; band.Columns[5 + i].Header.Caption = dr["materielforshort"].ToString(); band.Columns[5 + i].Width = 85; band.Columns[5 + i].CellAppearance.TextHAlign = Infragistics.Win.HAlign.Right; band.Columns[5 + i].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; band.Columns[5 + i].Format = "#########.00"; } this.ultraGrid2.DisplayLayout.Override.RowSelectorNumberStyle = RowSelectorNumberStyle.RowIndex; if (band.Summaries.Count > 0 && band.Summaries.Count == count) return; band.Summaries.Clear(); SummarySettings summary = band.Summaries.Add(SummaryType.Count, band.Columns[1]); summary.SummaryPosition = SummaryPosition.UseSummaryPositionColumn; summary.DisplayFormat = "合计:"; summary = band.Summaries.Add(SummaryType.Count, band.Columns[1]); summary.SummaryPosition = SummaryPosition.UseSummaryPositionColumn; summary.DisplayFormat = "平均:"; for (int i = 5; i < 5 + count; i++) { summary = band.Summaries.Add(SummaryType.Sum, band.Columns[i]); summary.SummaryPosition = SummaryPosition.UseSummaryPositionColumn; if (i > 4) summary.DisplayFormat = " {0:#####}"; else summary.DisplayFormat = " {0:#####.000}"; summary.Appearance.TextHAlign = HAlign.Right; summary.Appearance.ForeColor = Color.DarkBlue; summary.Appearance.BackColor = Color.White; summary = band.Summaries.Add(SummaryType.Average, band.Columns[i]); summary.SummaryPosition = SummaryPosition.UseSummaryPositionColumn; if (i > 4) summary.DisplayFormat = " {0:#####}"; else summary.DisplayFormat = " {0:#####.000}"; summary.Appearance.TextHAlign = HAlign.Right; summary.Appearance.ForeColor = Color.DarkBlue; summary.Appearance.BackColor = Color.White; } band.Override.SummaryFooterCaptionVisible = DefaultableBoolean.False; } catch { } } // 初始化工位 /// /// 初始化工位 /// private void initGW() { cboGW.Items.Clear(); //cboGW.Items.Add("SYGW", "所有工位"); cboGW.Items.Add("HMP0", "脱硫站"); cboGW.Items.Add("BOF0", "转炉"); cboGW.Items.Add("CAS0", "吹氩站"); cboGW.Items.Add("LFS0", "精炼炉"); // cboGW.Items.Add("CCM0", "连铸机"); cboGW.SelectedIndex = 0; } // 初始化班组 /// /// 初始化班组 /// private void initBZ() { cboStaticode.Items.Clear(); cboStaticode.Items.Add("0", "所有"); cboStaticode.Items.Add("1", "甲"); cboStaticode.Items.Add("2", "乙"); cboStaticode.Items.Add("3", "丙"); cboStaticode.Items.Add("4", "丁"); cboStaticode.SelectedIndex = 0; } #region " Control Events " 条件选择 //private void ultraGrid2_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) //{ // UltraGridBand band = this.ultraGrid2.DisplayLayout.Bands[0]; // if (this.ultraGrid2.Rows.Count < 1) return; // try // { // DateTime dtForeTime = Convert.ToDateTime(this.ultraGrid2.Rows[0].Cells[18].Value); // DateTime dtCurrTime = dtForeTime; // TimeSpan ts = new TimeSpan(); // for (int i = 1; i < this.ultraGrid2.Rows.Count; i++) // { // dtCurrTime = Convert.ToDateTime(this.ultraGrid2.Rows[i].Cells[18].Value); // ts = dtCurrTime - dtForeTime; // if (ts.Minutes > 99 || ts.Minutes < 0) // this.ultraGrid2.Rows[i].Cells[20].Value = 0; // else // this.ultraGrid2.Rows[i].Cells[20].Value = ts.Minutes; // dtForeTime = dtCurrTime; // } // } // catch { } //} private void chk_HeaNo_CheckedChanged(object sender, EventArgs e) { this.ultraMaskedEdit1.Enabled = this.chk_HeaNo.Checked; this.ultraMaskedEdit2.Enabled = this.chk_HeaNo.Checked; if (!this.ultraMaskedEdit1.Enabled) { ultraMaskedEdit1.BackColor = Color.WhiteSmoke; } if (!this.ultraMaskedEdit2.Enabled) { ultraMaskedEdit2.BackColor = Color.WhiteSmoke; } } private void checkBox3_CheckedChanged(object sender, System.EventArgs e) { this.cboGWID.Enabled = this.checkBox3.Checked; this.cboGW.Enabled = this.checkBox3.Checked; } private void chk_Staticode_CheckedChanged(object sender, System.EventArgs e) { this.cboStaticode.Enabled = this.chk_Staticode.Checked; } #endregion //初始化物料信息列名 /// /// 初始化物料信息列名 /// private void GetGridInfo() { try { string strErr = ""; string addTalbeName = ""; string strWhere = ""; string strgw = cboGW.Value.ToString(); if (cboGW.SelectedIndex == -1) { strgw = "BOF0"; } string strStartTime = ""; string strEndTime = ""; string strMType = ""; string resTalbeName = TableName(strgw, out addTalbeName); if (Convert.ToDateTime(uldtBeginTime.Value) > Convert.ToDateTime(uldtEndTime.Value)) { MessageBox.Show("时间条件的开始时间不能大于结束时间!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); return; } else { strStartTime = this.uldtBeginTime.DateTime.ToString("yyyy-MM-dd"); strEndTime = this.uldtEndTime.DateTime.ToString("yyyy-MM-dd"); } if (cboGWID.Value.ToString() != "0" ) //岗位 strWhere += " and a.stationcode='" + addTalbeName + "0" + cboGWID.Value.ToString() + "'"; else strWhere += " and a.stationcode like '" + addTalbeName + "%'"; if (this.ultraTabControl1.Tabs[0].Selected == true) strMType = "HJ"; else strMType = "FL"; //定义一个ArrayList集合存储变量[参数]值 string NowTime = DateTime.Now.ToString("yyyy-MM-dd"); ArrayList arry = new ArrayList(); arry.Add("frmAdditStat_Load.select");//此ID为XML文件ID arry.Add(strMType); arry.Add(strStartTime == "" ? NowTime : strStartTime); arry.Add(strEndTime == "" ? NowTime : strEndTime); CommonClientToServer cctos = new CommonClientToServer(); cctos.ob = this.ob; DataSet ds = cctos.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr); _dsGridInfo = ds; } catch (Exception ex) { Console.WriteLine(ex.Message); } } // 获取物料信息 /// /// 获取物料信息 /// private void GetAdditStat() { string sqlstr; string addTalbeName = ""; if (cboGW.Value == null) return; string strGw = cboGW.Value.ToString(); string strGWID = cboGWID.Value.ToString(); if (chk_HeaNo.Checked) { if (ultraMaskedEdit1.Text.Length == 0 && ultraMaskedEdit2.Text.Length == 0) { MessageBox.Show("炉号不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); ultraMaskedEdit1.Focus(); return; } } if (chk_Staticode.Checked) { if (cboStaticode.SelectedIndex == -1) { MessageBox.Show("班组不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); cboStaticode.Focus(); return; } } if (chkSteel.Checked) { if (txtSteel.Text.Length == 0) { MessageBox.Show("牌号不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); txtSteel.Focus(); return; } } GetGridInfo(); //初始化物料信息列名 if (this.ultraTabControl1.Tabs[0].Selected == true) sqlstr = BuildSql(strGWID, "HJ"); else sqlstr = BuildSql(strGWID, "FL"); try { string resTalbeName = TableName(strGw, out addTalbeName); string strIronWSteel = ""; if (addTalbeName == "C") strIronWSteel = " ,IRONPOTWGT,PIGIRONWGT,WSTEELWGT "; string strWhereB = ""; if (addTalbeName == "B") strWhereB = " where a.heatno =b.heatno and '" + addTalbeName + "'|| a.EQUIPMENTNO = b.stationcode "; else strWhereB = " where a.heatno =b.heatno and '" + addTalbeName + "'|| a.stationcode = b.stationcode and a.disposaltime = b.disposaltime "; //定义一个ArrayList集合存储变量[参数]值 ArrayList arry = new ArrayList(); ArrayList sqlList = new ArrayList(); arry.Add("frmAdditStat_Query.select");//此ID为XML文件ID sqlList.Add(strIronWSteel); sqlList.Add(strIronWSteel); sqlList.Add(resTalbeName); sqlList.Add(resTalbeName); sqlList.Add(strWhereB); sqlList.Add(sqlstr); //调用服务端方法 CoreClientParam CCP_AStat = new CoreClientParam(); DataTable dt = new DataTable(); CCP_AStat.ServerName = "Core.LgMes.Server.Common.ComDBQuery"; CCP_AStat.MethodName = "doQuery"; CCP_AStat.ServerParams = new object[] { arry, sqlList }; CCP_AStat.SourceDataTable = dt; this.ExecuteSortResultByQueryToDataTable(CCP_AStat, CoreInvokeType.Internal); DataTable dtHj = new DataTable(); DataTable dtFl = new DataTable(); _dsPL.Tables.Clear(); _dsHj.Tables.Clear(); if (dt.Rows.Count > 0) { if (this.ultraTabControl1.Tabs[0].Selected == true) { _dsHj.Tables.Add(dt); dtHj = FormatData(_dsHj, "HJ"); this.ultraGrid1.DataSource = dtHj; InitData1(); PublicMethod.RefreshAndAutoSize(ultraGrid1); } else { _dsPL.Tables.Add(dt); dtFl = FormatData(_dsPL, "FL"); this.ultraGrid2.DataSource = dtFl; InitData2(); PublicMethod.RefreshAndAutoSize(ultraGrid2); } } else { ultraGrid1.DataSource = null; ultraGrid2.DataSource = null; dtHj.Clear(); dtFl.Clear(); } } catch (Exception ex) { Console.WriteLine(ex.Message); } } // 将获取的数据序列化 /// /// 将获取的数据序列化 /// /// /// private DataTable FormatData(DataSet _dsFl, string Type) { DataTable dtFl = new DataTable(); dtFl.Columns.Add("heatprocessno"); dtFl.Columns.Add("heatno"); dtFl.Columns.Add("STEEL"); dtFl.Columns.Add("STATIONCODE"); dtFl.Columns.Add("SHIFTCODE"); if (cboGW.Text == "转炉" && Type == "HJ") { dtFl.Columns.Add("IRONPOTWGT"); //铁水 dtFl.Columns.Add("PIGIRONWGT"); //生铁 dtFl.Columns.Add("WSTEELWGT"); //废钢 } string strSel = ""; strSel = "MATERIELTYPE='" + Type + "'"; DataRow[] drs = _dsGridInfo.Tables[0].Select(strSel); int count = drs.Length; for (int i = 0; i < count; i++) { DataRow dr = drs[i]; dtFl.Columns.Add(dr[2].ToString()); } dtFl.Columns.Add("OPTDATE"); dtFl.Columns["OPTDATE"].Caption = "操作时间"; bool bolIs = false; foreach (DataRow drfl in _dsFl.Tables[0].Rows) { foreach (DataRow Isdrfl in dtFl.Rows) { if (drfl["heatprocessno"].ToString() == Isdrfl["heatprocessno"].ToString()) { bolIs = true; break; } } if (!bolIs) { DataRow drFL = dtFl.NewRow(); drFL["heatprocessno"] = drfl["heatprocessno"].ToString(); drFL["heatno"] = drfl["heatno"].ToString(); drFL["STEEL"] = tabSteel[drfl["STEEL"].ToString()].ToString(); drFL["STATIONCODE"] = drfl["WSID"].ToString() + GetGW(drfl["STATIONCODE"].ToString()); drFL["OPTDATE"] = Convert.ToDateTime(drfl["OPTDATE"].ToString()).ToString("yyyy-MM-dd HH:mm:ss"); if (drfl["SHIFTCODE"].ToString().Length > 1) { drFL["SHIFTCODE"] = GetBZ(drfl["SHIFTCODE"].ToString().Substring(1, 1)); } else { drFL["SHIFTCODE"] = "未知"; } if (cboGW.Text == "转炉" && Type == "HJ") { drFL["IRONPOTWGT"] = drfl["IRONPOTWGT"].ToString();//铁水 drFL["PIGIRONWGT"] = drfl["PIGIRONWGT"].ToString();//废钢 drFL["WSTEELWGT"] = drfl["WSTEELWGT"].ToString();//废钢 } foreach (DataColumn dcfl in dtFl.Columns) { if (dcfl.ColumnName.ToString() == drfl["MATERIELNAME"].ToString()) { drFL[dcfl.ColumnName.ToString()] = drfl["JMWGT"].ToString(); } } dtFl.Rows.Add(drFL); bolIs = false; } else { foreach (DataRow drFlvalue in dtFl.Rows) { if (drFlvalue["heatprocessno"].ToString() == drfl["heatprocessno"].ToString()) { foreach (DataColumn dcfl in dtFl.Columns) { if (dcfl.ColumnName.ToString() == drfl["MATERIELNAME"].ToString()) { drFlvalue[dcfl.ColumnName.ToString()] = drfl["JMWGT"].ToString(); } } bolIs = false; } } } } return dtFl; } // 查询条件 /// /// 查询条件 /// /// 返回查询条件 private string BuildSql(string wsid, string WlType) { string sqlstr = ""; //时间 sqlstr = " and a.optdate>=to_date('" + uldtBeginTime.Value.ToString() + "','yyyy-MM-dd HH24:mi:ss') " + " and a.optdate<=to_date('" + uldtEndTime.Value.ToString() + "','yyyy-MM-dd HH24:mi:ss') "; //熔炼号 if (chk_HeaNo.Checked) { if (!string.IsNullOrEmpty(ultraMaskedEdit1.Text) && !string.IsNullOrEmpty(ultraMaskedEdit2.Text)) { if (string.Compare(ultraMaskedEdit1.Text.Trim(), ultraMaskedEdit2.Text.Trim()) != 1) //sqlstr += " and a.heatno>='" + ultraMaskedEdit1.Text.ToString() + "' and a.heatno<='" + ultraMaskedEdit2.Text.ToString() + "'"; sqlstr += " and a.heatno between'" + ultraMaskedEdit1.Text.ToString() + "' and '" + ultraMaskedEdit2.Text.ToString() + "'"; else MessageBox.Show("结束熔炼号不能大于开始熔炼号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } else if (!string.IsNullOrEmpty(ultraMaskedEdit1.Text) && string.IsNullOrEmpty(ultraMaskedEdit2.Text)) sqlstr += " and a.heatno like '" + ultraMaskedEdit1.Text.ToString() + "%'"; else if (string.IsNullOrEmpty(ultraMaskedEdit1.Text) && !string.IsNullOrEmpty(ultraMaskedEdit2.Text)) sqlstr += " and a.heatno like '" + ultraMaskedEdit2.Text.ToString() + "%'"; } //岗位 if (wsid != "0") sqlstr += " and a.stationcode='0" + wsid + "'"; //班组 if (chk_Staticode.Checked && this.cboStaticode.Value.ToString()!="0") sqlstr += " and substr(SHIFTCODE,2,1)='" + cboStaticode.Value.ToString() + "'"; //钢种 if (chkSteel.Checked && txtSteel.Text.Trim().Length > 0) { string strSteeAll = "", str = ""; string[] strSteel = txtSteel.Text.Split(','); for (int i = 0; i < strSteel.Length; i++) { if (!string.IsNullOrEmpty(strSteel[i])) strSteeAll = strSteeAll + "'" + strSteel[i].ToUpper().Trim() + "'" + ","; } str = strSteeAll.Substring(0, strSteeAll.Length - 1); //sqlstr += " and a.plansteel in ('" + str + "')"; sqlstr += string.Format(" and UPPER(a.plansteel) in ({0})", str); // lower(b.jhgz) } sqlstr += " and b.MATERIELTYPE='" + WlType + "'"; //物料类型(合金、辅料) return sqlstr; } private void ultraMaskedEdit1_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e) { UltraMaskedEdit ume = (UltraMaskedEdit)sender; switch (e.Button.Key) { //case "edit": // frmNumberWriter frm = new frmNumberWriter(); // frm._strText = ume.Text.Trim(); // frm.Location = GetChildWindowLocation(frm.Size); // frm.ShowDialog(); // ume.Text = frm._strText; // break; case "clear": if (ume.Text.Trim().Length > 0) { ume.Tag = ume.Text.Trim(); ume.Text = ""; } else { if (ume.Tag != null) ume.Text = ume.Tag.ToString(); } break; } } private void cboGW_SelectedIndexChanged(object sender, EventArgs e) { cboGWID.Items.Clear(); //cboGWID.Items.Add(GetCWIDItems(cboGW.SelectedIndex)); cboGWID.SelectedIndex = 0; } public string GetBZ(string str) { switch (str) { case "1": return "甲班"; case "2": return "乙班"; case "3": return "丙班"; case "4": return "丁班"; default: return ""; } } // 岗位名称 /// /// 岗位名称 /// /// /// private string GetGW(string GwID) { switch (GwID) { case "BOF0": return "#转炉"; case "CAS0": return "#吹氩"; case "LFS0": return "#钢包"; case "HMP0": return "脱硫"; default: return ""; } } // 根据岗位获取表名 /// /// 根据岗位获取表名 /// /// 岗位 /// 物料表 /// 返回实绩信息表 private string TableName(string GWID, out string addTableName) { string resTableName = ""; string addtableName = ""; switch (GWID) { case "HMP0": resTableName = "STL_HMP_Optinfo"; addtableName = "B"; break; case "BOF0": resTableName = "STL_BOF_Optinfo"; addtableName = "C"; break; case "CAS0": resTableName = "STL_CAS_Optinfo"; addtableName = "D"; break; case "RHS0": resTableName = "STL_RHS_Optinfo"; addtableName = "F"; break; case "LFS0": resTableName = "STL_LFS_Optinfo"; addtableName = "E"; break; default: resTableName = "STL_CCM_Optinfo"; addtableName = "G"; break; } addTableName = addtableName; return resTableName; } private void ultraTabControl1_SelectedTabChanged(object sender, Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventArgs e) { GetAdditStat(); } private void chkSteel_CheckedChanged(object sender, EventArgs e) { txtSteel.Enabled = chkSteel.Checked; if (!chkSteel.Checked) { txtSteel.BackColor = Color.WhiteSmoke; } } /// /// 系统功能 /// public override void ToolBar_Click(object sender, string ToolbarKey) { switch (ToolbarKey) { case "Query": GetAdditStat(); break; case "Export": try { if (ultraTabControl1.SelectedTab.Text == "金属料") { //Core.Mes.Client.Common.Globals.ulGridToExcel(ultraGrid1, Text + "_金属料"); GridHelper.ulGridToExcel(ultraGrid1, Text + "_金属料"); } if (ultraTabControl1.SelectedTab.Text == "辅料") { //Core.Mes.Client.Common.Globals.ulGridToExcel(ultraGrid2, Text + "_辅料"); GridHelper.ulGridToExcel(ultraGrid2, Text + "_辅料"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } break; case "Exit": this.Close(); break; default: break; } } // 工序位置选择 /// /// 工序位置选择 /// private void cboGW_SelectionChanged(object sender, EventArgs e) { cboGWID.Items.Clear(); string gw = cboGW.Value.ToString(); switch (gw) { case "BOF0": cboGWID.Items.Add("0", "所有"); cboGWID.Items.Add("1", "1#转炉"); cboGWID.Items.Add("2", "2#转炉"); cboGWID.Items.Add("3", "3#转炉"); cboGWID.Items.Add("4", "4#转炉"); //cboGWID.Items.Add("5", "5#转炉"); break; case "CAS0": cboGWID.Items.Add("0", "所有"); cboGWID.Items.Add("1", "1#吹氩站"); cboGWID.Items.Add("2", "2#吹氩站"); cboGWID.Items.Add("3", "3#吹氩站"); cboGWID.Items.Add("4", "4#吹氩站"); //cboGWID.Items.Add("5", "5#吹氩站"); break; case "LFS0": cboGWID.Items.Add("0", "所有"); cboGWID.Items.Add("1", "1#精炼炉"); cboGWID.Items.Add("2", "2#精炼炉"); //cboGWID.Items.Add("3", "3#精炼炉"); break; case "CCM0": cboGWID.Items.Add("0", "所有"); cboGWID.Items.Add("1", "1#连铸"); cboGWID.Items.Add("2", "2#连铸"); cboGWID.Items.Add("3", "3#连铸"); cboGWID.Items.Add("4", "2#连铸"); cboGWID.Items.Add("5", "3#连铸"); break; case "HMP0": cboGWID.Items.Add("0", "所有"); cboGWID.Items.Add("1", "1#脱硫"); cboGWID.Items.Add("2", "2#脱硫"); break; case "SYGW": cboGWID.Items.Add("0", "所有岗位"); break; default: cboGWID.Items.Add("0", "所有岗位"); break; } cboGWID.SelectedIndex = 0; } private void uCkEditorForFilter_CheckedChanged(object sender, EventArgs e) { ClsControlPack.SetUltraGridRowFilter(ref this.ultraGrid1, uCkEditorForFilter.Checked); ClsControlPack.SetUltraGridRowFilter(ref this.ultraGrid2, uCkEditorForFilter.Checked); } } }