Exemplo n.º 1
0
 public static void CreateProducts(ProductsModel entity)
 {
     // List<ProductsModel> modellst = new List<ProductsModel>();
     var productId = ProductsList.Max(a => a.ProductId) + 1;
     ProductsList.Add(new ProductsModel { ProductId = productId, ProductName = entity.ProductName, Price = entity.Price, Description = entity.Description });
     SessionHelper.SetSession("Products", ProductsList);
 }
Exemplo n.º 2
0
 public ActionResult Create(ProductsModel model)
 {
     ProductsHelper.CreateProducts(model);
     ModelState.Clear();
     ViewBag.Message = "Products has been added successfully";
     return View();
 }