| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- 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"));
- }
- /// <summary>
- /// 重写基类方法
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="ToolbarKey"></param>
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- queryData();
- break;
- case "Export":
- exportData();
- break;
- case "Close":
- this.Close();
- break;
- }
- }
- /// <summary>
- /// 查询
- /// </summary>
- 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 { }
- }
- /// <summary>
- /// 导出
- /// </summary>
- private void exportData()
- {
- GridHelper.ulGridToExcel(ultraGrid1, "炼钢-制造部-轧管监控汇总");
- }
- }
- }
|