コード例 #1
0
        /// <summary>
        /// updates project.
        /// </summary>
        /// <param name="projectId">The project identifier.</param>
        /// <param name="includeInactive">The include inactive.</param>
        /// <returns>
        /// Add Edit project view
        /// </returns>
        public ActionResult Update(string projectId, string includeInactive)
        {
            this.AddBreadcrumbItem(Resources.ManageProject, Url.ProjectsAction());
            this.AddBreadcrumbItem(Resources.EditProject, string.Empty);
            ProjectPresenter presenter = new ProjectPresenter();

            if (!string.IsNullOrEmpty(includeInactive))
            {
                presenter.IncludeInactive = Convert.ToBoolean(includeInactive, CultureInfo.CurrentCulture);
            }

            presenter.IsEdit = true;
            this.AssignProjectDetails(presenter, projectId);

            var projectPersons = this.projectStakeHolderService.RetrieveProjectPersonList(SessionData.Instance.UserInfo.Developer.DeveloperID).Where(p => p.ProjectID == presenter.Project.ProjectID).ToList();
            this.AssignPersonsList(presenter, projectPersons);

            this.RetrieveHistory(presenter);
            presenter.AssignArtifacts(this.lookupService.RetrieveProjectArtifactList(presenter.Project.ProjectID, SessionData.Instance.UserInfo.Developer.DeveloperID));
            presenter.OldRiskValue = presenter.Project.Risk;
            int nodeIndex = 0;
            var groupedList = presenter.Artifacts.OrderBy(a => a.Squence)
                             .GroupBy(u => u.FunctionalArea)
                             .Select(grp => new ArtifactFillListItem { FunctionalArea = grp.Key, Items = grp.ToList() })
                             .ToList();

            groupedList.ForEach(g => { g.NodeIndex = nodeIndex; nodeIndex++; g.IsSelected = g.Items.All(i => i.IsSelected.Value); });
            presenter.AssignArtifacts(groupedList);
            this.AssignMailRecipients(presenter);
            return this.View("InsertOrUpdate", presenter);
        }
コード例 #2
0
        /// <summary>
        /// view project.
        /// </summary>
        /// <param name="projectId">The project identifier.</param>
        /// <returns>
        /// View Edit project view
        /// </returns>
        public ActionResult ViewProject(string projectId)
        {
            this.AddBreadcrumbItem(Resources.ManageProject, Url.ProjectsAction());
            this.AddBreadcrumbItem(Resources.ProjectDashboard, string.Empty);
            ProjectPresenter presenter = new ProjectPresenter();
            presenter.Project = this.projectService.RetrieveById(Convert.ToInt32(projectId, CultureInfo.CurrentCulture), SessionData.Instance.UserInfo.Developer.DeveloperID);
            this.ViewProjectDetails(presenter);
            this.RetrieveHistory(presenter);
            presenter.AssignArtifacts(this.lookupService.RetrieveProjectArtifactList(presenter.Project.ProjectID, SessionData.Instance.UserInfo.Developer.DeveloperID).Where(g => g.IsSelected == true).ToList());
            int nodeIndex = 0;
            var groupedList = presenter.Artifacts.OrderBy(a => a.Squence)
                             .GroupBy(u => u.FunctionalArea)
                             .Select(grp => new ArtifactFillListItem { FunctionalArea = grp.Key, Items = grp.Where(g => g.IsSelected == true).ToList() })
                             .ToList();

            groupedList.ForEach(g => { g.NodeIndex = nodeIndex; nodeIndex++; g.IsSelected = g.Items.All(i => i.IsSelected.Value); });
            presenter.AssignArtifacts(groupedList);
            return this.View("ViewProject", presenter);
        }
コード例 #3
0
        /// <summary>
        /// inserts project.
        /// </summary>
        /// <returns>
        /// Add Edit project view
        /// </returns>
        public ActionResult Insert()
        {
            this.AddBreadcrumbItem(Resources.ManageProject, Url.ProjectsAction());
            this.AddBreadcrumbItem(Resources.AddProject, string.Empty);
            ProjectPresenter presenter = new ProjectPresenter();
            presenter.IsEdit = false;
            presenter.Project = new Project();
            this.AssignProjectDetails(presenter, null);
            presenter.AssignArtifacts(this.lookupService.RetrieveProjectArtifactList(null, SessionData.Instance.UserInfo.Developer.DeveloperID));

            int nodeIndex = 0;
            var groupedList = presenter.Artifacts.OrderBy(a => a.Squence)
                             .GroupBy(u => u.FunctionalArea)
                             .Select(grp => new ArtifactFillListItem { FunctionalArea = grp.Key, Items = grp.ToList() })
                             .ToList();

            groupedList.ForEach(g => { g.NodeIndex = nodeIndex; g.IsSelected = true; nodeIndex++; g.Items.ForEach(i => i.IsSelected = true); });
            presenter.AssignArtifacts(groupedList);
            this.AssignMailRecipients(presenter);
            return this.View("InsertOrUpdate", presenter);
        }