| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- 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();
- }
- /// <summary>
- /// 查询
- /// </summary>
- 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;
- }
- }
- /// <summary>
- /// UltraGrid显示设置
- /// </summary>
- 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
- { }
- }
- /// <summary>
- /// 窗体菜单
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- 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;
- }
- }
- }
- }
|