Example #1
0
        // GET: Projects/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Project project = db.Projects.Find(id);

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

            //Give my details view a MultiSelectList of available PM's
            //KEEP AN EYE OUT FOR 'MAGIC STRINGS' THROUGHOUT YOUR APPLICATION...
            //MAGIC STRINGS ARE HARD CODED STRINGS THAT SHOULD BE HANDLED DIFFERENTLY...

            var allProjectManagers     = roleHelper.UsersInRole("ProjectManager");
            var currentProjectManagers = projectHelper.UsersInRoleOnProject(project.Id, "ProjectManager");

            ViewBag.ProjectManagers = new MultiSelectList(allProjectManagers, "Id", "FullNameWithEmail", currentProjectManagers);

            var allSubmitters     = roleHelper.UsersInRole("Submitter");
            var currentSubmitters = projectHelper.UsersInRoleOnProject(project.Id, "Submitter");

            ViewBag.Submitters = new MultiSelectList(allSubmitters, "Id", "FullNameWithEmail", currentSubmitters);

            var allDevelopers     = roleHelper.UsersInRole("Developer");
            var currentDevelopers = projectHelper.UsersInRoleOnProject(project.Id, "Developer");

            ViewBag.Developers = new MultiSelectList(allDevelopers, "Id", "FullNameWithEmail", currentDevelopers);

            return(View(project));
        }
Example #2
0
        // GET: Projects/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Project project = db.Projects.Find(id);

            if (project == null)
            {
                return(HttpNotFound());
            }
            //Give details view
            var allProjectManagers     = roleHelper.UsersInRole("Project Manager");
            var currentProjectManagers = projectHelper.UsersInRoleOnProject(project.Id, "Project Manager");

            ViewBag.ProjectManagers = new MultiSelectList(allProjectManagers, "Id", "FullName", currentProjectManagers);

            var allSubmitters     = roleHelper.UsersInRole("Submitter");
            var currentSubmitters = projectHelper.UsersInRoleOnProject(project.Id, "Submitter");

            ViewBag.Submitters = new MultiSelectList(allSubmitters, "Id", "FullName", currentSubmitters);

            var allDevelopers     = roleHelper.UsersInRole("Developer");
            var currentDevelopers = projectHelper.UsersInRoleOnProject(project.Id, "Developer");

            ViewBag.Developers = new MultiSelectList(allDevelopers, "Id", "FullName", currentDevelopers);

            return(View(project));   //otherwise, return the 'Details' view with the project that had an id that matches the id passed to this method
        }
        // GET: Projects/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Project project = db.Projects.Find(id);

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

            //Give my details view a multiSelectList of available PM's
            //Keep an eye out for 'magic strings' throughout your spplication..
            //Magic strings are hard coded strings that should be handled differently
            var allProjectManagers     = roleHelper.UsersInRole("ProjectManager");
            var currentProjectManagers = projectHelper.UsersInRoleOnProject(project.Id, "ProjectManager");

            ViewBag.ProjectManagers = new MultiSelectList(allProjectManagers, "Id", "FullNameWithEmail", currentProjectManagers);

            var allSubmitters     = roleHelper.UsersInRole("Submitter");
            var currentSubmitters = projectHelper.UsersInRoleOnProject(project.Id, "Submitter");

            ViewBag.Submitters = new MultiSelectList(allSubmitters, "Id", "FullNameWithEmail", currentSubmitters);

            var allDevelopers     = roleHelper.UsersInRole("Developer");
            var currentDevelopers = projectHelper.UsersInRoleOnProject(project.Id, "Developer");

            ViewBag.Developers = new MultiSelectList(allDevelopers, "Id", "FullNameWithEmail", currentDevelopers);

            return(View(project));
        }
