示例#1
0
        public ActionResult WikiDocListByCatalogue()
        {
            if (SessionData.CurrentUser == null)
            {
                return(Redirect("/"));
            }
            List <WikiDoc_Info> lstObj  = new List <WikiDoc_Info>();
            decimal             _Cataid = 0;

            if (RouteData.Values.ContainsKey("id"))
            {
                _Cataid = Convert.ToInt32(RouteData.Values["id"]);
                var _ObjectInfo       = new WikiCatalogues_Info();
                var _WikiCatalogue_BL = new WikiCatalogue_BL();
                _ObjectInfo      = _WikiCatalogue_BL.WikiCatalogue_GetByID(_Cataid);
                ViewBag.CataInfo = _ObjectInfo;
            }
            try
            {
                var _WikiCataBL = new WikiCatalogue_BL();
                var ObjBL       = new WikiDoc_BL();
                lstObj         = ObjBL.WikiDoc_Search(CommonWiki.Stt_daduyet.ToString() + "|" + _Cataid.ToString() + "|" + "|" + SessionData.CurrentUser.Username);
                ViewBag.Paging = ObjBL.GetPagingHtml();
                List <WikiCatalogues_Info> lstOjects = _WikiCataBL.WikiCatalogueGetAll();
                ViewBag.ListCata = lstOjects;
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }
            return(PartialView("/Areas/Wiki/Views/WikiDoc/WikiListByCatalogue.cshtml", lstObj));
        }
示例#2
0
 public ActionResult WikiDocAdd()
 {
     try
     {
         if (SessionData.CurrentUser == null)
         {
             return(Redirect("/account/dang-xuat"));
         }
         decimal _Cataid = 0;
         if (RouteData.Values.ContainsKey("id") && RouteData.Values["id"].ToString() != "0")
         {
             _Cataid = Convert.ToInt32(RouteData.Values["id"]);
             var _ObjectInfo       = new WikiCatalogues_Info();
             var _WikiCatalogue_BL = new WikiCatalogue_BL();
             _ObjectInfo      = _WikiCatalogue_BL.WikiCatalogue_GetByID(_Cataid);
             ViewBag.CataInfo = _ObjectInfo;
         }
         ViewBag.Cataid = _Cataid;
         if (SessionData.CurrentUser == null)
         {
             return(Redirect("/"));
         }
         var _WikiCataBL = new WikiCatalogue_BL();
         List <WikiCatalogues_Info> lstOjects = _WikiCataBL.WikiCatalogueGetAll();
         ViewBag.ListCata = lstOjects;
     }
     catch (Exception ex)
     {
         Logger.LogException(ex);
     }
     return(PartialView("/Areas/Wiki/Views/WikiDoc/_PartialDocAdd.cshtml"));
 }
示例#3
0
        public ActionResult CatalougeSearch(string keysSearch, string options)
        {
            var lstOjects = new List <WikiCatalogues_Info>();

            try
            {
                WikiCatalogue_BL _CatalogueBL = new WikiCatalogue_BL();
                lstOjects      = _CatalogueBL.Portal_Catalogue_Search(keysSearch + "|" + AppsCommon.GetCurrentLang(), options);
                ViewBag.Paging = _CatalogueBL.GetPagingHtml();
                string _Cataid = "";
                WikiCatalogues_Info _parentinfo = new WikiCatalogues_Info();
                if (keysSearch != "" && keysSearch.Split('|').Length > 1)
                {
                    _Cataid = keysSearch.Split('|')[2];
                }
                if (_Cataid != "0")
                {
                    _parentinfo = _CatalogueBL.WikiCatalogue_GetByID(Convert.ToDecimal(_Cataid));
                }
                else
                {
                    _Cataid = _parentinfo.ID.ToString();
                }
                ViewBag.Parentinfo = _parentinfo;
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }
            ViewBag.ListObject = lstOjects;
            return(PartialView("/Areas/Home/Views/Wiki/_PartialListChilCataByParent.cshtml"));
        }
