Beispiel #1
0
        public List <EventListViewModel> ListEvents(string s)
        {
            var eventRepository     = new EventRepository();
            var eventTypeRepository = new EventTypeRepository();

            IQueryable <MNFEvent> events = eventRepository.FindByName(s).OrderByDescending(n => n.Name);
            var eventList = new List <EventListViewModel>();

            foreach (MNFEvent e in events)
            {
                var vm = new EventListViewModel();
                vm.mnfEvent           = e;
                vm.mnfEvent.EventType = eventTypeRepository.Find(e.EventTypeID);
                eventList.Add(vm);
            }
            return(eventList);
        }
Beispiel #2
0
        public List <EventListViewModel> ListEvents()
        {
            var eventRepository     = new EventRepository();
            var eventTypeRepository = new EventTypeRepository();

            var events    = eventRepository.ListEvents();
            var eventList = new List <EventListViewModel>();

            foreach (MNFEvent e in events)
            {
                var vm = new EventListViewModel();
                vm.mnfEvent           = e;
                vm.mnfEvent.EventType = eventTypeRepository.Find(e.EventTypeID);
                eventList.Add(vm);
            }
            return(eventList);
        }
Beispiel #3
0
        public List <EventListViewModel> DisplayEvents()
        {
            var eventRepository = new EventRepository();

            var events    = eventRepository.ListEvents();
            var eventList = new List <EventListViewModel>();

            foreach (MNFEvent displayEvent in events)
            {
                if (displayEvent.EventDate >= DateTime.Today && displayEvent.ShowEvent)
                {
                    var vm = new EventListViewModel();
                    vm.mnfEvent = displayEvent;
                    eventList.Add(vm);
                }
            }
            return(eventList);
        }