20230724_MBJC_upperpc/Views/AnchorPointView.xaml.cs

57 lines
2.0 KiB
C#
Raw Normal View History

2023-12-15 08:14:17 +00:00
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 _20230724_MBJC_upperpc.Views
{
/// <summary>
2023-12-23 03:35:57 +00:00
/// AnchorPointView.xaml 的交互逻辑
2023-12-15 08:14:17 +00:00
/// </summary>
2023-12-23 03:35:57 +00:00
public partial class AnchorPointView : UserControl
2023-12-15 08:14:17 +00:00
{
2023-12-23 03:35:57 +00:00
public AnchorPointView()
2023-12-15 08:14:17 +00:00
{
InitializeComponent();
}
2024-02-27 09:21:02 +00:00
private void DataPicker1_SelectedDateChanged(object sender, SelectionChangedEventArgs e)
{
//如果结束时间没有选
if (DataPicker2.SelectedDate == null)
return;
if (DataPicker1.SelectedDate > DataPicker2.SelectedDate)
{
MessageBox.Show("所选日期不能在起始日期之后!");
DataPicker1.SelectedDate = null;
}
//通过日期查询历史数据
MainWindow.viewModel.SearchHisData((DateTime)DataPicker1.SelectedDate, ((DateTime)DataPicker2.SelectedDate).AddHours(23).AddMinutes(59).AddSeconds(59), int.Parse(ID.Text));
}
2024-01-09 09:33:18 +00:00
private void DatePicker_SelectedDateChanged(object sender, SelectionChangedEventArgs e)
{
2024-02-27 09:21:02 +00:00
//如果起始时间没有选
if (DataPicker1.SelectedDate == null)
return;
//如果起始时间大于结束时间
if (DataPicker1.SelectedDate > DataPicker2.SelectedDate)
{
MessageBox.Show("所选日期不能在起始日期之前!");
DataPicker2.SelectedDate = null;
}
//通过日期查询历史数据
MainWindow.viewModel.SearchHisData((DateTime)DataPicker1.SelectedDate, ((DateTime)DataPicker2.SelectedDate).AddHours(23).AddMinutes(59).AddSeconds(59), int.Parse(ID.Text));
2024-01-09 09:33:18 +00:00
}
2024-02-27 09:21:02 +00:00
2023-12-15 08:14:17 +00:00
}
}