Пример #1
0
        public ActionResult Create(Sector sector)
        {
            if (ModelState.IsValid)
            {
                db.Sectors.Add(sector);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(sector);
        }
Пример #2
0
 public ActionResult Edit(Sector sector)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sector).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(sector);
 }