Esempio n. 1
0
        public ActionResult NewsDetailmembership()
        {
            try
            {
                string _code = "";
                if (RouteData.Values.ContainsKey("id"))
                {
                    _code = CommonFuc.ConvertToString(RouteData.Values["id"]);
                }
                var            objBL     = new Sys_Pages_BL();
                string         language  = AppsCommon.GetCurrentLang();
                Sys_Pages_Info _pageInfo = objBL.Sys_Pages_GetBy_Code(_code);
                ViewBag.objNewInfo = _pageInfo;
                return(View("~/Areas/Sys_Pages/Views/SysPages/NewsDetail_By_Home.cshtml"));

                //string pCategory = "";
                //if (RouteData.Values.ContainsKey("id"))
                //{
                //    pCategory = CommonFuc.ConvertToString(RouteData.Values["id"]);
                //}
                //var objNewsBL = new NewsBL();
                //string language = AppsCommon.GetCurrentLang();
                //List<NewsInfo> lstNews = objNewsBL.NewsStatic(language);
                //ViewBag.objNewInfo = new NewsInfo();
                //if (lstNews.Count > 0)
                //{
                //    foreach (var item in lstNews)
                //    {
                //        if (item.Categories_Id.ToUpper() == pCategory.ToUpper())
                //        {
                //            ViewBag.objNewInfo = item;
                //            return View("~/Areas/Articles/Views/ArticlesNews/NewsDetailByCategory.cshtml");
                //        }
                //    }
                //}
                //return View("~/Areas/Articles/Views/ArticlesNews/NewsDetailByCategory.cshtml");
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
                return(View());
            }
        }
Esempio n. 2
0
 public ActionResult NewsDetail_Page()
 {
     try
     {
         string _code = "";
         if (RouteData.Values.ContainsKey("id"))
         {
             _code = CommonFuc.ConvertToString(RouteData.Values["id"]);
         }
         var            objBL     = new Sys_Pages_BL();
         string         language  = AppsCommon.GetCurrentLang();
         Sys_Pages_Info _pageInfo = objBL.Sys_Pages_GetBy_Code(_code);
         ViewBag.objNewInfo = _pageInfo;
         return(View("~/Areas/Sys_Pages/Views/SysPages/NewsDetail_By_Home.cshtml"));
     }
     catch (Exception ex)
     {
         Logger.LogException(ex);
         return(View());
     }
 }