Esempio n. 1
0
 public override string ToString()
 {
     return(string.Format("[{0} -> {1}]/{2}: {3}",
                          FromTime.ToString("HH:mm"), ToTime.ToString("HH:mm"),
                          this.TotalHours(),
                          this.TimeSheetType.ToString()));
 }
Esempio n. 2
0
        public bool Contains(DateTime time, DateTime periodStart, DateTime periodEnd)
        {
            int startHour   = int.Parse(FromTime.Substring(0, 2));
            int startMinute = int.Parse(FromTime.Substring(3, 2));

            int endHour   = int.Parse(ToTime.Substring(0, 2));
            int endMinute = int.Parse(ToTime.Substring(3, 2));

            while (periodStart <= periodEnd)
            {
                if (DaysOfWeek.Contains(periodStart.DayOfWeek))
                {
                    var dayPartStart = new DateTime(periodStart.Year, periodStart.Month, periodStart.Day, startHour, startMinute, 0);
                    var dayPartEnd   = new DateTime(periodStart.Year, periodStart.Month, periodStart.Day, endHour, endMinute, 59);

                    var result = time >= dayPartStart && time <= dayPartEnd;

                    if (result)
                    {
                        return(true);
                    }
                }
                periodStart = periodStart.AddDays(1);
            }

            return(false);
        }
Esempio n. 3
0
 public override string ToString()
 {
     if (!String.IsNullOrEmpty(Hospital))
     {
         return(FromTime.ToString("hh\\:mm") + " até " + ToTime.ToString("hh\\:mm") + " no " + Hospital);
     }
     return(FromTime.ToString("hh\\:mm") + " até " + ToTime.ToString("hh\\:mm"));
 }
Esempio n. 4
0
        private void UpdateTimespan()
        {
            Properties.Settings.Default.FromTime = FromTime.ToString("o");
            Properties.Settings.Default.ToTime   = ToTime.ToString("o");
            Properties.Settings.Default.Save();

            overviewPage.UpdateTimespan(FromTime, ToTime);
        }
 public override string ToString()
 {
     return(string.Format(
                "{0}\n{1} - {2}\n{3}",
                Subject,
                FromTime.ToString("HH:mm"),
                ToTime.ToString("HH:mm"),
                Teacher
                ));
 }
Esempio n. 6
0
        private Boolean InputSettingsAreValid()
        {
            if (FromTime.Value.HasValue == false)
            {
                FromTime.Focus();
                MessageBox.Show("please select a start time", "Invalid Settings", MessageBoxButton.OK, MessageBoxImage.Information);
                return(false);
            }

            if (ToTime.Value.HasValue == false)
            {
                ToTime.Focus();
                MessageBox.Show("please select a end time", "Invalid Settings", MessageBoxButton.OK, MessageBoxImage.Information);
                return(false);
            }

            if (FromTime.Value.Value == ToTime.Value.Value)
            {
                MessageBox.Show("selected timespans are not valid", "Invalid Settings", MessageBoxButton.OK, MessageBoxImage.Information);
                return(false);
            }

            if (RunUntil.SelectedDate.HasValue == false)
            {
                RunUntil.Focus();
                MessageBox.Show("please select an end date", "Invalid Settings", MessageBoxButton.OK, MessageBoxImage.Information);
                return(false);
            }

            if (RunUntil.SelectedDate.Value.Date < DateTime.Now.Date)
            {
                RunUntil.Focus();
                MessageBox.Show("end date must be greater than today", "Invalid Settings", MessageBoxButton.OK, MessageBoxImage.Information);
                return(false);
            }

            return(true);
        }
Esempio n. 7
0
 public override string ToString()
 {
     return(string.Concat(FromTime.ToString("h:mm"), " - ", ToTime.ToString("h:mm")));
 }
Esempio n. 8
0
 public async Task <List <DataPoint> > FetchDataAsync(TimeShift timeShift)
 {
     return(await FetchData(FromTime.GetTime(), ToTime.GetTime()));
 }
Esempio n. 9
0
 public IMeasurement Clone()
 {
     return(new RandomTimeSeriesMeasurement {
         Low = Low, High = High, FromTime = FromTime.Clone(), ToTime = ToTime.Clone(), TimeResolution = TimeResolution, MaxFetchSize = MaxFetchSize
     });
 }
Esempio n. 10
0
 public string GetDisplayText()
 {
     return($"{Low} (Low), {High} (High), {FromTime.GetTime()} to {ToTime.GetTime()}");
 }
 public override string ToString()
 {
     if (Every == 1)
     {
         return("every hour between " + FromTime.ToString(@"H\:mm") + " and " + ToTime.ToString(@"H\:mm"));
     }
     else
     {
         return("every " + Every.ToString() + " hours between " + FromTime.ToString(@"H\:mm") + " and " + ToTime.ToString(@"H\:mm"));
     }
 }
Esempio n. 12
0
 public static List <Bookings> LoadReservationList()
 {
     list_result = Initialization.LoadBookingList(CustFname, CustLname, DOB, Insurance, Vname, FromDate, ToDate, Total_Days, Convert.ToDateTime(FromTime.ToString("HH:mm")), Convert.ToDateTime(ToTime.ToString("HH:mm")), RentalDate, VID, PickUp, DropOff);
     return(list_result);
 }