예제 #1
0
        // GET: Projects/Details/5
        public ActionResult Dashboard(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            var thisProject = db.Projects.Find(id);

            if (thisProject == null)
            {
                return(HttpNotFound());
            }

            var project = new ProjectDashboardVM()
            {
                Project           = thisProject,
                ProjectManager    = projHelp.ListProjectUsersInRole(thisProject.Id, "ProjectManager").FirstOrDefault(),
                ProjectDevs       = projHelp.ListProjectUsersInRole(thisProject.Id, "Developer"),
                ProjectSubs       = projHelp.ListProjectUsersInRole(thisProject.Id, "Submitter"),
                NotProjectUsers   = projHelp.NotProjectUsers(thisProject.Id),
                UnassignedTickets = ticketHelp.ListUnassignedTickets(thisProject.Id)
            };

            ViewBag.TicketPriorityId = new SelectList(db.TicketPriorities, "Id", "Name");
            ViewBag.TicketTypeId     = new SelectList(db.TicketTypes, "Id", "Name");

            return(View(project));
        }