public ActionResult Create(Artigo form) { try { rep.Add(form); rep.Save(); rep.Dispose(); return RedirectToAction("Details", new { id = form.ArtigoID }); } catch { return View(); } }
public ActionResult Edit(int id, Artigo form) { var art = rep.GetArtigo(id); if (art.isOwnerOrAdmin) { UpdateModel(art); rep.Save(); rep.Dispose(); return RedirectToAction("Details", new { id = id }); } else return View("AcessoNegado"); }
partial void DeleteArtigo(Artigo instance);
partial void UpdateArtigo(Artigo instance);
partial void InsertArtigo(Artigo instance);
private void detach_Artigos(Artigo entity) { this.SendPropertyChanging(); entity.Editor = null; }
private void attach_Artigos(Artigo entity) { this.SendPropertyChanging(); entity.Editor = this; }