public ActionResult Edit(Category cat)
 {
     if (ModelState.IsValid)
     {
         db.Entry(cat).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(cat);
 }
 public ActionResult AddCategory(Category cat)
 {
     if (ModelState.IsValid)
     {
         db.Categories.Add(cat);
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(cat);
 }