public JsonResult DeleteWebNews(int newsID)
        {
            IWebNews newsService = new WebNewsService();
            int      result      = newsService.deleteWebNews(newsID);

            return(Json(new { RetCode = result }));
        }
        public ActionResult WebNewsList()
        {
            IWebNews       newsService = new WebNewsService();
            List <WebNews> newsList    = newsService.GetWebNewsList();

            ViewBag.NewsList = newsList;
            return(View());
        }
        public JsonResult AddOrEditWebNews1(WebNews news)
        {
            IWebNews newsService = new WebNewsService();
            int      result      = 0;
            WebMenu  parentMenu  = webMenuService.GetMenuByID(news.ClassID);

            news.ClassName = parentMenu != null ? parentMenu.WebMenuName : string.Empty;
            if (news.ContentID > 0)
            {
                result = newsService.updateWebNews(news);
            }
            else
            {
                result = newsService.AddWebNews(news);
            }
            return(Json(new { RetCode = result }));
        }
        public ActionResult AddOrEditWebNews(int newsID)
        {
            IWebNews newsService = new WebNewsService();
            WebNews  news        = newsService.GetWebNewsByID(newsID);

            if (news == null)
            {
                news = new WebNews();
            }
            List <WebMenu> menuList = webMenuService.GetWebMenuList();
            IEnumerable <SelectListItem> parentMenus = menuList.Select(m => new SelectListItem {
                Value = m.WebMenuID.ToString(), Text = m.WebMenuName
            });

            ViewBag.ParentMenus = parentMenus;
            return(View(news));
        }