// GET CREATE EXPENSE public ViewResult Create(int clientID) { // create view model var viewModel = new LegalDocumentFormViewModel { clientId = clientID }; return View("Edit", viewModel); }
public ActionResult Edit(LegalDocumentFormViewModel legalDocumentForm) { var legalDocument = Mapper.Map<LegalDocumentFormViewModel, LegalDocument>(legalDocumentForm); if (ModelState.IsValid) { _clientsRepository.SaveLegalDocument(legalDocument); TempData["message"] = "Legal Document: " + legalDocument.LegalDocumentName + " has been saved."; return RedirectToAction("List", "LegalFinance", new { legalDocument.ClientId }); } // validation error, so redisplay the same view return View("Edit", legalDocumentForm); }