using Core.Mes.Client.Comm.Control; using Core.Mes.Client.Comm.Server; using CoreFS.CA06; using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace Core.StlMes.Client.YdmStuffReport { public partial class FrmMonitoring : FrmBase { public FrmMonitoring() { InitializeComponent(); } private void FrmMonitoring_Load(object sender, EventArgs e) { this.dataYearMoth.Value = DateTime.Parse(DateTime.Now.ToString("yyyy-MM")); } /// /// 重写基类方法 /// /// /// public override void ToolBar_Click(object sender, string ToolbarKey) { switch (ToolbarKey) { case "Query": queryData(); break; case "Export": exportData(); break; case "Close": this.Close(); break; } } /// /// 查询 /// private void queryData() { string bathYearMoth = this.dataYearMoth.Value.ToString("yyyyMM"); try { this.Cursor = Cursors.WaitCursor; //控制鼠标的样式为等待 if (Constant.WaitingForm == null) { Constant.WaitingForm = new WaitingForm(); } Constant.WaitingForm.ShowToUser = true; Constant.WaitingForm.Show(); Constant.WaitingForm.Update(); DataTable dt = ServerHelper.GetData("Core.LgMes.Server.Stuffmanage.Report.FrmMonitoring.queryData", new object[] { bathYearMoth }, ob); GridHelper.CopyDataToDatatable(ref dt, ref dataTable1, true); this.SetStaticsInfo(); CommonMethod.SetGridSumArea(this.ultraGrid1); this.Cursor = Cursors.Default; Constant.WaitingForm.ShowToUser = false; Constant.WaitingForm.Close(); Constant.WaitingForm = null; } catch (Exception e) { this.Cursor = Cursors.Default; Constant.WaitingForm.ShowToUser = false; Constant.WaitingForm.Close(); Constant.WaitingForm = null; } } private void SetStaticsInfo() { try { if (this.ultraGrid1.Rows.Count == 0) { this.ultraGrid1.DisplayLayout.Bands[0].Summaries.Clear(); } else { ArrayList alist = new ArrayList(); alist.Add("LGCOUNT"); alist.Add("LGWEIGHT"); alist.Add("ZRCOUNT"); alist.Add("ZRWEIGHT"); alist.Add("CZCOUNT"); alist.Add("CZWEIGHT"); alist.Add("ZCCOUNT"); alist.Add("ZCWEIGHT"); alist.Add("ZGCOUNT"); alist.Add("ZGWEIGHT"); alist.Add("CZCOUNT1"); alist.Add("CZWEIGHT1"); CommonMethod.SetStaticsInfoSum(ref this.ultraGrid1, alist, true); } } catch { } } /// /// 导出 /// private void exportData() { GridHelper.ulGridToExcel(ultraGrid1, "炼钢-制造部-轧管监控汇总"); } } }