Esempio n. 1
0
        public ActionResult Create(Occupation occupation)
        {
            if (ModelState.IsValid)
            {
                occupation.Id = Guid.NewGuid();
                db.Occupations.Add(occupation);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(occupation);
        }
Esempio n. 2
0
 public ActionResult Edit(Occupation occupation)
 {
     if (ModelState.IsValid)
     {
         db.Entry(occupation).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(occupation);
 }