| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154 |
- 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 frmrepairehis : FrmLgDevFunctions
- {
- public frmrepairehis(OpeBase oba)
- {
- InitializeComponent();
- ob = oba;
- }
- private DataSet _dsMain;
- public string potno = "1";
- private void frmrepairehis_Load(object sender, EventArgs e)
- {
- this.txtNoLadle.Text = potno;
- this.udteStart.DateTime = DateTime.Today;
- this.udteEnd.DateTime = DateTime.Today;
- InitData1();
-
- }
- /// <summary>
- /// 维修记录查询
- /// </summary>
- private void GetTableData()
- {
- string strWhere = " where TOOLTYPEID = '0'";
- string strFrom = this.udteStart.DateTime.ToString("yyyyMMdd");
- string strTo = this.udteEnd.DateTime.ToString("yyyyMMdd");
- strWhere += " and to_char(REPAIRTIME,'yyyyMMdd') between '" + strFrom + "' and '" + strTo + "'";
- if (potno != "")
- {
- strWhere += string.Format(" and REPAIRTOOLID = '{0}' ", potno);
- }
- try
- {
- _dsMain = QueryToFunions("Core.LgMes.Server.LgDeviceManager.potmanger", "GetRepairHis", strWhere,ob);
- try
- {
- ((DataSet)uGrdpairehis.DataSource).Tables[0].Rows.Clear();
- }
- catch (Exception)
- {
- }
- if (_dsMain.Tables[0].Rows.Count > 0)
- {
- this.uGrdpairehis.DataSource = _dsMain;
- }
- }
- catch { }
- }
- /// <summary>
- /// UltraGrid样式设置
- /// </summary>
- private void InitData1()
- {
- try
- {
- UltraGridBand band = this.uGrdpairehis.DisplayLayout.Bands[0];
- band.Columns["REPAIRTOOLID"].Header.Caption = "钢包号";
- band.Columns["REPAIRTOOLID"].Width = 75;
- band.Columns["REPAIRPART"].Header.Caption = "维修位置";
- band.Columns["REPAIRPART"].Width = 85;
- band.Columns["REPAIRPART"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- band.Columns["REASON"].Header.Caption = "维修原因";
- band.Columns["REASON"].Width = 75;
- band.Columns["REASON"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- band.Columns["REPAIRTYPE"].Header.Caption = "维修类别";
- band.Columns["REPAIRTYPE"].Width = 75;
- band.Columns["REPAIRTYPE"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- band.Columns["REPAIRTIME"].Header.Caption = "维修开始时间";
- band.Columns["REPAIRTIME"].Width = 150;
- band.Columns["REPAIRTIME"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- band.Columns["REPAIRTIME"].Format = "yyyy-MM-dd HH:mm:ss";
- band.Columns["REPAIREDTIME"].Header.Caption = "维修结束时间";
- band.Columns["REPAIREDTIME"].Width = 150;
- band.Columns["REPAIREDTIME"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- band.Columns["REPAIREDTIME"].Format = "yyyy-MM-dd HH:mm:ss";
- band.Columns["REPTIME"].Header.Caption = "维修时间";
- band.Columns["REPTIME"].Width = 80;
- band.Columns["REPTIME"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- band.Columns["MATERIALREPLACING"].Header.Caption = "耐材厂家";
- band.Columns["MATERIALREPLACING"].Width = 80;
- band.Columns["MATERIALREPLACING"].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(uGrdpairehis, Text);
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message);
- }
- break;
- }
- case "CLOSE":
- {
- this.Close();
- break;
- }
- default:
- break;
- }
- }
- }
- }
|