Ejemplo n.º 1
0
        public ActionResult Create(Product model)
        {
            _productRepository.Create(model);
               SendTransaction(_productRepository.Get(model.Name).Id, "Create");

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

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