예제 #1
0
 public ActionResult CreateNewProduct(Product NewProduct)
 {
     if (ModelState.IsValid)
     {
         NewProduct.CreateProduct();
         ViewData["SuccessMessgae"] = "Product Successfully Created";
     }
     return View(NewProduct);
 }
예제 #2
0
 public static void CreateProduct(Product Product)
 {
     lock (IsProductUse)
     {
         CurrentProductId++;
         Product.Id = CurrentProductId;
         Products.Add(Product.Id, Product);
     }
 }