async Task ExecuteLoadDatesCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                Dates.Clear();
                var dates = await DataStore.GetItemsAsync(true);

                Dates.ReplaceRange(dates);
            }
            catch (Exception ex)
            {
                MessagingCenter.Send("Não é possível carregar as Previsões de Ganhos.", "messageForecastGain");
            }
            finally
            {
                IsBusy = false;
            }
        }
Ejemplo n.º 2
0
        protected void LoadSpecialDatesAsync(DateTime from, DateTime to)
        {
            IsBusy = true;
            Device.BeginInvokeOnMainThread(async() =>
            {
                try
                {
                    Dates.Clear();
                    _currentTimesheet = await _timesheetModule.TimesheetService.GetTimesheetBeetweenDates(from, to);
                    var specialDates  = await _timesheetModule.CalendarService.GetSpecialDatesBeetweenDatesAsync(_currentTimesheet);
                    specialDates.ForEach(x => SpecialDates.Add(x));
                    IsBusy = false;
                }
                catch (Exception ex)
                {
                    IsBusy = false;
                    Debug.WriteLine($"[Booking] Error: {ex}");

                    await BaseModule.DialogService.ShowAlertAsync(
                        "An error ocurred, try again",
                        "Error",
                        "Ok");
                }
            });
        }
Ejemplo n.º 3
0
 private void CalendarDatesChangedMethod(SelectedDatesCollection source)
 {
     Dates.Clear();
     foreach (var item in source)
     {
         Dates.Add(item.Date);
     }
 }
Ejemplo n.º 4
0
 public void Clear()
 {
     Dates.Clear();
     for (int i = 0; i < Values.Length; i++)
     {
         Values[i].Clear();
     }
 }
Ejemplo n.º 5
0
        public bool init(string fileName)
        {
            FileName = fileName;
            Headers.Clear();
            Dates.Clear();
            Data.Clear();

            return(File.Exists(fileName));
        }
Ejemplo n.º 6
0
        public void sortDates()
        {
            List <Date> tmp = Dates.OrderBy(Date => Date.date).ToList();

            Dates.Clear();
            for (int i = tmp.Count - 1; i >= 0; i--)
            {
                Dates.Add(tmp[i]);
            }
        }
Ejemplo n.º 7
0
        private void DetermineDates()
        {
            Dates.Clear();
            DateTime startDate  = GetStartDate();
            int      month      = startDate.Month;
            int      year       = startDate.Year;
            var      dayOfWeek  = (int)startDate.DayOfWeek;
            DateTime time2      = startDate.AddDays(-7.0);
            int      startIndex = StartIndex;

            while (startIndex <= LastIndex)
            {
                double xValue     = startIndex;
                bool   startWeek  = false;
                bool   startMonth = false;
                bool   startYear  = false;
                if (((((int)startDate.DayOfWeek < dayOfWeek) || (startDate.DayOfWeek == DayOfWeek.Monday)) ||
                     (startDate.Subtract(time2).Days >= 7)) &&
                    ((startDate.DayOfWeek != DayOfWeek.Saturday) && (startDate.DayOfWeek != DayOfWeek.Sunday)))
                {
                    time2     = startDate;
                    startWeek = true;
                }
                dayOfWeek = (int)startDate.DayOfWeek;
                if (startDate.Month != month)
                {
                    month      = startDate.Month;
                    startMonth = true;
                }
                if (startDate.Year != year)
                {
                    year      = startDate.Year;
                    startYear = true;
                }
                Dates.Add(new XAxisLabelInfo(startDate, xValue, startWeek, startMonth, startYear));
                GetNextDate(ref startDate, ref startIndex);
            }
        }
Ejemplo n.º 8
0
 public void SetDates(List <string> dates)
 {
     Dates.Clear();
     Dates.AddRange(dates);
 }