public ContactsViewData(FirmaSession currentFirmaSession, ProjectFirmaModels.Models.Project project, ProposalSectionsStatus proposalSectionsStatus, EditContactsViewData editContactsViewData) : base(currentFirmaSession, project, ProjectCreateSection.Contacts.ProjectCreateSectionDisplayName, proposalSectionsStatus) { EditContactsViewData = editContactsViewData; ShowCommentsSection = project.IsPendingApproval() || (project.ContactsComment != null && project.ProjectApprovalStatus == ProjectApprovalStatus.Returned); CanEditComments = project.IsPendingApproval() && new ProjectEditAsAdminRegardlessOfStageFeature().HasPermission(currentFirmaSession, project).HasPermission; }
public ContactsViewData(FirmaSession currentFirmaSession, ProjectUpdateBatch projectUpdateBatch, ProjectUpdateStatus projectUpdateStatus, EditContactsViewData editContactsViewData, ContactsValidationResult contactsValidationResult, ProjectContactsDetailViewData projectContactsDetailViewData) : base(currentFirmaSession, projectUpdateBatch, projectUpdateStatus, contactsValidationResult.GetWarningMessages(), ProjectUpdateSection.Contacts.ProjectUpdateSectionDisplayName) { EditContactsViewData = editContactsViewData; ProjectContactsDetailViewData = projectContactsDetailViewData; SectionCommentsViewData = new SectionCommentsViewData(projectUpdateBatch.ContactsComment, projectUpdateBatch.IsReturned()); RefreshUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.RefreshContacts(projectUpdateBatch.Project)); DiffUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.DiffContacts(projectUpdateBatch.Project)); }
private PartialViewResult ViewEditContacts(FirmaSession currentFirmaSession, EditContactsViewModel viewModel, Project project) { var allPeople = HttpRequestStorage.DatabaseEntities.People.ToList().OrderBy(p => p.GetFullNameFirstLastAndOrg()).ToList(); if (!allPeople.Contains(CurrentPerson)) { allPeople.Add(CurrentPerson); } var allContactRelationshipTypes = HttpRequestStorage.DatabaseEntities.ContactRelationshipTypes.ToList(); var viewData = new EditContactsViewData(project, allPeople, allContactRelationshipTypes, currentFirmaSession); return(RazorPartialView <EditContacts, EditContactsViewData, EditContactsViewModel>(viewData, viewModel)); }