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 frmhothis : FrmLgDevFunctions { public frmhothis(OpeBase oba) { InitializeComponent(); ob = oba; } private DataSet _dsMain; public string potno = "1"; private void frmhothis_Load(object sender, EventArgs e) { this.txtNoLadle.Text = potno; this.uDTEStart.DateTime = DateTime.Today; this.uDTEEnd.DateTime = DateTime.Today; GetTableData(); InitData1(); } /// /// 查询 /// private void GetTableData() { string strFrom = this.uDTEStart.DateTime.ToString("yyyyMMdd"); string strTo = this.uDTEEnd.DateTime.ToString("yyyyMMdd"); string strWhere = " to_char(BEGINTIME,'yyyyMMdd') between '" + strFrom + "' and '" + strTo + "' "; if (potno != "") { strWhere +=" and FIRINGTOOLID = '"+potno+"'"; } try { _dsMain =QueryToFunions("Core.LgMes.Server.LgDeviceManager.potmanger", "GetHotRecLog",strWhere,ob); try { ((DataSet)uGrdhothis.DataSource).Tables[0].Rows.Clear(); } catch (Exception) { } if (_dsMain.Tables[0].Rows.Count > 0) { this.uGrdhothis.DataSource = _dsMain; } } catch (Exception ex) { string strMsg = ex.Message; } } /// /// UltraGrid显示设置 /// private void InitData1() { try { UltraGridBand band = this.uGrdhothis.DisplayLayout.Bands[0]; band.Columns[0].Header.Caption = "钢包号"; band.Columns[0].Width = 60; band.Columns[1].Header.Caption = "烘烤位置"; band.Columns[1].Width = 60; band.Columns[1].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; band.Columns[2].Header.Caption = "开始时间"; band.Columns[2].Width = 150; band.Columns[2].CellAppearance.ForeColor = Color.Black; band.Columns[2].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; band.Columns[3].Header.Caption = "结束时间"; band.Columns[3].Width = 150; band.Columns[3].CellAppearance.ForeColor = Color.Black; band.Columns[3].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; band.Columns[4].Header.Caption = "烘烤时间"; band.Columns[4].Width = 65; band.Columns[4].CellAppearance.ForeColor = Color.Black; band.Columns[4].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; } catch { } } /// /// 窗体菜单 /// /// /// private void toolStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e) { switch (e.ClickedItem.Name) { case "QUERY": { potno = this.txtNoLadle.Text.Trim(); GetTableData(); break; } case "ALL": { potno = ""; GetTableData(); break; } case "EXPORT": { try { Core.Mes.Client.Common.Globals.ulGridToExcel(uGrdhothis, Text); } catch (Exception ex) { MessageBox.Show(ex.Message); } break; } case "CLOSE": { this.Close(); break; } default: break; } } } }