public ActionResult UpdateManager(Managers manager) { Managers d = db.Managers.Where(s => s.Id == manager.Id).First(); d.Name = manager.Name; d.Phone = manager.Phone; d.Team = manager.Team; db.SaveChanges(); return(RedirectToAction("Index", "Managers")); }
public bool Delete(int id) { try { Managers manager = db.Managers.Where(s => s.Id == id).First(); db.Managers.Remove(manager); db.SaveChanges(); return(true); } catch (System.Exception) { return(false); } }
public ActionResult CreateManager(Managers manager) { db.Managers.Add(manager); db.SaveChanges(); return(RedirectToAction("Index", "Managers")); }