Пример #1
0
        public JsonResult DeleteNews(Guid guid)
        {
            try
            {
                _newsManager.DeleteNews(guid);

                return(new JsonResult(new { success = true }));
            }
            catch (Exception ex)
            {
                return(new JsonResult(new { success = false, msg = ex.Message }));
            }
        }
Пример #2
0
        public JsonResult DeleteNews(int id)
        {
            bool          result = _newsManager.DeleteNews(id);
            MvcHtmlString jsonResult;

            if (result)
            {
                jsonResult = Alert.GetAlert(SetAlert.Set("Poprawnie usunięto news!", "Sukcess", AlertType.Success));
            }
            else
            {
                jsonResult = Alert.GetAlert(SetAlert.Set("Wystąpił błąd, spróbuj ponownie później!", "Błąd", AlertType.Danger));
            }

            return(Json(jsonResult.ToHtmlString()));
        }