public ActionResult Edit(int id, DelayCode code) { try { // TODO: Add update logic here if (ModelState.IsValid) { context.Entry(code).State = System.Data.Entity.EntityState.Modified; context.SaveChanges(); return(RedirectToAction("Index", "Config")); } else { return(View()); } } catch { return(View()); } }
public ActionResult Create(DelayCode code) { try { // TODO: Add insert logic here if (ModelState.IsValid) { context.DelayCode.Add(code); context.SaveChanges(); return(RedirectToAction("Index", "Config")); } else { return(View()); } } catch { return(View()); } }