示例#4
0
        public ActionResult ChildCatalogue()
        {
            try
            {
                WikiCatalogue_BL _CatalogueBL = new WikiCatalogue_BL();
                WikiDoc_BL       _WikiBL      = new WikiDoc_BL();
                decimal          _Cataid      = 0;
                if (RouteData.Values["id"] != null)
                {
                    _Cataid = Convert.ToDecimal(RouteData.Values["id"]);
                }
                List <WikiCatalogues_Info> _ListCata = new List <WikiCatalogues_Info>();
                _ListCata = _CatalogueBL.Portal_CataGetAll();
                List <WikiDoc_Info> _ListDocSearch = new List <WikiDoc_Info>();
                if (_Cataid > 0)
                {
                    // lấy ds tin theo danh mục
                    _ListDocSearch        = _WikiBL.PortalWikiDoc_Search("3|" + _Cataid.ToString() + "|ALL|" + AppsCommon.GetCurrentLang());
                    ViewBag.Paging        = _WikiBL.GetPagingHtml();
                    ViewBag.ListDocSearch = _ListDocSearch;
                    WikiCatalogue_BL    _Catabl   = new WikiCatalogue_BL();
                    WikiCatalogues_Info _Catainfo = new WikiCatalogues_Info();
                    _Catainfo             = _Catabl.WikiCatalogue_GetByID(_Cataid);
                    ViewBag.CatalogueInfo = _Catainfo;
                }
                else
                {
                    // lấy thằng đầu tiên
                    WikiCatalogues_Info _firstCata = new WikiCatalogues_Info();
                    foreach (var item in _ListCata)
                    {
                        if (item.PARENT_ID != 0)
                        {
                            _firstCata = item;
                            break;
                        }
                    }

                    _ListDocSearch        = _WikiBL.PortalWikiDoc_Search("3|" + _firstCata.ID.ToString() + "|ALL|" + AppsCommon.GetCurrentLang());
                    ViewBag.Paging        = _WikiBL.GetPagingHtml();
                    ViewBag.ListDocSearch = _ListDocSearch;
                    ViewBag.CatalogueInfo = _firstCata;
                }
                ViewBag.ListCatalogue = _ListCata;
                ViewBag.CurrCata      = _Cataid;
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }
            return(View("~/Areas/Home/Views/Wiki/ChildCatalogue.cshtml"));
        }
示例#5
0
 public decimal WikiCatalogue_Update(WikiCatalogues_Info p_ObjInffo)
 {
     try
     {
         WikiCatalogue_DA _da = new WikiCatalogue_DA();
         return(_da.WikiCatalogue_Update(p_ObjInffo.ID, p_ObjInffo.NAME, p_ObjInffo.NAME_ENG, p_ObjInffo.CATA_LEVEL, p_ObjInffo.MODIFIED_BY, p_ObjInffo.MODIFIED_DATE, p_ObjInffo.PARENT_ID));
     }
     catch (Exception ex)
     {
         Logger.LogException(ex);
         return(-1);
     }
 }
示例#6
0
        public ActionResult ViewCata()
        {
            try
            {
                WikiCatalogue_BL _CatalogueBL = new WikiCatalogue_BL();
                string           _Cataid      = "";
                if (RouteData.Values["id"] != null)
                {
                    _Cataid = RouteData.Values["id"].ToString();
                }

                WikiCatalogues_Info        _parentinfo   = new WikiCatalogues_Info();
                List <WikiCatalogues_Info> _ListCataMenu = new List <WikiCatalogues_Info>();
                _ListCataMenu = _CatalogueBL.Portal_CataGetAll();
                List <WikiCatalogues_Info> _ListCata = new List <WikiCatalogues_Info>();
                foreach (var item in _ListCataMenu)
                {
                    if (item.ID != 0)
                    {
                        _parentinfo = item;
                        break;
                    }
                }
                if (_Cataid != "0")
                {
                    _parentinfo = _CatalogueBL.WikiCatalogue_GetByID(Convert.ToDecimal(_Cataid));
                }
                else
                {
                    ViewBag.DefaultPage = 1;
                    _Cataid             = _parentinfo.ID.ToString();
                }


                _ListCata          = _CatalogueBL.Portal_Catalogue_Search("ALL|ALL|" + _Cataid.ToString() + "|" + AppsCommon.GetCurrentLang());
                ViewBag.Paging     = _CatalogueBL.GetPagingHtml();
                ViewBag.ListObject = _ListCata;
                ViewBag.Parentinfo = _parentinfo;

                ViewBag.ListCatalogue = _ListCataMenu;
                // lấy thằng đầu tiên

                ViewBag.CurrCata = _parentinfo.ID;
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }
            return(View("/Areas/Home/Views/Wiki/ViewCatalogue.cshtml"));
        }
