Пример #1
0
        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));
        }
Пример #2
0
        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));
        }
Пример #3
0
        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);
        }
Пример #4
0
        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);
        }