using System.Collections.Generic;
|
using System;
|
using System.Drawing.Drawing2D;
|
using System.IO;
|
using System.Text;
|
using System.Linq;
|
using System.Runtime.InteropServices.ComTypes;
|
using DevExpress.XtraCharts.Native;
|
using DevExpress.Utils.MVVM;
|
using IStation.BLL;
|
namespace IStation.WinFrmUI.Monitor
|
{
|
public partial class SearchHistoryData : DocumentPage
|
{
|
public SearchHistoryData()
|
{
|
InitializeComponent();
|
this.PageTitle.Caption = "查询数据";
|
this.SurfaceGuid = new SurfaceGuid()
|
{
|
Modular = eModular.Basic,
|
Function = this.PageTitle.Caption
|
};
|
|
}
|
|
//初始化
|
private void SearchHistoryData_Load(object sender, EventArgs e)
|
{
|
spinEditYear.Text = DateTime.Today.Year.ToString();
|
comboBoxMonth.Text = DateTime.Today.Month.ToString();
|
RefreshList();
|
listBoxDay.SelectedIndex = DateTime.Today.Day - 1;
|
}
|
|
private void listBoxDay_SelectedIndexChanged(object sender, EventArgs e)
|
{
|
|
}
|
|
private void listBoxDay_CustomItemDisplayText(object sender, DevExpress.XtraEditors.CustomItemDisplayTextEventArgs e)
|
{
|
|
}
|
|
|
|
|
private void RefreshList()
|
{
|
int year = Convert.ToInt32(spinEditYear.Text);
|
int month = Convert.ToInt32(comboBoxMonth.Text);
|
|
int day_count = DateTime.DaysInMonth(year, month);
|
listBoxDay.Items.Clear();
|
for (int i = 1; i <= day_count; i++)
|
{
|
listBoxDay.Items.Add(i.ToString());
|
}
|
dict = BLL.AnaPrj.GetExistStatus(year, month);
|
}
|
Dictionary<int, bool> dict = null;
|
|
private void RefreshByDay()
|
{
|
var bll = new BLL.PumpRunHelper();
|
// var OneHistoryPumpParas= bll.GetPumpRunParasOneDay(this.StartTimeEidt.DateTime,out string error );
|
}
|
|
//年变化
|
private void spinEditYear_EditValueChanged(object sender, EventArgs e)
|
{
|
RefreshList();
|
}
|
//月变化
|
private void comboBoxMonth_EditValueChanged(object sender, EventArgs e)
|
{
|
RefreshList();
|
}
|
|
private void listBoxDay_SelectedIndexChanged_1(object sender, EventArgs e)
|
{
|
List<Model.RunParasData> OneHistoryPumpParas = new List<Model.RunParasData>();
|
var bll = new BLL.PumpRunHelper();
|
if (listBoxDay.SelectedIndex < 0)
|
return;
|
if (listBoxDay.Items.Count == 0)
|
return;
|
int year = Convert.ToInt32(spinEditYear.Text);
|
int month = Convert.ToInt32(comboBoxMonth.Text);
|
int day = listBoxDay.SelectedIndex + 1;
|
// var Project = IStation.BLL.AnaPrj.GetPrj(new DateTime(year, month, day));
|
|
OneHistoryPumpParas = bll.GetByHistoryOneData(new DateTime(year, month, day).AddDays(-365), out string error); //调用运行参数Api
|
// this.resultChartControl1.SetBindingData();
|
var historydata = new HistoryDataAPiHelper();
|
|
}
|
|
private void listBoxDay_CustomItemDisplayText_1(object sender, DevExpress.XtraEditors.CustomItemDisplayTextEventArgs e)
|
{
|
if (dict == null)
|
return;
|
if (e.Item == null)
|
return;
|
if (!dict[e.Index + 1])
|
{
|
e.DisplayText = string.Format("{0} (无)", e.Value);
|
|
}
|
}
|
}
|
|
}
|