Пример #1
0
        public ActionResult Insert(DAL.Entity.Personnel personnel)
        {
            db.Personnels.Add(personnel);
            db.SaveChanges();


            return(RedirectToAction("Index"));
        }
Пример #2
0
        public ActionResult Update(DAL.Entity.Personnel p)
        {
            var personel = db.Personnels.Find(p.ID);

            personel.Name        = p.Name;
            personel.Surname     = p.Surname;
            personel.PhoneNumber = p.PhoneNumber;
            personel.Title       = p.Title;
            personel.Address     = p.Address;
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }