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);
 }
예제 #5
0
 partial void DeleteProduct(Product instance);
예제 #6
0
 partial void UpdateProduct(Product instance);
예제 #7
0
 partial void InsertProduct(Product instance);
예제 #8
0
		private void detach_Products(Product entity)
		{
			this.SendPropertyChanging();
			entity.Category = null;
		}
예제 #9
0
		private void attach_Products(Product entity)
		{
			this.SendPropertyChanging();
			entity.Category = this;
		}
예제 #10
0
 public void Create(Product product)
 {
     shoppingCardDB.Products.Add(product);
     Save();
 }
예제 #11
0
 public void Update(Product product)
 {
     shoppingCardDB.Entry(product).State = EntityState.Modified;
     Save();
 }
예제 #12
0
        public ActionResult Edit(Product model)
        {
            try
               {
            _productRepository.Update(model);
            SendTransaction(model.Id,"Edit");

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