Ejemplo n.º 1
0
 public SmsBlackphoneInfo GetInfo(int id)
 {
     using (SelectAction action = new SelectAction(this.Entity))
     {
         action.SqlWhere(SmsBlackphoneInfo.Columns.ID, id);
         return(action.QueryEntity <SmsBlackphoneInfo>());
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 查询一个实体
 /// </summary>
 /// <returns></returns>
 public cms_user SelectDemo()
 {
     using (SelectAction action = new SelectAction(Entity))
     {
         action.SqlWhere(cms_user.Columns.username, "wang", RelationEnum.LikeLeft);
         return(action.QueryEntity <cms_user>());
     }
 }
Ejemplo n.º 3
0
 public SmsContentfilterkeyInfo GetInfo(int id)
 {
     using (SelectAction action = new SelectAction(this.Entity))
     {
         action.SqlWhere(SmsContentfilterkeyInfo.Columns.ID, id);
         return(action.QueryEntity <SmsContentfilterkeyInfo>());
     }
 }
Ejemplo n.º 4
0
 public cms_user SelectDemo1()
 {
     using (SelectAction action = new SelectAction(Entity))
     {
         action.Cast <cms_user>()
         .Where(user1 => user1.username == "wangjun");
         return(action.QueryEntity <cms_user>());
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// 获取账号的基本信息
 /// </summary>
 /// <param name="username"></param>
 /// <param name="password"></param>
 /// <returns></returns>
 public SmsAccountInfo GetAccountInfo(string username, string password)
 {
     using (SelectAction action = new SelectAction(Entity))
     {
         action.SqlWhere(SmsAccountInfo.Columns.Account, username);
         action.SqlWhere(SmsAccountInfo.Columns.Password, md5.Encrypt(password));
         return(action.QueryEntity <SmsAccountInfo>());
     }
 }
Ejemplo n.º 6
0
 public users getModel(string username, string pwd)
 {
     using (SelectAction action = new SelectAction(this.Entity))
     {
         action.SqlWhere(users.Columns.username, username);
         if (!string.IsNullOrEmpty(pwd))
         {
             action.SqlWhere(users.Columns.password, pwd);
         }
         return(action.QueryEntity <users>());
     }
 }
Ejemplo n.º 7
0
 /// <summary>
 /// 获取账号的基本信息
 /// </summary>
 /// <param name="username"></param>
 /// <param name="password"></param>
 /// <returns></returns>
 public SmsAddrecordInfo GetAccountInfo(string username, string password)
 {
     using (SelectAction action = new SelectAction(Entity))
     {
         action.SqlClomns = "_Sms_AddRecord.*";
         {
             //添加视图的关联关系
             List <QueryField> field = new List <QueryField>();
             field.Add(new QueryField()
             {
                 FiledName = SmsAddrecordInfo.Columns.AccountID,
                 Condition = ConditionEnum.And,
                 Value     = SmsAccountInfo.Columns.ID
             });
             action.AddJoin(ViewJoinEnum.leftjoin, "SmsAccountInfo", "Sms_AddRecord", field);
         }
         action.SqlWhere(SmsAccountInfo.Columns.Account, username);
         action.SqlWhere(SmsAccountInfo.Columns.Password, password);
         action.SqlOrderBy("_Sms_AddRecord." + SmsAddrecordInfo.Columns.CreateTime, OrderByEnum.Desc);
         return(action.QueryEntity <SmsAddrecordInfo>());
     }
 }
Ejemplo n.º 8
0
        public SmsEnterpriseCfgInfo GetModelWithKey(string cfgkey, int enterpriseId)
        {
            string key = "enterprise_" + cfgkey + enterpriseId;
            SmsEnterpriseCfgInfo getCacheValue = CacheHelper.Cache.Get <SmsEnterpriseCfgInfo>(key);

            if (getCacheValue == null)
            {
                using (SelectAction action = new SelectAction(this.Entity))
                {
                    action.SqlWhere(SmsEnterpriseCfgInfo.Columns.CfgKey, cfgkey);
                    SmsEnterpriseCfgInfo info = action.QueryEntity <SmsEnterpriseCfgInfo>();
                    if (info != null)
                    {
                        CacheHelper.Cache.Set(key, info);
                        return(info);
                    }
                }
            }
            else
            {
                return(getCacheValue);
            }
            return(null);
        }