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.Mes.Client.Common;
namespace Core.LgMes.Client.LgIntegrationQuery
{
///
/// FrmAdditStat 的摘要说明。
///
public class frmAdditStat : Core.Mes.Client.Common.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 chk_Date;
private System.Windows.Forms.CheckBox checkBox3;
private System.Windows.Forms.CheckBox chk_Staticode;
private UltraMaskedEdit ultraMaskedEdit2;
private UltraMaskedEdit ultraMaskedEdit1;
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 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 valueListItem10 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem11 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem4 = 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();
Infragistics.Win.UltraWinEditors.EditorButton editorButton1 = new Infragistics.Win.UltraWinEditors.EditorButton("edit");
Infragistics.Win.UltraWinEditors.EditorButton editorButton2 = new Infragistics.Win.UltraWinEditors.EditorButton("clear");
Infragistics.Win.UltraWinEditors.EditorButton editorButton3 = new Infragistics.Win.UltraWinEditors.EditorButton("edit");
Infragistics.Win.UltraWinEditors.EditorButton editorButton4 = new Infragistics.Win.UltraWinEditors.EditorButton("clear");
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.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.ultraMaskedEdit2 = new Infragistics.Win.UltraWinMaskedEdit.UltraMaskedEdit();
this.ultraMaskedEdit1 = new Infragistics.Win.UltraWinMaskedEdit.UltraMaskedEdit();
this.chk_Staticode = new System.Windows.Forms.CheckBox();
this.checkBox3 = new System.Windows.Forms.CheckBox();
this.chk_Date = 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.Override.RowSelectorWidth = 25;
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("Tahoma", 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.Override.RowSelectorWidth = 25;
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("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
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;
this.ultraGrid2.InitializeLayout += new Infragistics.Win.UltraWinGrid.InitializeLayoutEventHandler(this.ultraGrid2_InitializeLayout);
//
// 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.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.txtSteel);
this.ultraGroupBox1.Controls.Add(this.chkSteel);
this.ultraGroupBox1.Controls.Add(this.ultraMaskedEdit2);
this.ultraGroupBox1.Controls.Add(this.ultraMaskedEdit1);
this.ultraGroupBox1.Controls.Add(this.chk_Staticode);
this.ultraGroupBox1.Controls.Add(this.checkBox3);
this.ultraGroupBox1.Controls.Add(this.chk_Date);
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;
//
// 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(791, 10);
this.uCkEditorForFilter.Name = "uCkEditorForFilter";
this.uCkEditorForFilter.Size = new System.Drawing.Size(46, 20);
this.uCkEditorForFilter.TabIndex = 292;
this.uCkEditorForFilter.Text = "过滤";
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(305, 38);
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 = "精炼炉";
valueListItem10.DataValue = "4";
valueListItem10.DisplayText = "RH炉";
valueListItem11.DataValue = "5";
valueListItem11.DisplayText = "VD炉";
valueListItem4.DataValue = "3";
valueListItem4.DisplayText = "脱硫";
valueListItem12.DataValue = "6";
valueListItem12.DisplayText = "连铸";
this.cboGW.Items.AddRange(new Infragistics.Win.ValueListItem[] {
valueListItem1,
valueListItem2,
valueListItem3,
valueListItem10,
valueListItem11,
valueListItem4,
valueListItem12});
this.cboGW.Location = new System.Drawing.Point(234, 38);
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(698, 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 = "yyyy-MM-dd HH:mm:ss";
this.uldtEndTime.Location = new System.Drawing.Point(475, 9);
this.uldtEndTime.MaskInput = "yyyy-mm-dd hh:mm:ss";
this.uldtEndTime.Name = "uldtEndTime";
this.uldtEndTime.Size = new System.Drawing.Size(150, 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 = "yyyy-MM-dd HH:mm:ss";
this.uldtBeginTime.Location = new System.Drawing.Point(301, 9);
this.uldtBeginTime.MaskInput = "yyyy-mm-dd hh:mm:ss";
this.uldtBeginTime.Name = "uldtBeginTime";
this.uldtBeginTime.Size = new System.Drawing.Size(150, 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(511, 37);
this.txtSteel.Name = "txtSteel";
this.txtSteel.Size = new System.Drawing.Size(252, 21);
this.txtSteel.TabIndex = 88;
//
// chkSteel
//
this.chkSteel.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chkSteel.Location = new System.Drawing.Point(459, 35);
this.chkSteel.Name = "chkSteel";
this.chkSteel.Size = new System.Drawing.Size(56, 24);
this.chkSteel.TabIndex = 87;
this.chkSteel.Text = "钢种";
this.chkSteel.CheckedChanged += new System.EventHandler(this.chkSteel_CheckedChanged);
//
// ultraMaskedEdit2
//
editorButton1.Key = "edit";
editorButton2.Key = "clear";
this.ultraMaskedEdit2.ButtonsRight.Add(editorButton1);
this.ultraMaskedEdit2.ButtonsRight.Add(editorButton2);
this.ultraMaskedEdit2.EditAs = Infragistics.Win.UltraWinMaskedEdit.EditAsType.String;
this.ultraMaskedEdit2.Enabled = false;
this.ultraMaskedEdit2.Location = new System.Drawing.Point(102, 37);
this.ultraMaskedEdit2.Name = "ultraMaskedEdit2";
this.ultraMaskedEdit2.PromptChar = ' ';
this.ultraMaskedEdit2.Size = new System.Drawing.Size(121, 21);
this.ultraMaskedEdit2.TabIndex = 85;
this.ultraMaskedEdit2.UseFlatMode = Infragistics.Win.DefaultableBoolean.True;
this.ultraMaskedEdit2.EditorButtonClick += new Infragistics.Win.UltraWinEditors.EditorButtonEventHandler(this.ultraMaskedEdit1_EditorButtonClick);
//
// ultraMaskedEdit1
//
editorButton3.Key = "edit";
editorButton4.Key = "clear";
this.ultraMaskedEdit1.ButtonsRight.Add(editorButton3);
this.ultraMaskedEdit1.ButtonsRight.Add(editorButton4);
this.ultraMaskedEdit1.EditAs = Infragistics.Win.UltraWinMaskedEdit.EditAsType.String;
this.ultraMaskedEdit1.Enabled = false;
this.ultraMaskedEdit1.Location = new System.Drawing.Point(103, 9);
this.ultraMaskedEdit1.Name = "ultraMaskedEdit1";
this.ultraMaskedEdit1.PromptChar = ' ';
this.ultraMaskedEdit1.Size = new System.Drawing.Size(120, 21);
this.ultraMaskedEdit1.TabIndex = 84;
this.ultraMaskedEdit1.UseFlatMode = Infragistics.Win.DefaultableBoolean.True;
this.ultraMaskedEdit1.EditorButtonClick += new Infragistics.Win.UltraWinEditors.EditorButtonEventHandler(this.ultraMaskedEdit1_EditorButtonClick);
//
// chk_Staticode
//
this.chk_Staticode.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chk_Staticode.Location = new System.Drawing.Point(643, 7);
this.chk_Staticode.Name = "chk_Staticode";
this.chk_Staticode.Size = new System.Drawing.Size(55, 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(259, 44);
this.checkBox3.Name = "checkBox3";
this.checkBox3.Size = new System.Drawing.Size(98, 24);
this.checkBox3.TabIndex = 62;
this.checkBox3.Text = "工序位置";
this.checkBox3.Visible = false;
this.checkBox3.CheckedChanged += new System.EventHandler(this.checkBox3_CheckedChanged);
//
// chk_Date
//
this.chk_Date.Checked = true;
this.chk_Date.CheckState = System.Windows.Forms.CheckState.Checked;
this.chk_Date.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chk_Date.Location = new System.Drawing.Point(234, 7);
this.chk_Date.Name = "chk_Date";
this.chk_Date.Size = new System.Drawing.Size(70, 24);
this.chk_Date.TabIndex = 61;
this.chk_Date.Text = "时间从";
this.chk_Date.CheckedChanged += new System.EventHandler(this.chk_Date_CheckedChanged);
//
// chk_HeaNo
//
this.chk_HeaNo.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chk_HeaNo.Location = new System.Drawing.Point(12, 7);
this.chk_HeaNo.Name = "chk_HeaNo";
this.chk_HeaNo.Size = new System.Drawing.Size(88, 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("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label6.Location = new System.Drawing.Point(455, 12);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(21, 14);
this.label6.TabIndex = 59;
this.label6.Text = "到";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label2.Location = new System.Drawing.Point(65, 40);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(21, 14);
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 = "frmAdditStat";
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
#region " Valiable "
private DataSet _dsHj = new DataSet();
private DataSet _dsPL = new DataSet();
private DataSet _dsFl = new DataSet();
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();
#endregion
#region " Init "
private void frmAdditStat_Load(object sender, System.EventArgs e)
{
ultraGrid1.Font = new System.Drawing.Font("Tahoma", 9F);
ultraGrid2.Font = new System.Drawing.Font("Tahoma", 9F);
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";
cboGW.SelectedIndex = 0;
checkBox3.Checked = true;
InitControl();
//GetGridInfo();
}
#region " 金属料 "
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
{ }
}
#endregion
#region " 散装料 "
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
{ }
}
#endregion
#endregion
#region " Control Events "
private void 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 Point GetChildWindowLocation(Size ChildWindowSize)
{
int width = Cursor.Position.X + ChildWindowSize.Width - Screen.PrimaryScreen.Bounds.Width;
int height = Cursor.Position.Y + ChildWindowSize.Height - Screen.PrimaryScreen.Bounds.Height + 30;
if (width > 0)
width = Cursor.Position.X - width;
else
width = Cursor.Position.X;
if (height > 0)
height = Cursor.Position.Y - height + 10;
else
height = Cursor.Position.Y + 10;
return new Point(width, height);
}
private void InitControl()
{
if (_strCob2 == "")
this.cboStaticode.SelectedIndex = 0;
else
this.cboStaticode.Value = _strCob2;
}
///
/// 初始化班次
///
///
private DataTable BuildTableDuty()
{
DataTable dt = new DataTable();
DataColumn dc = new DataColumn("id", typeof(System.String));
dt.Columns.Add(dc);
dc = new DataColumn("name", typeof(System.String));
dt.Columns.Add(dc);
DataRow dr = dt.NewRow();
dr[0] = "0";
dr[1] = "全部";
dt.Rows.Add(dr);
dr = dt.NewRow();
dr[0] = "1";
dr[1] = "甲";
dt.Rows.Add(dr);
dr = dt.NewRow();
dr[0] = "2";
dr[1] = "乙";
dt.Rows.Add(dr);
dr = dt.NewRow();
dr[0] = "3";
dr[1] = "丙";
dt.Rows.Add(dr);
dr = dt.NewRow();
dr[0] = "4";
dr[1] = "丁";
dt.Rows.Add(dr);
dt.AcceptChanges();
return dt;
}
#endregion
#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;
}
private void chk_Date_CheckedChanged(object sender, System.EventArgs e)
{
this.uldtBeginTime.Enabled = this.chk_Date.Checked;
this.uldtEndTime.Enabled = this.chk_Date.Checked;
}
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
#region " InitGrid "
private void GetGridInfo()
{
try
{
string strErr = "";
string addTalbeName = "";
string strWhere = "";
string strgw = Convert.ToString(GetGW(this.cboGW.SelectedIndex));
if (cboGW.SelectedIndex == -1)
{
strgw = "BOF0";
}
string strStartTime = "";
string strEndTime = "";
string strMType = "";
string resTalbeName = TableName(strgw, out addTalbeName);
if (chk_Date.Checked == true)
{
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 (Convert.ToString(Convert.ToString(this.cboGWID.SelectedIndex)) != "0" && Convert.ToString(Convert.ToString(this.cboGWID.SelectedIndex)) != "-1") //岗位
strWhere += " and a.stationcode='" + addTalbeName + "0" + Convert.ToString(Convert.ToString(this.cboGWID.SelectedIndex)) + "'";
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 string GetSqlWhere2()
{
string str = "";
if (this.chk_Staticode.Checked)
{
str = string.Format(" where substr(bc,2,1)='{0}' ", this.cboStaticode.SelectedIndex + 1);
}
return str;
}
private string GetSqlWhere1()
{
string str = " where 1=1 ";
if (this.chk_HeaNo.Checked)
{
str += string.Format(" and (lh >= '{0}' and lh <= '{1}') ",
this.ultraMaskedEdit1.Text.Trim(), this.ultraMaskedEdit2.Text.Trim());
}
if (this.chk_Date.Checked)
{
str += string.Format(" and (jlsk >= to_date('{0}','yyyy-MM-dd HH24:mi:ss') "
+ " and jlsk <= to_date('{1}','yyyy-MM-dd HH24:mi:ss')) ",
this.uldtBeginTime.Text, this.uldtEndTime.Text);
}
return str;
}
///
/// 获取物料信息
///
private void GetAdditStat()
{
string sqlstr;
string addTalbeName = "";
string strGw = Convert.ToString(GetGW(this.cboGW.SelectedIndex));
string strGWID = Convert.ToString(this.cboGWID.SelectedIndex);
GetGridInfo(); //初始化物料信息列名
if (this.ultraTabControl1.Tabs[0].Selected == true)
sqlstr = BuildSql(Convert.ToString(Convert.ToString(this.cboGWID.SelectedIndex)), "HJ");
else
sqlstr = BuildSql(Convert.ToString(Convert.ToString(this.cboGWID.SelectedIndex)), "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.hudwid =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.ExecuteQueryToDataTable(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();
}
else
{
_dsPL.Tables.Add(dt);
dtFl = FormatData(_dsPL, "FL");
this.ultraGrid2.DataSource = dtFl;
InitData2();
}
}
else
{
ultraGrid1.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 = "";
if (this.checkBox3.Checked)
strSel = "MATERIELTYPE='" + Type + "'";
else
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());
}
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"] = drfl["STEEL"].ToString();
drFL["STATIONCODE"] = drfl["WSID"].ToString() + GetGW(drfl["STATIONCODE"].ToString());
drFL["SHIFTCODE"] = GetBC(drfl["SHIFTCODE"].ToString());
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["MATERIELCODE"].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["MATERIELCODE"].ToString())
{
drFlvalue[dcfl.ColumnName.ToString()] = drfl["JMWGT"].ToString();
}
}
bolIs = false;
}
}
}
}
return dtFl;
}
private string BuildSql(string wsid, string WlType)
{
string sqlstr = "";
if (chk_Date.Checked) //时间
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='" + ultraMaskedEdit1.Text.ToString() + "'";
else if (string.IsNullOrEmpty(ultraMaskedEdit1.Text) && !string.IsNullOrEmpty(ultraMaskedEdit2.Text))
sqlstr += " and a.heatno='" + ultraMaskedEdit2.Text.ToString() + "'";
}
if (wsid != "0" && wsid != "-1") //岗位
sqlstr += " and a.stationcode='0" + wsid + "'";
if (chk_Staticode.Checked && this.cboStaticode.SelectedIndex != 0)
sqlstr += " and substr(SHIFTCODE,2,1)='" + cboStaticode.SelectedIndex + "'";
//钢种
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]+"'",";
strSteeAll = strSteeAll + "'" + strSteel[i] + "'" + ",";
}
str = strSteeAll.Substring(0, strSteeAll.Length - 1);
//sqlstr += " and a.plansteel in ('" + str + "')";
sqlstr += string.Format(" and UPPER(a.plansteel) in (UPPER({0}))", str); // lower(b.jhgz)
}
sqlstr += " and b.MATERIELTYPE='" + WlType + "'"; //物料类型(合金、辅料)
return sqlstr;
}
#endregion
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;
}
///
/// 初始化工位
///
///
///
private object[] GetCWIDItems(int index)
{
switch (index)
{
case 0:
return new object[] { "所有", "1#转炉", "2#转炉", "3#转炉" };
case 1:
return new object[] { "所有", "1#吹氩站", "2#吹氩站", "3#吹氩站" };
case 2:
return new object[] { "所有", "1#精炼炉", "2#精炼炉" };
case 3:
return new object[] { "所有", "1#RH炉" };
case 4:
return new object[] { "所有", "1#VD炉" };
case 5:
return new object[] { "所有", "1#脱硫", "2#脱硫" };
default:
return new object[] { "所有岗位" };
}
}
///
/// 岗位编码
///
///
///
private string GetGW(int index)
{
switch (index)
{
case 0:
return "BOF0";
case 1:
return "CAS0";
case 2:
return "LFS0";
case 3:
return "RHS0";
case 4:
return "VDS0";
case 5:
return "HMP0";
default:
return "0";
}
}
///
/// 岗位名称
///
///
///
private string GetGW(string GwID)
{
switch (GwID)
{
case "BOF0":
return "#转炉";
case "CAS0":
return "#吹氩";
case "LFS0":
return "#钢包";
case "RHS0":
return "RH炉";
case "VDS0":
return "VD炉";
case "HMP0":
return "脱硫";
default:
return "";
}
}
///
/// 班别
///
///
///
private string GetBC(string bcID)
{
string bb = "";
if (bcID.Length > 1) bb = bcID.Substring(1, 1);
switch (bb)
{
case "1":
return "甲";
case "2":
return "乙";
case "3":
return "丙";
case "4":
return "丁";
default:
return "";
}
}
///
/// 根据岗位获取表名
///
/// 岗位
/// 物料表
/// 返回实绩信息表
private string TableName(string GWID, out string addTableName)
{
string resTableName = "";
string addtableName = "";
switch (GWID)
{
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;
case "VDS0":
resTableName = "STL_VDS_Optinfo";
addtableName = "I";
break;
case "HMP0":
resTableName = "STL_HMP_Optinfo";
addtableName = "B";
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 ExportExcel()
{
try
{
string StrfileName = System.Windows.Forms.Application.StartupPath + "\\Report\\物料消耗明细.xls";
if (ultraTabControl1.SelectedTab.Index == 0)
this.GridExcelExporter.Export(this.ultraGrid1, StrfileName);
else
this.GridExcelExporter.Export(this.ultraGrid2, StrfileName);
ProcessStartInfo p = new ProcessStartInfo(StrfileName);
p.WindowStyle = System.Diagnostics.ProcessWindowStyle.Maximized;
p.WorkingDirectory = Path.GetDirectoryName(StrfileName);
Process.Start(p);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message + "\n处理方法:查看(" + System.Windows.Forms.Application.StartupPath + ")目录下是否有[ Report文件夹 ],如果没有请手动创建!");
}
}
private void chkSteel_CheckedChanged(object sender, EventArgs e)
{
txtSteel.Enabled = chkSteel.Checked;
if (!chkSteel.Checked)
{
txtSteel.BackColor = Color.WhiteSmoke;//(224, 224, 224);
}
}
public override void ToolBar_Click(object sender, string ToolbarKey)
{
switch (ToolbarKey)
{
case "Query":
GetAdditStat();
break;
case "Export":
ExportExcel();
break;
case "Exit":
this.Close();
break;
default:
break;
}
}
private void cboGW_SelectionChanged(object sender, EventArgs e)
{
cboGWID.Items.Clear();
int index;
index = cboGW.SelectedIndex;
//cboGWID.Items.Add(GetCWIDItems(cboGW.SelectedIndex));
switch (index)
{
case 0:
cboGWID.Items.Add(0, "所有");
cboGWID.Items.Add(1, "1#转炉");
cboGWID.Items.Add(2, "2#转炉");
break;
case 1:
cboGWID.Items.Add(0, "所有");
cboGWID.Items.Add(1, "1#吹氩站");
cboGWID.Items.Add(2, "2#吹氩站");
break;
case 2:
cboGWID.Items.Add(0, "所有");
cboGWID.Items.Add(1, "1#精炼炉");
cboGWID.Items.Add(2, "2#精炼炉");
break;
case 3:
cboGWID.Items.Add(0, "所有");
cboGWID.Items.Add(1, "1#RH炉");
break; ;
case 4:
cboGWID.Items.Add(0, "所有");
cboGWID.Items.Add(1, "1#VD炉");
break;
case 5:
cboGWID.Items.Add(0, "所有铁水");
break;
case 6:
cboGWID.Items.Add(0, "所有");
cboGWID.Items.Add(1, "1#连铸");
cboGWID.Items.Add(2, "2#连铸");
cboGWID.Items.Add(3, "3#连铸");
break;
default:
cboGWID.Items.Add(0, "所有岗位");
break;
}
cboGWID.SelectedIndex = 0;
}
private void uCkEditorForFilter_CheckedChanged(object sender, EventArgs e)
{
JJBStaticFunction.SetGridRowFilter(ref this.ultraGrid1, uCkEditorForFilter.Checked);
JJBStaticFunction.SetGridRowFilter(ref this.ultraGrid2, uCkEditorForFilter.Checked);
}
}
}