duheng
2024-03-26 c14e9e6b31bc808a7defa271b3dd140b6dd67c74
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
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);
 
            }
        }
    }
     
}