Ejemplo n.º 1
0
 public ActionResult Edit(Branch branch)
 {
     if (ModelState.IsValid)
     {
         db.Entry(branch).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.DivisionID = new SelectList(db.Divisions, "DivisionID", "DivisionName", branch.DivisionID);
     return View(branch);
 }
Ejemplo n.º 2
0
        public ActionResult Create(Branch branch)
        {
            if (ModelState.IsValid)
            {
                db.Branches.Add(branch);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.DivisionID = new SelectList(db.Divisions, "DivisionID", "DivisionName", branch.DivisionID);
            return View(branch);
        }