using System; using System.IO; using System.Drawing; using System.Collections; using System.Diagnostics; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.Threading; using CoreFS.CA06; using Infragistics.Win.UltraWinMaskedEdit; using Infragistics.Win.UltraWinGrid; using Infragistics.Win; using System.Collections.Generic; using Core.Mes.Client.Common; using Core.LgMes.Client.LgJobMgt; using Core.LgMes.Client.lgClassModel.LgChem; using Core.LgMes.Client.lgClassModel.SqModel; namespace Core.LgMes.Client.LgIntegrationQuery { /// /// ELEMENTS 的摘要说明。 /// public class frmLgElements : Core.Mes.Client.Common.frmStyleBase { #region " Construct " private Infragistics.Win.Misc.UltraGroupBox ultraGroupBox1; private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label2; private System.ComponentModel.IContainer components; private System.Windows.Forms.Label label3; private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Label label4; private System.Windows.Forms.Label label5; private System.Windows.Forms.Label label6; private System.Windows.Forms.TextBox txtPage; private System.Windows.Forms.Button btn_Up; private System.Windows.Forms.Button btn_Down; private System.Windows.Forms.Button button3; private System.Windows.Forms.Label label7; private System.Windows.Forms.Label label8; private System.Windows.Forms.CheckBox chkRefresh; private System.Windows.Forms.Label label9; public string StrPost = "0"; private Label label11; private Label label10; private Infragistics.Win.UltraWinEditors.UltraDateTimeEditor uldtBeginTime; private Infragistics.Win.UltraWinEditors.UltraDateTimeEditor uldtEndTime; private UltraMaskedEdit ultraMaskedEdit2; private Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter GridExcelExporter; private Infragistics.Win.UltraWinToolbars.UltraToolbarsManager ultraToolbarsManager1; private UltraGrid EMGrid; private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _panel1_Toolbars_Dock_Area_Left; private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _panel1_Toolbars_Dock_Area_Right; private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _panel1_Toolbars_Dock_Area_Top; private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _panel1_Toolbars_Dock_Area_Bottom; private string m_szEntry = ""; private DataSet dataSet1; private DataTable dataTable1; private DataColumn dataColumn7; private DataColumn dataColumn8; private DataColumn dataColumn9; private DataColumn dataColumn84; private DataColumn dataColumn85; string[] strERow; private TextBox txtSteel; private CheckBox chkGasSample; //化学成份列名 string[] strRowName = new string[] { "C", "Mn", "S", "P", "Si", "Als", "Alt", "N", "Ti", "Nb", "B", "V", "Asn", "Sn", "Cu", "Sb", "O", "H", "Bsol", "SAMPLE_DATE1", "CM", "化验时间" }; bool Isbool = false; private DataColumn dataColumn1; private Infragistics.Win.UltraWinEditors.UltraComboEditor cmb_BZ; private Infragistics.Win.UltraWinEditors.UltraComboEditor cboGW; private Infragistics.Win.UltraWinEditors.UltraComboEditor comboBox2; private DataColumn dataColumn2; private DataColumn dataColumn3; private Infragistics.Win.UltraWinEditors.UltraPictureBox ultraPictureBox1; private DataColumn dataColumn4; private DataColumn dataColumn5; private DataColumn dataColumn6; private DataColumn dataColumn10; private DataColumn dataColumn11; private Button button1; private DataColumn dataColumn12; private DataColumn dataColumn13; private UltraMaskedEdit ultraMaskedEdit1; public frmLgElements(string szPost) { InitializeComponent(); this._devPos = szPost; } public frmLgElements() { // // Windows 窗体设计器支持所必需的 // InitializeComponent(); this._devPos = StrPost; InitSteel(); } public frmLgElements(string szEntry, string szLH) { InitializeComponent(); this._devPos = StrPost; this.m_szEntry = szEntry; this.ultraMaskedEdit1.Text = szLH; } /// /// 初始化Grind牌号 /// private void InitSteel() { string strErr = ""; EMGrid.DisplayLayout.ValueLists.Add("SteelCode"); DataSet dsSteel = null;//hengxing (DataSet)ClientCommon._RemotingHelp.ExecuteMethod( // "lgIntegrationQuery", // "Core.LgMes.Server.lgIntegrationQuery.LgGeneralInfo", // "GetSteelInfo", new object[] { "where largeflag='1' order by steelcode " }, out strErr); if (strErr == "" && dsSteel != null) { //初始经Grid牌号字段数据集 for (int i = 0; i < dsSteel.Tables[0].Rows.Count; i++) { EMGrid.DisplayLayout.ValueLists["SteelCode"].ValueListItems.Add(dsSteel.Tables[0].Rows[i]["SteelCode"].ToString(), dsSteel.Tables[0].Rows[i]["Steel"].ToString()); } //绑定单位 EMGrid.DisplayLayout.Bands[0].Columns["计划牌号"].ValueList = EMGrid.DisplayLayout.ValueLists["SteelCode"]; } } /// /// 清理所有正在使用的资源。 /// protected override void Dispose(bool disposing) { try { if (_getDataThread != null) _getDataThread.Abort(); } catch { } if (disposing) { if (components != null) { components.Dispose(); } } base.Dispose(disposing); } #region Windows 窗体设计器生成的代码 /// /// 设计器支持所需的方法 - 不要使用代码编辑器修改 /// 此方法的内容。 /// private void InitializeComponent() { this.components = new System.ComponentModel.Container(); Infragistics.Win.UltraWinEditors.EditorButton editorButton1 = new Infragistics.Win.UltraWinEditors.EditorButton("edit"); Infragistics.Win.UltraWinEditors.EditorButton editorButton2 = new Infragistics.Win.UltraWinEditors.EditorButton("clear"); Infragistics.Win.Appearance appearance1 = 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 valueListItem4 = new Infragistics.Win.ValueListItem(); Infragistics.Win.ValueListItem valueListItem30 = new Infragistics.Win.ValueListItem(); Infragistics.Win.ValueListItem valueListItem31 = new Infragistics.Win.ValueListItem(); Infragistics.Win.ValueListItem valueListItem5 = new Infragistics.Win.ValueListItem(); Infragistics.Win.Appearance appearance2 = new Infragistics.Win.Appearance(); Infragistics.Win.ValueListItem valueListItem6 = new Infragistics.Win.ValueListItem(); Infragistics.Win.ValueListItem valueListItem7 = new Infragistics.Win.ValueListItem(); Infragistics.Win.ValueListItem valueListItem8 = new Infragistics.Win.ValueListItem(); Infragistics.Win.ValueListItem valueListItem9 = new Infragistics.Win.ValueListItem(); Infragistics.Win.ValueListItem valueListItem28 = new Infragistics.Win.ValueListItem(); Infragistics.Win.ValueListItem valueListItem29 = new Infragistics.Win.ValueListItem(); Infragistics.Win.ValueListItem valueListItem10 = new Infragistics.Win.ValueListItem(); Infragistics.Win.Appearance appearance3 = new Infragistics.Win.Appearance(); Infragistics.Win.ValueListItem valueListItem11 = new Infragistics.Win.ValueListItem(); Infragistics.Win.ValueListItem valueListItem12 = new Infragistics.Win.ValueListItem(); Infragistics.Win.ValueListItem valueListItem13 = new Infragistics.Win.ValueListItem(); Infragistics.Win.ValueListItem valueListItem14 = new Infragistics.Win.ValueListItem(); Infragistics.Win.ValueListItem valueListItem15 = new Infragistics.Win.ValueListItem(); Infragistics.Win.UltraWinEditors.EditorButton editorButton3 = new Infragistics.Win.UltraWinEditors.EditorButton("edit"); Infragistics.Win.UltraWinEditors.EditorButton editorButton4 = new Infragistics.Win.UltraWinEditors.EditorButton("clear"); Infragistics.Win.UltraWinGrid.UltraGridBand ultraGridBand1 = new Infragistics.Win.UltraWinGrid.UltraGridBand("Table1", -1); Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn1 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("序号"); Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn2 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("熔炼号"); Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn3 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("计划牌号"); Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn4 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("化验时间"); Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn5 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("JHGZ"); Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn6 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("shiftcode", -1, 7905313); Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn7 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("Station"); Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn8 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("SumTime"); Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn9 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("JUDGE_STL_GRD"); Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn10 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("JUDGE_RESULT"); Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn11 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("REG_ID"); Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn12 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("JUDGE_SEQ"); Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn13 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("SIMN"); Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn14 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("CM"); Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn15 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("SAMPLE_DATE1"); Infragistics.Win.Appearance appearance6 = new Infragistics.Win.Appearance(); Infragistics.Win.Appearance appearance7 = new Infragistics.Win.Appearance(); Infragistics.Win.ValueList valueList1 = new Infragistics.Win.ValueList(7905313); Infragistics.Win.ValueListItem valueListItem16 = new Infragistics.Win.ValueListItem(); Infragistics.Win.ValueListItem valueListItem17 = new Infragistics.Win.ValueListItem(); Infragistics.Win.ValueListItem valueListItem18 = new Infragistics.Win.ValueListItem(); Infragistics.Win.ValueListItem valueListItem19 = new Infragistics.Win.ValueListItem(); Infragistics.Win.ValueListItem valueListItem20 = new Infragistics.Win.ValueListItem(); Infragistics.Win.ValueListItem valueListItem21 = new Infragistics.Win.ValueListItem(); Infragistics.Win.ValueListItem valueListItem22 = new Infragistics.Win.ValueListItem(); Infragistics.Win.ValueListItem valueListItem23 = new Infragistics.Win.ValueListItem(); Infragistics.Win.ValueListItem valueListItem24 = new Infragistics.Win.ValueListItem(); Infragistics.Win.ValueListItem valueListItem25 = new Infragistics.Win.ValueListItem(); Infragistics.Win.ValueListItem valueListItem26 = new Infragistics.Win.ValueListItem(); Infragistics.Win.ValueListItem valueListItem27 = new Infragistics.Win.ValueListItem(); Infragistics.Win.UltraWinToolbars.UltraToolbar ultraToolbar1 = new Infragistics.Win.UltraWinToolbars.UltraToolbar("UltraToolbar1"); Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool1 = new Infragistics.Win.UltraWinToolbars.ButtonTool("query"); Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool2 = new Infragistics.Win.UltraWinToolbars.ButtonTool("set"); Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool3 = new Infragistics.Win.UltraWinToolbars.ButtonTool("excel"); Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool4 = new Infragistics.Win.UltraWinToolbars.ButtonTool("SRow"); Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool5 = new Infragistics.Win.UltraWinToolbars.ButtonTool("Close"); Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool6 = new Infragistics.Win.UltraWinToolbars.ButtonTool("query"); Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool7 = new Infragistics.Win.UltraWinToolbars.ButtonTool("set"); Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool8 = new Infragistics.Win.UltraWinToolbars.ButtonTool("excel"); Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool9 = new Infragistics.Win.UltraWinToolbars.ButtonTool("SRow"); Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool10 = new Infragistics.Win.UltraWinToolbars.ButtonTool("Close"); Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool12 = new Infragistics.Win.UltraWinToolbars.ButtonTool("FlushCeq"); this.ultraGroupBox1 = new Infragistics.Win.Misc.UltraGroupBox(); this.button1 = new System.Windows.Forms.Button(); this.ultraMaskedEdit1 = new Infragistics.Win.UltraWinMaskedEdit.UltraMaskedEdit(); this.comboBox2 = new Infragistics.Win.UltraWinEditors.UltraComboEditor(); this.cboGW = new Infragistics.Win.UltraWinEditors.UltraComboEditor(); this.cmb_BZ = new Infragistics.Win.UltraWinEditors.UltraComboEditor(); this.chkGasSample = new System.Windows.Forms.CheckBox(); this.txtSteel = new System.Windows.Forms.TextBox(); this.ultraMaskedEdit2 = new Infragistics.Win.UltraWinMaskedEdit.UltraMaskedEdit(); this.uldtEndTime = new Infragistics.Win.UltraWinEditors.UltraDateTimeEditor(); this.uldtBeginTime = new Infragistics.Win.UltraWinEditors.UltraDateTimeEditor(); this.label11 = new System.Windows.Forms.Label(); this.label10 = new System.Windows.Forms.Label(); this.label9 = new System.Windows.Forms.Label(); this.chkRefresh = new System.Windows.Forms.CheckBox(); this.label8 = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label(); this.button3 = new System.Windows.Forms.Button(); this.btn_Down = new System.Windows.Forms.Button(); this.btn_Up = new System.Windows.Forms.Button(); this.txtPage = new System.Windows.Forms.TextBox(); this.label6 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); this.panel1 = new System.Windows.Forms.Panel(); this.EMGrid = new Infragistics.Win.UltraWinGrid.UltraGrid(); this.dataSet1 = new System.Data.DataSet(); this.dataTable1 = new System.Data.DataTable(); this.dataColumn7 = new System.Data.DataColumn(); this.dataColumn8 = new System.Data.DataColumn(); this.dataColumn9 = new System.Data.DataColumn(); this.dataColumn84 = new System.Data.DataColumn(); this.dataColumn85 = new System.Data.DataColumn(); this.dataColumn1 = new System.Data.DataColumn(); this.dataColumn2 = new System.Data.DataColumn(); this.dataColumn3 = new System.Data.DataColumn(); this.dataColumn4 = new System.Data.DataColumn(); this.dataColumn5 = new System.Data.DataColumn(); this.dataColumn6 = new System.Data.DataColumn(); this.dataColumn10 = new System.Data.DataColumn(); this.dataColumn11 = new System.Data.DataColumn(); this.dataColumn12 = new System.Data.DataColumn(); this.dataColumn13 = new System.Data.DataColumn(); this.ultraPictureBox1 = new Infragistics.Win.UltraWinEditors.UltraPictureBox(); this.label3 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this._panel1_Toolbars_Dock_Area_Left = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea(); this.ultraToolbarsManager1 = new Infragistics.Win.UltraWinToolbars.UltraToolbarsManager(this.components); this._panel1_Toolbars_Dock_Area_Right = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea(); this._panel1_Toolbars_Dock_Area_Top = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea(); this._panel1_Toolbars_Dock_Area_Bottom = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea(); ((System.ComponentModel.ISupportInitialize)(this.ultraGroupBox1)).BeginInit(); this.ultraGroupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.comboBox2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.cboGW)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.cmb_BZ)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.uldtEndTime)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.uldtBeginTime)).BeginInit(); this.panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.EMGrid)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dataSet1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dataTable1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.ultraToolbarsManager1)).BeginInit(); this.SuspendLayout(); // // ultraGroupBox1 // this.ultraGroupBox1.Controls.Add(this.button1); this.ultraGroupBox1.Controls.Add(this.ultraMaskedEdit1); this.ultraGroupBox1.Controls.Add(this.comboBox2); this.ultraGroupBox1.Controls.Add(this.cboGW); this.ultraGroupBox1.Controls.Add(this.cmb_BZ); this.ultraGroupBox1.Controls.Add(this.chkGasSample); this.ultraGroupBox1.Controls.Add(this.txtSteel); this.ultraGroupBox1.Controls.Add(this.ultraMaskedEdit2); this.ultraGroupBox1.Controls.Add(this.uldtEndTime); this.ultraGroupBox1.Controls.Add(this.uldtBeginTime); this.ultraGroupBox1.Controls.Add(this.label11); this.ultraGroupBox1.Controls.Add(this.label10); this.ultraGroupBox1.Controls.Add(this.label9); this.ultraGroupBox1.Controls.Add(this.chkRefresh); this.ultraGroupBox1.Controls.Add(this.label8); this.ultraGroupBox1.Controls.Add(this.label7); this.ultraGroupBox1.Controls.Add(this.button3); this.ultraGroupBox1.Controls.Add(this.btn_Down); this.ultraGroupBox1.Controls.Add(this.btn_Up); this.ultraGroupBox1.Controls.Add(this.txtPage); this.ultraGroupBox1.Controls.Add(this.label6); this.ultraGroupBox1.Controls.Add(this.label5); this.ultraGroupBox1.Controls.Add(this.label4); this.ultraGroupBox1.Controls.Add(this.label1); this.ultraGroupBox1.Dock = System.Windows.Forms.DockStyle.Top; this.ultraGroupBox1.Location = new System.Drawing.Point(0, 28); this.ultraGroupBox1.Name = "ultraGroupBox1"; this.ultraGroupBox1.Size = new System.Drawing.Size(1008, 71); this.ultraGroupBox1.TabIndex = 3; // // button1 // this.button1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(224)))), ((int)(((byte)(192))))); this.button1.Location = new System.Drawing.Point(594, 9); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(70, 50); this.button1.TabIndex = 288; this.button1.Text = "生成复合元素"; this.button1.UseVisualStyleBackColor = false; this.button1.Click += new System.EventHandler(this.button1_Click_1); // // ultraMaskedEdit1 // this.ultraMaskedEdit1.BorderStyle = Infragistics.Win.UIElementBorderStyle.Inset; editorButton1.Key = "edit"; editorButton1.Text = ""; editorButton2.Key = "clear"; this.ultraMaskedEdit1.ButtonsRight.Add(editorButton1); this.ultraMaskedEdit1.ButtonsRight.Add(editorButton2); this.ultraMaskedEdit1.EditAs = Infragistics.Win.UltraWinMaskedEdit.EditAsType.String; this.ultraMaskedEdit1.Location = new System.Drawing.Point(84, 40); this.ultraMaskedEdit1.Name = "ultraMaskedEdit1"; this.ultraMaskedEdit1.PromptChar = ' '; this.ultraMaskedEdit1.Size = new System.Drawing.Size(97, 21); this.ultraMaskedEdit1.TabIndex = 287; this.ultraMaskedEdit1.UseFlatMode = Infragistics.Win.DefaultableBoolean.True; this.ultraMaskedEdit1.EditorButtonClick += new Infragistics.Win.UltraWinEditors.EditorButtonEventHandler(this.EditorButtonClick); // // comboBox2 // appearance1.BorderAlpha = Infragistics.Win.Alpha.UseAlphaLevel; appearance1.BorderColor = System.Drawing.Color.Black; this.comboBox2.Appearance = appearance1; this.comboBox2.BorderStyle = Infragistics.Win.UIElementBorderStyle.Solid; this.comboBox2.DropDownStyle = Infragistics.Win.DropDownStyle.DropDownList; this.comboBox2.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 = "吹氩站"; valueListItem4.DataValue = "3"; valueListItem4.DisplayText = "精炼炉"; valueListItem30.DataValue = "4"; valueListItem30.DisplayText = "RH炉"; valueListItem31.DataValue = "5"; valueListItem31.DisplayText = "VD炉"; valueListItem5.DataValue = "6"; valueListItem5.DisplayText = "连铸"; this.comboBox2.Items.AddRange(new Infragistics.Win.ValueListItem[] { valueListItem1, valueListItem2, valueListItem3, valueListItem4, valueListItem30, valueListItem31, valueListItem5}); this.comboBox2.Location = new System.Drawing.Point(470, 9); this.comboBox2.Name = "comboBox2"; this.comboBox2.Size = new System.Drawing.Size(118, 19); this.comboBox2.TabIndex = 286; this.comboBox2.UseFlatMode = Infragistics.Win.DefaultableBoolean.True; // // cboGW // appearance2.BorderAlpha = Infragistics.Win.Alpha.UseAlphaLevel; appearance2.BorderColor = System.Drawing.Color.Black; this.cboGW.Appearance = appearance2; 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))); valueListItem6.DataValue = "0"; valueListItem6.DisplayText = "铁水"; valueListItem7.DataValue = "1"; valueListItem7.DisplayText = "转炉"; valueListItem8.DataValue = "2"; valueListItem8.DisplayText = "吹氩站"; valueListItem9.DataValue = "3"; valueListItem9.DisplayText = "精炼炉"; valueListItem28.DataValue = "4"; valueListItem28.DisplayText = "RH炉"; valueListItem29.DataValue = "5"; valueListItem29.DisplayText = "VD炉"; valueListItem10.DataValue = "6"; valueListItem10.DisplayText = "连铸"; this.cboGW.Items.AddRange(new Infragistics.Win.ValueListItem[] { valueListItem6, valueListItem7, valueListItem8, valueListItem9, valueListItem28, valueListItem29, valueListItem10}); this.cboGW.Location = new System.Drawing.Point(405, 10); this.cboGW.Name = "cboGW"; this.cboGW.Size = new System.Drawing.Size(56, 19); this.cboGW.TabIndex = 285; this.cboGW.UseFlatMode = Infragistics.Win.DefaultableBoolean.True; this.cboGW.SelectionChanged += new System.EventHandler(this.cboGW_SelectionChanged); // // cmb_BZ // appearance3.BorderAlpha = Infragistics.Win.Alpha.UseAlphaLevel; appearance3.BorderColor = System.Drawing.Color.Black; this.cmb_BZ.Appearance = appearance3; this.cmb_BZ.BorderStyle = Infragistics.Win.UIElementBorderStyle.Solid; this.cmb_BZ.DropDownStyle = Infragistics.Win.DropDownStyle.DropDownList; this.cmb_BZ.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); valueListItem11.DataValue = "0"; valueListItem11.DisplayText = "全部"; valueListItem12.DataValue = "1"; valueListItem12.DisplayText = "甲班"; valueListItem13.DataValue = "2"; valueListItem13.DisplayText = "乙班"; valueListItem14.DataValue = "3"; valueListItem14.DisplayText = "丙班"; valueListItem15.DataValue = "4"; valueListItem15.DisplayText = "丁班"; this.cmb_BZ.Items.AddRange(new Infragistics.Win.ValueListItem[] { valueListItem11, valueListItem12, valueListItem13, valueListItem14, valueListItem15}); this.cmb_BZ.Location = new System.Drawing.Point(405, 41); this.cmb_BZ.Name = "cmb_BZ"; this.cmb_BZ.Size = new System.Drawing.Size(56, 19); this.cmb_BZ.TabIndex = 284; this.cmb_BZ.UseFlatMode = Infragistics.Win.DefaultableBoolean.True; // // chkGasSample // this.chkGasSample.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.chkGasSample.Location = new System.Drawing.Point(670, 38); this.chkGasSample.Name = "chkGasSample"; this.chkGasSample.Size = new System.Drawing.Size(82, 24); this.chkGasSample.TabIndex = 85; this.chkGasSample.Text = "气体样"; // // txtSteel // this.txtSteel.Location = new System.Drawing.Point(501, 40); this.txtSteel.Name = "txtSteel"; this.txtSteel.Size = new System.Drawing.Size(87, 21); this.txtSteel.TabIndex = 84; // // ultraMaskedEdit2 // this.ultraMaskedEdit2.BorderStyle = Infragistics.Win.UIElementBorderStyle.Inset; editorButton3.Key = "edit"; editorButton3.Text = ""; editorButton4.Key = "clear"; this.ultraMaskedEdit2.ButtonsRight.Add(editorButton3); this.ultraMaskedEdit2.ButtonsRight.Add(editorButton4); this.ultraMaskedEdit2.EditAs = Infragistics.Win.UltraWinMaskedEdit.EditAsType.String; this.ultraMaskedEdit2.Location = new System.Drawing.Point(214, 40); this.ultraMaskedEdit2.Name = "ultraMaskedEdit2"; this.ultraMaskedEdit2.PromptChar = ' '; this.ultraMaskedEdit2.Size = new System.Drawing.Size(111, 21); this.ultraMaskedEdit2.TabIndex = 83; this.ultraMaskedEdit2.UseFlatMode = Infragistics.Win.DefaultableBoolean.True; this.ultraMaskedEdit2.EditorButtonClick += new Infragistics.Win.UltraWinEditors.EditorButtonEventHandler(this.EditorButtonClick); // // uldtEndTime // this.uldtEndTime.FormatProvider = new System.Globalization.CultureInfo("en-US"); this.uldtEndTime.FormatString = "yyyy-MM-dd HH:mm"; this.uldtEndTime.Location = new System.Drawing.Point(214, 9); this.uldtEndTime.MaskInput = "yyyy-mm-dd hh:mm"; this.uldtEndTime.Name = "uldtEndTime"; this.uldtEndTime.Size = new System.Drawing.Size(111, 21); this.uldtEndTime.TabIndex = 80; // // uldtBeginTime // this.uldtBeginTime.FormatProvider = new System.Globalization.CultureInfo("en-US"); this.uldtBeginTime.FormatString = "yyyy-MM-dd HH:mm"; this.uldtBeginTime.Location = new System.Drawing.Point(84, 9); this.uldtBeginTime.MaskInput = "yyyy-mm-dd hh:mm"; this.uldtBeginTime.Name = "uldtBeginTime"; this.uldtBeginTime.Size = new System.Drawing.Size(97, 21); this.uldtBeginTime.TabIndex = 79; // // label11 // this.label11.AutoSize = true; this.label11.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label11.Location = new System.Drawing.Point(189, 43); this.label11.Name = "label11"; this.label11.Size = new System.Drawing.Size(21, 14); this.label11.TabIndex = 78; this.label11.Text = "到"; // // label10 // this.label10.AutoSize = true; this.label10.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label10.Location = new System.Drawing.Point(189, 12); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(21, 14); this.label10.TabIndex = 77; this.label10.Text = "到"; // // label9 // this.label9.AutoSize = true; this.label9.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label9.Location = new System.Drawing.Point(466, 43); this.label9.Name = "label9"; this.label9.Size = new System.Drawing.Size(35, 14); this.label9.TabIndex = 72; this.label9.Text = "牌号"; // // chkRefresh // this.chkRefresh.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.chkRefresh.Location = new System.Drawing.Point(670, 7); this.chkRefresh.Name = "chkRefresh"; this.chkRefresh.Size = new System.Drawing.Size(82, 24); this.chkRefresh.TabIndex = 71; this.chkRefresh.Text = "自动刷新"; this.chkRefresh.CheckedChanged += new System.EventHandler(this.chkRefresh_CheckedChanged); // // label8 // this.label8.AutoSize = true; this.label8.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label8.Location = new System.Drawing.Point(335, 43); this.label8.Name = "label8"; this.label8.Size = new System.Drawing.Size(70, 14); this.label8.TabIndex = 70; this.label8.Text = "选择班组:"; // // label7 // this.label7.AutoSize = true; this.label7.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label7.Location = new System.Drawing.Point(335, 12); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(70, 14); this.label7.TabIndex = 68; this.label7.Text = "工序位置:"; // // button3 // this.button3.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.button3.Location = new System.Drawing.Point(914, 39); this.button3.Name = "button3"; this.button3.Size = new System.Drawing.Size(72, 23); this.button3.TabIndex = 58; this.button3.Text = "全部显示"; this.button3.UseVisualStyleBackColor = false; this.button3.Click += new System.EventHandler(this.button3_Click); // // btn_Down // this.btn_Down.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btn_Down.Location = new System.Drawing.Point(866, 39); this.btn_Down.Name = "btn_Down"; this.btn_Down.Size = new System.Drawing.Size(40, 23); this.btn_Down.TabIndex = 57; this.btn_Down.Text = ">>"; this.btn_Down.Click += new System.EventHandler(this.btn_Down_Click); // // btn_Up // this.btn_Up.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btn_Up.Location = new System.Drawing.Point(762, 39); this.btn_Up.Name = "btn_Up"; this.btn_Up.Size = new System.Drawing.Size(40, 23); this.btn_Up.TabIndex = 56; this.btn_Up.Text = "<<"; this.btn_Up.Click += new System.EventHandler(this.btn_Up_Click); // // txtPage // this.txtPage.Location = new System.Drawing.Point(802, 40); this.txtPage.Name = "txtPage"; this.txtPage.Size = new System.Drawing.Size(64, 21); this.txtPage.TabIndex = 55; this.txtPage.Text = "40"; // // label6 // this.label6.AutoSize = true; this.label6.ForeColor = System.Drawing.Color.Red; this.label6.Location = new System.Drawing.Point(856, 13); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(0, 12); this.label6.TabIndex = 54; // // label5 // this.label5.AutoSize = true; this.label5.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label5.Location = new System.Drawing.Point(760, 12); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(98, 14); this.label5.TabIndex = 52; this.label5.Text = "当前数据显示:"; // // label4 // this.label4.AutoSize = true; this.label4.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label4.Location = new System.Drawing.Point(21, 43); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(63, 14); this.label4.TabIndex = 48; this.label4.Text = "熔炼号从"; // // label1 // this.label1.AutoSize = true; this.label1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label1.Location = new System.Drawing.Point(7, 12); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(77, 14); this.label1.TabIndex = 15; this.label1.Text = "化验时间从"; // // panel1 // this.panel1.Controls.Add(this.EMGrid); this.panel1.Controls.Add(this.ultraPictureBox1); this.panel1.Controls.Add(this.label3); this.panel1.Controls.Add(this.label2); this.panel1.Controls.Add(this.ultraGroupBox1); this.panel1.Controls.Add(this._panel1_Toolbars_Dock_Area_Left); this.panel1.Controls.Add(this._panel1_Toolbars_Dock_Area_Right); this.panel1.Controls.Add(this._panel1_Toolbars_Dock_Area_Top); this.panel1.Controls.Add(this._panel1_Toolbars_Dock_Area_Bottom); 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(1008, 653); this.panel1.TabIndex = 12; // // EMGrid // this.EMGrid.DataMember = "Table1"; this.EMGrid.DataSource = this.dataSet1; ultraGridColumn1.Header.VisiblePosition = 0; ultraGridColumn1.Hidden = true; ultraGridColumn1.Width = 54; ultraGridColumn2.Header.Caption = "炉号"; ultraGridColumn2.Header.VisiblePosition = 1; ultraGridColumn2.RowLayoutColumnInfo.OriginX = 0; ultraGridColumn2.RowLayoutColumnInfo.OriginY = 0; ultraGridColumn2.RowLayoutColumnInfo.SpanX = 1; ultraGridColumn2.RowLayoutColumnInfo.SpanY = 1; ultraGridColumn2.Width = 179; ultraGridColumn3.Header.VisiblePosition = 6; ultraGridColumn3.RowLayoutColumnInfo.OriginX = 4; ultraGridColumn3.RowLayoutColumnInfo.OriginY = 0; ultraGridColumn3.RowLayoutColumnInfo.SpanX = 1; ultraGridColumn3.RowLayoutColumnInfo.SpanY = 1; ultraGridColumn3.Width = 116; ultraGridColumn4.Header.VisiblePosition = 7; ultraGridColumn4.RowLayoutColumnInfo.OriginX = 5; ultraGridColumn4.RowLayoutColumnInfo.OriginY = 0; ultraGridColumn4.RowLayoutColumnInfo.SpanX = 1; ultraGridColumn4.RowLayoutColumnInfo.SpanY = 1; ultraGridColumn4.Width = 160; ultraGridColumn5.Header.VisiblePosition = 4; ultraGridColumn5.Hidden = true; ultraGridColumn6.Header.VisiblePosition = 5; ultraGridColumn6.RowLayoutColumnInfo.OriginX = 3; ultraGridColumn6.RowLayoutColumnInfo.OriginY = 0; ultraGridColumn6.RowLayoutColumnInfo.SpanX = 1; ultraGridColumn6.RowLayoutColumnInfo.SpanY = 1; ultraGridColumn6.Width = 53; ultraGridColumn7.CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ultraGridColumn7.Header.VisiblePosition = 2; ultraGridColumn7.RowLayoutColumnInfo.OriginX = 1; ultraGridColumn7.RowLayoutColumnInfo.OriginY = 0; ultraGridColumn7.RowLayoutColumnInfo.SpanX = 1; ultraGridColumn7.RowLayoutColumnInfo.SpanY = 1; ultraGridColumn7.Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDown; ultraGridColumn7.Width = 66; ultraGridColumn8.Header.VisiblePosition = 3; ultraGridColumn8.RowLayoutColumnInfo.OriginX = 2; ultraGridColumn8.RowLayoutColumnInfo.OriginY = 0; ultraGridColumn8.RowLayoutColumnInfo.SpanX = 1; ultraGridColumn8.RowLayoutColumnInfo.SpanY = 1; ultraGridColumn8.Width = 40; ultraGridColumn9.CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ultraGridColumn9.Header.VisiblePosition = 8; ultraGridColumn9.RowLayoutColumnInfo.OriginX = 8; ultraGridColumn9.RowLayoutColumnInfo.OriginY = 0; ultraGridColumn9.RowLayoutColumnInfo.SpanX = 1; ultraGridColumn9.RowLayoutColumnInfo.SpanY = 1; ultraGridColumn10.CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ultraGridColumn10.Header.VisiblePosition = 9; ultraGridColumn10.RowLayoutColumnInfo.OriginX = 9; ultraGridColumn10.RowLayoutColumnInfo.OriginY = 0; ultraGridColumn10.RowLayoutColumnInfo.SpanX = 1; ultraGridColumn10.RowLayoutColumnInfo.SpanY = 1; ultraGridColumn11.CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ultraGridColumn11.Header.VisiblePosition = 10; ultraGridColumn11.RowLayoutColumnInfo.OriginX = 10; ultraGridColumn11.RowLayoutColumnInfo.OriginY = 0; ultraGridColumn11.RowLayoutColumnInfo.SpanX = 1; ultraGridColumn11.RowLayoutColumnInfo.SpanY = 1; ultraGridColumn12.Header.VisiblePosition = 11; ultraGridColumn12.Hidden = true; ultraGridColumn13.Header.VisiblePosition = 12; ultraGridColumn13.RowLayoutColumnInfo.OriginX = 11; ultraGridColumn13.RowLayoutColumnInfo.OriginY = 0; ultraGridColumn13.RowLayoutColumnInfo.PreferredCellSize = new System.Drawing.Size(70, 0); ultraGridColumn13.RowLayoutColumnInfo.SpanX = 1; ultraGridColumn13.RowLayoutColumnInfo.SpanY = 1; ultraGridColumn14.Header.VisiblePosition = 13; ultraGridColumn14.RowLayoutColumnInfo.OriginX = 6; ultraGridColumn14.RowLayoutColumnInfo.OriginY = 0; ultraGridColumn14.RowLayoutColumnInfo.PreferredCellSize = new System.Drawing.Size(70, 0); ultraGridColumn14.RowLayoutColumnInfo.PreferredLabelSize = new System.Drawing.Size(30, 0); ultraGridColumn14.RowLayoutColumnInfo.SpanX = 1; ultraGridColumn14.RowLayoutColumnInfo.SpanY = 1; ultraGridColumn15.Header.VisiblePosition = 14; ultraGridColumn15.RowLayoutColumnInfo.OriginX = 7; ultraGridColumn15.RowLayoutColumnInfo.OriginY = 0; ultraGridColumn15.RowLayoutColumnInfo.PreferredCellSize = new System.Drawing.Size(160, 0); ultraGridColumn15.RowLayoutColumnInfo.SpanX = 1; ultraGridColumn15.RowLayoutColumnInfo.SpanY = 1; ultraGridBand1.Columns.AddRange(new object[] { ultraGridColumn1, ultraGridColumn2, ultraGridColumn3, ultraGridColumn4, ultraGridColumn5, ultraGridColumn6, ultraGridColumn7, ultraGridColumn8, ultraGridColumn9, ultraGridColumn10, ultraGridColumn11, ultraGridColumn12, ultraGridColumn13, ultraGridColumn14, ultraGridColumn15}); ultraGridBand1.RowLayoutStyle = Infragistics.Win.UltraWinGrid.RowLayoutStyle.ColumnLayout; this.EMGrid.DisplayLayout.BandsSerializer.Add(ultraGridBand1); this.EMGrid.DisplayLayout.GroupByBox.Hidden = true; appearance6.FontData.BoldAsString = "True"; appearance6.FontData.SizeInPoints = 10F; this.EMGrid.DisplayLayout.Override.CellAppearance = appearance6; appearance7.FontData.BoldAsString = "True"; this.EMGrid.DisplayLayout.Override.HeaderAppearance = appearance7; this.EMGrid.DisplayLayout.Override.HeaderClickAction = Infragistics.Win.UltraWinGrid.HeaderClickAction.SortMulti; this.EMGrid.DisplayLayout.Override.WrapHeaderText = Infragistics.Win.DefaultableBoolean.True; valueListItem16.DataValue = "11"; valueListItem16.DisplayText = "白-甲"; valueListItem17.DataValue = "12"; valueListItem17.DisplayText = "白-乙"; valueListItem18.DataValue = "13"; valueListItem18.DisplayText = "白-丙"; valueListItem19.DataValue = "14"; valueListItem19.DisplayText = "白-丁"; valueListItem20.DataValue = "21"; valueListItem20.DisplayText = "中-甲"; valueListItem21.DataValue = "22"; valueListItem21.DisplayText = "中-乙"; valueListItem22.DataValue = "23"; valueListItem22.DisplayText = "中-丙"; valueListItem23.DataValue = "24"; valueListItem23.DisplayText = "中-丁"; valueListItem24.DataValue = "31"; valueListItem24.DisplayText = "夜-甲"; valueListItem25.DataValue = "32"; valueListItem25.DisplayText = "夜-乙"; valueListItem26.DataValue = "33"; valueListItem26.DisplayText = "夜-丙"; valueListItem27.DataValue = "34"; valueListItem27.DisplayText = "夜-丁"; valueList1.ValueListItems.AddRange(new Infragistics.Win.ValueListItem[] { valueListItem16, valueListItem17, valueListItem18, valueListItem19, valueListItem20, valueListItem21, valueListItem22, valueListItem23, valueListItem24, valueListItem25, valueListItem26, valueListItem27}); this.EMGrid.DisplayLayout.ValueLists.AddRange(new Infragistics.Win.ValueList[] { valueList1}); this.EMGrid.Dock = System.Windows.Forms.DockStyle.Fill; this.EMGrid.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.EMGrid.Location = new System.Drawing.Point(0, 99); this.EMGrid.Name = "EMGrid"; this.EMGrid.Size = new System.Drawing.Size(1008, 554); this.EMGrid.TabIndex = 6; this.EMGrid.DoubleClickRow += new Infragistics.Win.UltraWinGrid.DoubleClickRowEventHandler(this.EMGrid_DoubleClickRow); this.EMGrid.Click += new System.EventHandler(this.EMGrid_Click); // // dataSet1 // this.dataSet1.DataSetName = "NewDataSet"; this.dataSet1.Locale = new System.Globalization.CultureInfo("zh-CN"); this.dataSet1.Tables.AddRange(new System.Data.DataTable[] { this.dataTable1}); // // dataTable1 // this.dataTable1.Columns.AddRange(new System.Data.DataColumn[] { this.dataColumn7, this.dataColumn8, this.dataColumn9, this.dataColumn84, this.dataColumn85, this.dataColumn1, this.dataColumn2, this.dataColumn3, this.dataColumn4, this.dataColumn5, this.dataColumn6, this.dataColumn10, this.dataColumn11, this.dataColumn12, this.dataColumn13}); this.dataTable1.TableName = "Table1"; // // dataColumn7 // this.dataColumn7.ColumnName = "序号"; // // dataColumn8 // this.dataColumn8.ColumnName = "熔炼号"; // // dataColumn9 // this.dataColumn9.ColumnName = "计划牌号"; // // dataColumn84 // this.dataColumn84.ColumnName = "化验时间"; // // dataColumn85 // this.dataColumn85.Caption = "牌号编码"; this.dataColumn85.ColumnName = "JHGZ"; // // dataColumn1 // this.dataColumn1.Caption = "班别"; this.dataColumn1.ColumnName = "shiftcode"; // // dataColumn2 // this.dataColumn2.Caption = "工序"; this.dataColumn2.ColumnName = "Station"; // // dataColumn3 // this.dataColumn3.Caption = "次数"; this.dataColumn3.ColumnName = "SumTime"; // // dataColumn4 // this.dataColumn4.Caption = "判定牌号"; this.dataColumn4.ColumnName = "JUDGE_STL_GRD"; // // dataColumn5 // this.dataColumn5.Caption = "判定结果"; this.dataColumn5.ColumnName = "JUDGE_RESULT"; // // dataColumn6 // this.dataColumn6.Caption = "判定人"; this.dataColumn6.ColumnName = "REG_ID"; // // dataColumn10 // this.dataColumn10.Caption = "次数"; this.dataColumn10.ColumnName = "JUDGE_SEQ"; // // dataColumn11 // this.dataColumn11.Caption = "MN/S"; this.dataColumn11.ColumnName = "SIMN"; // // dataColumn12 // this.dataColumn12.Caption = "时间差(分钟)"; this.dataColumn12.ColumnName = "CM"; // // dataColumn13 // this.dataColumn13.Caption = "送样时间"; this.dataColumn13.ColumnName = "SAMPLE_DATE1"; // // ultraPictureBox1 // this.ultraPictureBox1.BorderShadowColor = System.Drawing.Color.Empty; this.ultraPictureBox1.Location = new System.Drawing.Point(339, 286); this.ultraPictureBox1.Name = "ultraPictureBox1"; this.ultraPictureBox1.Size = new System.Drawing.Size(100, 50); this.ultraPictureBox1.TabIndex = 16; // // label3 // this.label3.BackColor = System.Drawing.Color.Blue; this.label3.ForeColor = System.Drawing.SystemColors.ControlText; this.label3.Location = new System.Drawing.Point(564, 271); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(100, 23); this.label3.TabIndex = 11; this.label3.Text = "label3"; this.label3.Visible = false; // // label2 // this.label2.BackColor = System.Drawing.Color.Red; this.label2.Location = new System.Drawing.Point(458, 230); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(100, 23); this.label2.TabIndex = 6; this.label2.Text = "label2"; this.label2.Visible = false; // // _panel1_Toolbars_Dock_Area_Left // this._panel1_Toolbars_Dock_Area_Left.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping; this._panel1_Toolbars_Dock_Area_Left.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(229)))), ((int)(((byte)(229)))), ((int)(((byte)(215))))); this._panel1_Toolbars_Dock_Area_Left.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Left; this._panel1_Toolbars_Dock_Area_Left.ForeColor = System.Drawing.SystemColors.ControlText; this._panel1_Toolbars_Dock_Area_Left.Location = new System.Drawing.Point(0, 28); this._panel1_Toolbars_Dock_Area_Left.Name = "_panel1_Toolbars_Dock_Area_Left"; this._panel1_Toolbars_Dock_Area_Left.Size = new System.Drawing.Size(0, 625); this._panel1_Toolbars_Dock_Area_Left.ToolbarsManager = this.ultraToolbarsManager1; // // ultraToolbarsManager1 // this.ultraToolbarsManager1.DesignerFlags = 1; this.ultraToolbarsManager1.DockWithinContainer = this.panel1; this.ultraToolbarsManager1.LockToolbars = true; this.ultraToolbarsManager1.ShowFullMenusDelay = 500; this.ultraToolbarsManager1.ShowQuickCustomizeButton = false; this.ultraToolbarsManager1.Style = Infragistics.Win.UltraWinToolbars.ToolbarStyle.VisualStudio2005; ultraToolbar1.DockedColumn = 0; ultraToolbar1.DockedRow = 0; buttonTool1.InstanceProps.IsFirstInGroup = true; buttonTool2.InstanceProps.IsFirstInGroup = true; buttonTool4.InstanceProps.IsFirstInGroup = true; buttonTool5.InstanceProps.IsFirstInGroup = true; ultraToolbar1.NonInheritedTools.AddRange(new Infragistics.Win.UltraWinToolbars.ToolBase[] { buttonTool1, buttonTool2, buttonTool3, buttonTool4, buttonTool5}); ultraToolbar1.Text = "UltraToolbar1"; this.ultraToolbarsManager1.Toolbars.AddRange(new Infragistics.Win.UltraWinToolbars.UltraToolbar[] { ultraToolbar1}); buttonTool6.SharedPropsInternal.Caption = "查询(&Q)"; buttonTool6.SharedPropsInternal.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.ImageAndText; buttonTool7.SharedPropsInternal.Caption = "设置样点(&S)"; buttonTool7.SharedPropsInternal.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.ImageAndText; buttonTool8.SharedPropsInternal.Caption = "导出(&P)"; buttonTool8.SharedPropsInternal.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.ImageAndText; buttonTool9.SharedPropsInternal.Caption = "设置列(&R)"; buttonTool9.SharedPropsInternal.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.ImageAndText; buttonTool10.SharedPropsInternal.Caption = "关闭(&C)"; buttonTool10.SharedPropsInternal.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.ImageAndText; buttonTool12.SharedPropsInternal.Caption = "刷新复合元素"; buttonTool12.SharedPropsInternal.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.ImageAndText; this.ultraToolbarsManager1.Tools.AddRange(new Infragistics.Win.UltraWinToolbars.ToolBase[] { buttonTool6, buttonTool7, buttonTool8, buttonTool9, buttonTool10, buttonTool12}); this.ultraToolbarsManager1.Visible = false; this.ultraToolbarsManager1.ToolClick += new Infragistics.Win.UltraWinToolbars.ToolClickEventHandler(this.ultraToolbarsManager1_ToolClick); // // _panel1_Toolbars_Dock_Area_Right // this._panel1_Toolbars_Dock_Area_Right.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping; this._panel1_Toolbars_Dock_Area_Right.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(229)))), ((int)(((byte)(229)))), ((int)(((byte)(215))))); this._panel1_Toolbars_Dock_Area_Right.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Right; this._panel1_Toolbars_Dock_Area_Right.ForeColor = System.Drawing.SystemColors.ControlText; this._panel1_Toolbars_Dock_Area_Right.Location = new System.Drawing.Point(1008, 28); this._panel1_Toolbars_Dock_Area_Right.Name = "_panel1_Toolbars_Dock_Area_Right"; this._panel1_Toolbars_Dock_Area_Right.Size = new System.Drawing.Size(0, 625); this._panel1_Toolbars_Dock_Area_Right.ToolbarsManager = this.ultraToolbarsManager1; // // _panel1_Toolbars_Dock_Area_Top // this._panel1_Toolbars_Dock_Area_Top.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping; this._panel1_Toolbars_Dock_Area_Top.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(229)))), ((int)(((byte)(229)))), ((int)(((byte)(215))))); this._panel1_Toolbars_Dock_Area_Top.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Top; this._panel1_Toolbars_Dock_Area_Top.ForeColor = System.Drawing.SystemColors.ControlText; this._panel1_Toolbars_Dock_Area_Top.Location = new System.Drawing.Point(0, 0); this._panel1_Toolbars_Dock_Area_Top.Name = "_panel1_Toolbars_Dock_Area_Top"; this._panel1_Toolbars_Dock_Area_Top.Size = new System.Drawing.Size(1008, 28); this._panel1_Toolbars_Dock_Area_Top.ToolbarsManager = this.ultraToolbarsManager1; // // _panel1_Toolbars_Dock_Area_Bottom // this._panel1_Toolbars_Dock_Area_Bottom.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping; this._panel1_Toolbars_Dock_Area_Bottom.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(229)))), ((int)(((byte)(229)))), ((int)(((byte)(215))))); this._panel1_Toolbars_Dock_Area_Bottom.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Bottom; this._panel1_Toolbars_Dock_Area_Bottom.ForeColor = System.Drawing.SystemColors.ControlText; this._panel1_Toolbars_Dock_Area_Bottom.Location = new System.Drawing.Point(0, 653); this._panel1_Toolbars_Dock_Area_Bottom.Name = "_panel1_Toolbars_Dock_Area_Bottom"; this._panel1_Toolbars_Dock_Area_Bottom.Size = new System.Drawing.Size(1008, 0); this._panel1_Toolbars_Dock_Area_Bottom.ToolbarsManager = this.ultraToolbarsManager1; // // frmLgElements // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.ClientSize = new System.Drawing.Size(1008, 653); this.Controls.Add(this.panel1); this.Name = "frmLgElements"; this.Text = "化学成分查询"; this.Load += new System.EventHandler(this.ELEMENTS_Load); ((System.ComponentModel.ISupportInitialize)(this.ultraGroupBox1)).EndInit(); this.ultraGroupBox1.ResumeLayout(false); this.ultraGroupBox1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.comboBox2)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.cboGW)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.cmb_BZ)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.uldtEndTime)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.uldtBeginTime)).EndInit(); this.panel1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.EMGrid)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.dataSet1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.dataTable1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.ultraToolbarsManager1)).EndInit(); this.ResumeLayout(false); } #endregion #endregion public int sValue(string Svalue, string SCHvalue) { if (SCHvalue.Length < 1) { return 0; } if (Svalue.Length > 0) { string BValue = "-1"; string EValue = "-1"; if (Svalue.IndexOf("~") > 0) { BValue = Svalue.Substring(0, Svalue.IndexOf("~")); EValue = Svalue.Substring(Svalue.IndexOf("~") + 1, Svalue.Length - Svalue.IndexOf("~") - 1); if (double.Parse(SCHvalue) >= double.Parse(BValue) && double.Parse(SCHvalue) <= double.Parse(EValue)) { return 0; //正确 } else { return -1; } } else { if (Svalue.IndexOf("<=") > -1) { EValue = Svalue.Substring(Svalue.IndexOf("<=") + 2, Svalue.Length - Svalue.IndexOf("<=") - 2); if (double.Parse(SCHvalue) <= double.Parse(EValue)) { return 0; //正确 } else { return -1; } } else { if (Svalue.IndexOf("<") > -1 && Svalue.IndexOf("=") == -1) { EValue = Svalue.Substring(Svalue.IndexOf("<") + 1, Svalue.Length - Svalue.IndexOf("<") - 1); if (double.Parse(SCHvalue) < double.Parse(EValue)) { return 0; //正确 } else { return -1; } } else { if (Svalue.IndexOf(">=") > -1) { EValue = Svalue.Substring(Svalue.IndexOf(">=") + 1, Svalue.Length - Svalue.IndexOf(">=") - 1); if (double.Parse(SCHvalue) >= double.Parse(EValue)) { return 0; //正确 } else { return -1; } } else { if (Svalue.IndexOf(">") > -1 && Svalue.IndexOf("=") == -1) { EValue = Svalue.Substring(Svalue.IndexOf(">") + 1, Svalue.Length - Svalue.IndexOf(">") - 1); if (double.Parse(SCHvalue) > double.Parse(EValue)) { return 0; //正确 } else { return -1; } } else { EValue = Svalue; try { if (double.Parse(SCHvalue) == double.Parse(EValue)) { return 0; //正确 } } catch { } return -1; } } } } } } return 0; } public void GetTAM_StandardElement()/// 查询判定牌号成分 { int intSelectedIndex = cboGW.SelectedIndex; //选择的岗位 try { // string strForeSmeltingId = "", strSme = ""; Color tmpC = c1; string szJHGZ = "", strErr = "", szWhere = "", szQJ = "", szJYH = ""; object obj = null; DataSet ds = new DataSet(); for (int j = 0; j < EMGrid.Rows.Count; j++) { for (int i = 0; i < EMGrid.DisplayLayout.Bands[0].Columns.Count; i++) { EMGrid.Rows[j].Cells[i].Appearance.ForeColor = Color.Black; } if (j == 0) { EMGrid.Rows[j].Appearance.BackColor = tmpC; if (intSelectedIndex == 0) strForeSmeltingId = EMGrid.Rows[j].Cells[1].Value.ToString().Substring(0, EMGrid.Rows[j].Cells[1].Value.ToString().IndexOf("-")); else { if (EMGrid.Rows[j].Cells[1].Value.ToString().Length >= 10) strForeSmeltingId = EMGrid.Rows[j].Cells[1].Value.ToString().Substring(0, 10); } } else { if (intSelectedIndex == 0) strSme = EMGrid.Rows[j].Cells[1].Value.ToString().Substring(0, EMGrid.Rows[j].Cells[1].Value.ToString().IndexOf("-")); else { if (EMGrid.Rows[j].Cells[1].Value.ToString().Length >= 10) strSme = EMGrid.Rows[j].Cells[1].Value.ToString().Substring(0, 10); } if (strForeSmeltingId == strSme) { tmpC = SetRowBackColor(EMGrid.Rows[j], tmpC, true); } else { tmpC = SetRowBackColor(EMGrid.Rows[j], tmpC, false); strForeSmeltingId = strSme; } } if (intSelectedIndex == 0) continue; szJHGZ = EMGrid.Rows[j].Cells["JHGZ"].Value.ToString(); szJYH = EMGrid.Rows[j].Cells[1].Value.ToString().Substring(0, 10); strErr = ""; string[] ArrayId = new string[strERow.Length + 100]; // 后面加复合元素后,原有的会报错,加100 szWhere = szJYH; //条件 string szEleStd = ""; string szCrfStd = "('L02001','L02005') "; int id = 0; for (int i = 6; i < EMGrid.DisplayLayout.Bands[0].Columns.Count; i++) { if (EMGrid.Rows[j].Cells[i].Appearance.ForeColor == Color.Red || EMGrid.Rows[j].Cells[i].Appearance.ForeColor == Color.FromArgb(204, 153, 0)) EMGrid.Rows[j].Cells[i].Appearance.ForeColor = Color.Black; } //铁样与转炉样不判定 if (EMGrid.Rows[j].Cells["Station"].Value.ToString().Contains("转炉") == false) { //设置要获取的化学成分标准,此处i的值必须与(SetGridRowHidden)要显示的列数一样,否则将无法实现相同炉号显示不同颜色 for (int i = 11; i < EMGrid.DisplayLayout.Bands[0].Columns.Count; i++) { if (EMGrid.DisplayLayout.Bands[0].Columns[i].Hidden == false) { szEleStd = szEleStd + "','" + EMGrid.DisplayLayout.Bands[0].Columns[i].Header.Caption; ArrayId[id] = EMGrid.DisplayLayout.Bands[0].Columns[i].Header.Caption; id++; } } if (!string.IsNullOrEmpty(szEleStd)) { szEleStd = "('" + szEleStd.Substring(3, szEleStd.Length - 3) + "')"; ArrayList arry = new ArrayList(); arry.Add("ChemStandardInfo.select"); arry.Add(EMGrid.Rows[j].Cells["熔炼号"].Value.ToString()); CommonClientToServer cctos = new CommonClientToServer(); cctos.ob = this.ob; ds = cctos.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr); } else continue; if (strErr != "") { continue; } else if (ds.Tables[0].Rows.Count > 0) { //ArrayList ar = ds as ArrayList; //DataSet dsStandard = (ar[0] as DataSet); if (ds.Tables[0].Rows.Count == 0) { for (int i = 3; i < 18; i++) { if (EMGrid.Rows[j].Cells[i].Appearance.ForeColor == Color.Red) EMGrid.Rows[j].Cells[i].Appearance.ForeColor = Color.Black; } continue; } foreach (DataRow Drow in ds.Tables[0].Rows) { for (int i = 0; i < ArrayId.Length; i++) { if (dataSet1.Tables[0].Columns.Contains(Drow["ITEMCODE"].ToString())) { if (EMGrid.Rows[j].Cells[Drow["ITEMCODE"].ToString()].Value.ToString().Length > 0) { if (Drow["ITEMCODE"].ToString() == ArrayId[i]) { int reP = 0; try { if (reP == 0) { if (Drow["STDMIN"].ToString() != "" && Drow["STDMAX"].ToString() != "") szQJ = Drow["STDMIN"].ToString() + "~" + Drow["STDMAX"].ToString(); else if (Drow["STDMIN"].ToString() != "" && Drow["STDMAX"].ToString() == "") szQJ = "> " + Drow["STDMIN"].ToString(); else if (Drow["STDMIN"].ToString() == "" && Drow["STDMAX"].ToString() != "") szQJ = "<= " + Drow["STDMAX"].ToString(); reP = sValue(szQJ, EMGrid.Rows[j].Cells[Drow["ITEMCODE"].ToString()].Value.ToString()); } } catch (Exception ex) { Console.WriteLine(ex.Message); } if (reP == -1 && Drow["STDSTYLE"].ToString() == "1") { EMGrid.Rows[j].Cells[Drow["ITEMCODE"].ToString()].Appearance.ForeColor = Color.FromArgb(204, 153, 0);// Color.Yellow; } else if (reP == -1 && Drow["STDSTYLE"].ToString() == "2" && EMGrid.Rows[j].Cells[Drow["ITEMCODE"].ToString()].Appearance.ForeColor == Color.FromArgb(204, 153, 0)) { EMGrid.Rows[j].Cells[Drow["ITEMCODE"].ToString()].Appearance.ForeColor = Color.Violet; } else if (reP == -1 && Drow["STDSTYLE"].ToString() == "3" && EMGrid.Rows[j].Cells[Drow["ITEMCODE"].ToString()].Appearance.ForeColor == Color.Violet) { EMGrid.Rows[j].Cells[Drow["ITEMCODE"].ToString()].Appearance.ForeColor = Color.Red; } else if (EMGrid.Rows[j].Cells[Drow["ITEMCODE"].ToString()].Appearance.ForeColor != Color.FromArgb(204, 153, 0)) { EMGrid.Rows[j].Cells[Drow["ITEMCODE"].ToString()].Appearance.ForeColor = Color.Black; } break; } } } } } } } } } catch(Exception ex) { } } public void GetId(int RowId, Infragistics.Win.UltraWinGrid.UltraGrid GRID) { int i = RowId; if (GRID.Rows[i].Cells[1].Value.ToString().Length > 0) { if (GRID.Rows[i].Cells[0].Value.ToString().IndexOf("√") < 0) { GRID.Rows[i].Cells[0].Value = GRID.Rows[i].Cells[0].Value + "√"; } else { GRID.Rows[i].Cells[0].Value = GRID.Rows[i].Cells[0].Value.ToString().Substring(0, GRID.Rows[i].Cells[0].Value.ToString().IndexOf("√")); } } } private string ReturnSteelCodeByHeatNoFromUltraGrid(string heatNo) { string strSteelCode = ""; foreach (UltraGridRow ugr in this.EMGrid.Rows) { if (ugr.Cells["熔炼号"].Value.ToString() == heatNo) { if (ugr.Cells["JUDGE_STL_GRD"].Value.ToString().Length > 0 && ugr.Cells["熔炼号"].Value.ToString() != ugr.Cells["JUDGE_STL_GRD"].Value.ToString()) return ugr.Cells["JUDGE_STL_GRD"].Value.ToString(); } } return strSteelCode; } private void EMGrid_DoubleClickRow(object sender, Infragistics.Win.UltraWinGrid.DoubleClickRowEventArgs e) { GetId(e.Row.Index, EMGrid); if (EMGrid.Rows[e.Row.Index].Cells[0].Value.ToString().IndexOf("√") > 0) { frmLgEleDetail.StrT = "02"; frmLgEleDetail.StrHic = EMGrid.Rows[e.Row.Index].Cells[1].Text.Trim().ToString(); string szLH = EMGrid.Rows[e.Row.Index].Cells["熔炼号"].Value.ToString(); string strJudjeCode = ReturnSteelCodeByHeatNoFromUltraGrid(szLH); //string[] szAr = szLH.Split('-'); //szLH = szAr[0];// + szAr[1]; if (szLH.Length < 8) return; // 如果判定牌号有变化,弹出框中显示判定牌号信息 frmLgEleDetail.strSteelCode = EMGrid.Rows[e.Row.Index].Cells["计划牌号"].Text.Trim(); frmLgEleDetail.strSteelCodeGrd = strJudjeCode; string szJYH = EMGrid.ActiveRow.Cells[1].Value.ToString(); string szEleStd = ""; //设置要获取的化学成分标准 for (int i = 5; i < EMGrid.DisplayLayout.Bands[0].Columns.Count; i++) { if (EMGrid.DisplayLayout.Bands[0].Columns[i].Hidden == false) { szEleStd = szEleStd + "','" + EMGrid.DisplayLayout.Bands[0].Columns[i].Header.Caption; } } frmLgEleDetail.szEleStd = szEleStd; frmLgEleDetail Azhupi = new frmLgEleDetail(frmLgEleDetail.StrHic, frmLgEleDetail.strSteelCode, szJYH.Substring(9, 1), ob); Azhupi.ultrgridRow = EMGrid.ActiveRow; Azhupi.ShowDialog(this); } } 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); } #region " Main Code " //增加分页显示功能 private DataSet _dsAll = new DataSet(); private DataSet _dsSet; private int _intBegin = 0; private int _intEnd = 40; private string _strDuty = "0"; private string _dvRowFilter = ""; private string _strWhere1 = ""; private string _strWhere2 = ""; private string _szTableName = ""; public string _devPos = ""; private Color c1 = Color.PaleGreen; private Color c2 = Color.White; private void btn_Up_Click(object sender, System.EventArgs e) { int step = 40; try { step = Convert.ToInt32(this.txtPage.Text.Trim()); if (step < 1) throw new Exception(); } catch { MessageBox.Show("请输入正确的显示行数!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } this.Cursor = Cursors.WaitCursor; dataTable1.Clear(); if (_dsAll.Tables.Count <= 0) return; int count = _dsAll.Tables[0].DefaultView.Count; if (_intBegin < step) { _intEnd = _intBegin; _intBegin = 0; } else { _intEnd = _intBegin; _intBegin -= step; } if (_intBegin > 0) this.btn_Up.Enabled = true; else btn_Up.Enabled = false; if (_intEnd < count) this.btn_Down.Enabled = true; else btn_Down.Enabled = false; this.label6.Text = String.Format("第 {0} 行到第 {1} 行, 共 {2} 行", _intBegin + 1, _intEnd, count); SetEachRowData(); //数据获取启动线程。执行完后关闭 Thread t = new Thread(new ThreadStart(DoStandFetchReady)); t.IsBackground = true; t.Start(); } private void DoStandFetchReady() { GetTAM_StandardElement(); try { this.Cursor = Cursors.Default; } catch { } //关闭正在取数据的对话框 // Invoke(new UpdateUIDelegate(UpdateUI), new object[] { true }); } private void btn_Down_Click(object sender, System.EventArgs e) { int step = 40; try { step = Convert.ToInt32(this.txtPage.Text.Trim()); if (step < 1) throw new Exception(); } catch { MessageBox.Show("请输入正确的显示行数!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } this.Cursor = Cursors.WaitCursor; dataTable1.Clear(); if (_dsAll.Tables.Count <= 0) return; int count = _dsAll.Tables[0].DefaultView.Count; this._intBegin = this._intEnd; this._intEnd += step; if (_intEnd > count) _intEnd = count; if (_intBegin > 0) this.btn_Up.Enabled = true; else btn_Up.Enabled = false; if (_intEnd < count) this.btn_Down.Enabled = true; else btn_Down.Enabled = false; this.label6.Text = String.Format("第 {0} 行到第 {1} 行, 共 {2} 行", _intBegin + 1, _intEnd, count); SetEachRowData(); //数据获取启动线程。执行完后关闭 Thread t = new Thread(new ThreadStart(DoStandFetchReady)); t.IsBackground = true; t.Start(); this.Cursor = Cursors.Default; } private void button3_Click(object sender, System.EventArgs e) { try { if (_dsAll == null || _dsAll.Tables.Count <= 0) return; int count = _dsAll.Tables[0].DefaultView.Count; if (this.button3.Text == "全部显示") { this._intBegin = 0; this.button3.Text = "分页显示"; this.btn_Up.Enabled = false; this.btn_Down.Enabled = false; if (_intEnd == count) return; else this._intEnd = count; } else { int step = 40; try { step = Convert.ToInt32(this.txtPage.Text.Trim()); if (step < 1) throw new Exception(); } catch { MessageBox.Show("请输入正确的显示行数!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } this._intBegin = 0; if (step < count) { this._intEnd = step; this.btn_Up.Enabled = false; this.btn_Down.Enabled = true; } else { this._intEnd = count; this.btn_Up.Enabled = false; this.btn_Down.Enabled = false; this.button3.Text = "全部显示"; return; } this.button3.Text = "全部显示"; } this.Cursor = Cursors.WaitCursor; if (count == 0) { this.label6.Text = "无数据"; this.Cursor = Cursors.Default; return; } else this.label6.Text = String.Format("第 {0} 行到第 {1} 行, 共 {2} 行", _intBegin, _intEnd, count); button3.Enabled = false; SetEachRowData(); button3.Enabled = true; //数据获取启动线程。执行完后关闭 Thread t = new Thread(new ThreadStart(DoStandFetchReady)); t.IsBackground = true; t.Start(); } catch { button3.Enabled = true; } } #region " Init " // 获取所有复合成分元素列表,并大写 ArrayList ceqChemList = null; private void ELEMENTS_Load(object sender, System.EventArgs e) { try { ceqChemList = Core.LgMes.Client.lgBll.LgChemeLementMgt.LgChemeLementMgt.GetAllCeqChemByUpperChar(new ClientParamWithSqlConditionAndOpenBase("", this.ob)); } catch { } this.EMGrid.DisplayLayout.Bands[0].Columns[1].Width = 95; this.EMGrid.DisplayLayout.Bands[0].Columns[2].Width = 90; this.EMGrid.DisplayLayout.Bands[0].Columns[8].Width = 90; this.EMGrid.DisplayLayout.Bands[0].Columns[9].Width = 65; this.EMGrid.DisplayLayout.Bands[0].Columns[10].Width = 65; label6.Visible = false; EMGrid.Font = new System.Drawing.Font("Tahoma", 9F); string strErr = ""; //获取所有化学成份列名 ArrayList arry = new ArrayList(); arry.Add("FrmLgElements.select");//此ID为XML文件ID CommonClientToServer cctos = new CommonClientToServer(); cctos.ob = this.ob; DataSet dsElements = cctos.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr); if (strErr == "" && dsElements != null) { foreach (DataRow dr in dsElements.Tables[0].Rows) { dataTable1.Columns.Add(dr["BaseName"].ToString(), typeof(System.Decimal)); //添加列 } } string strElementsRow = ElementsConfig.GetElementsRow(); //调用函数获取要显示的列名 strERow = strElementsRow.Split('*'); _strDuty = Core.LgMes.Client.LgJobMgt.CStaticMethod.GetCurrentClass(this.ob).Substring(1, 1); GetCurrDuty(); uldtBeginTime.Value = DateTime.Today.ToString("yyyy-MM-dd") + " 00:00"; uldtEndTime.Value = DateTime.Today.ToString("yyyy-MM-dd") + " 23:59"; if (_devPos == "0") { this.cboGW.SelectedIndex = 1; } else { int intIndex = 1; switch (_devPos.Substring(0, 3)) { case "HMP": intIndex = 0; break; case "BOF": intIndex = 1; break; case "CAS": intIndex = 2; break; case "LFS": intIndex = 3; break; case "RHS": intIndex = 4; break; case "VDS": intIndex = 5; break; case "CCM": intIndex = 6; break; default: break; } cboGW.SelectedIndex = intIndex; } this.SetDuty(); GetDataFromAll(); StartGetDataThread(); } public delegate void UpdateUIDelegate(bool IsDataLoaded); public void GetQualityInfo(string szLH) { try { this.ultraMaskedEdit1.Text = szLH; _strWhere1 = String.Format(" where lh like '%{0}%' ", this.ultraMaskedEdit1.Text.Trim()); object obj = null; _dsAll = obj as DataSet; _dsAll.Tables[0].DefaultView.RowFilter = _dvRowFilter; SetDataToGrid(); } catch (Exception ex) { string Msg = ex.Message; } } /// /// 将数据装载到DATASET /// private void SetEachRowData() { int XH = 0; try { ArrayList deleteCol = new ArrayList(); foreach (DataColumn dc in dataTable1.Columns) { if (!_dsAll.Tables[0].Columns.Contains(dc.ColumnName.ToUpper()) && ceqChemList.Contains(dc.ColumnName.ToUpper())) { deleteCol.Add(dc.ColumnName.ToUpper()); } } // 没有的元素需要删除 foreach (string s in deleteCol) { dataTable1.Columns.Remove(s); } DataRow newRow = dataTable1.NewRow(); DataRow Drow = null; dataTable1.Clear(); int RowId = this._intBegin + 1; for (int i = this._intBegin; i < this._intEnd; i++) { newRow = dataTable1.NewRow(); Drow = _dsAll.Tables[0].DefaultView[i].Row; newRow[0] = RowId++; newRow[1] = Drow["HEATNO"].ToString(); newRow[6] = CStaticMethod.ChemelementPath(Drow["ASSAYTYPECODE"].ToString()); string strAs = Drow["ASSAYTYPECODE"].ToString(); newRow[7] = strAs.Substring(strAs.Length - 1, 1); //次数 newRow[2] = Drow["gzbm"].ToString(); if (Drow["ASSAYDATE"].ToString() != "") newRow[3] = Convert.ToDateTime(Drow["ASSAYDATE"]).ToString("yyyy-MM-dd HH:mm:ss"); newRow[5] = Drow["shiftcode"].ToString(); newRow[11] = Drow["SIMN"].ToString();//20120109 新增 foreach (DataRow dr in dtSamplesignal.Tables[0].Rows)//20150401新增 { string Strpos =analysChineseName((dr["STRPOS"].ToString().Substring(0,3))); if (dr["HEATNO"].ToString().Contains(Drow["HEATNO"].ToString()) && Strpos.Equals(newRow[6])) { if (Math.Abs(Convert.ToDouble((Convert.ToDateTime(Drow["ASSAYDATE"]) - Convert.ToDateTime(dr["UPDATE_TIME"])).TotalMinutes)) < 2) { double aaa=(Convert.ToDateTime(Drow["ASSAYDATE"]) - Convert.ToDateTime(dr["SAMPLE_DATE1"])).TotalMinutes; if ((Math.Round((Convert.ToDateTime(Drow["ASSAYDATE"]) - Convert.ToDateTime(dr["SAMPLE_DATE1"])).TotalMinutes,0)) > 0) //(Math.Round((Convert.ToDateTime(Drow["ASSAYDATE"]) - Convert.ToDateTime(dr["SAMPLE_DATE1"])).TotalMinutes, 0)) < 20) { newRow[13] = Math.Round((Convert.ToDateTime(Drow["ASSAYDATE"]) - Convert.ToDateTime(dr["SAMPLE_DATE1"])).TotalMinutes,2).ToString();//Math.Round( newRow[14] = Convert.ToDateTime(dr["SAMPLE_DATE1"]).ToString("yyyy-MM-dd HH:mm:ss"); } } } } try { foreach (DataColumn dc in _dsAll.Tables[0].Columns) { foreach (DataColumn dc1 in dataTable1.Columns) { if (dc1.ColumnName.ToUpper() == dc.ColumnName.ToUpper()) { if (Drow[dc].ToString() != "") newRow[dc1] = Drow[dc].ToString(); if (!Isbool) if (newRow[7] != "" && Drow["JUDGE_SEQ"].ToString() != "") { if (strAs.Substring(0, 1) == "G" && Convert.ToInt32(newRow[7]) == Convert.ToInt32(Drow["JUDGE_SEQ"].ToString())) { newRow[8] = Drow["JUDGE_STL_GRD"].ToString(); newRow[9] = Drow["JUDGE_RESULT"].ToString() == "1" ? "合格" : "不合格"; newRow[10] = Drow["REG_ID"].ToString(); } else { newRow[8] = null; newRow[9] = null; newRow[10] = null; } } break; } } } } catch(Exception ex) { // MessageBox.Show(ex.Message); } dataTable1.Rows.Add(newRow); SetGridRowHidden(); } /* * 修改描述:计算连铸和前工序的成份偏差 * 作者:在datatable 数据填充后再计算 * 修改日期:20131203 */ try { calculateChemelentDifference(); } catch (Exception ex) { throw ex; } } catch (Exception ex) { throw ex; } } /// /// 根据设置隐藏不要显示的列 /// private void SetGridRowHidden() { try { //新增列时,相继修改J的值(新增n列时,j=j+n),否则将不会在界面显示 for (int j = 15; j < EMGrid.DisplayLayout.Bands[0].Columns.Count; j++) { if (ceqChemList.Contains(EMGrid.DisplayLayout.Bands[0].Columns[j].Header.Caption.ToUpper())) { EMGrid.DisplayLayout.Bands[0].Columns[j].Width = 60; EMGrid.DisplayLayout.Bands[0].Columns[j].CellActivation = Activation.NoEdit; continue; } EMGrid.DisplayLayout.Bands[0].Columns[j].Hidden = true; EMGrid.DisplayLayout.Bands[0].Columns[j].Width = 60; EMGrid.DisplayLayout.Bands[0].Columns[j].CellActivation = Activation.NoEdit; EMGrid.DisplayLayout.Bands[0].Columns[0].CellActivation = Activation.AllowEdit; EMGrid.DisplayLayout.Bands[0].Columns[1].CellActivation = Activation.AllowEdit; EMGrid.DisplayLayout.Bands[0].Columns[2].CellActivation = Activation.NoEdit; EMGrid.DisplayLayout.Bands[0].Columns[3].CellActivation = Activation.NoEdit; EMGrid.DisplayLayout.Bands[0].Columns[4].CellActivation = Activation.NoEdit; EMGrid.DisplayLayout.Bands[0].Columns[5].CellActivation = Activation.NoEdit; EMGrid.DisplayLayout.Bands[0].Columns[6].CellActivation = Activation.NoEdit; EMGrid.DisplayLayout.Bands[0].Columns[7].CellActivation = Activation.NoEdit; } for (int i = 0; i < strERow.Length; i++) { if (!string.IsNullOrEmpty(strERow[i])) EMGrid.DisplayLayout.Bands[0].Columns[strERow[i]].Hidden = false; } for (int j = 0; j < strRowName.Length; j++) { EMGrid.DisplayLayout.Bands[0].Columns[strRowName[j]].Header.VisiblePosition = j + 8; } EMGrid.DisplayLayout.Bands[0].Columns[5].Header.VisiblePosition = EMGrid.DisplayLayout.Bands[0].Columns.Count; EMGrid.DisplayLayout.Bands[0].Columns[3].Header.VisiblePosition = EMGrid.DisplayLayout.Bands[0].Columns.Count; EMGrid.DisplayLayout.Bands[0].Columns[6].Header.VisiblePosition = 2; EMGrid.DisplayLayout.Bands[0].Columns[7].Header.VisiblePosition = 3; EMGrid.DisplayLayout.Bands[0].Columns[2].Header.VisiblePosition = 4; EMGrid.DisplayLayout.Bands[0].Columns[8].Header.VisiblePosition = 5; EMGrid.DisplayLayout.Bands[0].Columns[9].Header.VisiblePosition = 6; EMGrid.DisplayLayout.Bands[0].Columns[10].Header.VisiblePosition = 7; EMGrid.DisplayLayout.Bands[0].Columns[12].Header.VisiblePosition = 8; EMGrid.DisplayLayout.Bands[0].Columns[1].Header.Fixed = true; EMGrid.DisplayLayout.Bands[0].Columns[2].Header.Fixed = true; EMGrid.DisplayLayout.Bands[0].Columns[6].Header.Fixed = true; EMGrid.DisplayLayout.Bands[0].Columns[7].Header.Fixed = true; } catch { } } private void TestDs() { ClientParamWithSqlConditionAndOpenBase param = new ClientParamWithSqlConditionAndOpenBase(); param.sqlCondition = "J41-04504A_C102_S"; param.ob = this.ob; //DataSet ds = Core.LgMes.Client.lgBll.LgChemeLementMgt.LgChemeLementMgt.ReturnCeqChemByCheckNo(param); } private void SetDataToGrid() { this._intBegin = 0; //this._intEnd = Convert.ToInt32(this.txtPage.Text); if (_dsAll != null) { int count = _dsAll.Tables[0].Rows.Count; if (count <= _intEnd) { //_intEnd = count; this.btn_Up.Enabled = false; this.btn_Down.Enabled = false; this.button3.Enabled = false; } else { this.btn_Up.Enabled = false; this.btn_Down.Enabled = true; this.button3.Enabled = true; } if (count == 0) { this.label6.Text = "无数据"; this.EMGrid.Cursor = System.Windows.Forms.Cursors.Arrow; } else this.label6.Text = String.Format("第 1 行到第 {0} 行, 共 {1} 行", _intEnd, count); try { SetEachRowData(); } catch { } GetTAM_StandardElement(); // 取成分割标准对比 } else { this.label6.Text = "无数据"; } this.EMGrid.Cursor = System.Windows.Forms.Cursors.Arrow; } #endregion #region " ToolBar Event " public override void ToolBar_Click(object sender, string ToolbarKey) { switch (ToolbarKey) { case "Query": this.GetDataFromAll(); break; case "SetSampling": //设置样点 SetSampling(); break; case "SetRowName": //设置化学成份字段显示 SetRowName(); break; case "Export": if (EMGrid.Rows.Count > 0) { ExportExcel(); } else MessageBox.Show("没有化学成分信息。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); break; case "Exit": this.Close(); break; default: break; } base.ToolBar_Click(sender, ToolbarKey); } /// /// 设置化学成份列名 /// private void SetRowName() { DataSet dsElements = new DataSet(); //定义一个ArrayList集合存储变量[参数]值 ArrayList arry = new ArrayList(); arry.Add("FrmSetRowName.select"); //调用服务端方法 CoreClientParam CCP_Sampling = new CoreClientParam(); DataTable dt = new DataTable(); CCP_Sampling.ServerName = "Core.LgMes.Server.Common.ComDBQuery"; CCP_Sampling.MethodName = "doSimpleQuery"; CCP_Sampling.ServerParams = new object[] { arry }; CCP_Sampling.SourceDataTable = dt; this.ExecuteQueryToDataTable(CCP_Sampling, CoreInvokeType.Internal); if (dt != null) { if (dt.Rows.Count > 0) { dt.Rows[0].Table.Columns.Add(new DataColumn("选择", typeof(System.Boolean))); foreach (DataRow dr in dt.Rows) { dr["选择"] = false; } frmConfigElementsRow frm = new frmConfigElementsRow(); frm.StartPosition = FormStartPosition.CenterScreen; frm.WindowState = FormWindowState.Normal; dsElements.Tables.Add(dt); frm._dsSet = dsElements; frm.ShowDialog(); // 判断是否有设置 if (frm._setFlag) { string strElementsRow = ElementsConfig.GetElementsRow(); //调用函数获取要显示的列名 strERow = strElementsRow.Split('*'); GetDataFromAll(); } } else MessageBox.Show("查询失败!!!", "提示"); } } /// /// 显示样点 /// private void SetSampling() { DataTable dt = new DataTable(); if (dataSet1 != null) { _dsSet = new DataSet(); //定义一个ArrayList集合存储变量[参数]值 ArrayList arry = new ArrayList(); arry.Add("FrmSetSamplin.select");//此ID为XML文件ID //调用服务端方法 CoreClientParam CCP_Sampling = new CoreClientParam(); CCP_Sampling.ServerName = "Core.LgMes.Server.Common.ComDBQuery"; CCP_Sampling.MethodName = "doSimpleQuery"; CCP_Sampling.ServerParams = new object[] { arry }; CCP_Sampling.SourceDataTable = dt; this.ExecuteQueryToDataTable(CCP_Sampling, CoreInvokeType.Internal); dt.Rows[0].Table.Columns.Add(new DataColumn("工序名", typeof(System.String))); dt.Rows[0].Table.Columns.Add(new DataColumn("选择", typeof(System.Boolean))); foreach (DataRow dr in dt.Rows) { string SetColumn = dr["ASSAYTYPECODE"].ToString().Substring(0, 2); dr["ASSAYTYPECODE"] = dr["ASSAYTYPECODE"].ToString(); dr["工序名"] = analysPath(SetColumn, dr["ASSAYTYPECODE"].ToString()); dr["选择"] = true; } } _dsSet.Tables.Add(dt); frmSetSampling frm = new frmSetSampling(); frm._dsSet = _dsSet; frm.ShowDialog(); if (frm._setFlag) { _dsSet = frm._dsSet; _dsSet.AcceptChanges(); _dvRowFilter = ""; foreach (DataRow dr in _dsSet.Tables[0].Rows) { if (Convert.ToBoolean(dr["选择"]) == true) { _dvRowFilter += string.Format("or assaytypecode = '{0}' ", dr[0].ToString()); } } if (_dvRowFilter.Length > 0) { _dvRowFilter = _dvRowFilter.Substring(2, _dvRowFilter.Length - 2); } GetDataFromAll(); } } private void ExportExcel() { try { string StrfileName = System.Windows.Forms.Application.StartupPath + "\\Report\\成分明细.xls"; this.GridExcelExporter.Export(this.EMGrid, 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文件夹 ],如果没有请手动创建!"); } } #endregion private void HiddCeqColumn() { bool flag = false; try { foreach (UltraGridColumn col in this.EMGrid.DisplayLayout.Bands[0].Columns) { flag = false; if (!this.ceqChemList.Contains(col.Header.Caption.ToUpper())) { continue; } foreach (UltraGridRow ugr in this.EMGrid.Rows) { if (ugr.Cells[col.Header.Caption].Value.ToString().Length > 0) { flag = true; break; } } this.EMGrid.DisplayLayout.Bands[0].Columns[col.Header.Caption].Hidden = (flag) ? false : true; } } catch { } } private void AddCeqToDataTable(ref DataTable dt) { Hashtable hsCeq = null; Hashtable tb = null; ClientParamWithSqlConditionAndOpenBase param = new ClientParamWithSqlConditionAndOpenBase(); param.ob = this.ob; if (dt == null || dt.Rows.Count == 0) return; // 先获取所有的复合成分,减少后续扫描数据库的循环 DataSet dsChemCeqByHeatno = Core.LgMes.Client.lgBll.LgChemeLementMgt.LgChemeLementMgt.GetCeqChem(new ClientParamWithSqlConditionAndOpenBase(string.Format(" and ASSAYDATE >= '{0}' ", this.uldtBeginTime.DateTime.ToString("yyyy-MM-dd HH:mm:ss")), this.ob)); if (dsChemCeqByHeatno == null || dsChemCeqByHeatno.Tables[0].Rows.Count == 0) return; foreach (DataRow dr in dt.Rows) { // g根据炉号和化验时间过滤复合元素,唯一的 DataView dv = dsChemCeqByHeatno.Tables[0].DefaultView; dv.RowFilter = string.Format("HEATNO = '{0}' and ASSAYDATE = '{1}'", dr["HEATNO"].ToString(), dr["ASSAYDATE"].ToString()); if (dv.Count == 0) continue; param.param = null; param.param = new Object[] { dr["HEATNO"].ToString(), dr["ASSAYDATE"].ToString(),dv.ToTable() }; tb = Core.LgMes.Client.lgBll.LgChemeLementMgt.LgChemeLementMgt.ReturnCeqChemByHeatNoAndAssDate(param); if (tb == null || tb.Count == 0) continue; // 获取该记录的复合成分列表 hsCeq = tb[dr["HEATNO"].ToString() + dr["ASSAYDATE"].ToString()] as Hashtable; if (hsCeq != null && hsCeq.Count > 0) { foreach (string s in hsCeq.Keys) { // 表没有复合成分名称,新增 if (!dt.Columns.Contains(s)) { dt.Columns.Add(new DataColumn(s, System.Type.GetType("System.String"))); } try { // 同步新增显示数据的表结构 if (!this.dataTable1.Columns.Contains(s)) { this.dataTable1.Columns.Add(new DataColumn(s, System.Type.GetType("System.String"))); } } catch { } // 赋值 dr[s] = hsCeq[s].ToString(); } } } } #region " 直接打开界面 或 查询 " public void GetDataFromAll() { List listIngr = null; try { listIngr = Core.LgMes.Client.lgBll.LgChemeLementMgt.LgChemeLementMgt.GetTbb01SeqIngrAll(new ClientParamWithSqlConditionAndOpenBase("",this.ob)); } catch { } string strFindName = ""; for (int i = 0; i < strERow.Length; i++) { if (!string.IsNullOrEmpty(strERow[i])) strFindName = strFindName + "," + strERow[i]; } try { if (Convert.ToDateTime(uldtEndTime.Value) < Convert.ToDateTime(uldtBeginTime.Value)) { MessageBox.Show("结束时间必须大于等于开始时间!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } GetPost(); GetDuty(); if (this.ultraMaskedEdit1.Text.Trim().Length > 0 || this.ultraMaskedEdit2.Text.Trim().Length > 0) BuildSQLWithID(); else BuildSQLWithOutID(); _dsAll = new DataSet(); //定义一个ArrayList集合存储变量[参数]值 ArrayList arry = new ArrayList(); ArrayList sqlList = new ArrayList(); if (Isbool) { arry.Add("FrmHMPElements_Query.select"); } else { arry.Add("FrmLgElements_Query.select"); } sqlList.Add(strFindName); //sqlList.Add(_strWhere1); //sqlList.Add(_strWhere1); sqlList.Add(_szTableName);//表名 sqlList.Add("J#" + _szTableName);//表名 sqlList.Add("and ASSAYDATE between to_date('" + this.uldtBeginTime.DateTime.ToString("yyyy-MM-dd HH:mm:ss") + "', 'yyyy-mm-dd hh24:mi:ss') and to_date('" + this.uldtEndTime.DateTime.ToString("yyyy-MM-dd HH:mm:ss") + "','yyyy-mm-dd hh24:mi:ss')");//时间 sqlList.Add("and ASSAYDATE between to_date('" + this.uldtBeginTime.DateTime.ToString("yyyy-MM-dd HH:mm:ss") + "', 'yyyy-mm-dd hh24:mi:ss') and to_date('" + this.uldtEndTime.DateTime.ToString("yyyy-MM-dd HH:mm:ss") + "','yyyy-mm-dd hh24:mi:ss')"); sqlList.Add(_strWhere2); //调用服务端方法 CoreClientParam CCP_LgEts = new CoreClientParam(); DataTable dt = new DataTable(); CCP_LgEts.ServerName = "Core.LgMes.Server.Common.ComDBQuery"; CCP_LgEts.MethodName = "doQuery"; CCP_LgEts.ServerParams = new object[] { arry, sqlList }; CCP_LgEts.SourceDataTable = dt; this.ExecuteQueryToDataTable(CCP_LgEts, CoreInvokeType.Internal); DataTable dtTemp = dt.Copy(); //获取炉号 dtSamplesignal = this.ObtainSamplesignal(dtTemp); // 增加复合元素 try { AddCeqToDataTable(ref dt); } catch { dt = dtTemp; } _dsAll.Tables.Add(dt); _dsAll.Tables[0].DefaultView.RowFilter = _dvRowFilter; DataRow[] row = _dsAll.Tables[0].Select(_dvRowFilter); int currrow = row.Length; if (currrow < 40) { this._intEnd = currrow; } else { _intEnd = Convert.ToInt32(this.txtPage.Text.Trim()); } // _intEnd = 4000; SetDataToGrid(); } catch (Exception ex) { Debug.WriteLine(ex.Message); } } #endregion #region " 从作业管理打开界面 " public void GetDataFromCurr() { try { GetCurrDuty(); _dsAll = null; //定义一个ArrayList集合存储变量[参数]值 ArrayList arry = new ArrayList(); arry.Add("frmSysteLog.select"); //调用服务端方法 CoreClientParam CCP_SysLog = new CoreClientParam(); DataTable dt = new DataTable(); CCP_SysLog.ServerName = "Core.LgMes.Server.Common.ComDBQuery"; CCP_SysLog.MethodName = "doSimpleQuery"; CCP_SysLog.ServerParams = new object[] { arry }; CCP_SysLog.SourceDataTable = dt; this.ExecuteQueryToDataTable(CCP_SysLog, CoreInvokeType.Internal); _dsAll.Tables[0].DefaultView.RowFilter = _dvRowFilter; SetPost(); SetDuty(); SetDataToGrid(); } catch { } } private void GetCurrDuty() { try { string strErr = ""; string strDuty = ""; ArrayList arry = new ArrayList(); arry.Add("GetClassCode.query"); CommonClientToServer cctos = new CommonClientToServer(); cctos.ob = this.ob; DataSet ds = cctos.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr); strDuty = ds.Tables[0].Rows[0]["mes"].ToString(); _strDuty = strDuty.Substring(1, 1); return; } catch { } _strDuty = "0"; } #endregion #region " SQL " private void BuildSQLWithOutID() { string begTime = this.uldtBeginTime.DateTime.ToString("yyyy-MM-dd HH:mm:ss"); string endTime = this.uldtEndTime.DateTime.ToString("yyyy-MM-dd HH:mm:ss"); string strStartTime = ""; string strEndTime = ""; if (Convert.ToDateTime(uldtBeginTime.Text.Trim()) > Convert.ToDateTime(uldtEndTime.Text.Trim())) { MessageBox.Show("选择的开始时间不能大于结束时间!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); return; } else { strStartTime = this.uldtBeginTime.DateTime.ToString("yyyy-MM-dd HH:mm:ss"); strEndTime = this.uldtEndTime.DateTime.ToString("yyyy-MM-dd HH:mm:ss"); } if (_devPos.Substring(0, 3) == "HMP" || _devPos.Substring(0, 4) == "SYGW")// 铁水 或者 所有岗位 { _strWhere2 = " where a.hudwid = b.heatno and to_char(b.ASSAYDATE, 'yyyy-MM-dd HH:mm:ss') between '" + strStartTime + "' and '" + strEndTime + "' "; Isbool = true; } else { _strWhere2 = " where b.HEATNO = a.HEATNO and to_char(b.ASSAYDATE, 'yyyy-MM-dd HH:mm:ss') between '" + strStartTime + "' and '" + strEndTime + "' "; Isbool = false; } string str = this._devPos.Substring(0, 3), szWZ = this._devPos.Substring(3, 2); if (this._strDuty != "0" && str != "HMP") _strWhere2 += string.Format(" and substr(a.SHIFTCODE,2,1) = '{0}' ", this._strDuty); if (str != "HMP" && szWZ != "00" && str != "SYG") _strWhere2 += string.Format(" and a.stationcode = '{0}'", szWZ); if (txtSteel.Text.Trim() != "") str = txtSteel.Text.ToString(); else str = ""; if (str != "") { string strSteeAll = ""; string[] strSteel = str.Split(','); for (int i = 0; i < strSteel.Length; i++) { if (!string.IsNullOrEmpty(strSteel[i])) strSteeAll = strSteeAll + "'" + strSteel[i] + "',"; } str = strSteeAll.Substring(0, strSteeAll.Length - 1); _strWhere2 += string.Format(" and a.plansteel in ({0})", str); } //气体样 if (chkGasSample.Checked) { _strWhere2 += " and (N>0 or H>0 or O>0) "; } } private void BuildSQLWithID() { string begTime = this.uldtBeginTime.DateTime.ToString("yyyy-MM-dd HH:mm:ss"); string endTime = this.uldtEndTime.DateTime.ToString("yyyy-MM-dd HH:mm:ss"); string strStartTime = ""; string strEndTime = ""; if (Convert.ToDateTime(uldtBeginTime.Text.Trim()) > Convert.ToDateTime(uldtEndTime.Text.Trim())) { MessageBox.Show("选择的开始时间不能大于结束时间!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); return; } else { strStartTime = this.uldtBeginTime.DateTime.ToString("yyyy-MM-dd HH:mm:ss"); strEndTime = this.uldtEndTime.DateTime.ToString("yyyy-MM-dd HH:mm:ss"); } //熔炼号从 if (this.ultraMaskedEdit1.Text.Length == 0) { _strWhere2 = String.Format(" where a.HEATNO like '%{0}%' ", this.ultraMaskedEdit2.Text.Trim()); } else { if (this.ultraMaskedEdit2.Text.Length == 0) { _strWhere2 = String.Format(" where a.HEATNO like '%{0}%' ", this.ultraMaskedEdit1.Text.Trim()); } else { _strWhere2 = String.Format(" where a.HEATNO between '{0}' and '{1}' ", this.ultraMaskedEdit1.Text.Trim(), this.ultraMaskedEdit2.Text.Trim()); } } if (_devPos.Substring(0, 3) == "HMP" || _devPos.Substring(0, 4) == "SYGW") { _strWhere2 += " "; Isbool = true; } else { Isbool = false; _strWhere2 += " and b.HEATNO = a.HEATNO and to_char(b.ASSAYDATE, 'yyyy-MM-dd HH:mm:ss') between '" + strStartTime + "' and '" + strEndTime + "'"; } string str = this._devPos.Substring(0, 3), szWZ = this._devPos.Substring(4, 1); if (this._strDuty != "0" && str != "HMP") _strWhere2 += string.Format(" and substr(a.SHIFTCODE,2,1) = '{0}' ", this._strDuty); if (txtSteel.Text.Trim() != "") str = txtSteel.Text.ToString(); else str = ""; if (str != "") { string strSteeAll = ""; string[] strSteel = str.Split(','); for (int i = 0; i < strSteel.Length; i++) { if (!string.IsNullOrEmpty(strSteel[i])) strSteeAll = strSteeAll + "'" + strSteel[i] + "',"; } str = strSteeAll.Substring(0, strSteeAll.Length - 1); _strWhere2 += string.Format(" and a.plansteel in ({0})", str); } //气体样 if (chkGasSample.Checked) { _strWhere2 += " and (N>0 or H>0 or O>0) "; } } #endregion #region " ComboBox Event " private object[] GetComboBox2Items(int index) { switch (index) { case 1: return new object[] { "所有", "1#转炉", "2#转炉", "3#转炉" }; case 2: return new object[] { "所有", "1#吹氩站", "2#吹氩站", "3#吹氩站" }; case 3: return new object[] { "所有", "1#精炼炉", "2#精炼炉" }; case 4: return new object[] { "所有", "1#RH炉" }; case 5: return new object[] { "所有", "1#连铸", "2#连铸", "3#连铸", "4#连铸" }; default: return new object[] { "所有铁水" }; } } #endregion #region " Common Event " private Color SetRowBackColor(UltraGridRow ugr, Color frc, bool ifSame) { Color c; if (ifSame) { c = frc; } else { if (frc == c1) c = c2; else c = c1; } ugr.Appearance.BackColor = c; return c; } private void SetMaskText() { try { this.ultraMaskedEdit1.Text = ""; this.ultraMaskedEdit2.Text = ""; if (this._devPos.Substring(0, 3) == "BOF" || this._devPos.Substring(0, 3) == "CAS") { int count = _dsAll.Tables[0].Rows.Count; if (count > 1) { this.ultraMaskedEdit1.Text = _dsAll.Tables[0].Rows[count - 1]["LH"].ToString(); this.ultraMaskedEdit2.Text = _dsAll.Tables[0].Rows[0]["LH"].ToString(); } else if (count == 1) { this.ultraMaskedEdit1.Text = _dsAll.Tables[0].Rows[count - 1]["LH"].ToString(); } } } catch { } } private void GetPost() { this._devPos = ""; switch (this.cboGW.SelectedIndex) { case 0: this._devPos = "HMP0"; this._szTableName = "STL_HMP_OPTINFO"; break; case 1: this._devPos = "BOF0"; this._szTableName = "STL_BOF_OPTINFO"; break; case 2: this._devPos = "CAS0"; this._szTableName = "STL_CAS_OPTINFO"; break; case 3: this._devPos = "LFS0"; this._szTableName = "STL_LFS_OPTINFO"; break; case 4: this._devPos = "RHS0"; this._szTableName = "STL_RHS_OPTINFO"; break; case 5: this._devPos = "VDS0"; this._szTableName = "STL_VDS_OPTINFO"; break; case 6: this._devPos = "CCM0"; this._szTableName = "STL_CCM_OPTINFO"; break; default: this._devPos = "SYGW"; // 所有岗位 this._szTableName = ""; break; } this._devPos += this.comboBox2.Value.ToString(); } private string GetTableName() { string szTableName = ""; switch (_devPos.Substring(0, 3)) { case "HMP": szTableName = "STL_HMP_OPTINFO"; break; case "BOF": szTableName = "STL_BOF_OPTINFO"; break; case "CAS": szTableName = "STL_CAS_OPTINFO"; break; case "LFS": szTableName = "STL_LFS_OPTINFO"; break; case "CCM": szTableName = "STL_CCM_OPTINFO"; break; default: break; } return szTableName; } /// /// 设置设备选择框 /// private void SetPost() { this._devPos = CurrectDevPos(this._devPos); if (_devPos.Length < 5) return; switch (_devPos.Substring(0, 3)) { case "HMP": this.cboGW.SelectedIndex = 0; break; case "BOF": this.cboGW.SelectedIndex = 1; break; case "CAS": this.cboGW.SelectedIndex = 2; break; case "LFS": this.cboGW.SelectedIndex = 3; break; case "RHS": this.cboGW.SelectedIndex = 4; break; case "CCM": this.cboGW.SelectedIndex = 5; break; } this.comboBox2.SelectedIndex = Convert.ToInt32(_devPos.Substring(4, 1)); } private void GetDuty() { this._strDuty = this.cmb_BZ.SelectedIndex.ToString(); } /// /// 设置班组下拉框 /// private void SetDuty() { try { this.cmb_BZ.SelectedIndex = Convert.ToInt32(this._strDuty); } catch { } } private string CurrectDevPos(string devPos) { if (devPos.Length < 5) return ""; if (devPos.Substring(0, 3) == "BOF") { switch (devPos.Substring(4, 1)) { case "7": devPos = devPos.Replace("7", "1"); break; case "8": devPos = devPos.Replace("8", "2"); break; case "9": devPos = devPos.Replace("9", "3"); break; } } return devPos; } #endregion #region " Auto Refresh " private Thread _getDataThread; private bool On_Off_GetDataThread = false; private delegate void getDataFromAllDelegate(); private void StartGetDataThread() { try { ThreadStart ts = new ThreadStart(GetDataThread); _getDataThread = new Thread(ts); _getDataThread.Name = "GetDataThread "; _getDataThread.Start(); } catch { } } private void GetDataThread() { ReStartGetDataThread: while (true) { if (!this.On_Off_Thread || !On_Off_GetDataThread) { System.Threading.Thread.Sleep(500); continue; } try { this.Invoke(new getDataFromAllDelegate(GetDataFromAll)); System.Threading.Thread.Sleep(3000); } catch { } } goto ReStartGetDataThread; } private void chkRefresh_CheckedChanged(object sender, EventArgs e) { On_Off_GetDataThread = this.chkRefresh.Checked; } #endregion private int nRow = -1; private Color c3 = Color.White; private bool bColor = false; private void EMGrid_Click(object sender, System.EventArgs e) { if (this.EMGrid.ActiveRow != null) { foreach (Infragistics.Win.UltraWinGrid.UltraGridRow rw in this.EMGrid.Rows) { if (rw.Appearance.BackColor == Color.LightBlue) rw.Appearance.BackColor = Color.White; } if (bColor) { if (nRow < EMGrid.Rows.Count) this.EMGrid.Rows[nRow].Appearance.BackColor = c3; } else { bColor = true; } c3 = this.EMGrid.ActiveRow.Appearance.BackColor; nRow = this.EMGrid.ActiveRow.Index; this.EMGrid.ActiveRow.Appearance.BackColor = Color.LightBlue; } } #endregion private void cboGW_SelectionChanged(object sender, EventArgs e) { comboBox2.Items.Clear(); int index; index = cboGW.SelectedIndex; switch (index) { case 1: comboBox2.Items.Add(0, "所有"); comboBox2.Items.Add(1, "1#转炉"); comboBox2.Items.Add(2, "2#转炉"); break; case 2: comboBox2.Items.Add(0, "所有"); comboBox2.Items.Add(1, "1#吹氩站"); comboBox2.Items.Add(2, "2#吹氩站"); break; case 3: comboBox2.Items.Add(0, "所有"); comboBox2.Items.Add(1, "1#精炼炉"); comboBox2.Items.Add(2, "2#精炼炉"); break; case 4: comboBox2.Items.Add(0, "所有"); comboBox2.Items.Add(1, "RH炉"); break; case 5: comboBox2.Items.Add(0, "所有"); comboBox2.Items.Add(1, "VD炉"); break; case 6: comboBox2.Items.Add(0, "所有"); comboBox2.Items.Add(1, "1#连铸"); comboBox2.Items.Add(2, "2#连铸"); comboBox2.Items.Add(3, "3#连铸"); break; default: comboBox2.Items.Add(0, "所有铁水"); break; } comboBox2.SelectedIndex = 0; } /// /// 解析作业路线 /// /// 路线代码 /// public string analysPath(string craftPath, string strPath) { string path = "", strcPath = ""; strcPath = strPath; try { string StationCode = craftPath.Substring(0, 2); string strCS = ""; if (strPath.Length < 5) { strCS = strcPath.Substring(2, 2); } else if (strPath.Length > 5 && strcPath.Length < 7) { strCS = strcPath.Substring(2, 4); } else strCS = strcPath.Substring(2, 3); switch (StationCode) { case "B0": path = "脱硫" + Convert.ToInt32(strCS) + "次样"; break; case "B1": path = "1#脱硫" + Convert.ToInt32(strCS) + "次样"; break; case "B2": path = "2#脱硫" + Convert.ToInt32(strCS) + "次样"; break; case "C0": path = "转炉" + Convert.ToInt32(strCS) + "次样"; break; case "C1": path = "1#转炉" + Convert.ToInt32(strCS) + "次样"; break; case "C2": path = "2#转炉" + Convert.ToInt32(strCS) + "次样"; break; case "D0": path = "吹氩" + Convert.ToInt32(strCS) + "次样"; break; case "D1": path = "1#吹氩" + Convert.ToInt32(strCS) + "次样"; break; case "D2": path = "2#吹氩" + Convert.ToInt32(strCS) + "次样"; break; case "DQ": path = "CAS前" + Convert.ToInt32(strCS) + "次样"; break; case "DH": path = "CAS后" + Convert.ToInt32(strCS) + "次样"; break; case "E0": path = "LF炉" + Convert.ToInt32(strCS) + "次样"; break; case "E1": path = "1#LF炉" + Convert.ToInt32(strCS) + "次样"; break; case "E2": path = "2#LF炉" + Convert.ToInt32(strCS) + "次样"; break; case "F0": path = "RH炉" + Convert.ToInt32(strCS) + "次样"; break; case "F1": path = "RH炉" + Convert.ToInt32(strCS) + "次样"; break; case "I0": path = "VD炉" + Convert.ToInt32(strCS) + "次样"; break; case "I1": path = "VD炉" + Convert.ToInt32(strCS) + "次样"; break; case "GP": path = "连铸" + Convert.ToInt32(strCS) + "次样"; ; break; } } catch { } return path; } private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e) { } /// /// /// /// /// 计算成份偏差主体 /// private void doInitChemelentDifference( string vHeatNo) { try { DataTable dt = this.dataTable1; DataView dv = new DataView(dt); dv.RowFilter = string.Format(" 熔炼号 = '{0}'", vHeatNo); DataRow drTemp = null; DataRow drSource = null; DataRow dr = dt.NewRow(); if (dv != null && dv.Table.Rows.Count > 0) { dv.Sort = "化验时间 desc"; } if (dv.ToTable().Rows[0]["Station"].ToString().Contains("连铸") && dv.ToTable().Rows.Count >= 2) { drSource = dv.ToTable().Rows[0]; drTemp = dv.ToTable().Rows[1]; if (drTemp["Station"].ToString().Contains("连铸") && dv.ToTable().Rows.Count >= 3) { drTemp = dv.ToTable().Rows[2]; } } else return; for (int i = 0; i < drSource.Table.Columns.Count; i++) { try { if (Convert.ToDouble(drSource[i].ToString()) > 0) { dr[i] = Math.Round(Convert.ToDouble(drSource[i].ToString()) - Convert.ToDouble(drTemp[i].ToString()), 4); } } catch { dr[i] = drSource[i]; } } dr["Station"] = "成分偏差"; dr["SumTime"] = 1; dr["shiftcode"] = drSource["shiftcode"]; //20150401 dr["CM"] = ""; dr["SAMPLE_DATE1"] = ""; System.DateTime dtime = Convert.ToDateTime(dr["化验时间"].ToString()); dtime.AddMinutes(1); dr["化验时间"] = dtime.ToString(); dt.Rows.Add(dr); dt.AcceptChanges(); } catch(Exception ex) { } } /// /// /// /// /// 获取带有连铸信息的所有炉号 /// 返回list private ArrayList getHeatNo() { ArrayList list = new ArrayList(); foreach (DataRow dr in dataTable1.Rows) { if (!list.Contains(dr["熔炼号"].ToString()) && dr["Station"].ToString().Contains("连铸")) { list.Add(dr["熔炼号"].ToString()); } } return list; } /// /// /// /// /// 计算连铸工序和前道工序的成份偏差 private void calculateChemelentDifference() { ArrayList list = this.getHeatNo(); foreach (string s in list) { this.doInitChemelentDifference(s); } DataTable tbTemp = new DataTable(); tbTemp.Merge(this.dataTable1); DataView dv = new DataView(tbTemp); dv.Sort = "熔炼号 desc,化验时间 asc"; this.dataTable1.Clear(); this.dataTable1.Merge(dv.ToTable()); } private void button1_Click(object sender, EventArgs e) { } private void button1_Click_1(object sender, EventArgs e) { try { ClientParamWithSqlConditionAndOpenBase param = new ClientParamWithSqlConditionAndOpenBase(); param.param = new object[] { this.uldtBeginTime.DateTime.ToString("yyyy-MM-dd HH:mm:ss") , this.uldtEndTime.DateTime.ToString("yyyy-MM-dd HH:mm:ss")}; param.ob = this.ob; Core.LgMes.Client.lgBll.LgChemeLementMgt.LgChemeLementMgt.Insert_StlChemelementCeq(param); } catch { } } #region 20150401 新增送样时间,化验时间差 private DataSet ObtainSamplesignal(DataTable dtTemp) { List heatNoList =removeDuplicate( GetColumnStringValueFromDataSourceByColumnName(dtTemp,"HEATNO")); string sqlCondition = GetSqlConditionFromHeatNoList(heatNoList); DataSet dt= MethodCallService(sqlCondition); return dt; } public DataSet MethodCallService(string sqlCondition) { DataSet ds = new DataSet(); string strErr=""; string strSql = string.Format(@"select * from (select * from stl_air_samplesignal where {0} union all select * from J#stl_Air_Samplesignal where {0}) order by SAMPLE_DATE1", sqlCondition); CommonClientToServer cctos = new CommonClientToServer(); cctos.ob = this.ob; ds = cctos.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBExecute", "doSimpleQuery", strSql, out strErr); return ds; } public List GetColumnStringValueFromDataSourceByColumnName(DataTable dsSource, string columnName) { List list = new List(); if (dsSource == null || dsSource.Rows.Count == 0 || columnName.Length == 0) return list; if (!dsSource.Columns.Contains(columnName.ToUpper())) return list; try { foreach (DataRow dr in dsSource.Rows) { try { list.Add(dr[columnName.ToUpper()].ToString()); } catch { break; } } } catch { } return list; } private List removeDuplicate(List lists) { for (int i = 0; i < lists.Count; i++) { for (int j = lists.Count - 1; j >= 0; j--) { if (i != j) { if (lists[i] == lists[j]) { lists.Remove(lists[j]); } } } } return lists; } /// /// 拼接查询条件 /// /// /// private string GetSqlConditionFromHeatNoList(List heatNoList) { string strSqlHeatno = ""; string strsqlwhere = ""; string strsql = ""; foreach (string heatno in heatNoList) { strSqlHeatno = "heatno = '" + heatno + "' or "; strsqlwhere += strSqlHeatno; } strsql = strsqlwhere +" 1 = 2"; return strsql; } public int Count(DataSet ds) { try { return ds.Tables[0].Rows.Count; } catch { } return 0; } /// /// 根据岗位号获取工序中文名 /// /// 岗位编码 /// 工序中文名 public string analysChineseName(string _DEVICE_POSITION) { string strChineseName = ""; //工序代码 if (!string.IsNullOrEmpty(_DEVICE_POSITION)) { switch (_DEVICE_POSITION.Substring(0, 3)) { case "HMP": strChineseName = "脱硫站"; break; case "BOF": strChineseName = "转炉"; break; case "CAS": strChineseName = "吹氩站"; break; case "LFS": strChineseName = "LF炉"; break; case "RHS": strChineseName = "RH炉"; break; case "VDS": strChineseName = "VD炉"; break; case "CCM": strChineseName = "连铸"; break; default: break; } } return strChineseName; } DataSet dtSamplesignal = null; #endregion } }