Beispiel #1
0
        public ActionResult Create([Bind(Include = "ProductId,Title,Genre,Photo,Size,Colour,SellingPrice,InventoryId")] Product product)
        {
            if (ModelState.IsValid)
            {
                _rangamoRepository.InsertProduct(product);
                _rangamoRepository.Save();
                // db.Products.Add(product);
                //db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(product));
        }
 public ActionResult Create([Bind(Include = "InventoryId,ReOrderQuantity,ProductId,QuantityOnHand")] InventoryItems inventoryItems)
 {
     if (ModelState.IsValid)
     {
         _ranagamoRepository.InsertInventory(inventoryItems);
         _ranagamoRepository.Save();
         //db.Inventory.Add(inventoryItems);
         //db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ProductId = new SelectList(db.Products, "ProductId", "Title", inventoryItems.ProductId);
     return(View(inventoryItems));
 }