public ActionResult Create(DiscountPoco poco)
        {
            if (ModelState.IsValid)
                if (poco!= null)
                {
                    USER Usr = (USER)HttpContext.Session["USER"];
                    var resultProduct = Dbcontext.setDiscount(poco.Discount.Total, poco.Discount.DateStart,
                                                              poco.Discount.DateEnd, Usr.Id,
                                                              poco.Discount.Fk_Products).FirstOrDefault();
                    if (resultProduct != 0)
                        return RedirectToAction("Index");
                    else
                        ModelState.AddModelError("", "Erreur: Les informations sont incorrectes");
                }
                else
                    ModelState.AddModelError("", "Erreur: Le modèle n'est pas valide");

            ViewBag.Products = new SelectList(Dbcontext.PRODUCTS, "Id", "Name");
            return View();
        }
 private static DiscountPoco makeDicountPoco(ShopAroundEntities Dbcontext, DISCOUNT discount)
 {
     DiscountPoco poco = new DiscountPoco();
     poco.Discount = discount;
     poco.Product = Dbcontext.PRODUCTS.Find(discount.Fk_Products);
     return poco;
 }