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

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