Ejemplo n.º 1
0
 public ActionResult SuaPromotion(Promotion pro, PromotionDetail detail)
 {
     if (ModelState.IsValid)
     {
         QuanLy ql = new QuanLy();
         ql.UpdatePromotion(pro, detail);
         __db.Entry(pro).State = EntityState.Modified;
         __db.SaveChanges();
         __db.Entry(detail).State = EntityState.Modified;
         __db.SaveChanges();
         ViewBag.IDPromotion = new SelectList(__db.Brands, "ID", "Name", pro.ID);
         return(RedirectToAction("Promotion"));
     }
     return(View(pro));
 }