コード例 #1
0
        /// <summary>
        /// Assigns the project details.
        /// </summary>
        /// <param name="presenter">The presenter.</param>
        /// <param name="projectId">The project identifier.</param>
        private void AssignProjectDetails(ProjectPresenter presenter, string projectId)
        {
            int? clientId = null;
            int? primarydeveloperId = null;
            int? secondarydeveloperId = null;
            int? parentProjectId = null;
            if (presenter.IsEdit)
            {
                presenter.Project = this.projectService.RetrieveById(Convert.ToInt32(projectId, CultureInfo.CurrentCulture), SessionData.Instance.UserInfo.Developer.DeveloperID);
                clientId = presenter.Project.ClientID;
                primarydeveloperId = presenter.Project.PrimaryPOCDeveloperID;
                secondarydeveloperId = presenter.Project.SecondaryPOCDeveloperID;
                parentProjectId = presenter.Project.ParentProjectID;
            }
            else
            {
                presenter.Project = new Project();
                presenter.Project.Priority = this.projectService.RetrieveMaximumPriorityValue(SessionData.Instance.UserInfo.Developer.CompanyID.Value);
                presenter.Project.IsClosed = false;
            }

            presenter.AssignClients(this.lookupService.RetrieveClients(clientId, false, SessionData.Instance.UserInfo.Developer.DeveloperID));

            presenter.AssignProjectStatusList(this.lookupService.RetrieveProjectStatusList(SessionData.Instance.UserInfo.Developer.DeveloperID));

            presenter.AssignPrimaryPointOfContacts(this.lookupService.RetrieveDevelopers(primarydeveloperId, false, SessionData.Instance.UserInfo.Developer.DeveloperID));

            presenter.AssignSecondaryPointOfContacts(this.lookupService.RetrieveDevelopers(secondarydeveloperId, false, SessionData.Instance.UserInfo.Developer.DeveloperID));

            presenter.AssignParentProjects(this.lookupService.RetrieveProjects(null, parentProjectId, false, false, SessionData.Instance.UserInfo.Developer.DeveloperID).Where(p => p.ProjectID != presenter.Project.ProjectID && p.ParentProjectID.HasValue == false).ToList());

            presenter.ParentProjectList.ForEach(p => { p.ProjectName = p.ProjectFullName; });

            presenter.AssignEstimationCategories(this.lookupService.RetrieveEstimationCategories(null, null, SessionData.Instance.UserInfo.Developer.DeveloperID));

            presenter.AssignRoles(this.lookupService.RetrieveRoles(null, null, SessionData.Instance.UserInfo.Developer.DeveloperID));

            AssignEstimationHourCategories(presenter);

            CalculateTotalEstimationHours(presenter);
        }