Example #4
0
        // GET: Projects/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Project project = db.Projects.Find(id);

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

            var allProjectManagers     = roleHelper.UsersInRole("Project Manager");
            var currentProjectManagers = projectHelper.UsersInRoleOnProject(project.Id, "Project Manager");

            ViewBag.ProjectManagers = new MultiSelectList(allProjectManagers, "Id", "FullNameWithEmail", currentProjectManagers);

            var allSubmitters     = roleHelper.UsersInRole("Submitter");
            var currentSubmitters = projectHelper.UsersInRoleOnProject(project.Id, "Submitter");

            ViewBag.Submitters = new MultiSelectList(allSubmitters, "Id", "FullNameWithEmail", currentSubmitters);

            var allDevelopers     = roleHelper.UsersInRole("Developer");
            var currentDevelopers = projectHelper.UsersInRoleOnProject(project.Id, "Developer");

            ViewBag.Developers = new MultiSelectList(allDevelopers, "Id", "FullNameWithEmail", currentDevelopers);

            return(View(project));
        }
Example #5
0
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Ticket ticket = db.Tickets.Find(id);

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

            var                    myProjects     = projectHelper.ListUserProjects(User.Identity.GetUserId());
            ProjectsHelper         projectsHelper = new ProjectsHelper();
            List <ApplicationUser> projectusers   = new List <ApplicationUser>();
            List <string>          projectDevIds  = new List <string>();

            foreach (Project project in myProjects)
            {
                projectDevIds = projectsHelper.UsersInRoleOnProject(project.Id, "Developer");
            }
            foreach (string devId in projectDevIds)
            {
                ApplicationUser devUser = db.Users.Find(devId);
                projectusers.Add(devUser);
            }
            ViewBag.AssignedToUserId = new SelectList(projectusers, "Id", "DisplayName", ticket.AssignedToUserId);



            return(View(ticket));
        }
        public JsonResult GetTicketsAssignedToDevs()
        {
            var data = new ChartJSGroupedBarData1();

            var mgrId       = User.Identity.GetUserId();
            var mgrProjects = projHelper.ListUserProjects(mgrId);
            var devs        = new List <ApplicationUser>();
            var developers  = new List <ApplicationUser>();

            foreach (var project in mgrProjects.ToList())
            {
                devs.AddRange(projHelper.UsersInRoleOnProject(project.Id, SystemRole.Developer).Distinct());
            }

            developers = devs.Distinct().ToList();

            foreach (var dev in developers.ToList())
            {
                var valActive   = db.Tickets.Where(t => t.AssignedToUserId == dev.Id && t.TicketStatus.Name == "Active/Assigned").Count();
                var valComplete = db.Tickets.Where(t => t.AssignedToUserId == dev.Id && t.TicketStatus.Name == "Completed").Count();
                data.Labels.Add(dev.FirstName);
                data.ValueActive.Add(valActive);
                data.ValueComplete.Add(valComplete);
            }
            return(Json(data));
        }
        public ActionResult Dashboard(int id, string stat)
        {
            var ticket = db.Tickets.Find(id);

            if (ticket == null)
            {
                return(HttpNotFound());
            }
            var project = ticket.Project;

            ViewBag.Stats       = stat;
            ViewBag.TeamPMs     = projHelper.UsersInRoleOnProject(project.Id, SystemRole.ProjectManager).ToList();
            ViewBag.TeamSubs    = projHelper.UsersInRoleOnProject(project.Id, SystemRole.Submitter).ToList();
            ViewBag.TeamDevs    = projHelper.UsersInRoleOnProject(project.Id, SystemRole.Developer).ToList();
            ViewBag.History     = ticket.TicketHistories;
            ViewBag.CurrentUser = User.Identity.GetUserId();
            ViewBag.DevProjects = projHelper.ListUserProjects(ticket.AssignedToUserId);
            return(View(ticket));
        }
Example #8
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());
            }
            var project = ticket.Project;

            ViewBag.TeamPMs = projectHelper.UsersInRoleOnProject(project.Id, "Project Manager");
            //ViewBag.TeamSubs = projectHelper.UsersInRoleOnProject(project.Id, "Submitter").ToList();
            //ViewBag.TeamDevs = projectHelper.UsersInRoleOnProject(project.Id, "Developer").ToList();
            ViewBag.History      = ticket.TicketHistories;
            ViewBag.Notification = ticket.TicketNotifications;
            //ViewBag.CurrentUser = User.Identity.GetUserId();
            //ViewBag.DevProjects = projectHelper.ListUserProjects(ticket.AssignedToUserId);
            return(View(ticket));
        }