private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     TarikhShoroe.SetDateG(StartTime.Year, StartTime.Month, StartTime.Day);
     TarikhPayan.SetDateG(EndTime.Year, EndTime.Month, EndTime.Day);
     DateTimePickerShoroe.SelectedTime = new TimeSpan(0, StartTime.Hour, StartTime.Minute, 0);
     DateTimePickerPayan.SelectedTime  = new TimeSpan(0, EndTime.Hour, EndTime.Minute, 0);
 }
        private void ButtonSetDateToCurrent_Click(object sender, RoutedEventArgs e)
        {
            DateTime currentDate = DateTime.Now;

            TarikhPayan.SetDateG(currentDate.Year, currentDate.Month, currentDate.Day);
            DateTimePickerPayan.SelectedTime = new TimeSpan(0, currentDate.Hour, currentDate.Minute, 0);
        }
        private void SetDates()
        {
            DateTime tempDate1;
            DateTime tempDate2;
            int      hour1;
            int      hour2;
            int      minute1;
            int      minute2;

            tempDate1 = TarikhShoroe.GetDateG();
            TimeSpan hour1ts = (TimeSpan)DateTimePickerShoroe.SelectedTime;

            hour1     = hour1ts.Hours;
            minute1   = hour1ts.Minutes;
            StartTime = new DateTime(tempDate1.Year, tempDate1.Month, tempDate1.Day, hour1, minute1, 0);

            tempDate2 = TarikhPayan.GetDateG();
            TimeSpan hour2ts = (TimeSpan)DateTimePickerPayan.SelectedTime;

            hour2   = hour2ts.Hours;
            minute2 = hour2ts.Minutes;
            EndTime = new DateTime(tempDate2.Year, tempDate2.Month, tempDate2.Day, hour2, minute2, 0);
        }