public ActionResult EditIncomeSource(int id) { var source = incomeSourceService.GetSourceById(id); if (source != null) { var model = new IncomeSourceModel(source); return(View("EditIncomeSource", model)); } return(RedirectToAction("Index")); }
public ActionResult SaveIncomeSource(IncomeSourceModel newIncome) { if (ModelState.IsValid) { var saveIncomeSource = new IncomeSource { Id = newIncome.Id, Source = newIncome.Source }; incomeSourceService.SaveIncomeSource(saveIncomeSource); return(RedirectToAction("Index")); } return(View("EditIncomeSource", newIncome)); }
public ActionResult CreateIncomeSource() { var model = new IncomeSourceModel(); return(View("EditIncomeSource", model)); }