Пример #1
0
        /// <summary>
        /// views the project details.
        /// </summary>
        /// <param name="presenter">The presenter.</param>
        private void ViewProjectDetails(ProjectPresenter presenter)
        {
            if (presenter != null)
            {
                presenter.Project.ClientName = this.lookupService.RetrieveClients(presenter.Project.ClientID, false, SessionData.Instance.UserInfo.Developer.DeveloperID).FirstOrDefault(c => c.ID == presenter.Project.ClientID).Name;
                presenter.Project.StatusTitle = this.lookupService.RetrieveProjectStatusList(SessionData.Instance.UserInfo.Developer.DeveloperID).FirstOrDefault(c => c.ID == presenter.Project.Status).Name;

                if (presenter.Project.ParentProjectID.HasValue)
                {
                    var parentProject = this.projectService.RetrieveById(presenter.Project.ParentProjectID.Value, SessionData.Instance.UserInfo.Developer.DeveloperID);
                    presenter.Project.ParentProjectName = parentProject != null ? parentProject.Name : string.Empty;
                }

                if (presenter.Project.SecondaryPOCDeveloperID.HasValue)
                {
                    var secondaryDeveloper = this.developerService.RetrieveById(presenter.Project.SecondaryPOCDeveloperID.Value);
                    presenter.Project.SecondaryContactName = secondaryDeveloper != null ? secondaryDeveloper.Name : string.Empty;
                }

                var primaryDeveloepr = this.developerService.RetrieveById(presenter.Project.PrimaryPOCDeveloperID);
                presenter.Project.PrimaryContactName = primaryDeveloepr != null ? primaryDeveloepr.Name : string.Empty;
                presenter.AssignEstimationCategories(this.lookupService.RetrieveEstimationCategories(null, null, SessionData.Instance.UserInfo.Developer.DeveloperID));
                AssignEstimationHourCategories(presenter);

                CalculateTotalEstimationHours(presenter);
            }
        }
Пример #2
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);
        }