コード例 #1
0
        public async Task OnGetAsync()
        {
            if (FilterCriteria == null || FilterCriteria == "")
            {
                SortedEvents = await eventCatalogue.GetAllItems();
            }
            else
            {
                foreach (Event evt in await eventCatalogue.GetAllItems())
                {
                    bool add = false;

                    if (evt.Name.ToLower().Contains(FilterCriteria.ToLower()))
                    {
                        add = true;
                    }
                    else if (evt.Theme.ToLower().Contains(FilterCriteria.ToLower()))
                    {
                        add = true;
                    }

                    if (evt.RoomNr != RoomNr)
                    {
                        add = false;
                    }

                    if (add)
                    {
                        SortedEvents.Add(evt);
                    }
                }
            }

            SortedEvents.Sort(Comparer <Event> .Create((x, y) => x.Name.CompareTo(y.Name)));
        }
コード例 #2
0
 public IndexModel(ICatalogue <Room> rooms, ICatalogue <IUser> users, ICatalogue <Event> events)
 {
     Rooms  = (RoomCatalogue)rooms;
     Users  = (UserCatalogue)users;
     Events = events.GetAllItems().Result;
 }
コード例 #3
0
        public async Task OnGetAsync()
        {
            listRoom = await RoomCatalogue.GetAllItems();

            //listPart = await userCatalogue.GetAllItems();
        }