Jelajahi Sumber

查询报错修改

谢翼翔 1 tahun lalu
induk
melakukan
0f370cd079

+ 91 - 0
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Models/SelectTime/selectTimeModel.cs

@@ -0,0 +1,91 @@
+using SCADA.CommonLib;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SCADA_DAQ.Customer.Models.SelectTime
+{
+    public class selectTimeModel:ObservableObject
+    {
+        /// <summary>
+		/// 
+		/// </summary>
+		private int _Year = DateTime.Now.Year;
+        [Range(2000, 2200)]
+        [AutoViewProperty("年", Icon = "看板")]
+        public int Year
+        {
+            get { return _Year; }
+            set
+            {
+                if (value != _Year)
+                {
+                    _Year = value;
+                    OnPropertyChanged(nameof(Year));
+                }
+            }
+        }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        private int _Month = DateTime.Now.Month;
+        [Range(1, 12)]
+        [AutoViewProperty("月", Icon = "看板")]
+        public int Month
+        {
+            get { return _Month; }
+            set
+            {
+                if (value != _Month)
+                {
+                    _Month = value;
+                    OnPropertyChanged(nameof(Month));
+                }
+            }
+        }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        private int _Day = DateTime.Now.Day;
+        [Range(1, 31)]
+        [AutoViewProperty("日", Icon = "看板")]
+        public int Day
+        {
+            get { return _Day; }
+            set
+            {
+                if (value != _Day)
+                {
+                    _Day = value;
+                    OnPropertyChanged(nameof(Day));
+                }
+            }
+        }
+
+
+
+        private int _TimeChange = 0;
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public int TimeChange
+        {
+            get { return _TimeChange; }
+            set
+            {
+                if (value != _TimeChange)
+                {
+                    _TimeChange = value;
+                    OnPropertyChanged(nameof(TimeChange));
+                }
+            }
+        }
+    }
+}

+ 1 - 2
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmRunHistory.xaml

@@ -9,8 +9,7 @@
          d:DesignHeight="1080" d:DesignWidth="1920"
       Title="UctFrmRunHistory">
     <Grid >
-  
-   
+        <uct:UctTimeSelect x:Name="TimeSelect"/>
     </Grid>
 
 </wpfcontrol:BaseUctFrm>

+ 35 - 4
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmRunHistory.xaml.cs

@@ -48,12 +48,43 @@ namespace SCADA_DAQ.Customer
         public UctFrmRunHistory()
         {
             InitializeComponent();
-           
-           
+            //TimeSelect.SelectTimeChangeEvent += TimeSelect_SelectTimeChangeEvent; ;
+            //TimeSelect.ReturnTodayEvent += TimeSelect_ReturnTodayEvent; ;
+            //Env.selectTimeModel.PropertyChanged += SelectTimeModel_PropertyChanged;
+
+        }
+        private void SelectTimeModel_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
+        {
+            if (e.PropertyName == "TimeChange")
+            {
+                Dispatcher.Invoke(() =>
+                {
+                    //UpdateDayView();
+                    //UpdateWeekView();
+                    //UpdateMonthView();
+                });
+            }
         }
-   
-     
 
+        //private void TimeSelect_ReturnTodayEvent(object sender, EventArgs e)
+        //{
+        //    Env.selectTimeModel.TimeChange++;
+        //}
+
+        //private void TimeSelect_SelectTimeChangeEvent(object sender, EventArgs e)
+        //{
+        //    ShowChildWindow(new AutoView(Env.selectTimeModel), "日期查询", () =>
+        //    {
+        //        Dispatcher.Invoke(() =>
+        //        {
+        //            if (CheckTime())
+        //            {
+        //                Env.selectTimeModel.TimeChange++;
+        //            }
+        //        });
+        //        return true;
+        //    });
+        //}
 
     }
 

+ 15 - 0
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Views/Uct/UctTimeSelect.xaml

@@ -0,0 +1,15 @@
+<wpfcontrol:BaseUserControl x:Class="SCADA_DAQ.Customer.Views.Uct.UctTimeSelect"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+             xmlns:local="clr-namespace:SCADA_DAQ.Customer.Views.Uct" xmlns:wpfcontrol="clr-namespace:SCADA.CommonCtrl.WpfControl;assembly=SCADA.CommonCtrl"
+             mc:Ignorable="d" 
+             d:DesignHeight="450" d:DesignWidth="800">
+    <Grid>
+        <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right">
+            <wpfcontrol:IconButton ButtonKind="QueryButton" HorizontalAlignment="Right" Title="日期搜索" Margin="16,0" Click="IconButton_Click"/>
+            <wpfcontrol:IconButton ButtonKind="RigthButton" ButtonStyle="Success" HorizontalAlignment="Right" Title="转今日" Margin="16,0" Click="IconButton_Click_1"/>
+        </StackPanel>
+    </Grid>
+</wpfcontrol:BaseUserControl>

+ 53 - 0
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Views/Uct/UctTimeSelect.xaml.cs

@@ -0,0 +1,53 @@
+using SCADA.CommonCtrl.WpfControl;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace SCADA_DAQ.Customer.Views.Uct
+{
+    /// <summary>
+    /// UctTimeSelect.xaml 的交互逻辑
+    /// </summary>
+    public partial class UctTimeSelect : BaseUserControl
+    {
+        public UctTimeSelect()
+        {
+            InitializeComponent();
+        }
+        public event EventHandler SelectTimeChangeEvent;
+
+        public event EventHandler ReturnTodayEvent;
+
+     
+        private void IconButton_Click(object sender, RoutedEventArgs e)
+        {
+            if (SelectTimeChangeEvent != null)
+            {
+                SelectTimeChangeEvent.Invoke(this, new EventArgs());
+            }
+
+        }
+
+        private void IconButton_Click_1(object sender, RoutedEventArgs e)
+        {
+            //Env.selectTimeModel.Year = DateTime.Now.Year;
+            //Env.selectTimeModel.Month = DateTime.Now.Month;
+            //Env.selectTimeModel.Day = DateTime.Now.Day;
+            if (ReturnTodayEvent != null)
+            {
+                ReturnTodayEvent.Invoke(this, new EventArgs());
+            }
+        }
+    }
+}

+ 6 - 0
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/SCADA_DAQ.csproj.user

@@ -122,6 +122,9 @@
     <Compile Update="Customer\Views\Uct\UctSiemensDigitalPunchingEquipment.xaml.cs">
       <SubType>Code</SubType>
     </Compile>
+    <Compile Update="Customer\Views\Uct\UctTimeSelect.xaml.cs">
+      <SubType>Code</SubType>
+    </Compile>
     <Compile Update="Customer\Views\Uct\UctTimeYield.xaml.cs">
       <SubType>Code</SubType>
     </Compile>
@@ -258,6 +261,9 @@
     <Page Update="Customer\Views\Uct\UctScheduleStopHourMinaa.xaml">
       <SubType>Designer</SubType>
     </Page>
+    <Page Update="Customer\Views\Uct\UctTimeSelect.xaml">
+      <SubType>Designer</SubType>
+    </Page>
     <Page Update="Customer\Views\Uct\UctYaweiPressBrakeTwo.xaml">
       <SubType>Designer</SubType>
     </Page>