Пример #1
0
 public void Clear()
 {
     if (TimeList != null)
     {
         Modified |= TimeList.Count > 0;
         TimeList.Clear();
     }
     CountDailyWorkingHours        = 0;
     CountDailyPlannedWorkingHours = 0;
 }
Пример #2
0
 public void CancelReservation()
 {
     //reset set variables
     Direction            = null;
     _userReservationTime = null;
     _userReservationDate = null;
     SelectedDate         = DateTime.Today;
     TimeList.Clear();
     IsTimeListEnabled     = false;
     IsCreateButtonEnabled = false;
 }
Пример #3
0
 /// <summary>
 /// Eager load data from database
 /// </summary>
 private void GetTimeKeepingList()
 {
     try
     {
         Logger.Info("GetTimeKeepingList Method");
         var timeList = DatabaseHelper.GetList <Timekeeping>();
         TimeList.Clear();
         foreach (var item in timeList)
         {
             TimeList.Add(item);
         }
     }
     catch (Exception ex)
     {
         Logger.Error(ex, "Exception occured from getting timekeeping list");
     }
 }
Пример #4
0
 private async Task GetAvailableHoursForDateAndDirection()
 {
     await Task.Run(async() =>
     {
         if (SelectedDate != null && Direction != null && Direction != "")
         {
             CancellationToken token = new CancellationToken();
             List <ReservationResponse> reservations = await _reservationService.GetReservationsForDateAndDirections(pathDateAndDirections, Direction, SelectedDate, token);
             _userReservationDate       = _selectedDate.Date.ToString();
             List <string> allHoursList = _reservationService.GetAllHours(_direction);
             DateTime newSelectedDate   = new DateTime();
             UseTempDateTime(newSelectedDate);
             //ParseHourArrays(allHoursList);
             //RemoveReservedHours(allHoursList, reservations);
             Xamarin.Forms.Device.BeginInvokeOnMainThread(() =>
             {
                 TimeList.Clear();
                 allHoursList.ForEach(time => TimeList.Add(time));
                 IsTimeListEnabled = true;
             });
         }
     });
 }