public ActionResult Edit(danhmucsanpham model)
 {
     if (ModelState.IsValid)
     {
         db.Entry(model).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ModelState.AddModelError("", "Thông tin không chính xác");
     return(View(model));
 }
 public ActionResult Create(danhmucsanpham model)
 {
     if (ModelState.IsValid)
     {
         db.danhmucsanphams.Add(model);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ModelState.AddModelError("", "Thông tin nhập liệu không chính xác ! Hãy xem lại .");
     return(View());
 }