コード例 #1
0
        /// <summary>
        /// Refreshes the project dashboard history details.
        /// </summary>
        /// <param name="presenter">The presenter.</param>
        /// <param name="projectPortalId">The project portal id.</param>
        /// <returns>
        /// partial view for
        /// </returns>
        public ActionResult RefreshProjectDashboardHistoryDetails(ProjectDashboardPresenter presenter, string projectPortalId)
        {
            if (presenter != null && !string.IsNullOrEmpty(presenter.SelectedReleaseTypeIds))
            {
                presenter.ProjectPortalProjectSummaryList.ForEach(DecodeSummaryNewValue);
                IList<int> selectedReleaseTypeIds = presenter.SelectedReleaseTypeIds.Split(',').Select(releaseType => Convert.ToInt32(releaseType, CultureInfo.CurrentCulture)).ToList();
                presenter.AssignSelectedReleaseTypes(presenter.ReleaseTypeList.Where(releaseType => selectedReleaseTypeIds.Contains(releaseType.ID)).ToList());
                presenter.Offset = DefaultOffset;
                presenter.DateTo = DateTimeExtensions.RetrieveTodayEndTime(presenter.DateTo);
                presenter.AssignProjectPortalHistoryList(this.projectService.RetrieveProjectPortalHistoryInfo(presenter.SelectedReleaseTypeIds, Convert.ToInt32(projectPortalId, CultureInfo.CurrentCulture), presenter.DateFrom, presenter.DateTo, presenter.Offset, ProjectDashboardPresenter.NumberOfRecord, SessionData.Instance.UserInfo.Developer.DeveloperID));
            }

            return this.PartialView(ProjectHistoryPartialView, presenter);
        }
コード例 #2
0
        /// <summary>
        /// Assigns the project portal history.
        /// </summary>
        /// <param name="presenter">The presenter.</param>
        /// <param name="projectPortalId">The project portal id.</param>
        /// <param name="historyTypeIds">The history type ids.</param>
        /// <param name="fromDate">From date.</param>
        /// <param name="toDate">To date.</param>
        private void AssignProjectPortalHistory(ProjectDashboardPresenter presenter, int projectPortalId, string historyTypeIds, string fromDate, string toDate)
        {
            presenter.DateFrom = !string.IsNullOrEmpty(fromDate) ? Convert.ToDateTime(fromDate) : DateTimeHelper.RetrieveCurrentDate().AddMonths(-1);
            presenter.DateTo = !string.IsNullOrEmpty(toDate) ? Convert.ToDateTime(toDate) : DateTimeHelper.RetrieveCurrentDateTime();
            var date = presenter.DateTo;
            date = new DateTime(date.Year, date.Month, date.Day, date.Hour, date.Minute, date.Second);

            if (SessionData.Instance.UserInfo != null && SessionData.Instance.UserInfo.Developer != null)
            {
                presenter.AssignProjectPortalHistoryList(this.projectService.RetrieveProjectPortalHistoryInfo(null, projectPortalId, presenter.DateFrom, date, presenter.Offset, ProjectDashboardPresenter.NumberOfRecord, SessionData.Instance.UserInfo.Developer.DeveloperID));
                presenter.AssignProjectPortalProjectSummaryList(this.projectService.RetrieveProjectPortalProjectSummaryList(projectPortalId, null, null, presenter.SummaryOffset, ProjectDashboardPresenter.SummaryNumberOfRecord, SessionData.Instance.UserInfo.Developer.DeveloperID));
            }

            presenter.AssignReleaseTypes(this.lookupService.RetrieveHistoryEntity(null, null, SessionData.Instance.UserInfo.Developer.DeveloperID));

            if (!string.IsNullOrEmpty(historyTypeIds))
            {
                var selectedhistoryTypeIds = historyTypeIds.Split(',').Select(s => Convert.ToInt32(s, CultureInfo.CurrentCulture)).ToList();
                presenter.AssignSelectedReleaseTypes(presenter.ReleaseTypeList.Where(releaseTypeItem => selectedhistoryTypeIds.Contains(releaseTypeItem.ID)).ToList());
            }
            else
            {
                presenter.AssignSelectedReleaseTypes(presenter.ReleaseTypeList);
            }
        }
