public ActionResult Create(Blog form) { try { rep.Add(form); rep.Save(); rep.Dispose(); return RedirectToAction("Details", new { id = form.BlogID }); } catch { return View(); } }
public ActionResult Edit(int id, Blog form) { var blog = rep.GetBlog(id); if (blog.isOwnerOrAdmin) { UpdateModel(blog); rep.Save(); rep.Dispose(); return RedirectToAction("Details", new { id = id }); } else return View("AcessoNegado"); }
public void Add(Blog Blog) { Blog.CriadoEm = DateTime.Now; Blog.EditorID = Usuario.Logado.ID; db.Blogs.InsertOnSubmit(Blog); }
public void Delete(Blog Blog) { db.Blogs.DeleteOnSubmit(Blog); }
partial void DeleteBlog(Blog instance);
partial void UpdateBlog(Blog instance);
partial void InsertBlog(Blog instance);
private void detach_Blogs(Blog entity) { this.SendPropertyChanging(); entity.Editor = null; }
private void attach_Blogs(Blog entity) { this.SendPropertyChanging(); entity.Editor = this; }