예제 #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"));
        }
예제 #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);
     }
 }
예제 #3
0
 public ActionResult CreateManager(Managers manager)
 {
     db.Managers.Add(manager);
     db.SaveChanges();
     return(RedirectToAction("Index", "Managers"));
 }