Пример #1
0
        public IActionResult EventFacultyManage(string id)
        {
            var db = _repository.GetEventFaculty(id);

            var x = _repository.GetEventFacultyRoles(db.UserId, db.EventId);

            var selected = x.Select(role => role.FacultyRoleId).ToList();
            var allRoles = _repository.GetAllFacultyRoles();

            ViewBag.RolesSelect = new MultiSelectList(allRoles, "Id", "Name", selected); //  (_repository.GetAllFacultyRoles(); //_repository.GetEventFacultyRoles(UserId, int.Parse(EventId));
            ViewBag.RoleCount   = allRoles.Count;

            ViewBag.times = new SelectList(GetTimes());

            return(View(Mapper.Map <AdminEventFacultyViewModel>(db)));
        }