public PartialViewResult EditProjectCustomGrid(ProjectCustomGridTypePrimaryKey projectCustomGridTypePrimaryKey) { var projectCustomGridTypeID = projectCustomGridTypePrimaryKey.EntityObject.ProjectCustomGridTypeID; var projectCustomGridConfigurations = HttpRequestStorage.DatabaseEntities.ProjectCustomGridConfigurations.Where(x => x.ProjectCustomGridTypeID == projectCustomGridTypeID).ToList(); var geospatialAreaTypes = HttpRequestStorage.DatabaseEntities.GeospatialAreaTypes.OrderBy(x => x.GeospatialAreaTypeName).ToList(); var projectCustomAttributeTypes = HttpRequestStorage.DatabaseEntities.ProjectCustomAttributeTypes.OrderBy(x => x.ProjectCustomAttributeTypeName).ToList(); var viewModel = new EditProjectCustomGridViewModel(projectCustomGridTypeID, projectCustomGridConfigurations, geospatialAreaTypes, projectCustomAttributeTypes); return(ViewEditProjectCustomGrid(viewModel)); }
private PartialViewResult ViewEditProjectCustomGrid(EditProjectCustomGridViewModel viewModel) { var viewData = new EditProjectCustomGridViewData(); return(RazorPartialView <EditProjectCustomGrid, EditProjectCustomGridViewData, EditProjectCustomGridViewModel>(viewData, viewModel)); }
public ActionResult EditProjectCustomGrid(ProjectCustomGridTypePrimaryKey projectCustomGridTypePrimaryKey, EditProjectCustomGridViewModel viewModel) { if (!ModelState.IsValid) { return(ViewEditProjectCustomGrid(viewModel)); } var gridTypeID = viewModel.ProjectCustomGridConfigurationSimples.First().ProjectCustomGridTypeID; var existingProjectCustomGridConfigurations = HttpRequestStorage.DatabaseEntities.ProjectCustomGridConfigurations.Where(x => x.ProjectCustomGridTypeID == gridTypeID).ToList(); var allProjectCustomGridConfigurations = HttpRequestStorage.DatabaseEntities.AllProjectCustomGridConfigurations.Local; viewModel.UpdateModel(existingProjectCustomGridConfigurations, allProjectCustomGridConfigurations); SetMessageForDisplay("Successfully Updated Custom Grid"); return(new ModalDialogFormJsonResult()); }