Exemplo n.º 1
0
        public ActionResult ViewDoc()
        {
            if (SessionData.CurrentUser == null)
            {
                return(Redirect("/account/dang-xuat"));
            }
            var          _WikiDoc_BL = new WikiDoc_BL();
            WikiDoc_Info _ObjInfo    = new WikiDoc_Info();
            decimal      _docid      = 0;

            if (RouteData.Values.ContainsKey("id"))
            {
                _docid = CommonFuc.ConvertToDecimal(RouteData.Values["id"]);
            }
            try
            {
                _ObjInfo = _WikiDoc_BL.WikiDoc_GetById(_docid);
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }

            int _crrstatus = 0;

            if (RouteData.Values.ContainsKey("id1"))
            {
                _crrstatus = CommonFuc.ConvertToInt(RouteData.Values["id1"]);
            }
            ViewBag.CurrStatus = _crrstatus;
            return(PartialView("~/Areas/Wiki/Views/WikiDoc/_PartialDocView.cshtml", _ObjInfo));
        }
Exemplo n.º 2
0
 public ActionResult DetailNewsArticles()
 {
     try
     {
         if (SessionData.CurrentUser == null)
         {
             return(Redirect("/"));
         }
         decimal pIDArticles = 0;
         int     Status      = 0;
         if (RouteData.Values.ContainsKey("id"))
         {
             pIDArticles = CommonFuc.ConvertToDecimal(RouteData.Values["id"]);
         }
         if (RouteData.Values.ContainsKey("id2"))
         {
             Status = CommonFuc.ConvertToInt(RouteData.Values["id2"]);
         }
         ViewBag.Status = Status;
         var objNewsBL = new NewsBL();
         ViewBag.lstCategory = WebApps.CommonFunction.AppsCommon.AllCode_GetBy_CdTypeCdName("ARTICLES", "CATEGORIES");
         string language   = AppsCommon.GetCurrentLang();
         var    objNewInfo = objNewsBL.ArticlesGetById(pIDArticles, language);
         return(View("~/Areas/Articles/Views/ArticlesNews/_PartialviewView.cshtml", objNewInfo));
     }
     catch (Exception ex)
     {
         Logger.LogException(ex);
         return(View());
     }
 }
Exemplo n.º 3
0
        public ActionResult ViewEdit()
        {
            if (SessionData.CurrentUser == null)
            {
                return(Redirect("/account/dang-xuat"));
            }
            var          _WikiDoc_BL = new WikiDoc_BL();
            WikiDoc_Info _ObjInfo    = new WikiDoc_Info();

            decimal _docid = 0;

            if (RouteData.Values.ContainsKey("id"))
            {
                _docid = CommonFuc.ConvertToDecimal(RouteData.Values["id"]);
            }
            int _crrstatus = 0;

            if (RouteData.Values.ContainsKey("id1"))
            {
                _crrstatus = CommonFuc.ConvertToInt(RouteData.Values["id1"]);
            }
            try
            {
                _ObjInfo = _WikiDoc_BL.WikiDoc_GetById(_docid);
                var _WikiCataBL = new WikiCatalogue_BL();
                List <WikiCatalogues_Info> lstOjects = _WikiCataBL.WikiCatalogueGetAll();
                ViewBag.ListCata = lstOjects;

                // bỏ hết hashtag nvshashtag đi
                _ObjInfo.CONTENT = _ObjInfo.CONTENT.Replace("<nvshashtag>", "").Replace("</nvshashtag>", "");

                var _ObjectInfo       = new WikiCatalogues_Info();
                var _WikiCatalogue_BL = new WikiCatalogue_BL();
                _ObjectInfo      = _WikiCatalogue_BL.WikiCatalogue_GetByID(_ObjInfo.CATA_ID);
                ViewBag.CataInfo = _ObjectInfo;
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }
            ViewBag.CurrStatus = _crrstatus;
            return(PartialView("~/Areas/Wiki/Views/WikiDoc/_PartialDocEdit.cshtml", _ObjInfo));
        }
Exemplo n.º 4
0
        public ActionResult EditNewsArticles()
        {
            try
            {
                if (SessionData.CurrentUser == null)
                {
                    return(Redirect("/"));
                }
                decimal pIDArticles = 0;
                int     Status      = 0;
                if (RouteData.Values.ContainsKey("id"))
                {
                    pIDArticles = CommonFuc.ConvertToDecimal(RouteData.Values["id"]);
                }
                if (RouteData.Values.ContainsKey("id2"))
                {
                    Status = CommonFuc.ConvertToInt(RouteData.Values["id2"]);
                }
                ViewBag.Status = Status;
                var objNewsBL = new NewsBL();
                ViewBag.lstCategory = WebApps.CommonFunction.AppsCommon.AllCode_GetBy_CdTypeCdName("ARTICLES", "CATEGORIES");
                string language   = AppsCommon.GetCurrentLang();
                var    objNewInfo = objNewsBL.ArticlesGetById(pIDArticles, language);

                if (SessionData.CurrentUser != null && SessionData.CurrentUser.Type != (decimal)CommonEnums.UserType.Customer)
                {
                    B_Todos_BL   _B_Todos_BL   = new B_Todos_BL();
                    B_Todos_Info _B_Todos_Info = _B_Todos_BL.Todo_GetByCaseCode(objNewInfo.Case_Code, SessionData.CurrentUser.Username);
                    if (_B_Todos_Info != null)
                    {
                        ViewBag.B_Todos_Info = _B_Todos_Info;
                    }
                }

                return(View("~/Areas/Articles/Views/ArticlesNews/_PartialviewEdit.cshtml", objNewInfo));
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
                return(View());
            }
        }