public ActionResult DeleteSpamItems(DeleteSpamViewModel model) { var snipKeys = Request.Form.AllKeys.Where(ky => ky.StartsWith("snippet_")).ToArray(); for (int index = 0; index < snipKeys.Length; index++) { snipKeys[index] = snipKeys[index].Replace("snippet_", ""); } var adminBus = new busAdministration(); if (!adminBus.DeleteSnippets(snipKeys)) { ErrorDisplay.ShowError(adminBus.ErrorMessage); } else { ErrorDisplay.ShowMessage(snipKeys.Length + " snippets deleted."); } var busAdmin = new busAdministration(); model.Snippets = busAdmin.GetSpamKeywords(model.SearchTerm); return(View("DeleteSpam", model)); }
public ActionResult DeleteSpam(DeleteSpamViewModel model) { if (!string.IsNullOrEmpty(Request.Form["btnDelete"])) { return(DeleteSpamItems(model)); } var busAdmin = new busAdministration(); model.Snippets = busAdmin.GetSpamKeywords(model.SearchTerm); return(View(model)); }
public ActionResult DeleteSpamItems(DeleteSpamViewModel model) { var snipKeys = Request.Form.AllKeys.Where(ky => ky.StartsWith("snippet_")).ToArray(); for (int index = 0; index < snipKeys.Length; index++) { snipKeys[index] =snipKeys[index].Replace("snippet_", ""); } var adminBus = new busAdministration(); if (!adminBus.DeleteSnippets(snipKeys)) this.ErrorDisplay.ShowError(adminBus.ErrorMessage); else this.ErrorDisplay.ShowMessage(snipKeys.Length + " snippets deleted."); var busAdmin = new busAdministration(); model.Snippets = busAdmin.GetSpamKeywords(model.SearchTerm); return this.View("DeleteSpam",model); }
public ActionResult DeleteSpam(DeleteSpamViewModel model) { if (!string.IsNullOrEmpty(Request.Form["btnDelete"])) return DeleteSpamItems(model); var busAdmin = new busAdministration(); model.Snippets = busAdmin.GetSpamKeywords(model.SearchTerm); return View(model); }