コード例 #3
0
        /// <summary>
        /// Refreshes the project dashboard compliance details.
        /// </summary>
        /// <param name="projectId">The project id.</param>
        /// <param name="presenter">The presenter.</param>
        /// <returns>
        /// result view
        /// </returns>
        public ActionResult RefreshProjectDashboardComplianceDetails(string projectId, ProjectDashboardPresenter presenter)
        {
            if (string.IsNullOrWhiteSpace(projectId))
            {
                return this.Redirect(Url.AccountAction());
            }

            var projectPortalId = Convert.ToInt32(projectId, CultureInfo.CurrentCulture);
            var project = this.projectService.RetrieveById(projectPortalId, SessionData.Instance.UserInfo.Developer.DeveloperID);

            if (project == null)
            {
                return this.Redirect(Url.AccountAction());
            }

            presenter.ProjectId = projectPortalId;

            presenter.AssignReleaseTypes(this.lookupService.RetrieveReleaseTypes(SessionData.Instance.UserInfo.Developer.DeveloperID));
            presenter.AssignArtifactStatus(this.lookupService.RetrieveArtifactStatusTypes(SessionData.Instance.UserInfo.Developer.DeveloperID));

            ////IList<int> selectedArtifactsList = null;
            IList<int> selectedReleaseTypeList = null;
            ////if (!string.IsNullOrEmpty(presenter.SelectedArtifactStatusIds))
            ////{
            ////    selectedArtifactsList = presenter.SelectedArtifactStatusIds.Split(',').Select(s => Convert.ToInt32(s, CultureInfo.CurrentCulture)).ToList();
            ////    presenter.AssignSelectedArtifactsList(presenter.ArtifactStatusList.Where(artifact => selectedArtifactsList.Contains(artifact.ID)).ToList());
            ////}

            if (!string.IsNullOrEmpty(presenter.SelectedReleaseTypeIds))
            {
                selectedReleaseTypeList = presenter.SelectedReleaseTypeIds.Split(',').Select(s => Convert.ToInt32(s, CultureInfo.CurrentCulture)).ToList();
                presenter.AssignSelectedReleaseTypes(presenter.ReleaseTypeList.Where(releaseType => selectedReleaseTypeList.Contains(releaseType.ID)).ToList());
            }

            var artifactList = this.projectArtifactService.RetrieveList(projectPortalId, selectedReleaseTypeList, null, SessionData.Instance.UserInfo.Developer.DeveloperID);
            (from artifact in artifactList
             from artifactStatus in presenter.ArtifactStatusList
             where artifact.Status == artifactStatus.ID
             select MapProcessComplianceStatusTitle(artifactStatus, artifact)).ToList();

            AssignProjectArtifactList(presenter, artifactList);

            AssignReleaseArtifactList(presenter, artifactList);

            return this.PartialView(ProjectCompliancePartialView, presenter);
        }
コード例 #4
0
        /// <summary>
        /// Assigns the compliance detail.
        /// </summary>
        /// <param name="presenter">The presenter.</param>
        /// <param name="projectPortalId">The project portal identifier.</param>
        /// <param name="releaseTypeIds">The release type ids.</param>
        /// <param name="releaseStatusIds">The release status ids.</param>
        private void AssignComplianceDetail(ProjectDashboardPresenter presenter, int projectPortalId, string releaseTypeIds, string releaseStatusIds)
        {
            presenter.AssignReleaseTypes(this.lookupService.RetrieveReleaseTypes(SessionData.Instance.UserInfo.Developer.DeveloperID));
            presenter.AssignArtifactStatus(this.lookupService.RetrieveArtifactStatusTypes(SessionData.Instance.UserInfo.Developer.DeveloperID));
            if (!string.IsNullOrEmpty(releaseTypeIds))
            {
                var selectedReleaseTypeIds = releaseTypeIds.Split(',').Select(s => Convert.ToInt32(s, CultureInfo.CurrentCulture)).ToList();
                presenter.AssignSelectedReleaseTypes(presenter.ReleaseTypeList.Where(releaseType => selectedReleaseTypeIds.Contains(releaseType.ID)).ToList());
            }
            else
            {
                presenter.AssignSelectedReleaseTypes(presenter.ReleaseTypeList.Where(r => r.ID == (byte)ReleaseType.UAT).ToList());
            }

            if (!string.IsNullOrEmpty(releaseStatusIds))
            {
                var selectedReleaseStatusIds = releaseStatusIds.Split(',').Select(s => Convert.ToInt32(s, CultureInfo.CurrentCulture)).ToList();
                presenter.AssignSelectedArtifactsList(presenter.ProjectStatusList.Where(projectStatus => selectedReleaseStatusIds.Contains(projectStatus.ID)).ToList());
            }
            else
            {
                presenter.AssignSelectedArtifactsList(presenter.ArtifactStatusList);
            }

            IList<int> releaseEnvironmentList = new List<int>();
            releaseEnvironmentList.Add(UatReleaseType);
            releaseEnvironmentList.Add(InternalReleaseType);
            releaseEnvironmentList.Add(ProductionReleaseType);
            releaseEnvironmentList.Add(BetaReleaseType);

            var artifactList = this.projectArtifactService.RetrieveList(projectPortalId, releaseEnvironmentList, null, SessionData.Instance.UserInfo.Developer.DeveloperID);
            (from artifact in artifactList
             from artifactStatus in presenter.ArtifactStatusList
             where artifact.Status == artifactStatus.ID
             select MapProcessComplianceStatusTitle(artifactStatus, artifact)).ToList();

            AssignProjectArtifactList(presenter, artifactList);
            AssignReleaseArtifactList(presenter, artifactList);
        }