Пример #1
0
        public ActionResult Rate(int eventid)
        {
            //int currentId = CurrentUser.ID;
            //var agenda = service.GetMyAgenda(eventid, currentId);// CurrentUser.ID);
            var sessions = service.GetSessions(eventid);
            var timeSlots = service.GetTimeslots(eventid);
            //ViewBag.Agenda = agenda;
            ViewBag.Sessions = sessions;
            ViewBag.TimeSlots = timeSlots;
            Rate model = new Rate();
            //List<int> timeSlotIDs = new List<int> { 22, 23, 24, 26, 27, 28, 29 };
            foreach (var timeSlot in timeSlots)
            {
                RateSession rs = new RateSession
                {
                    TimeSlotID = timeSlot.ID
                };
                model.RateSessions.Add(rs);
            }

            return View(model);
        }
Пример #2
0
        public ActionResult Rate(int eventid)
        {
            int currentId = CurrentUser.ID;
            var agenda = service.GetMyAgenda(eventid, currentId);// CurrentUser.ID);
            var sessions = service.GetSessions(eventid);
            var timeSlots = service.GetTimeslots(eventid);
            ViewBag.Agenda = agenda;
            ViewBag.Sessions = sessions;
            ViewBag.TimeSlots = timeSlots;
            Rate model = new Rate();
            List<int> timeSlotIDs = new List<int> { 22, 23, 24, 26, 27, 28, 29 };
            foreach (var timeSlot in timeSlots.Where(ts => timeSlotIDs.Contains(ts.ID)).Select(ts => ts))
            {
                RateSession rs = new RateSession();
                rs.TimeSlotID = timeSlot.ID;
                model.RateSessions.Add(rs);
            }

            return View(model);
        }