Exemplo n.º 1
0
        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"));
        }
Exemplo n.º 2
0
 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);
     }
 }
Exemplo n.º 3
0
 public ActionResult CreateManager(Managers manager)
 {
     db.Managers.Add(manager);
     db.SaveChanges();
     return(RedirectToAction("Index", "Managers"));
 }