コード例 #1
0
        public ObservableCollection <Day> LoadEvents(DateTime from, DateTime to)
        {
            // List<Appointment> appointments = storage.getAppointments();
            // AllDays = getDays(appointments);
            // AllDays.ForEach(d => d.AppointmentsList = d.AppointmentsList.OrderBy(e => e.StartTime).ToList());
            List <Day> filteredList = AllDays.Where(d => d.Date.Date.CompareTo(from.Date) >= 0 && d.Date.Date.CompareTo(to.Date) <= 0).ToList();

            Days = new ObservableCollection <Day>(filteredList);

            return(Days);
        }
コード例 #2
0
        public List <Day> LoadEvents(DateTime from, DateTime to, string user)
        {
            logUser(user);
            AllDays = getDays(storage.getAppointments(Login));
            AllDays.ForEach(d => d.AppointmentsList = d.AppointmentsList.OrderBy(e => e.StartTime).ToList());
            List <Day> filteredList = AllDays.Where(d => d.Date.Date.CompareTo(from.Date) >= 0 && d.Date.Date.CompareTo(to.Date) <= 0).ToList();

            Days = filteredList;


            return(Days);
        }
コード例 #3
0
        private void CreateCarouselItems()
        {
            try
            {
                var temp = new List <CarouselItem>()
                {
                    new CarouselItem(Year, 1)
                    {
                        Days = new List <CalendarDayBoxView>(
                            AllDays.Where(d => d.DataContext.Month == 1))
                    },
                    new CarouselItem(Year, 2)
                    {
                        Days = new List <CalendarDayBoxView>(
                            AllDays.Where(d => d.DataContext.Month == 2))
                    },
                    new CarouselItem(Year, 3)
                    {
                        Days = new List <CalendarDayBoxView>(
                            AllDays.Where(d => d.DataContext.Month == 3))
                    },
                    new CarouselItem(Year, 4)
                    {
                        Days = new List <CalendarDayBoxView>(
                            AllDays.Where(d => d.DataContext.Month == 4))
                    },
                    new CarouselItem(Year, 5)
                    {
                        Days = new List <CalendarDayBoxView>(
                            AllDays.Where(d => d.DataContext.Month == 5))
                    },
                    new CarouselItem(Year, 6)
                    {
                        Days = new List <CalendarDayBoxView>(
                            AllDays.Where(d => d.DataContext.Month == 6))
                    },
                    new CarouselItem(Year, 7)
                    {
                        Days = new List <CalendarDayBoxView>(
                            AllDays.Where(d => d.DataContext.Month == 7))
                    },
                    new CarouselItem(Year, 8)
                    {
                        Days = new List <CalendarDayBoxView>(
                            AllDays.Where(d => d.DataContext.Month == 8))
                    },
                    new CarouselItem(Year, 9)
                    {
                        Days = new List <CalendarDayBoxView>(
                            AllDays.Where(d => d.DataContext.Month == 9))
                    },
                    new CarouselItem(Year, 10)
                    {
                        Days = new List <CalendarDayBoxView>(
                            AllDays.Where(d => d.DataContext.Month == 10))
                    },
                    new CarouselItem(Year, 11)
                    {
                        Days = new List <CalendarDayBoxView>(
                            AllDays.Where(d => d.DataContext.Month == 11))
                    },
                    new CarouselItem(Year, 12)
                    {
                        Days = new List <CalendarDayBoxView>(
                            AllDays.Where(d => d.DataContext.Month == 12))
                    },
                };

                CarouselItems = temp;
                Position      = (int)SelectedDayBox.Month - 1;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }