Example #1
0
        public static List <VIEW_SYS_REF> GetSysConfigList(string type)
        {
            IList <VIEW_SYS_REF> items = new List <VIEW_SYS_REF>();

            if (HttpContext.Current.Application["SYSConfig"] == null)
            {
                HttpContext.Current.Application["SYSConfig"] = VIEW_SYS_REF.ToListViewModel(OperateContext.Current.BLLSession.ISYS_REF_MANAGER.GetListBy(r => true).ToList());
            }
            else
            {
                items = (IList <VIEW_SYS_REF>)HttpContext.Current.Application["SYSConfig"];
            }
            var model = items.Where(r => r.REF_TYPE == type).OrderBy(r => r.REF_SEQ).ToList();

            if (model == null)
            {
                return(items.ToList());
            }
            return(model);
        }
Example #2
0
        /// <summary>
        /// 应用程序加载所有的Controller
        /// </summary>
        /// <returns></returns>
        public static string GetSysConfigValue(string type, string name)
        {
            IList <VIEW_SYS_REF> items = new List <VIEW_SYS_REF>();

            if (HttpContext.Current.Application["SYSConfig"] == null)
            {
                HttpContext.Current.Application["SYSConfig"] = VIEW_SYS_REF.ToListViewModel(OperateContext.Current.BLLSession.ISYS_REF_MANAGER.GetListBy(r => true).ToList());
            }
            else
            {
                items = (IList <VIEW_SYS_REF>)HttpContext.Current.Application["SYSConfig"];
            }
            var model = items.Where(r => r.REF_TYPE == type && r.REF_PARAM == name).FirstOrDefault();

            if (model == null)
            {
                return("");
            }
            return(model.REF_VALUE);
        }