public ActionResult Edit(EmplDetails details) { try { db.Entry(details.ToEmployee()).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } catch { return(View("EmplDetails", details)); } }
public ActionResult Create(EmplDetails details) { try { db.Employees.Add(details.ToEmployee()); db.SaveChanges(); return(RedirectToAction("Index")); } catch { return(View("EmplDetails")); } }