Ejemplo n.º 1
0
        public ActionResult AddDiscount()
        {
            ViewBag.ClientTypes = _iCommonManager.GetAllClientType().ToList();
            foreach (ClientType clientType in _iCommonManager.GetAllClientType())
            {
                foreach (var product in _iProductManager.GetAllProducts())
                {
                    Discount model = new Discount
                    {
                        UpdateByUserId  = 6,
                        DiscountPercent = 6,
                        ClientTypeId    = clientType.ClientTypeId,
                        UpdateDate      = DateTime.Now,
                        ProductId       = product.ProductId,
                    };

                    _iDiscountManager.Add(model);
                }
            }

            return(View());
        }
Ejemplo n.º 2
0
 public ActionResult AddDiscount(Discount model)
 {
     if (ModelState.IsValid)
     {
         var anUser = (ViewUser)Session["user"];
         model.UpdateByUserId = anUser.UserId;
         bool result = _iDiscountManager.Add(model);
         ViewData["Message"] = result ? "Discount info Saved Successfully!!" : "Failed to Save!!";
         ModelState.Clear();
     }
     ViewBag.ClientTypes = _iCommonManager.GetAllClientType().ToList();
     return(View());
 }