public ActionResult Create(Product model)
        {
            _productRepository.Create(model);
               SendTransaction(_productRepository.Get(model.Name).Id, "Create");

               return RedirectToAction("Index");
        }
 public void Update(Product product)
 {
     httpHelpers.HttpInvoke(SupportedHttpMethods.PUT, string.Format("{0}/{1}", restService, apiPath),
     serializer.Serialize<Product>(product));
 }
 /// <summary>
 /// Create a new Product object.
 /// </summary>
 /// <param name="productId">Initial value of the ProductId property.</param>
 /// <param name="productName">Initial value of the ProductName property.</param>
 /// <param name="costPrice">Initial value of the CostPrice property.</param>
 /// <param name="sellPrice">Initial value of the SellPrice property.</param>
 public static Product CreateProduct(global::System.Int32 productId, global::System.String productName, global::System.Decimal costPrice, global::System.Decimal sellPrice)
 {
     Product product = new Product();
     product.ProductId = productId;
     product.ProductName = productName;
     product.CostPrice = costPrice;
     product.SellPrice = sellPrice;
     return product;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the Products EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToProducts(Product product)
 {
     base.AddObject("Products", product);
 }
Esempio n. 5
0
 partial void DeleteProduct(Product instance);
Esempio n. 6
0
 partial void UpdateProduct(Product instance);
Esempio n. 7
0
 partial void InsertProduct(Product instance);
Esempio n. 8
0
		private void detach_Products(Product entity)
		{
			this.SendPropertyChanging();
			entity.Category = null;
		}
Esempio n. 9
0
		private void attach_Products(Product entity)
		{
			this.SendPropertyChanging();
			entity.Category = this;
		}
Esempio n. 10
0
 public void Create(Product product)
 {
     shoppingCardDB.Products.Add(product);
     Save();
 }
Esempio n. 11
0
 public void Update(Product product)
 {
     shoppingCardDB.Entry(product).State = EntityState.Modified;
     Save();
 }
        public ActionResult Edit(Product model)
        {
            try
               {
            _productRepository.Update(model);
            SendTransaction(model.Id,"Edit");

            return RedirectToAction("Index");
               }
               catch
               {
            return View();
               }
        }