public ActionResult Create(Branch branch)
        {
            if (ModelState.IsValid)
            {
                db.Branches.Add(branch);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.LocationId = new SelectList(db.Locations, "Id", "Zip", branch.LocationId);
            ViewBag.CompanyId = new SelectList(db.Companies, "Id", "Name", branch.CompanyId);
            return View(branch);
        }
 public ActionResult Edit(Branch branch)
 {
     if (ModelState.IsValid)
     {
         db.Entry(branch).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.LocationId = new SelectList(db.Locations, "Id", "Zip", branch.LocationId);
     ViewBag.CompanyId = new SelectList(db.Companies, "Id", "Name", branch.CompanyId);
     return View(branch);
 }