Exemplo n.º 1
0
        public PartialViewResult EditProjectCustomAttributesForProject(ProjectPrimaryKey projectPrimaryKey)
        {
            var project   = projectPrimaryKey.EntityObject;
            var viewModel = new EditProjectCustomAttributesViewModel(project, CurrentFirmaSession);

            return(ViewEditProjectCustomAttributes(project, viewModel));
        }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
        private ActionResult UpdateProjectCustomAttributes(EditProjectCustomAttributesViewModel viewModel, Project project)
        {
            viewModel.UpdateModel(project, CurrentFirmaSession);

            return(new ModalDialogFormJsonResult());
        }
Exemplo n.º 4
0
        public ActionResult EditProjectCustomAttributesForProject(ProjectPrimaryKey projectPrimaryKey, EditProjectCustomAttributesViewModel viewModel)
        {
            var project = projectPrimaryKey.EntityObject;

            if (!ModelState.IsValid)
            {
                return(ViewEditProjectCustomAttributes(project, viewModel));
            }

            return(UpdateProjectCustomAttributes(viewModel, project));
        }