public ActionResult DeleteArticle(int? id) { mu = Membership.GetUser(); var model = new BootBaronLib.AppSpec.DasKlub.BOL.UserContent.Content(); if (id != null && id > 0) { model = new BootBaronLib.AppSpec.DasKlub.BOL.UserContent.Content( Convert.ToInt32(id)); ContentComments concoms = new ContentComments(); concoms.GetCommentsForContent(model.ContentID, SiteEnums.CommentStatus.U); concoms.GetCommentsForContent(model.ContentID, SiteEnums.CommentStatus.C); if (model.CreatedByUserID == Convert.ToInt32(mu.ProviderUserKey)) { // security check foreach (ContentComment c1 in concoms) c1.Delete(); model.Delete(); } } return RedirectToAction("Articles"); }
public ActionResult DeleteArticle(int? id) { if (id == null || !(id > 0)) return RedirectToAction("Articles"); var model = new Content(Convert.ToInt32(id)); var concoms = new ContentComments(); concoms.GetCommentsForContent(model.ContentID, SiteEnums.CommentStatus.U); concoms.GetCommentsForContent(model.ContentID, SiteEnums.CommentStatus.C); if (_mu == null || model.CreatedByUserID != Convert.ToInt32(_mu.ProviderUserKey)) return RedirectToAction("Articles"); // security check foreach (var c1 in concoms) c1.Delete(); model.Delete(); return RedirectToAction("Articles"); }
public ActionResult DeleteArticle(int? id) { if (id == null || !(id > 0)) return RedirectToAction("Articles"); var model = new Content( Convert.ToInt32(id)); var concoms = new ContentComments(); concoms.GetCommentsForContent(model.ContentID, SiteEnums.CommentStatus.U); concoms.GetCommentsForContent(model.ContentID, SiteEnums.CommentStatus.C); foreach (ContentComment c1 in concoms) c1.Delete(); model.Delete(); return RedirectToAction("Articles"); }
public ActionResult DeleteArticle(int? id) { var model = new BootBaronLib.AppSpec.DasKlub.BOL.UserContent.Content(); if (id != null && id > 0) { model = new BootBaronLib.AppSpec.DasKlub.BOL.UserContent.Content( Convert.ToInt32(id)); ContentComments concoms = new ContentComments(); concoms.GetCommentsForContent(model.ContentID, SiteEnums.CommentStatus.U); concoms.GetCommentsForContent(model.ContentID, SiteEnums.CommentStatus.C); foreach (ContentComment c1 in concoms) c1.Delete(); model.Delete(); } return RedirectToAction("Articles"); }