示例#7
0
        public ActionResult ViewDetailCatalogue(decimal p_id)
        {
            var _ObjectInfo = new WikiCatalogues_Info();
            var _ObjBL      = new WikiCatalogue_BL();

            try
            {
                _ObjectInfo = _ObjBL.WikiCatalogue_GetByID(p_id);
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }

            return(PartialView("~/Areas/Wiki/Views/Catalogue/_PartialCatalogueDetail.cshtml", _ObjectInfo));
        }
示例#8
0
        public ActionResult GetViewToEditClass(decimal p_id)
        {
            var _ObjectInfo = new WikiCatalogues_Info();
            var _ObjBL      = new WikiCatalogue_BL();

            try
            {
                _ObjectInfo = _ObjBL.WikiCatalogue_GetByID(p_id);
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }
            List <WikiCatalogues_Info> lstOjects = _ObjBL.WikiCatalogueGetAll();

            ViewBag.ListCata = lstOjects;
            return(PartialView("~/Areas/Wiki/Views/Catalogue/_PartialCatalogueEdit.cshtml", _ObjectInfo));
        }
示例#9
0
        public ActionResult DoAddCatalogue(WikiCatalogues_Info _ObjectInfo)
        {
            decimal _rel = 0;

            try
            {
                var _ObjBL = new WikiCatalogue_BL();
                _ObjectInfo.CREATED_BY   = SessionData.CurrentUser.Username;
                _ObjectInfo.CREATED_DATE = DateTime.Now;
                _rel = _ObjBL.WikiCatalogue_Insert(_ObjectInfo);
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }

            return(Json(new { result = _rel }));
        }
示例#10
0
        public ActionResult DoEditObject(WikiCatalogues_Info _ObjectInfo)
        {
            decimal _result = 0;

            try
            {
                var _ObjBL = new WikiCatalogue_BL();
                _ObjectInfo.MODIFIED_BY   = SessionData.CurrentUser.Username;
                _ObjectInfo.MODIFIED_DATE = DateTime.Now;
                _result = _ObjBL.WikiCatalogue_Update(_ObjectInfo);
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }

            return(Json(new { result = _result }));
        }
示例#11
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));
        }
示例#12
0
        public ActionResult GetListdocByCataid(decimal p_id)
        {
            try
            {
                WikiCatalogue_BL    _CatalogueBL   = new WikiCatalogue_BL();
                WikiDoc_BL          _WikiBL        = new WikiDoc_BL();
                List <WikiDoc_Info> _ListDocSearch = new List <WikiDoc_Info>();

                // lấy ds tin theo danh mục
                _ListDocSearch        = _WikiBL.WikiDoc_GetBy_CataID(p_id);
                ViewBag.ListDocSearch = _ListDocSearch;
                WikiCatalogue_BL    _Catabl   = new WikiCatalogue_BL();
                WikiCatalogues_Info _Catainfo = new WikiCatalogues_Info();
                _Catainfo             = _Catabl.WikiCatalogue_GetByID(p_id);
                ViewBag.CatalogueInfo = _Catainfo;
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }
            return(PartialView("/Areas/Home/Views/Wiki/_PartialListDocByCata.cshtml"));
        }
示例#13
0
        public ActionResult WikiDocSearch(string keysSearch, string options)
        {
            var lstOjects = new List <WikiDoc_Info>();

            try
            {
                var _WikiDoc_BL = new WikiDoc_BL();
                lstOjects      = _WikiDoc_BL.PortalWikiDoc_Search(keysSearch + "|" + AppsCommon.GetCurrentLang(), options);
                ViewBag.Paging = _WikiDoc_BL.GetPagingHtml();
                if (keysSearch.Split('|').Length > 2 && keysSearch.Split('|')[1] != "ALL" && keysSearch.Split('|')[1] != "")
                {
                    WikiCatalogue_BL    _Catabl   = new WikiCatalogue_BL();
                    WikiCatalogues_Info _Catainfo = new WikiCatalogues_Info();
                    _Catainfo             = _Catabl.WikiCatalogue_GetByID(Convert.ToDecimal((keysSearch.Split('|')[1])));
                    ViewBag.CatalogueInfo = _Catainfo;
                }
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }
            ViewBag.ListDocSearch = lstOjects;
            return(PartialView("/Areas/Home/Views/Wiki/_PartialListDocByCata.cshtml"));
        }