/// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        /// <remarks></remarks>
        public ActionResult Index()
        {
            //get all session from database
            var classs = _SessionClassService.GetAll();
            var model  = new AttendeeFilterViewModel();

            model.AttendeeSessionFilter = new List <SessionFilterViewModel>();

            foreach (var c in classs.Select(a => new { a.SessionTopicID, a.SessionTopic.Name }).Distinct())
            {
                var times      = classs.Where(a => a.SessionTopicID == c.SessionTopicID);
                var sessionRow = new SessionFilterViewModel();

                //default value of the checkbox not selected
                sessionRow.IsSelected       = false;
                sessionRow.SessionTopicName = c.Name;
                sessionRow.SessionTopicID   = c.SessionTopicID;
                sessionRow.TimeSlots        = new List <TimeSlot>();

                foreach (var time in times)
                {
                    sessionRow.TimeSlots.Add(new TimeSlot()
                    {
                        SessionClassID = time.Id, IsSelected = false, Date = time.StartDate, From = time.StartDate, To = time.EndDate
                    });
                }

                model.AttendeeSessionFilter.Add(sessionRow);
            }

            return(View(model));
        }
Exemple #2
0
 public IActionResult LoadSession(SessionFilterViewModel filter)
 {
     try
     {
         var uploadSession = _repository.GetUploadSession(filter.Id);
         var dashboardVM   = MapUploadSessionToViewModel(uploadSession);
         return(PartialView("_DashboardPartial", dashboardVM));
     }
     catch (Exception e)
     {
         return(PartialView("Error", new ErrorViewModel {
             RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier, ErrorMessage = e.Message, Stacktrace = e.StackTrace
         }));
     }
 }