public ActionResult Delete(int id) { var post = manager.GetPostById(id); manager.Delete(post); return(RedirectToAction("Index")); }
public ActionResult BlogDelete(Blog b) { var blog = blogManager.Find(x => x.Id == b.Id); blogManager.Delete(blog); return(RedirectToAction("Blog")); }
public ActionResult DeleteConfirmed(Guid?id) { Blog blog = _blogManager.Find(x => x.Id == id); BusinessLayerResult <Blog> res = _blogManager.Delete(blog); if (res.Errors.Count > 0) { res.Errors.ForEach(x => ModelState.AddModelError("", x.Message)); return(View(blog)); } else { CacheHelper.RemoveGetBlogsWithOutDraftDeleteFromCache(); return(RedirectToAction("Index", "Blog")); } }
private void ButtonDeleteBlog_Click(object sender, RoutedEventArgs e) { _bm.Delete(); ListBoxBlogs.ItemsSource = _bm.ReadBlog(); }
public ActionResult DeleteBlog(int id) { blogManager.Delete(id); return(RedirectToAction("Index")); }
public ActionResult Delete(int id) { BlogManager db = new BlogManager(); Entry etr = db.GetEntry(id); if ((etr.Author == User.Identity.Name && User.IsInRole("writer")) || User.IsInRole("chief")) { db.Delete(etr); db.Save(); return RedirectToAction("Index"); } else { return Redirect("~/Home/AccessError"); } }