public PartialViewResult Edit(GrantAllocationAwardPrimaryKey grantAllocationAwardPrimaryKey) { var grantAllocationAward = grantAllocationAwardPrimaryKey.EntityObject; var viewModel = new EditGrantAllocationAwardViewModel(grantAllocationAward); return(GrantAllocationAwardViewEdit(viewModel)); }
private PartialViewResult GrantAllocationAwardViewEdit(EditGrantAllocationAwardViewModel viewModel) { var grantAllocations = HttpRequestStorage.DatabaseEntities.GrantAllocations; var viewData = new EditGrantAllocationAwardViewData(grantAllocations); return(RazorPartialView <EditGrantAllocationAward, EditGrantAllocationAwardViewData, EditGrantAllocationAwardViewModel>(viewData, viewModel)); }
public PartialViewResult NewForAFocusArea(FocusAreaPrimaryKey focusAreaPrimaryKey) { var focusArea = focusAreaPrimaryKey.EntityObject; var viewModel = new EditGrantAllocationAwardViewModel() { FocusAreaID = focusArea.FocusAreaID }; return(GrantAllocationAwardViewEdit(viewModel)); }
public PartialViewResult NewForAGrantAllocation(GrantAllocationPrimaryKey grantAllocationPrimaryKey) { var grantAllocation = grantAllocationPrimaryKey.EntityObject; var viewModel = new EditGrantAllocationAwardViewModel() { GrantAllocationID = grantAllocation.GrantAllocationID }; return(GrantAllocationAwardViewEdit(viewModel)); }
public ActionResult NewForAFocusArea(FocusAreaPrimaryKey focusAreaPrimaryKey, EditGrantAllocationAwardViewModel viewModel) { if (!ModelState.IsValid) { return(GrantAllocationAwardViewEdit(viewModel)); } var grantAllocation = HttpRequestStorage.DatabaseEntities.GrantAllocations.Single(ga => ga.GrantAllocationID == viewModel.GrantAllocationID); var focusArea = HttpRequestStorage.DatabaseEntities.FocusAreas.Single(fa => fa.FocusAreaID == viewModel.FocusAreaID); var grantAllocationAward = GrantAllocationAward.CreateNewBlank(grantAllocation, focusArea); viewModel.UpdateModel(grantAllocationAward); return(new ModalDialogFormJsonResult()); }
public ActionResult Edit(GrantAllocationAwardPrimaryKey grantAllocationAwardPrimaryKey, EditGrantAllocationAwardViewModel viewModel) { var grantAllocationAward = grantAllocationAwardPrimaryKey.EntityObject; if (!ModelState.IsValid) { return(GrantAllocationAwardViewEdit(viewModel)); } viewModel.UpdateModel(grantAllocationAward); return(new ModalDialogFormJsonResult()); }