Exemplo n.º 1
0
        /// <summary>
        /// 获取用户
        /// </summary>
        /// <param name="account"></param>
        /// <returns></returns>
        internal List <SMS.Model.EnterpriseUser> GetAccounts()
        {
            List <SMS.Model.EnterpriseUser> list = CacheManager <SMS.Model.EnterpriseUser> .Instance.GetAll();//.Get(account);

            if (list == null)
            {
                //数据库操作
                try
                {
                    list = EnterpriseUserDB.GetEnterprises();
                }
                catch
                {
                    return(new List <SMS.Model.EnterpriseUser>());
                }
            }
            return(list);
        }
Exemplo n.º 2
0
        public void LoadAccountCache()
        {
            List <SMS.Model.EnterpriseUser> list = EnterpriseUserDB.GetEnterprises();

            foreach (var v in list)
            {
                if (!string.IsNullOrEmpty(v.Signature))
                {
                    v.Signature = v.Signature.Substring(1, v.Signature.Length - 2);
                }
                CacheManager <SMS.Model.EnterpriseUser> .Instance.Set(v.AccountCode, v);
            }


            List <SMSTemplet> sc = SMSTempletDB.GetSMSTempets();

            foreach (var v in sc)
            {
                CacheManager <SMSTemplet> .Instance.Set(v.TempletID, v);
            }
        }