public PartialViewResult EditProjectCustomAttributesForProject(ProjectPrimaryKey projectPrimaryKey) { var project = projectPrimaryKey.EntityObject; var viewModel = new EditProjectCustomAttributesViewModel(project, CurrentFirmaSession); return(ViewEditProjectCustomAttributes(project, viewModel)); }
private PartialViewResult ViewEditProjectCustomAttributes(Project project, EditProjectCustomAttributesViewModel viewModel) { var projectCustomAttributeTypes = HttpRequestStorage.DatabaseEntities.ProjectCustomAttributeTypes.Where(x => x.ProjectCustomAttributeGroup.ProjectCustomAttributeGroupProjectCategories.Any(pcagpt => pcagpt.ProjectCategoryID == project.ProjectCategoryID)).ToList().Where(x => x.HasEditPermission(CurrentFirmaSession)); var viewData = new EditProjectCustomAttributesViewData( projectCustomAttributeTypes.ToList(), new List <IProjectCustomAttribute>(project.ProjectCustomAttributes.ToList())); return(RazorPartialView <EditProjectCustomAttributes, EditProjectCustomAttributesViewData, EditProjectCustomAttributesViewModel>(viewData, viewModel)); }
private ActionResult UpdateProjectCustomAttributes(EditProjectCustomAttributesViewModel viewModel, Project project) { viewModel.UpdateModel(project, CurrentFirmaSession); return(new ModalDialogFormJsonResult()); }
public ActionResult EditProjectCustomAttributesForProject(ProjectPrimaryKey projectPrimaryKey, EditProjectCustomAttributesViewModel viewModel) { var project = projectPrimaryKey.EntityObject; if (!ModelState.IsValid) { return(ViewEditProjectCustomAttributes(project, viewModel)); } return(UpdateProjectCustomAttributes(viewModel, project)); }