Пример #1
0
 public ActionResult Create(Product product)
 {
     try
     {
         documentSession.Store(product);
         documentSession.SaveChanges();
         return RedirectToAction("Index");
     }
     catch
     {
         return View();
     }
 }
Пример #2
0
 public ActionResult Edit(int id, Product product)
 {
     try
     {
         // TODO: Add update logic here
         var ravenProduct = documentSession.Load<Product>(id);
         ravenProduct.Update(product);
         documentSession.SaveChanges();
         return RedirectToAction("Index");
     }
     catch
     {
         return View();
     }
 }
Пример #3
0
 public void Update(Product product)
 {
     Name = product.Name;
     Description = product.Description;
     LongDescription = product.LongDescription;
     Price = product.Price;
     StockAmount = product.StockAmount;
     Image = product.Image;
 }