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<T> property instead. /// </summary> public void AddToProducts(Product product) { base.AddObject("Products", product); }
partial void DeleteProduct(Product instance);
partial void UpdateProduct(Product instance);
partial void InsertProduct(Product instance);
private void detach_Products(Product entity) { this.SendPropertyChanging(); entity.Category = null; }
private void attach_Products(Product entity) { this.SendPropertyChanging(); entity.Category = this; }
public void Create(Product product) { shoppingCardDB.Products.Add(product); Save(); }
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(); } }