public ActionResult Edit(Produto produto) { if (ModelState.IsValid) { db.Produtoes.Attach(produto); db.ObjectStateManager.ChangeObjectState(produto, EntityState.Modified); db.SaveChanges(); return RedirectToAction("Index"); } return View(produto); }
public ActionResult Create(Produto produto) { if (ModelState.IsValid) { db.Produtoes.AddObject(produto); db.SaveChanges(); return RedirectToAction("Index"); } return View(produto); }
/// <summary> /// Create a new Produto object. /// </summary> /// <param name="id">Initial value of the id property.</param> /// <param name="descr">Initial value of the Descr property.</param> /// <param name="qtd">Initial value of the qtd property.</param> public static Produto CreateProduto(global::System.Decimal id, global::System.String descr, global::System.Decimal qtd) { Produto produto = new Produto(); produto.id = id; produto.Descr = descr; produto.qtd = qtd; return produto; }
/// <summary> /// Deprecated Method for adding a new object to the Produtoes EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToProdutoes(Produto produto) { base.AddObject("Produtoes", produto); }