Пример #1
0
        // GET: Tickets/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Ticket ticket = db.Tickets.Find(id);

            if (ticket == null)
            {
                return(HttpNotFound());
            }
            TicketDetailViewModel model = new TicketDetailViewModel();

            model.Ticket = ticket;
            var users = UserRolesHelper.UsersInRole("Developer").ToList();

            model.AssignUser         = new SelectList(UserRolesHelper.UsersInRole("Developer"), "Id", "FirstName");
            ViewBag.AssignedToUserId = new SelectList(projectsHelper.ListUsersProjectsInRole(ticket.ProjectId, "Developer"), "Id", "FullName", ticket.AssignedToUserId);

            return(View(model));
        }