public ActionResult Create(Equipment equipment)
        {
            if (ModelState.IsValid)
            {
                _db.Equipment.Add(equipment);
                _db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.CategoryId = new SelectList(_db.Categories, "CategoryId", "Name", equipment.CategoryId);
            ViewBag.LocationId = new SelectList(_db.Locations, "LocationId", "CellProvider", equipment.LocationId);
            return View(equipment);
        }
 public ActionResult Edit(Equipment equipment)
 {
     if (ModelState.IsValid)
     {
         _db.Entry(equipment).State = EntityState.Modified;
         _db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.CategoryId = new SelectList(_db.Categories.OrderBy(m => m.Name), "CategoryId", "Name", equipment.CategoryId);
     return View(equipment);
 }