public ActionResult Edit(A10FundingCodeViewModelItem model) { if (ModelState.IsValid) { var item = model.ToEntity(); db.Entry(item).State = EntityState.Modified; db.SaveChanges(); ShowGenericSavedMessage(); return(RedirectToAction("Index")); } PopulateRecordStatusList(); return(View(model)); }
public ActionResult Create(A10FundingCodeViewModelItem model) { model.ValidateNewEntry(db, ModelState); if (ModelState.IsValid) { var item = model.ToEntity(); db.A10FundingCode.Add(item); db.SaveChanges(); ShowGenericSavedMessage(); return(RedirectToAction("Index")); } PopulateRecordStatusList(); return(View(model)); }