public string CoreMr_Reddevil_GetByCode(string code, string defalt)
        {
            if (_listResource.ContainsKey(code))
            {
                return(_listResource[code]);
            }

            if (_iniResourceService == null)
            {
                _iniResourceService = new IniResourceService(HttpContext.Current.Server.MapPath("~/Views/Lang/" + _langCode + ".ini"));
            }

            return(_iniResourceService.CoreMr_Reddevil_GetByCode(code, defalt));
        }
        public static string GetValue(string code, string defalt)
        {
            var lang = SysLangService.Instance.CreateQuery()
                       .Where(o => o.Code == CurrentCode)
                       .ToSingle_Cache();

            if (lang == null)
            {
                return(defalt);
            }

            var resource = WebResourceService.Instance.GetByCode_Cache(code, lang.ID);

            if (resource != null)
            {
                return(resource.Value);
            }

            var iniResourceService = new IniResourceService(HttpContext.Current.Server.MapPath("~/Views/Lang/" + lang.Code + ".ini"));

            return(iniResourceService.CoreMr_Reddevil_GetByCode(code, defalt));
        }
Exemple #3
0
        public static string GetValue(string code, string defalt)
        {
            var resourceService = new IniResourceService(HttpContext.Current.Server.MapPath("~/" + Core.Web.Setting.Sys_AdminDir + "/Views/Lang/" + CurrentCode + ".ini"));

            return(resourceService.CoreMr_Reddevil_GetByCode(code, defalt));
        }