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 Core.StlMes.Client.LgCommon; using Core.Mes.Client.Comm.Control; //using Core.StlMes.Client.LgIntegrationQuery; namespace Core.StlMes.Client.LgIntegrationQuery { /// /// ELEMENTS 的摘要说明。 /// public class frmLgElements2 : 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 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" }; 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 UltraMaskedEdit ultraMaskedEdit1; #endregion private int nRow = -1; private Color c3 = Color.White; private bool bColor = false; private Hashtable tabResult; private Hashtable tabSteel; private Hashtable tabChement; private CheckBox chkHeatbo; private CheckBox checkBox1; private DataSet dsStand = new DataSet(); private string _strGW = ""; private DataSet _dsAll = new DataSet(); private DataSet _dsSet; private int _intBegin = 0; private int _intEnd = 40; private string _strDuty = "0"; private string _strDuty1 = "11"; private string _dvRowFilter = ""; private string _strWhere1 = ""; private string _strWhere2 = ""; private string _strWhere3 = ""; private string _orderby = ""; private string _szTableName = ""; public string _devPos = "0"; private Color c1 = Color.PaleGreen; private Color c2 = Color.White; public delegate void UpdateUIDelegate(bool IsDataLoaded); public frmLgElements2(string szPost) { InitializeComponent(); this._devPos = szPost; } public frmLgElements2() { // // Windows 窗体设计器支持所必需的 // InitializeComponent(); } public frmLgElements2(string szEntry, string szLH) { InitializeComponent(); this._devPos = StrPost; this.m_szEntry = szEntry; this.ultraMaskedEdit1.Text = szLH; } private void ELEMENTS_Load(object sender, System.EventArgs e) { 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); //_strDuty = Core.StlMes.Client.LgCommon.ClsBusinessPack.GetCurrentClass("2", this.ob); GetCurrDuty(); GetElementCode(); getElements(); InitSteel(); pro_QueryStandChe(); GetDudgeResult(); uldtBeginTime.Value = DateTime.Today.ToString("yyyy-MM-dd") + " 00:00:00"; uldtEndTime.Value = DateTime.Today.ToString("yyyy-MM-dd") + " 23:59:59"; initPos(); // this.SetDuty(); GetDataFromAll(); StartGetDataThread(); this.cmb_BZ.SelectedIndex = 0; } private void initPos() { try { if (_devPos.Length == 5) { 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; break; case "CCM": intIndex = 4; break; default: break; } cboGW.SelectedIndex = intIndex; try { comboBox2.SelectedIndex = Convert.ToInt16(_devPos.Substring(4, 1)); } catch { } } else { this.cboGW.SelectedIndex = 1; } } catch { } } /// /// 查询元素的编码 /// public void GetElementCode() { try { string strErr = ""; ArrayList arry = new ArrayList(); arry.Add("BaseInfoChement.select"); arry.Add("1005"); //复合元素 arry.Add("1006"); //单一元素 CommonClientToServer ccs = new CommonClientToServer(); ccs.ob = this.ob; DataSet ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr); tabChement = new Hashtable(); string strCode = ""; string strName = ""; if (ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { strCode = ds.Tables[0].Rows[i]["BASECODE"].ToString(); strName = ds.Tables[0].Rows[i]["BASENAME"].ToString(); tabChement.Add(strCode, strName); } } } catch { } } // 获取所有化学成份列名 /// /// 获取所有化学成份列名 /// private void getElements() { try { string strElementsRow = ElementsConfig.GetElementsRow(); //调用函数获取要显示的列名 strERow = strElementsRow.Split('*'); for (int i = 0; i < strERow.Length; i++) { dataTable1.Columns.Add(strERow[i], typeof(System.Decimal)); //添加列 } //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)); //添加列 // } //} } catch { } } /// /// 初始化Grind牌号 /// private void InitSteel() { try { string strErr = ""; EMGrid.DisplayLayout.ValueLists.Add("SteelCode"); EMGrid.DisplayLayout.ValueLists.Add("JUDGE_STL_GRD"); ArrayList arry = new ArrayList(); arry.Add("ElementsSteel.Query");//此ID为XML文件ID CommonClientToServer cctos = new CommonClientToServer(); cctos.ob = this.ob; DataSet dsSteel = cctos.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr); if (strErr == "" && dsSteel != null) { //SetColumnModeSteel(EMGrid, dsSteel); tabSteel = new Hashtable(); //初始经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.ValueLists["JUDGE_STL_GRD"].ValueListItems.Add(dsSteel.Tables[0].Rows[i]["SteelCode"].ToString(), dsSteel.Tables[0].Rows[i]["Steel"].ToString()); tabSteel.Add(dsSteel.Tables[0].Rows[i]["SteelCode"].ToString(), dsSteel.Tables[0].Rows[i]["Steel"].ToString()); } //绑定单位 EMGrid.DisplayLayout.Bands[0].Columns["计划牌号"].ValueList = EMGrid.DisplayLayout.ValueLists["SteelCode"]; EMGrid.DisplayLayout.Bands[0].Columns["JUDGE_STL_GRD"].ValueList = EMGrid.DisplayLayout.ValueLists["JUDGE_STL_GRD"]; } } catch { } } // 获取各牌号化学成分标准 /// /// 获取各牌号化学成分标准 /// private void pro_QueryStandChe() { try { string strErr = ""; ArrayList arry = new ArrayList(); CommonClientToServer ccTos = new CommonClientToServer(); ccTos.ob = this.ob; dsStand = ccTos.ExecuteQueryFunctionsSqlID("Core.Mes.Server.Common.ComDataAccess", "QueryWithParameter", "STL_CHE0001", 5, arry, out strErr); //if (strErr == "" && ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) //{ // hashLD.Clear(); // for (int i = 0; i < ds.Tables[0].Rows.Count; i++) // { // if (!hashLD.Contains(ds.Tables[0].Rows[i]["CHARGENO"].ToString())) // { // hashLD.Add(ds.Tables[0].Rows[i]["CHARGENO"].ToString(), ds.Tables[0].Rows[i]["TAREWEIGHT"].ToString()); // } // ultraLD.Items.Add(ds.Tables[0].Rows[i]["CHARGENO"].ToString()); // ultraSLD.Items.Add(ds.Tables[0].Rows[i]["CHARGENO"].ToString()); // } //} } catch { } } // 初始化判定结果编码 /// /// 初始化判定结果编码 /// public void GetDudgeResult() { try { string strErr = ""; ArrayList arry = new ArrayList(); arry.Add("frmBaseInfo_Children.select"); arry.Add("1031"); CommonClientToServer ccs = new CommonClientToServer(); ccs.ob = this.ob; DataSet ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr); tabResult = new Hashtable(); string strCode = ""; string strResult = ""; if (ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { strCode = ds.Tables[0].Rows[i]["BASECODE"].ToString(); strResult = ds.Tables[0].Rows[i]["BASENAME"].ToString(); tabResult.Add(strCode, strResult); } } } catch { } } /// /// 清理所有正在使用的资源。 /// 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 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.Appearance appearance4 = new Infragistics.Win.Appearance(); Infragistics.Win.Appearance appearance5 = new Infragistics.Win.Appearance(); Infragistics.Win.ValueList valueList1 = new Infragistics.Win.ValueList(7905313); Infragistics.Win.ValueListItem valueListItem32 = new Infragistics.Win.ValueListItem(); Infragistics.Win.ValueListItem valueListItem33 = new Infragistics.Win.ValueListItem(); Infragistics.Win.ValueListItem valueListItem34 = new Infragistics.Win.ValueListItem(); Infragistics.Win.ValueListItem valueListItem35 = new Infragistics.Win.ValueListItem(); Infragistics.Win.ValueListItem valueListItem36 = new Infragistics.Win.ValueListItem(); Infragistics.Win.ValueListItem valueListItem37 = new Infragistics.Win.ValueListItem(); Infragistics.Win.ValueListItem valueListItem38 = new Infragistics.Win.ValueListItem(); Infragistics.Win.ValueListItem valueListItem39 = new Infragistics.Win.ValueListItem(); Infragistics.Win.ValueListItem valueListItem40 = new Infragistics.Win.ValueListItem(); Infragistics.Win.ValueListItem valueListItem41 = new Infragistics.Win.ValueListItem(); Infragistics.Win.ValueListItem valueListItem42 = new Infragistics.Win.ValueListItem(); Infragistics.Win.ValueListItem valueListItem43 = 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"); this.ultraGroupBox1 = new Infragistics.Win.Misc.UltraGroupBox(); this.ultraMaskedEdit1 = new Infragistics.Win.UltraWinMaskedEdit.UltraMaskedEdit(); this.chkHeatbo = new System.Windows.Forms.CheckBox(); 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.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.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(); this.GridExcelExporter = new Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter(this.components); this.checkBox1 = new System.Windows.Forms.CheckBox(); ((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.ultraMaskedEdit1); this.ultraGroupBox1.Controls.Add(this.chkHeatbo); 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.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; // // ultraMaskedEdit1 // this.ultraMaskedEdit1.BorderStyle = Infragistics.Win.UIElementBorderStyle.Inset; editorButton1.Key = "edit"; editorButton1.Text = ""; editorButton1.Visible = false; 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(126, 21); this.ultraMaskedEdit1.TabIndex = 287; this.ultraMaskedEdit1.UseFlatMode = Infragistics.Win.DefaultableBoolean.True; this.ultraMaskedEdit1.EditorButtonClick += new Infragistics.Win.UltraWinEditors.EditorButtonEventHandler(this.EditorButtonClick); // // chkHeatbo // this.chkHeatbo.AutoSize = true; this.chkHeatbo.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.chkHeatbo.Location = new System.Drawing.Point(19, 42); this.chkHeatbo.Name = "chkHeatbo"; this.chkHeatbo.Size = new System.Drawing.Size(68, 18); this.chkHeatbo.TabIndex = 288; this.chkHeatbo.Text = "炉号从"; // // 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(522, 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 = "精炼炉"; valueListItem10.DataValue = "4"; valueListItem10.DisplayText = "连铸"; this.cboGW.Items.AddRange(new Infragistics.Win.ValueListItem[] { valueListItem6, valueListItem7, valueListItem8, valueListItem9, valueListItem10}); this.cboGW.Location = new System.Drawing.Point(445, 10); this.cboGW.Name = "cboGW"; this.cboGW.Size = new System.Drawing.Size(71, 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(445, 41); this.cmb_BZ.Name = "cmb_BZ"; this.cmb_BZ.Size = new System.Drawing.Size(71, 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(656, 41); this.chkGasSample.Name = "chkGasSample"; this.chkGasSample.Size = new System.Drawing.Size(82, 24); this.chkGasSample.TabIndex = 85; this.chkGasSample.Text = "气体样"; this.chkGasSample.Visible = false; // // txtSteel // this.txtSteel.Location = new System.Drawing.Point(553, 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 = ""; editorButton3.Visible = false; 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(239, 40); this.ultraMaskedEdit2.Name = "ultraMaskedEdit2"; this.ultraMaskedEdit2.PromptChar = ' '; this.ultraMaskedEdit2.Size = new System.Drawing.Size(126, 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(239, 9); this.uldtEndTime.MaskInput = "yyyy-mm-dd hh:mm"; this.uldtEndTime.Name = "uldtEndTime"; this.uldtEndTime.Size = new System.Drawing.Size(126, 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(126, 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(214, 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(214, 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(518, 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(656, 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(375, 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(375, 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(900, 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(852, 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(748, 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(788, 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.Font = new System.Drawing.Font("宋体", 10.5F); this.label6.ForeColor = System.Drawing.Color.Red; this.label6.Location = new System.Drawing.Point(842, 13); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(0, 14); 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(746, 12); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(98, 14); this.label5.TabIndex = 52; this.label5.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.Width = 179; ultraGridColumn3.Header.VisiblePosition = 6; ultraGridColumn3.Width = 116; ultraGridColumn4.Header.VisiblePosition = 7; ultraGridColumn4.Width = 160; ultraGridColumn5.Header.VisiblePosition = 4; ultraGridColumn5.Hidden = true; ultraGridColumn6.Header.VisiblePosition = 5; ultraGridColumn6.Width = 53; ultraGridColumn7.CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ultraGridColumn7.Header.VisiblePosition = 2; ultraGridColumn7.Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDown; ultraGridColumn7.Width = 66; ultraGridColumn8.Header.VisiblePosition = 3; ultraGridColumn8.Width = 40; ultraGridColumn9.CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ultraGridColumn9.Header.VisiblePosition = 8; ultraGridColumn10.CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ultraGridColumn10.Header.VisiblePosition = 9; ultraGridColumn11.CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ultraGridColumn11.Header.VisiblePosition = 10; ultraGridColumn12.Header.VisiblePosition = 11; ultraGridColumn12.Hidden = true; ultraGridColumn13.Header.VisiblePosition = 12; ultraGridColumn13.RowLayoutColumnInfo.PreferredCellSize = new System.Drawing.Size(70, 0); ultraGridBand1.Columns.AddRange(new object[] { ultraGridColumn1, ultraGridColumn2, ultraGridColumn3, ultraGridColumn4, ultraGridColumn5, ultraGridColumn6, ultraGridColumn7, ultraGridColumn8, ultraGridColumn9, ultraGridColumn10, ultraGridColumn11, ultraGridColumn12, ultraGridColumn13}); ultraGridBand1.RowLayoutStyle = Infragistics.Win.UltraWinGrid.RowLayoutStyle.ColumnLayout; this.EMGrid.DisplayLayout.BandsSerializer.Add(ultraGridBand1); this.EMGrid.DisplayLayout.GroupByBox.Hidden = true; appearance4.FontData.BoldAsString = "True"; appearance4.FontData.SizeInPoints = 10F; this.EMGrid.DisplayLayout.Override.CellAppearance = appearance4; appearance5.FontData.BoldAsString = "True"; this.EMGrid.DisplayLayout.Override.HeaderAppearance = appearance5; this.EMGrid.DisplayLayout.Override.HeaderClickAction = Infragistics.Win.UltraWinGrid.HeaderClickAction.SortMulti; this.EMGrid.DisplayLayout.Override.WrapHeaderText = Infragistics.Win.DefaultableBoolean.True; valueListItem32.DataValue = "11"; valueListItem32.DisplayText = "白班-甲"; valueListItem33.DataValue = "12"; valueListItem33.DisplayText = "白班-乙"; valueListItem34.DataValue = "13"; valueListItem34.DisplayText = "白班-丙"; valueListItem35.DataValue = "14"; valueListItem35.DisplayText = "白班-丁"; valueListItem36.DataValue = "21"; valueListItem36.DisplayText = "小夜-甲"; valueListItem37.DataValue = "22"; valueListItem37.DisplayText = "小夜-乙"; valueListItem38.DataValue = "23"; valueListItem38.DisplayText = "小夜-丙"; valueListItem39.DataValue = "24"; valueListItem39.DisplayText = "小夜-丁"; valueListItem40.DataValue = "31"; valueListItem40.DisplayText = "大夜-甲"; valueListItem41.DataValue = "32"; valueListItem41.DisplayText = "大夜-乙"; valueListItem42.DataValue = "33"; valueListItem42.DisplayText = "大夜-丙"; valueListItem43.DataValue = "34"; valueListItem43.DisplayText = "大夜-丁"; valueList1.ValueListItems.AddRange(new Infragistics.Win.ValueListItem[] { valueListItem32, valueListItem33, valueListItem34, valueListItem35, valueListItem36, valueListItem37, valueListItem38, valueListItem39, valueListItem40, valueListItem41, valueListItem42, valueListItem43}); 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.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"; // // 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; buttonTool3.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; this.ultraToolbarsManager1.Tools.AddRange(new Infragistics.Win.UltraWinToolbars.ToolBase[] { buttonTool6, buttonTool7, buttonTool8, buttonTool9, buttonTool10}); this.ultraToolbarsManager1.Visible = false; // // _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; // // checkBox1 // this.checkBox1.AutoSize = true; this.checkBox1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.checkBox1.Location = new System.Drawing.Point(19, 42); this.checkBox1.Name = "checkBox1"; this.checkBox1.Size = new System.Drawing.Size(68, 18); this.checkBox1.TabIndex = 288; this.checkBox1.Text = "炉号从"; // // frmLgElements2 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.ClientSize = new System.Drawing.Size(1008, 653); this.Controls.Add(this.panel1); this.Name = "frmLgElements2"; 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 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(); else { if (EMGrid.Rows[j].Cells[1].Value.ToString().Length >= 8) strForeSmeltingId = EMGrid.Rows[j].Cells[1].Value.ToString(); } } else { if (intSelectedIndex == 0) strSme = EMGrid.Rows[j].Cells[1].Value.ToString(); else { if (EMGrid.Rows[j].Cells[1].Value.ToString().Length >= 8) strSme = EMGrid.Rows[j].Cells[1].Value.ToString(); } 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(); strErr = ""; szWhere = szJYH; //条件 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("成品样") == true) { //设置要获取的化学成分标准,此处i的值必须与(SetGridRowHidden)要显示的列数一样,否则将无法实现相同炉号显示不同颜色 //for (int i = 13; 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++; // } //} //for (int i = 0; i < strERow.Length; i++) //{ // szEleStd = szEleStd + "','" + strERow[i]; // ArrayId[id] = EMGrid.DisplayLayout.Bands[0].Columns[i].Header.Caption; // id++; //} //if (strERow.Length > 0) //{ // string strHeatNo = EMGrid.Rows[j].Cells["熔炼号"].Value.ToString(); // string strOrderno = ""; // strErr = ""; // ArrayList arry = new ArrayList(); // arry.Add("IntentOrderno.select"); // arry.Add(strHeatNo); //炉号 // CommonClientToServer ccs = new CommonClientToServer(); // ccs.ob = this.ob; // ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr); // if (ds.Tables[0].Rows.Count > 0) // { // strOrderno = ds.Tables[0].Rows[0][0].ToString(); // } // strErr = ""; // if (strOrderno == "") return; // arry.Clear(); // arry.Add("ChemStandardInfo.select"); // arry.Add(strOrderno); // 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; //} if (dsStand.Tables[0].Rows.Count > 0) { //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; //} string Steel = tabSteel[EMGrid.Rows[j].Cells["计划牌号"].Value.ToString()].ToString(); DataView dvwDefalt = dsStand.Tables[0].DefaultView; dvwDefalt.RowFilter = " STEEL='" + Steel + "'"; if (ds.Tables.Count > 0) { ds.Tables.Clear(); ds.Tables.Add(dvwDefalt.ToTable()); } else { ds.Tables.Add(dvwDefalt.ToTable()); } foreach (DataRow Drow in ds.Tables[0].Rows) { for (int i = 0; i < strERow.Length; i++) { string cheName = Drow["BASENAME"].ToString().ToString().ToUpper(); if (dataSet1.Tables[0].Columns.Contains(cheName)) { if (EMGrid.Rows[j].Cells[cheName].Value.ToString().Length > 0) { if (cheName == strERow[i]) { int reP = 0; try { if (reP == 0) { //if (Drow["NSTDMIN"].ToString() != "" && Drow["NSTDMAX"].ToString() != "") // szQJ = Drow["NSTDMIN"].ToString() + "~" + Drow["NSTDMAX"].ToString(); //else if (Drow["NSTDMIN"].ToString() != "" && Drow["NSTDMAX"].ToString() == "") // szQJ = "> " + Drow["NSTDMIN"].ToString(); //else if (Drow["NSTDMIN"].ToString() == "" && Drow["NSTDMAX"].ToString() != "") // szQJ = "<= " + Drow["NSTDMAX"].ToString(); if (Drow["MAXSIGN"].ToString().Trim() != "" && Drow["MINSIGN"].ToString().Trim() != "") { szQJ = Drow["MINVALUE"].ToString().Trim() + "~" + Drow["MAXVALUE"].ToString().Trim(); } else if (Drow["MINVALUE"].ToString().Trim() != "" && Drow["MAXVALUE"].ToString().Trim() == "") { szQJ = ">=" + Drow["MINVALUE"].ToString().Trim(); } else if (Drow["MINVALUE"].ToString().Trim() == "" && Drow["MAXVALUE"].ToString().Trim() != "") { szQJ = "<= " + Drow["MAXVALUE"].ToString().Trim(); } reP = sValue(szQJ, EMGrid.Rows[j].Cells[cheName].Value.ToString()); } } catch (Exception ex) { Console.WriteLine(ex.Message); } if (reP == -1 && Drow["STDSTYLE"].ToString() == "客户") { EMGrid.Rows[j].Cells[cheName].Appearance.ForeColor = Color.FromArgb(204, 153, 0);// Color.Yellow; } else if (reP == -1 && Drow["STDSTYLE"].ToString() == "国标" && EMGrid.Rows[j].Cells[cheName].Appearance.ForeColor == Color.FromArgb(204, 153, 0)) { EMGrid.Rows[j].Cells[cheName].Appearance.ForeColor = Color.Violet; } else if (reP == -1 && Drow["STDSTYLE"].ToString() == "内控")//&& EMGrid.Rows[j].Cells[cheName].Appearance.ForeColor == Color.Violet { EMGrid.Rows[j].Cells[cheName].Appearance.ForeColor = Color.Red; } else if (EMGrid.Rows[j].Cells[cheName].Appearance.ForeColor != Color.FromArgb(204, 153, 0)) { EMGrid.Rows[j].Cells[cheName].Appearance.ForeColor = Color.Black; } break; } } } } } } } } } catch { } } 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 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) //{ if (cboGW.Text.ToString() == "铁水") return; string strHeatNo = EMGrid.Rows[e.Row.Index].Cells["熔炼号"].Value.ToString(); if (strHeatNo.Length < 8) return; string strSteelCode = EMGrid.Rows[e.Row.Index].Cells["计划牌号"].Text.Trim(); //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(strHeatNo, 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); } //增加分页显示功能 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 " 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 { 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] = this.setAnalysName(Drow["ASSAYTYPECODE"].ToString()); string strAs = Drow["ASSAYTYPECODE"].ToString()==""?"":Drow["ASSAYTYPECODE"].ToString().Substring(3,1)+"次样"; newRow[7] = strAs; //次数 newRow[2] = Drow["gzbm"].ToString(); if (Drow["ASSAYDATE"].ToString() != "") newRow[3] = Convert.ToDateTime(Drow["ASSAYDATE"]).ToString("yyyy-MM-dd HH:mm:ss"); //newRow[4] = Drow["GZBM"].ToString(); newRow[5] = Drow["shiftcode"].ToString(); newRow[11] = Drow["SIMN"].ToString();//20120109 新增 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 (newRow[7].ToString() != "" && Drow["JUDGE_SEQ"].ToString() != "") { if (Drow["ASSAYTYPECODE"].ToString().Substring(0, 1) == "G")// && Convert.ToInt32(newRow[7]) == Convert.ToInt32(Drow["JUDGE_SEQ"].ToString())) { newRow[8] = Drow["JUDGE_STL_GRD"].ToString(); if (tabResult.Contains(Drow["JUDGE_RESULT"].ToString())) { newRow[9] = tabResult[Drow["JUDGE_RESULT"].ToString()].ToString(); //== "1" ? "合格" : "不合格"; } newRow[10] = Drow["REG_ID"].ToString(); } else { newRow[8] = null; newRow[9] = null; newRow[10] = null; } } break; } } } dataTable1.Rows.Add(newRow); } PublicMethod.RefreshAndAutoSize(EMGrid); SetGridRowHidden(); } catch (Exception ex) { throw ex; } } /// /// 根据设置隐藏不要显示的列 /// private void SetGridRowHidden() { try { //新增列时,相继修改J的值(新增n列时,j=j+n),否则将不会在界面显示 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 < strERow.Length; j++) { EMGrid.DisplayLayout.Bands[0].Columns[strERow[j]].Header.VisiblePosition = j + 9; } EMGrid.DisplayLayout.Bands[0].Columns[12].Header.VisiblePosition = EMGrid.DisplayLayout.Bands[0].Columns.Count; 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; for (int i = 0; i < EMGrid.DisplayLayout.Bands[0].Columns.Count; i++) { EMGrid.DisplayLayout.Bands[0].Columns[i].CellActivation = Activation.ActivateOnly; } } catch { } } 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); SetEachRowData(); 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": try { //Core.Mes.Client.Common.Globals.ulGridToExcel(EMGrid, Text); GridHelper.ulGridToExcel(EMGrid, Text); } catch (Exception ex) { MessageBox.Show(ex.Message); } break; break; case "Exit": this.Close(); break; default: break; } base.ToolBar_Click(sender, ToolbarKey); } /// /// 设置化学成份列名 /// private void SetRowName() { try { 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.ExecuteSortResultByQueryToDataTable(CCP_Sampling, CoreInvokeType.Internal); ArrayList alist = new ArrayList(); Hashtable htbl = new Hashtable(); if (dt != null) { if (dt.Rows.Count > 0) { DataRow newdr = dt.NewRow(); foreach (DataRow dr in dt.Rows) { if (dr["BASENAME"].ToString() != "As+Sn+Sb+Pb+Bi") { alist.Add(dr["BASENAME"].ToString()); htbl.Add(dr["BASENAME"].ToString(), "0"); } } } } if (htbl != null && htbl.Count > 0) { frmSetEleCols frm = new frmSetEleCols(); frm.alist = alist; frm.htbl = htbl; if (frm.ShowDialog() == DialogResult.OK) { //dataTable1.Clear(); //dataTable1.Reset(); for (int i = 0; i < strERow.Length; i++) { if (dataTable1.Columns.Contains(strERow[i])) { dataTable1.Columns.Remove(strERow[i]); } } getElements(); GetDataFromAll(); } } else { MessageBox.Show("化学成分列获取失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } catch { } } /// /// 显示样点 /// 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(); } } #endregion public void GetDataFromAll() { 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(); if (_devPos.Substring(0, 3) == "HMP") { BuildSQLWithHMP(); Isbool = true; } else { if (_strGW == "C") { BuildSQLWithBOF(); } else { BuildSQLWithCCM(); } Isbool = false; } _dsAll = new DataSet(); //定义一个ArrayList集合存储变量[参数]值 ArrayList arry = new ArrayList(); ArrayList sqlList = new ArrayList(); if (Isbool) { arry.Add("FrmHMPElements_Query.select"); sqlList.Add(strFindName); sqlList.Add(_szTableName);//表名 sqlList.Add("J#" + _szTableName);//表名 sqlList.Add(_strWhere2); } else { if (_strGW == "C") { arry.Add("FrmLgElementsBOFQuery.select"); sqlList.Add(strFindName.Substring(1)); sqlList.Add(_szTableName);//表名 sqlList.Add(_strWhere1); sqlList.Add("J#" + _szTableName);//表名 sqlList.Add(_strWhere1); sqlList.Add(""); sqlList.Add(""); sqlList.Add(_strWhere2); sqlList.Add(_strWhere2); sqlList.Add(_strWhere3); sqlList.Add(_orderby); } else { arry.Add("FrmLgElementsCCMQuery.select"); sqlList.Add(strFindName); sqlList.Add(_strWhere1); sqlList.Add(_strWhere1); sqlList.Add(_szTableName);//表名 sqlList.Add(""); sqlList.Add("J#" + _szTableName);//表名 sqlList.Add(""); sqlList.Add(_strWhere2); sqlList.Add(_strWhere2); sqlList.Add(_strWhere3); sqlList.Add(_orderby); } } //开发时删除 //调用服务端方法 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.ExecuteSortResultByQueryToDataTable(CCP_LgEts, CoreInvokeType.Internal); _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() == "" ? "40" : this.txtPage.Text.Trim()); } SetDataToGrid(); } catch (Exception ex) { Debug.WriteLine(ex.Message); } } #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 { return; 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(); _strDuty1 = strDuty; _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) "; } } // 铁水查询条件 /// /// 铁水查询条件 /// private void BuildSQLWithHMP() { try { _strWhere2 = ""; string strStartTime = this.uldtBeginTime.DateTime.ToString("yyyy-MM-dd HH:mm:ss"); string strEndTime = this.uldtEndTime.DateTime.ToString("yyyy-MM-dd HH:mm:ss"); _strWhere2 += " and b.heatno = a.hudwid and to_char(b.ASSAYDATE, 'yyyy-MM-dd HH24:Mi:ss')" + "between '" + strStartTime + "' and '" + strEndTime + "'"; //岗位 if (_strGW != "") { _strWhere2 += String.Format(" and substr(b.STATIONCODE,1,1) ='{0}' ", this._strGW); } string szWZ = this._devPos.Substring(3, 2); if (szWZ != "00") { _strWhere2 += string.Format(" and substr(b.STATIONCODE,2,2) = '{0}' ", szWZ); } //班组 if (cmb_BZ.Value.ToString() != "0") { _strWhere2 += string.Format(" and substr(a.SHIFTCODE,2,1) = '{0}' ", this._strDuty); } //气体样 if (chkGasSample.Checked) { _strWhere2 += " and (N>0 or H>0 or O>0) "; } } catch { } } // 转炉查询条件 /// /// 转炉查询条件 /// private void BuildSQLWithBOF() { try { string vPos = ""; _strWhere1 = ""; _strWhere2 = ""; _strWhere3 = ""; _orderby = ""; string strStartTime = this.uldtBeginTime.DateTime.ToString("yyyy-MM-dd HH:mm:ss"); string strEndTime = this.uldtEndTime.DateTime.ToString("yyyy-MM-dd HH:mm:ss"); _strWhere1 = " and optdate between " + " to_date('" + strStartTime + "','yyyy-MM-dd HH24:Mi:ss') " + " and to_date('" + strEndTime + "','yyyy-MM-dd HH24:Mi:ss') "; _strWhere2 = " and assaydate between to_date('" + strStartTime + "','yyyy-MM-dd HH24:Mi:ss')-1" + " and to_date('" + strEndTime + "','yyyy-MM-dd HH24:Mi:ss')+1 "; //熔炼号 if (chkHeatbo.Checked) { if (this.ultraMaskedEdit1.Text.Length == 0 && this.ultraMaskedEdit2.Text.Length > 0) { _strWhere1 += String.Format(" and HEATNO like '%{0}%' ", this.ultraMaskedEdit2.Text.Trim()); } if (this.ultraMaskedEdit2.Text.Length == 0 && this.ultraMaskedEdit1.Text.Length > 0) { _strWhere1 += String.Format(" and HEATNO like '%{0}%' ", this.ultraMaskedEdit1.Text.Trim()); } if (this.ultraMaskedEdit2.Text.Length > 0 && this.ultraMaskedEdit1.Text.Length > 0) { _strWhere1 += String.Format(" and HEATNO between '{0}' and '{1}' ", this.ultraMaskedEdit1.Text.Trim(), this.ultraMaskedEdit2.Text.Trim()); } } if (_strGW == "C") { _orderby += " m.heatno desc,m.assaydate asc "; } else if (_strGW == "G") { _orderby += " decode(m.balestarttime, null, m.optdate, m.balestarttime) desc"; } else { _orderby += " m.heatno desc,m.assaydate asc "; } if (comboBox2.Value.ToString() != "0") { vPos = "0" + comboBox2.Value.ToString(); if (_strGW == "C") { _strWhere1 += string.Format(" and STATIONCODE = '{0}' ", vPos); } } //班组 if (cmb_BZ.Value.ToString() != "0") { _strWhere3 += string.Format(" and substr(D.SHIFTCODE,2,1) = '{0}' ", this._strDuty); } string str = ""; //牌号 if (txtSteel.Text.Length > 0) { if (txtSteel.Text.Trim() != "") str = txtSteel.Text.ToString(); else str = ""; if (str != "") { string strSteeAll = ""; string steel = ""; string[] strSteel = str.Split(','); for (int i = 0; i < strSteel.Length; i++) { if (!string.IsNullOrEmpty(strSteel[i])) { if (tabSteel != null) { foreach (DictionaryEntry dSteel in tabSteel) { if (dSteel.Value.ToString() == strSteel[i]) { steel = dSteel.Key.ToString(); strSteeAll += "'" + steel + "',"; } } } } } str = strSteeAll.Substring(0, strSteeAll.Length - 1); _strWhere1 += string.Format(" and plansteel in ({0})", str); } } //气体样 if (chkGasSample.Checked) { _strWhere2 += " and (N>0 or H>0 or O>0) "; } } catch { } } // 连铸查询条件 /// /// 连铸查询条件 /// private void BuildSQLWithCCM() { try { string vPos = ""; _strWhere1 = ""; _strWhere2 = ""; _strWhere3 = ""; _orderby = ""; string strStartTime = this.uldtBeginTime.DateTime.ToString("yyyy-MM-dd HH:mm:ss"); string strEndTime = this.uldtEndTime.DateTime.ToString("yyyy-MM-dd HH:mm:ss"); _strWhere1 = " and decode(balestarttime, null, optdate, balestarttime) between " + " to_date('" + strStartTime + "','yyyy-MM-dd HH24:Mi:ss') " + " and to_date('" + strEndTime + "','yyyy-MM-dd HH24:Mi:ss') "; _strWhere2 = " and assaydate between to_date('" + strStartTime + "','yyyy-MM-dd HH24:Mi:ss')-1" + " and to_date('" + strEndTime + "','yyyy-MM-dd HH24:Mi:ss')+1 "; //熔炼号 if (chkHeatbo.Checked) { if (this.ultraMaskedEdit1.Text.Length == 0 && this.ultraMaskedEdit2.Text.Length > 0) { _strWhere1 += String.Format(" and HEATNO like '%{0}%' ", this.ultraMaskedEdit2.Text.Trim()); } if (this.ultraMaskedEdit2.Text.Length == 0 && this.ultraMaskedEdit1.Text.Length > 0) { _strWhere1 += String.Format(" and HEATNO like '%{0}%' ", this.ultraMaskedEdit1.Text.Trim()); } if (this.ultraMaskedEdit2.Text.Length > 0 && this.ultraMaskedEdit1.Text.Length > 0) { _strWhere1 += String.Format(" and HEATNO between '{0}' and '{1}' ", this.ultraMaskedEdit1.Text.Trim(), this.ultraMaskedEdit2.Text.Trim()); } } if (_strGW == "C") { _orderby += " m.heatno desc "; } else if (_strGW == "G") { _orderby += " decode(m.balestarttime, null, m.optdate, m.balestarttime) desc"; } else { _orderby += " m.heatno desc "; } if (comboBox2.Value.ToString() != "0") { vPos = "0" + comboBox2.Value.ToString(); if (_strGW == "C") { _strWhere3 += string.Format(" and d.STATIONCODE = '{0}' ", vPos); } else if (_strGW == "G") { _strWhere1 += string.Format(" and STATIONCODE = '{0}' ", vPos); } } //班组 if (cmb_BZ.Value.ToString() != "0") { _strWhere1 += string.Format(" and substr(SHIFTCODE,2,1) = '{0}' ", this._strDuty); } string str = ""; //牌号 if (txtSteel.Text.Length > 0) { if (txtSteel.Text.Trim() != "") str = txtSteel.Text.ToString(); else str = ""; if (str != "") { string strSteeAll = ""; string steel = ""; string[] strSteel = str.Split(','); for (int i = 0; i < strSteel.Length; i++) { if (!string.IsNullOrEmpty(strSteel[i])) { if (tabSteel != null) { foreach (DictionaryEntry dSteel in tabSteel) { if (dSteel.Value.ToString() == strSteel[i]) { steel = dSteel.Key.ToString(); strSteeAll += "'" + steel + "',"; } } } } } str = strSteeAll.Substring(0, strSteeAll.Length - 1); _strWhere1 += string.Format(" and plansteel in ({0})", str); } } //气体样 if (chkGasSample.Checked) { _strWhere2 += " and (N>0 or H>0 or O>0) "; } } catch { } } #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._strGW = "B"; this._szTableName = "STL_HMP_OPTINFO"; break; case 1: this._devPos = "BOF0"; this._strGW = "C"; this._szTableName = "STL_BOF_OPTINFO"; break; case 2: this._devPos = "CAS0"; this._strGW = "D"; this._szTableName = "STL_CAS_OPTINFO"; break; case 3: this._devPos = "LFS0"; this._strGW = "E"; this._szTableName = "STL_LFS_OPTINFO"; break; case 4: this._devPos = "CCM0"; this._strGW = "G"; 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 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; } } // 工序位置下拉列表设置 /// /// 工序位置下拉列表设置 /// 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#转炉"); comboBox2.Items.Add(3, "3#转炉"); comboBox2.Items.Add(4, "4#转炉"); comboBox2.Items.Add(5, "5#转炉"); break; case 2: comboBox2.Items.Add(0, "所有"); comboBox2.Items.Add(1, "1#吹氩站"); comboBox2.Items.Add(2, "2#吹氩站"); comboBox2.Items.Add(3, "3#吹氩站"); comboBox2.Items.Add(4, "4#吹氩站"); comboBox2.Items.Add(5, "5#吹氩站"); break; case 3: comboBox2.Items.Add(0, "所有"); comboBox2.Items.Add(1, "1#精炼炉"); comboBox2.Items.Add(2, "2#精炼炉"); comboBox2.Items.Add(3, "3#精炼炉"); break; case 4: comboBox2.Items.Add(0, "所有"); comboBox2.Items.Add(1, "1#连铸"); comboBox2.Items.Add(2, "2#连铸"); comboBox2.Items.Add(3, "3#连铸"); comboBox2.Items.Add(4, "4#连铸"); comboBox2.Items.Add(5, "5#连铸"); break; default: comboBox2.Items.Add(0, "所有铁水"); break; } if (index == 0) { chkHeatbo.Checked = false; chkHeatbo.Enabled = false; } else { chkHeatbo.Enabled = true; } 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 string setAnalysName(string stationCode) { try { string station = stationCode.Substring(0, 1); string station1 = stationCode.Substring(0, 2); string name = ""; switch (station) { case "B": name = "脱硫样"; break; case "C": name = "炉前样"; break; case "D": name = "氩后样"; break; case "E": name = "LF炉样"; break; case "G": if (station1 == "GZ") { name = "钢渣样"; } else { name = "成品样"; } break; case "P": name = "平台样"; break; } return name; } catch { return ""; } } } }