Esempio n. 1
0
 public EditProjectProjectStatusViewData(
     ProjectFirmaModels.Models.Project project
     , bool allowEditUpdateDate
     , string createdByPerson
     , string deleteUrl
     , ProjectFirmaModels.Models.FirmaPage projectStatusFirmaPage
     , FirmaSession currentFirmaSession
     , List <ProjectFirmaModels.Models.ProjectStatus> allProjectStatuses
     , ProjectStatusLegendDisplayViewData projectStatusLegendDisplayViewData
     , bool isFinalStatusReport) : base(currentFirmaSession)
 {
     ProjectStatuses = allProjectStatuses.OrderBy(x => x.ProjectStatusSortOrder)
                       .ToSelectListWithEmptyFirstRow(x => x.ProjectStatusID.ToString(),
                                                      x => !string.IsNullOrEmpty(x.ProjectStatusDescription)
                                                                                  ? $"{x.ProjectStatusDisplayName} - {x.ProjectStatusDescription}"
                                                                                  : $"{x.ProjectStatusDisplayName}");
     ProjectStatusJsonList = new ProjectStatusJsonList(allProjectStatuses.Select(x => new ProjectStatusJson(x)).ToList());
     AllowEditUpdateDate   = allowEditUpdateDate;
     CreatedByPerson       = !string.IsNullOrEmpty(createdByPerson)
         ? createdByPerson
         : currentFirmaSession.UserDisplayName;
     DeleteButton                       = string.IsNullOrEmpty(deleteUrl) ? new HtmlString(string.Empty) : ModalDialogFormHelper.MakeDeleteIconButton(deleteUrl, $"Delete {FieldDefinitionEnum.Status.ToType().GetFieldDefinitionLabel()} Update", true);
     ProjectStatusFirmaPage             = new ViewPageContentViewData(projectStatusFirmaPage, currentFirmaSession);
     ProjectStatusLegendDisplayViewData = projectStatusLegendDisplayViewData;
     AllowEditFinal                     = isFinalStatusReport || ProjectProjectStatusController.AllowUserToSetNewStatusReportToFinal(project, currentFirmaSession);
 }