wxr
2024-09-05 eeb6f0b4bf0a81834325638401d5fa404e53db93
HDL_ON/UI/UI2/FuntionControlView/Acst/InverterJinmaoHistroyPage.cs
@@ -48,15 +48,11 @@
        string queryTimeString2 = DateTime.Now.ToString("yyyy/MM/dd");
        /// <summary>
        /// echart容器
        /// </summary>
        MyEchartsViewOn tempEchartsView;
        public InverterJinmaoHistroyPage(Function deviceFunction)
        {
            bodyView = this;
            function = deviceFunction;
            BackgroundColor = CSS_Color.BackgroundColor;
        }
        public void LoadPage()
@@ -73,7 +69,7 @@
            bodyView.AddChidren(contentView);
            #region 发电量
            var infoView1 = new FrameLayout()
            infoView1 = new FrameLayout()
            {
                Width = Application.GetRealWidth(343),
                Height = Application.GetRealWidth(382),
@@ -100,7 +96,7 @@
            };
            infoView1.AddChidren(infoView1_DateView);
            var infoView1_Date_Day = new Button()
            infoView1_Date_Day = new Button()
            {
                Width = Application.GetRealWidth(103),
                Height = Application.GetRealWidth(26),
@@ -119,7 +115,7 @@
            infoView1_DateView.AddChidren(infoView1_Date_Day);
            var infoView1_Date_Month = new Button()
            infoView1_Date_Month = new Button()
            {
                Width = Application.GetRealWidth(103),
                Height = Application.GetRealWidth(26),
@@ -138,7 +134,7 @@
            infoView1_DateView.AddChidren(infoView1_Date_Month);
            var infoView1_Date_Year = new Button()
            infoView1_Date_Year = new Button()
            {
                Width = Application.GetRealWidth(103),
                Height = Application.GetRealWidth(26),
@@ -163,7 +159,7 @@
            };
            infoView1.AddChidren(infoView1_DateInfoView);
            var infoView1_DateInfo_PreIconButton = new Button()
            infoView1_DateInfo_PreIconButton = new Button()
            {
                X = Application.GetRealWidth(18),
                Gravity = Gravity.CenterVertical,
@@ -173,7 +169,7 @@
            };
            infoView1_DateInfoView.AddChidren(infoView1_DateInfo_PreIconButton);
            var infoView1_DateInfo_PreClickButton = new Button()
            infoView1_DateInfo_PreClickButton = new Button()
            {
                Width = Application.GetRealWidth(32 + 6),
            };
@@ -204,7 +200,7 @@
            infoView1_DateInfo_NextClickButton = new Button()
            {
                X = Application.GetRealWidth(343 - 18 - 6 -32),
                X = Application.GetRealWidth(343 - 18 - 6 - 32),
                Width = Application.GetRealWidth(32 + 6),
            };
            infoView1_DateInfoView.AddChidren(infoView1_DateInfo_NextClickButton);
@@ -212,50 +208,50 @@
            #endregion
            #region 数据图表
            MyEchartsViewOn infoView1_EchartsView = new MyEchartsViewOn()
            infoView1_EchartsView = new MyEchartsViewOn()
            {
                Y = Application.GetRealWidth(101),
                Height = Application.GetRealWidth(246),
            };
            infoView1.AddChidren(infoView1_EchartsView);
            var echartOption = new EchartsOption_Histogram();
            echartOption.xTitle = "时间";
            echartOption.yTitle = "电量(kw)";
            echartOption.InitXdataText(new List<string>()
            {
                "21","22","23","24","25","26","26","27","28","29",
                "21","22","23","24","25","26","26","27","28","29",
                "21","22","23","24"
            });
            echartOption.InitYdataText(new List<EnvironmentalSensorHistor>() {
                new EnvironmentalSensorHistor{ fieldName = "1", fieldValue= "23"  },
                new EnvironmentalSensorHistor{ fieldName = "2", fieldValue= "22"  },
                new EnvironmentalSensorHistor{ fieldName = "3", fieldValue= "11"  },
                new EnvironmentalSensorHistor{ fieldName = "4", fieldValue= "21"  },
                new EnvironmentalSensorHistor{ fieldName = "5", fieldValue= "41"  },
                new EnvironmentalSensorHistor{ fieldName = "6", fieldValue= "23"  },
                new EnvironmentalSensorHistor{ fieldName = "7", fieldValue= "31"  },
                new EnvironmentalSensorHistor{ fieldName = "8", fieldValue= "23"  },
                new EnvironmentalSensorHistor{ fieldName = "9", fieldValue= "11"  },
                new EnvironmentalSensorHistor{ fieldName = "10", fieldValue= "21"  },
                new EnvironmentalSensorHistor{ fieldName = "11", fieldValue= "24"  },
                new EnvironmentalSensorHistor{ fieldName = "12", fieldValue= "41"  },
                new EnvironmentalSensorHistor{ fieldName = "13", fieldValue= "32"  },
                new EnvironmentalSensorHistor{ fieldName = "14", fieldValue= "23"  },
                new EnvironmentalSensorHistor{ fieldName = "15", fieldValue= "23"  },
                new EnvironmentalSensorHistor{ fieldName = "16", fieldValue= "22"  },
                new EnvironmentalSensorHistor{ fieldName = "17", fieldValue= "11"  },
                new EnvironmentalSensorHistor{ fieldName = "18", fieldValue= "21"  },
                new EnvironmentalSensorHistor{ fieldName = "19", fieldValue= "41"  },
                new EnvironmentalSensorHistor{ fieldName = "20", fieldValue= "23"  },
                new EnvironmentalSensorHistor{ fieldName = "21", fieldValue= "31"  },
                new EnvironmentalSensorHistor{ fieldName = "22", fieldValue= "23"  },
                new EnvironmentalSensorHistor{ fieldName = "23", fieldValue= "11"  },
                new EnvironmentalSensorHistor{ fieldName = "24", fieldValue= "21"  },
            });
            var ddd = echartOption.InitOption();
            infoView1_EchartsView.ShowWithOption(ddd);
            echartOption1 = new EchartsOption_Histogram();
            echartOption1.xTitle = "时间";
            echartOption1.yTitle = "电量(kw)";
            //echartOption.InitXdataText(new List<string>()
            //{
            //    "21","22","23","24","25","26","26","27","28","29",
            //    "21","22","23","24","25","26","26","27","28","29",
            //    "21","22","23","24"
            //});
            //echartOption.InitYdataText(new List<EnvironmentalSensorHistor>() {
            //    new EnvironmentalSensorHistor{ fieldName = "1", fieldValue= "23"  },
            //    new EnvironmentalSensorHistor{ fieldName = "2", fieldValue= "22"  },
            //    new EnvironmentalSensorHistor{ fieldName = "3", fieldValue= "11"  },
            //    new EnvironmentalSensorHistor{ fieldName = "4", fieldValue= "21"  },
            //    new EnvironmentalSensorHistor{ fieldName = "5", fieldValue= "41"  },
            //    new EnvironmentalSensorHistor{ fieldName = "6", fieldValue= "23"  },
            //    new EnvironmentalSensorHistor{ fieldName = "7", fieldValue= "31"  },
            //    new EnvironmentalSensorHistor{ fieldName = "8", fieldValue= "23"  },
            //    new EnvironmentalSensorHistor{ fieldName = "9", fieldValue= "11"  },
            //    new EnvironmentalSensorHistor{ fieldName = "10", fieldValue= "21"  },
            //    new EnvironmentalSensorHistor{ fieldName = "11", fieldValue= "24"  },
            //    new EnvironmentalSensorHistor{ fieldName = "12", fieldValue= "41"  },
            //    new EnvironmentalSensorHistor{ fieldName = "13", fieldValue= "32"  },
            //    new EnvironmentalSensorHistor{ fieldName = "14", fieldValue= "23"  },
            //    new EnvironmentalSensorHistor{ fieldName = "15", fieldValue= "23"  },
            //    new EnvironmentalSensorHistor{ fieldName = "16", fieldValue= "22"  },
            //    new EnvironmentalSensorHistor{ fieldName = "17", fieldValue= "11"  },
            //    new EnvironmentalSensorHistor{ fieldName = "18", fieldValue= "21"  },
            //    new EnvironmentalSensorHistor{ fieldName = "19", fieldValue= "41"  },
            //    new EnvironmentalSensorHistor{ fieldName = "20", fieldValue= "23"  },
            //    new EnvironmentalSensorHistor{ fieldName = "21", fieldValue= "31"  },
            //    new EnvironmentalSensorHistor{ fieldName = "22", fieldValue= "23"  },
            //    new EnvironmentalSensorHistor{ fieldName = "23", fieldValue= "11"  },
            //    new EnvironmentalSensorHistor{ fieldName = "24", fieldValue= "21"  },
            //});
            //var ddd = echartOption.InitOption();
            //infoView1_EchartsView.ShowWithOption(ddd);
            infoView1.AddChidren(new Button()
            {
@@ -277,7 +273,7 @@
            });
            #region 用电量
            var infoView2 = new FrameLayout()
            infoView2 = new FrameLayout()
            {
                Width = Application.GetRealWidth(343),
                Height = Application.GetRealWidth(382),
@@ -305,7 +301,7 @@
            };
            infoView2.AddChidren(infoView2_DateView);
            var infoView2_Date_Day = new Button()
            infoView2_Date_Day = new Button()
            {
                Width = Application.GetRealWidth(103),
                Height = Application.GetRealWidth(26),
@@ -324,7 +320,7 @@
            infoView2_DateView.AddChidren(infoView2_Date_Day);
            var infoView2_Date_Month = new Button()
            infoView2_Date_Month = new Button()
            {
                Width = Application.GetRealWidth(103),
                Height = Application.GetRealWidth(26),
@@ -343,7 +339,7 @@
            infoView2_DateView.AddChidren(infoView2_Date_Month);
            var infoView2_Date_Year = new Button()
            infoView2_Date_Year = new Button()
            {
                Width = Application.GetRealWidth(103),
                Height = Application.GetRealWidth(26),
@@ -368,7 +364,7 @@
            };
            infoView2.AddChidren(infoView2_DateInfoView);
            var infoView2_DateInfo_PreIconButton = new Button()
            infoView2_DateInfo_PreIconButton = new Button()
            {
                X = Application.GetRealWidth(18),
                Gravity = Gravity.CenterVertical,
@@ -378,13 +374,13 @@
            };
            infoView2_DateInfoView.AddChidren(infoView2_DateInfo_PreIconButton);
            var infoView2_DateInfo_PreClickButton = new Button()
            infoView2_DateInfo_PreClickButton = new Button()
            {
                Width = Application.GetRealWidth(32 + 6),
            };
            infoView2_DateInfoView.AddChidren(infoView2_DateInfo_PreClickButton);
            var infoView2_DateInfo_DateTextButton = new Button()
            infoView2_DateInfo_DateTextButton = new Button()
            {
                Gravity = Gravity.Center,
                Width = Application.GetRealWidth(200),
@@ -397,7 +393,7 @@
            infoView2_DateInfoView.AddChidren(infoView2_DateInfo_DateTextButton);
            var infoView2_DateInfo_NextIconButton = new Button()
            infoView2_DateInfo_NextIconButton = new Button()
            {
                X = Application.GetRealWidth(343 - 18 - 6),
                Gravity = Gravity.CenterVertical,
@@ -407,9 +403,9 @@
            };
            infoView2_DateInfoView.AddChidren(infoView2_DateInfo_NextIconButton);
            var infoView2_DateInfo_NextClickButton = new Button()
            infoView2_DateInfo_NextClickButton = new Button()
            {
                X = Application.GetRealWidth(343 - 18 - 6 -32),
                X = Application.GetRealWidth(343 - 18 - 6 - 32),
                Width = Application.GetRealWidth(32 + 6),
            };
            infoView2_DateInfoView.AddChidren(infoView2_DateInfo_NextClickButton);
@@ -417,49 +413,49 @@
            #endregion
            #region 数据图表
            MyEchartsViewOn infoView2_EchartsView = new MyEchartsViewOn()
            infoView2_EchartsView = new MyEchartsViewOn()
            {
                Y = Application.GetRealWidth(101),
                Height = Application.GetRealWidth(246),
            };
            infoView2.AddChidren(infoView2_EchartsView);
            var echartOption2 = new EchartsOption_Histogram();
            echartOption2 = new EchartsOption_Histogram();
            echartOption2.xTitle = "时间";
            echartOption2.yTitle = "电量(kw)";
            echartOption2.InitXdataText(new List<string>()
            {
                "21","22","23","24","25","26","26","27","28","29",
                "21","22","23","24","25","26","26","27","28","29",
                "21","22","23","24"
            });
            echartOption2.InitYdataText(new List<EnvironmentalSensorHistor>() {
                new EnvironmentalSensorHistor{ fieldName = "1", fieldValue= "23"  },
                new EnvironmentalSensorHistor{ fieldName = "2", fieldValue= "22"  },
                new EnvironmentalSensorHistor{ fieldName = "3", fieldValue= "11"  },
                new EnvironmentalSensorHistor{ fieldName = "4", fieldValue= "21"  },
                new EnvironmentalSensorHistor{ fieldName = "5", fieldValue= "41"  },
                new EnvironmentalSensorHistor{ fieldName = "6", fieldValue= "23"  },
                new EnvironmentalSensorHistor{ fieldName = "7", fieldValue= "31"  },
                new EnvironmentalSensorHistor{ fieldName = "8", fieldValue= "23"  },
                new EnvironmentalSensorHistor{ fieldName = "9", fieldValue= "11"  },
                new EnvironmentalSensorHistor{ fieldName = "10", fieldValue= "21"  },
                new EnvironmentalSensorHistor{ fieldName = "11", fieldValue= "24"  },
                new EnvironmentalSensorHistor{ fieldName = "12", fieldValue= "41"  },
                new EnvironmentalSensorHistor{ fieldName = "13", fieldValue= "32"  },
                new EnvironmentalSensorHistor{ fieldName = "14", fieldValue= "23"  },
                new EnvironmentalSensorHistor{ fieldName = "15", fieldValue= "23"  },
                new EnvironmentalSensorHistor{ fieldName = "16", fieldValue= "22"  },
                new EnvironmentalSensorHistor{ fieldName = "17", fieldValue= "11"  },
                new EnvironmentalSensorHistor{ fieldName = "18", fieldValue= "21"  },
                new EnvironmentalSensorHistor{ fieldName = "19", fieldValue= "41"  },
                new EnvironmentalSensorHistor{ fieldName = "20", fieldValue= "23"  },
                new EnvironmentalSensorHistor{ fieldName = "21", fieldValue= "31"  },
                new EnvironmentalSensorHistor{ fieldName = "22", fieldValue= "23"  },
                new EnvironmentalSensorHistor{ fieldName = "23", fieldValue= "11"  },
                new EnvironmentalSensorHistor{ fieldName = "24", fieldValue= "21"  },
            });
            infoView2_EchartsView.ShowWithOption(echartOption2.InitOption());
            //echartOption2.InitXdataText(new List<string>()
            //{
            //    "21","22","23","24","25","26","26","27","28","29",
            //    "21","22","23","24","25","26","26","27","28","29",
            //    "21","22","23","24"
            //});
            //echartOption2.InitYdataText(new List<EnvironmentalSensorHistor>() {
            //    new EnvironmentalSensorHistor{ fieldName = "1", fieldValue= "23"  },
            //    new EnvironmentalSensorHistor{ fieldName = "2", fieldValue= "22"  },
            //    new EnvironmentalSensorHistor{ fieldName = "3", fieldValue= "11"  },
            //    new EnvironmentalSensorHistor{ fieldName = "4", fieldValue= "21"  },
            //    new EnvironmentalSensorHistor{ fieldName = "5", fieldValue= "41"  },
            //    new EnvironmentalSensorHistor{ fieldName = "6", fieldValue= "23"  },
            //    new EnvironmentalSensorHistor{ fieldName = "7", fieldValue= "31"  },
            //    new EnvironmentalSensorHistor{ fieldName = "8", fieldValue= "23"  },
            //    new EnvironmentalSensorHistor{ fieldName = "9", fieldValue= "11"  },
            //    new EnvironmentalSensorHistor{ fieldName = "10", fieldValue= "21"  },
            //    new EnvironmentalSensorHistor{ fieldName = "11", fieldValue= "24"  },
            //    new EnvironmentalSensorHistor{ fieldName = "12", fieldValue= "41"  },
            //    new EnvironmentalSensorHistor{ fieldName = "13", fieldValue= "32"  },
            //    new EnvironmentalSensorHistor{ fieldName = "14", fieldValue= "23"  },
            //    new EnvironmentalSensorHistor{ fieldName = "15", fieldValue= "23"  },
            //    new EnvironmentalSensorHistor{ fieldName = "16", fieldValue= "22"  },
            //    new EnvironmentalSensorHistor{ fieldName = "17", fieldValue= "11"  },
            //    new EnvironmentalSensorHistor{ fieldName = "18", fieldValue= "21"  },
            //    new EnvironmentalSensorHistor{ fieldName = "19", fieldValue= "41"  },
            //    new EnvironmentalSensorHistor{ fieldName = "20", fieldValue= "23"  },
            //    new EnvironmentalSensorHistor{ fieldName = "21", fieldValue= "31"  },
            //    new EnvironmentalSensorHistor{ fieldName = "22", fieldValue= "23"  },
            //    new EnvironmentalSensorHistor{ fieldName = "23", fieldValue= "11"  },
            //    new EnvironmentalSensorHistor{ fieldName = "24", fieldValue= "21"  },
            //});
            //infoView2_EchartsView.ShowWithOption(echartOption2.InitOption());
            infoView2.AddChidren(new Button()
            {
@@ -483,15 +479,18 @@
            });
            initQueryButton();
            getPvElectricityHistory();
            getLoadElectricityHistory();
        }
        /// <summary>
        /// 读取温度值历史数据
        /// 读取发电量历史数据
        /// hour=近24小时、day_hour =某日24小时、week=近一周、month = 近一月、custom_month=某年某月 y/M、custom_year=某年 y
        /// </summary>
        private void getTempHistory()
        private void getPvElectricityHistory()
        {
            if (MainPage.NoLoginMode)
            {
@@ -501,6 +500,7 @@
            var loadPage = new Loading()
            {
                LodingBackgroundColor = 0x88888888,
                BackgroundColor = 0x00FFFFFF,
            };
            infoView1.AddChidren(loadPage);
@@ -510,7 +510,7 @@
                {
                    Application.RunOnMainThread(() =>
                    {
                        loadPage.Start(Language.StringByID(StringId.PleaseWait));
                        loadPage.Start();
                    });
                    switch (queryType1)
@@ -563,9 +563,9 @@
        }
        /// <summary>
        /// 获取用水量历史记录
        /// 获取用电量历史记录
        /// </summary>
        private void getWaterHistory()
        private void getLoadElectricityHistory()
        {
            if (MainPage.NoLoginMode)
            {
@@ -574,6 +574,7 @@
            var loadPage = new Loading()
            {
                LodingBackgroundColor = 0x88888888,
                BackgroundColor = 0x00FFFFFF,
            };
            infoView2.AddChidren(loadPage);
@@ -583,7 +584,7 @@
                {
                    Application.RunOnMainThread(() =>
                    {
                        loadPage.Start(Language.StringByID(StringId.PleaseWait));
                        loadPage.Start();
                    });
                    switch (queryType2)
                    {
@@ -641,110 +642,83 @@
            {
                SetTempQureyDateDialog();
            };
            infoView1_DateInfo_PreClickButton.MouseUpEventHandler = (sender, e) => {
                var tempQueryDate = new DateTime(queryTime_Year1, queryTime_Month1, queryTime_Day1);
            infoView1_DateInfo_PreClickButton.MouseUpEventHandler = (sender, e) =>
            {
                var pvElecQueryDate = new DateTime(queryTime_Year1, queryTime_Month1, queryTime_Day1);
                if (queryType1 == QueryType.day_hour)
                {
                    tempQueryDate = tempQueryDate.AddDays(-1);
                    if (tempQueryDate.Year == 2023 && tempQueryDate.Month == 1 && tempQueryDate.Day == 1)
                    if (pvElecQueryDate.Year == 2023 && pvElecQueryDate.Month == 1 && pvElecQueryDate.Day == 1)
                    {
                        infoView1_DateInfo_PreIconButton.Visible = false;
                        infoView1_DateInfo_PreClickButton.Enable = false;
                        return;
                    }
                    if (tempQueryDate.Year == DateTime.Now.Year && tempQueryDate.Month == DateTime.Now.Month && tempQueryDate.Day == DateTime.Now.Day - 1)
                    {
                        infoView1_DateInfo_NextIconButton.Visible = true;
                        infoView1_DateInfo_NextClickButton.Enable = true;
                    }
                    pvElecQueryDate = pvElecQueryDate.AddDays(-1);
                    infoView1_DateInfo_DateTextButton.Text = pvElecQueryDate.ToString("yyyy-MM-dd");
                }
                else if (queryType1 == QueryType.custom_month)
                {
                    tempQueryDate = tempQueryDate.AddMonths(-1);
                    if (tempQueryDate.Year == 2023 && tempQueryDate.Month == 1)
                    if (pvElecQueryDate.Year == 2023 && pvElecQueryDate.Month == 1)
                    {
                        infoView1_DateInfo_PreIconButton.Visible = false;
                        infoView1_DateInfo_PreClickButton.Enable = false;
                        return;
                    }
                    if (tempQueryDate.Year == DateTime.Now.Year && tempQueryDate.Month == DateTime.Now.Month - 1)
                    {
                        infoView1_DateInfo_NextIconButton.Visible = true;
                        infoView1_DateInfo_NextClickButton.Enable = true;
                    }
                    pvElecQueryDate = pvElecQueryDate.AddMonths(-1);
                    infoView1_DateInfo_DateTextButton.Text = pvElecQueryDate.ToString("yyyy-MM");
                }
                else if (queryType1 == QueryType.custom_year)
                {
                    tempQueryDate = tempQueryDate.AddYears(-1);
                    if (tempQueryDate.Year == 2023)
                    if (pvElecQueryDate.Year == 2023)
                    {
                        infoView1_DateInfo_PreIconButton.Visible = false;
                        infoView1_DateInfo_PreClickButton.Enable = false;
                        return;
                    }
                    if (tempQueryDate.Year == DateTime.Now.Year - 1)
                    {
                        infoView1_DateInfo_NextIconButton.Visible = true;
                        infoView1_DateInfo_NextClickButton.Enable = true;
                    }
                    pvElecQueryDate = pvElecQueryDate.AddYears(-1);
                    infoView1_DateInfo_DateTextButton.Text = pvElecQueryDate.ToString("yyyy");
                }
                queryTime_Year1 = tempQueryDate.Year;
                queryTime_Month1 = tempQueryDate.Month;
                queryTime_Day1 = tempQueryDate.Day;
                infoView1_DateInfo_DateTextButton.Text = tempQueryDate.ToString("yyyy-MM-dd");
                getTempHistory();
                queryTime_Year1 = pvElecQueryDate.Year;
                queryTime_Month1 = pvElecQueryDate.Month;
                queryTime_Day1 = pvElecQueryDate.Day;
                getPvElectricityHistory();
            };
            infoView1_DateInfo_NextIconButton.Visible = false;
            infoView1_DateInfo_NextClickButton.Enable = false;
            infoView1_DateInfo_NextClickButton.MouseUpEventHandler = (sender, e) => {
            infoView1_DateInfo_NextClickButton.MouseUpEventHandler = (sender, e) =>
            {
                var tempQueryDate = new DateTime(queryTime_Year1, queryTime_Month1, queryTime_Day1);
                if (queryType1 == QueryType.day_hour)
                {
                    tempQueryDate = tempQueryDate.AddDays(1);
                    if (tempQueryDate.Year == 2023 && tempQueryDate.Month == 1 && tempQueryDate.Day == 2)
                    {
                        infoView1_DateInfo_PreIconButton.Visible = true;
                        infoView1_DateInfo_PreClickButton.Enable = true;
                    }
                    if (tempQueryDate.Year == DateTime.Now.Year && tempQueryDate.Month == DateTime.Now.Month && tempQueryDate.Day == DateTime.Now.Day)
                    {
                        infoView1_DateInfo_NextIconButton.Visible = false;
                        infoView1_DateInfo_NextClickButton.Enable = false;
                        return;
                    }
                    tempQueryDate = tempQueryDate.AddDays(1);
                    infoView1_DateInfo_DateTextButton.Text = tempQueryDate.ToString("yyyy-MM-dd");
                }
                else if (queryType1 == QueryType.custom_month)
                {
                    tempQueryDate = tempQueryDate.AddMonths(1);
                    if (tempQueryDate.Year == 2023 && tempQueryDate.Month == 2)
                    {
                        infoView1_DateInfo_PreIconButton.Visible = true;
                        infoView1_DateInfo_PreClickButton.Enable = true;
                    }
                    if (tempQueryDate.Year == DateTime.Now.Year && tempQueryDate.Month == DateTime.Now.Month)
                    {
                        infoView1_DateInfo_NextIconButton.Visible = false;
                        infoView1_DateInfo_NextClickButton.Enable = false;
                        return;
                    }
                    tempQueryDate = tempQueryDate.AddMonths(1);
                    infoView1_DateInfo_DateTextButton.Text = tempQueryDate.ToString("yyyy-MM");
                }
                else if (queryType1 == QueryType.custom_year)
                {
                    tempQueryDate = tempQueryDate.AddYears(1);
                    if (tempQueryDate.Year == 2023)
                    {
                        infoView1_DateInfo_PreIconButton.Visible = false;
                        infoView1_DateInfo_PreClickButton.Enable = false;
                        return;
                    }
                    if (tempQueryDate.Year == DateTime.Now.Year)
                    {
                        infoView1_DateInfo_NextIconButton.Visible = false;
                        infoView1_DateInfo_NextClickButton.Enable = false;
                        return;
                    }
                    tempQueryDate = tempQueryDate.AddYears(1);
                    infoView1_DateInfo_DateTextButton.Text = tempQueryDate.ToString("yyyy");
                }
                queryTime_Year1 = tempQueryDate.Year;
                queryTime_Month1 = tempQueryDate.Month;
                queryTime_Day1 = tempQueryDate.Day;
                infoView1_DateInfo_DateTextButton.Text = tempQueryDate.ToString("yyyy-MM-dd");
                getTempHistory();
                getPvElectricityHistory();
            };
            infoView1_Date_Day.MouseUpEventHandler = (sender, e) => {
            infoView1_Date_Day.MouseUpEventHandler = (sender, e) =>
            {
                if (infoView1_Date_Day.IsSelected)
                {
                    return;
@@ -754,9 +728,10 @@
                infoView1_Date_Year.IsSelected = false;
                queryType1 = QueryType.day_hour;
                infoView1_DateInfo_DateTextButton.Text = new DateTime(queryTime_Year1, queryTime_Month1, queryTime_Day1).ToString("yyyy-MM-dd");
                getTempHistory();
                getPvElectricityHistory();
            };
            infoView1_Date_Month.MouseUpEventHandler = (sender, e) => {
            infoView1_Date_Month.MouseUpEventHandler = (sender, e) =>
            {
                if (infoView1_Date_Month.IsSelected)
                {
                    return;
@@ -766,9 +741,10 @@
                infoView1_Date_Year.IsSelected = false;
                queryType1 = QueryType.custom_month;
                infoView1_DateInfo_DateTextButton.Text = new DateTime(queryTime_Year1, queryTime_Month1, queryTime_Day1).ToString("yyyy-MM");
                getTempHistory();
                getPvElectricityHistory();
            };
            infoView1_Date_Year.MouseUpEventHandler = (sender, e) => {
            infoView1_Date_Year.MouseUpEventHandler = (sender, e) =>
            {
                if (infoView1_Date_Year.IsSelected)
                {
                    return;
@@ -778,116 +754,89 @@
                infoView1_Date_Year.IsSelected = true;
                queryType1 = QueryType.custom_year;
                infoView1_DateInfo_DateTextButton.Text = queryTime_Year1.ToString();
                getTempHistory();
                getPvElectricityHistory();
            };
            //-----------用水
            infoView2_DateInfo_DateTextButton.MouseUpEventHandler = (sender, e) =>
            {
                SetWaterQureyDateDialog();
            };
            infoView2_DateInfo_PreClickButton.MouseUpEventHandler = (sender, e) => {
            infoView2_DateInfo_PreClickButton.MouseUpEventHandler = (sender, e) =>
            {
                var waterQueryDate = new DateTime(queryTime_Year2, queryTime_Month2, queryTime_Day2);
                if (queryType2 == QueryType.day_hour)
                {
                    waterQueryDate = waterQueryDate.AddDays(-1);
                    if (waterQueryDate.Year == 2023 && waterQueryDate.Month == 1 && waterQueryDate.Day == 1)
                    {
                        infoView2_DateInfo_PreIconButton.Visible = false;
                        infoView2_DateInfo_PreClickButton.Enable = false;
                        return;
                    }
                    if (waterQueryDate.Year == DateTime.Now.Year && waterQueryDate.Month == DateTime.Now.Month && waterQueryDate.Day == DateTime.Now.Day - 1)
                    {
                        infoView2_DateInfo_NextIconButton.Visible = true;
                        infoView2_DateInfo_NextClickButton.Enable = true;
                    }
                    waterQueryDate = waterQueryDate.AddDays(-1);
                    infoView2_DateInfo_DateTextButton.Text = waterQueryDate.ToString("yyyy-MM-dd");
                }
                else if (queryType2 == QueryType.custom_month)
                {
                    waterQueryDate = waterQueryDate.AddMonths(-1);
                    if (waterQueryDate.Year == 2023 && waterQueryDate.Month == 1)
                    {
                        infoView2_DateInfo_PreIconButton.Visible = false;
                        infoView2_DateInfo_PreClickButton.Enable = false;
                        return;
                    }
                    if (waterQueryDate.Year == DateTime.Now.Year && waterQueryDate.Month == DateTime.Now.Month - 1)
                    {
                        infoView2_DateInfo_NextIconButton.Visible = true;
                        infoView2_DateInfo_NextClickButton.Enable = true;
                    }
                    waterQueryDate = waterQueryDate.AddMonths(-1);
                    infoView2_DateInfo_DateTextButton.Text = waterQueryDate.ToString("yyyy-MM");
                }
                else if (queryType2 == QueryType.custom_year)
                {
                    waterQueryDate = waterQueryDate.AddYears(-1);
                    if (waterQueryDate.Year == 2023)
                    {
                        infoView2_DateInfo_PreIconButton.Visible = false;
                        infoView2_DateInfo_PreClickButton.Enable = false;
                        return;
                    }
                    if (waterQueryDate.Year == DateTime.Now.Year - 1)
                    {
                        infoView2_DateInfo_NextIconButton.Visible = true;
                        infoView2_DateInfo_NextClickButton.Enable = true;
                    }
                    waterQueryDate = waterQueryDate.AddYears(-1);
                    infoView2_DateInfo_DateTextButton.Text = waterQueryDate.ToString("yyyy");
                }
                queryTime_Year2 = waterQueryDate.Year;
                queryTime_Month2 = waterQueryDate.Month;
                queryTime_Day2 = waterQueryDate.Day;
                infoView2_DateInfo_DateTextButton.Text = waterQueryDate.ToString("yyyy-MM-dd");
                getWaterHistory();
                getLoadElectricityHistory();
            };
            infoView2_DateInfo_NextIconButton.Visible = false;
            infoView2_DateInfo_NextClickButton.Enable = false;
            infoView2_DateInfo_NextClickButton.MouseUpEventHandler = (sender, e) => {
            infoView2_DateInfo_NextClickButton.MouseUpEventHandler = (sender, e) =>
            {
                var waterQueryDate = new DateTime(queryTime_Year2, queryTime_Month2, queryTime_Day2);
                if (queryType2 == QueryType.day_hour)
                {
                    waterQueryDate = waterQueryDate.AddDays(1);
                    if (waterQueryDate.Year == 2023 && waterQueryDate.Month == 1 && waterQueryDate.Day == 2)
                    {
                        infoView2_DateInfo_PreIconButton.Visible = true;
                        infoView2_DateInfo_PreClickButton.Enable = true;
                    }
                    if (waterQueryDate.Year == DateTime.Now.Year && waterQueryDate.Month == DateTime.Now.Month && waterQueryDate.Day == DateTime.Now.Day)
                    {
                        infoView2_DateInfo_NextIconButton.Visible = false;
                        infoView2_DateInfo_NextClickButton.Enable = false;
                        return;
                    }
                    waterQueryDate = waterQueryDate.AddDays(1);
                    infoView2_DateInfo_DateTextButton.Text = waterQueryDate.ToString("yyyy-MM-dd");
                }
                else if (queryType2 == QueryType.custom_month)
                {
                    waterQueryDate = waterQueryDate.AddMonths(1);
                    if (waterQueryDate.Year == 2023 && waterQueryDate.Month == 2)
                    {
                        infoView2_DateInfo_PreIconButton.Visible = true;
                        infoView2_DateInfo_PreClickButton.Enable = true;
                    }
                    if (waterQueryDate.Year == DateTime.Now.Year && waterQueryDate.Month == DateTime.Now.Month)
                    {
                        infoView2_DateInfo_NextIconButton.Visible = false;
                        infoView2_DateInfo_NextClickButton.Enable = false;
                        return;
                    }
                    waterQueryDate = waterQueryDate.AddMonths(1);
                    infoView2_DateInfo_DateTextButton.Text = waterQueryDate.ToString("yyyy-MM");
                }
                else if (queryType2 == QueryType.custom_year)
                {
                    waterQueryDate = waterQueryDate.AddYears(1);
                    if (waterQueryDate.Year == 2023)
                    {
                        infoView2_DateInfo_PreIconButton.Visible = false;
                        infoView2_DateInfo_PreClickButton.Enable = false;
                        return;
                    }
                    if (waterQueryDate.Year == DateTime.Now.Year)
                    {
                        infoView2_DateInfo_NextIconButton.Visible = false;
                        infoView2_DateInfo_NextClickButton.Enable = false;
                        return;
                    }
                    waterQueryDate = waterQueryDate.AddYears(1);
                    infoView2_DateInfo_DateTextButton.Text = waterQueryDate.ToString("yyyy");
                }
                queryTime_Year2 = waterQueryDate.Year;
                queryTime_Month2 = waterQueryDate.Month;
                queryTime_Day2 = waterQueryDate.Day;
                infoView2_DateInfo_DateTextButton.Text = waterQueryDate.ToString("yyyy-MM-dd");
                getWaterHistory();
                getLoadElectricityHistory();
            };
            infoView2_Date_Day.MouseDownEventHandler = (sender, e) => {
            infoView2_Date_Day.MouseDownEventHandler = (sender, e) =>
            {
                if (infoView2_Date_Day.IsSelected)
                {
                    return;
@@ -897,9 +846,10 @@
                infoView2_Date_Year.IsSelected = false;
                queryType2 = QueryType.day_hour;
                infoView2_DateInfo_DateTextButton.Text = new DateTime(queryTime_Year2, queryTime_Month2, queryTime_Day2).ToString("yyyy-MM-dd");
                getWaterHistory();
                getLoadElectricityHistory();
            };
            infoView2_Date_Month.MouseDownEventHandler = (sender, e) => {
            infoView2_Date_Month.MouseDownEventHandler = (sender, e) =>
            {
                if (infoView2_Date_Month.IsSelected)
                {
                    return;
@@ -909,9 +859,10 @@
                infoView2_Date_Year.IsSelected = false;
                queryType2 = QueryType.custom_month;
                infoView2_DateInfo_DateTextButton.Text = new DateTime(queryTime_Year2, queryTime_Month2, queryTime_Day2).ToString("yyyy-MM");
                getWaterHistory();
                getLoadElectricityHistory();
            };
            infoView2_Date_Year.MouseDownEventHandler = (sender, e) => {
            infoView2_Date_Year.MouseDownEventHandler = (sender, e) =>
            {
                if (infoView2_Date_Year.IsSelected)
                {
                    return;
@@ -921,7 +872,7 @@
                infoView2_Date_Year.IsSelected = true;
                queryType2 = QueryType.custom_year;
                infoView2_DateInfo_DateTextButton.Text = queryTime_Year2.ToString();
                getWaterHistory();
                getLoadElectricityHistory();
            };
        }
@@ -1115,6 +1066,10 @@
                }
                if (pickerItems_Month != null)
                {
                    if (int2 > pickerItems_Month.Count)
                    {
                        int2 = 0;
                    }
                    if (pickerItems_Month[int2] != item2.ToString())
                    {
                        int.TryParse(pickerItems_Month[int2], out item2);
@@ -1178,7 +1133,7 @@
                        infoView1_DateInfo_DateTextButton.Text = new DateTime(queryTime_Year1, queryTime_Month1, queryTime_Day1).ToString("yyyy-MM-dd");
                    }
                }
                getTempHistory();
                getPvElectricityHistory();
            };
        }
@@ -1370,6 +1325,10 @@
                }
                if (pickerItems_Month != null)
                {
                    if (int2 > pickerItems_Month.Count)
                    {
                        int2 = 0;
                    }
                    if (pickerItems_Month[int2] != item2.ToString())
                    {
                        int.TryParse(pickerItems_Month[int2], out item2);
@@ -1433,7 +1392,7 @@
                        infoView2_DateInfo_DateTextButton.Text = new DateTime(queryTime_Year2, queryTime_Month2, queryTime_Day2).ToString("yyyy-MM-dd");
                    }
                }
                getWaterHistory();
                getLoadElectricityHistory();
            };
        }
@@ -1441,5 +1400,4 @@
    }
}
}