// // GET: /A10FundingCode/Create public ActionResult Create() { var model = new A10FundingCodeViewModelItem(); model = model.Populate(db); PopulateRecordStatusList(); return(View(model)); }
// // GET: /A10FundingCode/Edit/5 public ActionResult Edit(int id) { var model = new A10FundingCodeViewModelItem(); model = model.Populate(db, id); if (model == null) { return(HttpNotFound()); } PopulateRecordStatusList(); return(View(model)); }
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)); }