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.Shapes;

namespace MWS.Domain.View.History
{
    /// <summary>
    /// DateTimeSelectWindow.xaml 的交互逻辑
    /// </summary>
    public partial class DateTimeSelectWindow : Window
    {
        public bool Submit { get; internal set; }
        public DateTime BeginTime { get; internal set; }
        public DateTime EndTime { get; internal set; }
        

        public DateTimeSelectWindow(DateTime beginTime, DateTime endTime)
        {
            InitializeComponent();
            DateTime now = DateTime.Now;
            tpcEndTime.DateTime = endTime;
            tpcEndTime.BindData();
            tpcBeginTime.DateTime = beginTime;
            tpcBeginTime.BindData();
            this.Topmost = true;
        }

        private void closeButton_MouseDown(object sender, MouseButtonEventArgs e)
        {
            this.Close();
        }
        private void close_Click(object sender, RoutedEventArgs e)
        {
            DialogResult = false;
            Submit = false;
            this.Close();
        }
        private void select_Click(object sender, RoutedEventArgs e)
        {
            BeginTime = tpcBeginTime.DateTime;
            EndTime = tpcEndTime.DateTime;
            if (BeginTime >= EndTime)
            {
                MessageBox.Show("开始时间不能大于结束时间!");
                return;
            }
            DialogResult = true;
            Submit = true;
            this.Close();
        }

       
    }
}
