| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247 |
- using System;
- using System.Data;
- using System.Drawing;
- using System.Collections;
- using System.ComponentModel;
- using System.Windows.Forms;
- using System.Diagnostics;
- using Infragistics.Win.UltraWinGrid;
- using CoreFS.CA06;
- namespace Core.LgMes.Client.LgDeviceManager
- {
- public partial class frmworkhis : FrmLgDevFunctions
- {
- public string potno = "";
- private DataSet _dsMain;
- public frmworkhis(OpeBase oba)
- {
- InitializeComponent();
- this.chkTime.CheckedChanged += new System.EventHandler(this.checkBox3_CheckedChanged);
- ob = oba;
- }
- private void frmworkhis_Load(object sender, EventArgs e)
- {
- txtNoLadle.Text = potno;
- this.chkTime.Checked = true;
- Refreshworkhis();
- }
- private void Refreshworkhis()
- {
- string sqlstr = "";
- try
- {
- if (potno != "")
- {
- sqlstr = string.Format("where LADLEID='{0}'", this.txtNoLadle.Text.Trim());
- }
- else
- {
- sqlstr = "where 1 = 1";
- }
- if (this.chkTime.Checked)
- {
- sqlstr += string.Format(" and to_char(OPTDATE,'yyyy-MM-dd') between '{0}' and '{1}' ", this.udteStart.DateTime.ToString("yyyy-MM-dd"), this.udteEnd.DateTime.ToString("yyyy-MM-dd"));
- }
- _dsMain = QueryToFunions("Core.LgMes.Server.LgDeviceManager.potmanger", "Getworkhisdata", sqlstr,ob);
- try
- {
- ((DataSet)uGrdkHIS.DataSource).Tables[0].Rows.Clear();
- }
- catch (Exception)
- {
- }
- if (_dsMain.Tables[0].Rows.Count > 0)
- {
- this.uGrdkHIS.DataSource = _dsMain;
- }
- }
- catch { }
- }
- private void InitData1()
- {
- try
- {
- UltraGridBand band = this.uGrdkHIS.DisplayLayout.Bands[0];
- band.Columns[0].Header.Caption = "钢包号";
- band.Columns[0].Width = 80;
- band.Columns[1].Header.Caption = "炉号";
- band.Columns[1].Width = 80;
- band.Columns[1].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- band.Columns[2].Header.Caption = "钢种";
- band.Columns[2].Width = 80;
- band.Columns[2].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- band.Columns[3].Header.Caption = "状态";
- band.Columns[3].Width = 80;
- band.Columns[3].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- band.Columns[4].Header.Caption = "等级";
- band.Columns[4].Width = 80;
- band.Columns[4].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- band.Columns[5].Header.Caption = "包龄";
- band.Columns[5].Width = 80;
- band.Columns[5].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- band.Columns[5].Header.Caption = "班组";
- band.Columns[5].Width = 80;
- band.Columns[5].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- band.Columns[6].Header.Caption = "转炉座号";
- band.Columns[6].Width = 80;
- band.Columns[6].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- band.Columns[7].Header.Caption = "出钢开始";
- band.Columns[7].Width = 150;
- band.Columns[7].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- band.Columns[7].Format = "yyyy-MM-dd HH:mm:ss";
- band.Columns[8].Header.Caption = "出刚结束";
- band.Columns[8].Width = 150;
- band.Columns[8].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- band.Columns[8].Format = "yyyy-MM-dd HH:mm:ss";
- band.Columns[9].Header.Caption = "出钢时间";
- band.Columns[9].Width = 80;
- band.Columns[9].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- band.Columns[10].Header.Caption = "LF座号";
- band.Columns[10].Width = 80;
- band.Columns[10].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- band.Columns[11].Header.Caption = "LF开始";
- band.Columns[11].Width = 150;
- band.Columns[11].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- band.Columns[11].Format = "yyyy-MM-dd HH:mm:ss";
- band.Columns[12].Header.Caption = "LF结束";
- band.Columns[12].Width = 150;
- band.Columns[12].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- band.Columns[12].Format = "yyyy-MM-dd HH:mm:ss";
- band.Columns[13].Header.Caption = "精炼时间";
- band.Columns[13].Width = 80;
- band.Columns[13].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- band.Columns[14].Header.Caption = "氩站座号";
- band.Columns[14].Width = 80;
- band.Columns[14].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- band.Columns[15].Header.Caption = "吹氩开始";
- band.Columns[15].Width = 150;
- band.Columns[15].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- band.Columns[15].Format = "yyyy-MM-dd HH:mm:ss";
- band.Columns[16].Header.Caption = "吹氩结束";
- band.Columns[16].Width = 150;
- band.Columns[16].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- band.Columns[16].Format = "yyyy-MM-dd HH:mm:ss";
- band.Columns[17].Header.Caption = "吹氩时间";
- band.Columns[17].Width = 80;
- band.Columns[17].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- band.Columns[18].Header.Caption = "RH座号";
- band.Columns[18].Width = 80;
- band.Columns[18].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- band.Columns[18].Hidden = true;
- band.Columns[19].Header.Caption = "真空开始";
- band.Columns[19].Width = 150;
- band.Columns[19].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- band.Columns[19].Format = "yyyy-MM-dd HH:mm:ss";
- band.Columns[19].Hidden = true;
- band.Columns[20].Header.Caption = "真空结束";
- band.Columns[20].Width = 150;
- band.Columns[20].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- band.Columns[20].Format = "yyyy-MM-dd HH:mm:ss";
- band.Columns[20].Hidden = true;
- band.Columns[21].Header.Caption = "真空时间";
- band.Columns[21].Width = 80;
- band.Columns[21].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- band.Columns[21].Hidden = true;
- band.Columns[22].Header.Caption = "铸机号";
- band.Columns[22].Width = 80;
- band.Columns[22].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- band.Columns[23].Header.Caption = "浇铸开始";
- band.Columns[23].Width = 150;
- band.Columns[23].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- band.Columns[23].Format = "yyyy-MM-dd HH:mm:ss";
- band.Columns[24].Header.Caption = "浇铸结束";
- band.Columns[24].Width = 150;
- band.Columns[24].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- band.Columns[24].Format = "yyyy-MM-dd HH:mm:ss";
- band.Columns[25].Header.Caption = "浇铸时间";
- band.Columns[25].Width = 80;
- band.Columns[25].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
-
- band.Columns[26].Header.Caption = "是否引流";
- band.Columns[26].Width = 80;
- band.Columns[26].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- }
- catch
- { }
- }
- private void checkBox3_CheckedChanged(object sender, EventArgs e)
- {
- this.udteStart.Enabled = this.chkTime.Checked;
- this.udteEnd.Enabled = this.chkTime.Checked;
- }
- private void toolStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
- {
- switch (e.ClickedItem.Name)
- {
- case "QUERY":
- {
- potno = this.txtNoLadle.Text.Trim();
- Refreshworkhis();
- break;
- }
- case "ALL":
- {
- potno = "";
- Refreshworkhis();
- break;
- }
- case "EXPORT":
- {
- try
- {
- Core.Mes.Client.Common.Globals.ulGridToExcel(uGrdkHIS, Text);
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message);
- }
- break;
- }
- case "CLOSE":
- {
- this.Close();
- break;
- }
- default:
- break;
- }
- }
- }
- }
|