示例#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"));
 }