示例#1
0
        public List <SendingBatchModel> GetReadyBatch(int batchCount)
        {
            List <SendingBatchModel> models = new List <SendingBatchModel>();

            using (SelectAction action = new SelectAction(this.Entity))
            {
                action.PageSize = batchCount;
                action.SqlWhere(SmsBatchInfo.Columns.BatchState, (int)BatchState.Waiting);
                models = action.QueryPage <SendingBatchModel>(1);
            }
            string ids = "";

            foreach (var sendingBatchModel in models)
            {
                ids += sendingBatchModel.ID + ",";
            }
            if (ids.Length > 0)
            {
                using (UpdateAction update = new UpdateAction(this.Entity))
                {
                    update.SqlWhere(SmsBatchInfo.Columns.ID, ids.TrimEnd(','), ConditionEnum.And, RelationEnum.In);
                    update.SqlKeyValue(SmsBatchInfo.Columns.BatchState, (int)BatchState.Sending);
                    update.Excute();
                }
            }
            return(models);
        }
示例#2
0
 public int UpdateGroup(SmsContactgroupInfo info)
 {
     using (UpdateAction action = new UpdateAction(this.Entity))
     {
         action.SqlKeyValue(SmsContactgroupInfo.Columns.Name, info.Name);
         action.SqlWhere(SmsContactgroupInfo.Columns.ID, info.ID);
         return(action.Excute().ReturnCode);
     }
 }
示例#3
0
 /// <summary>
 /// 更新密码
 /// </summary>
 /// <param name="username"></param>
 /// <param name="password"></param>
 /// <param name="newpwd"></param>
 /// <returns></returns>
 public bool UpdatePwd(string username, string password, string newpwd)
 {
     using (UpdateAction action = new UpdateAction(Entity))
     {
         action.SqlKeyValue(SmsAccountInfo.Columns.Password, newpwd);
         action.SqlWhere(SmsAccountInfo.Columns.Account, username);
         action.SqlWhere(SmsAccountInfo.Columns.Password, md5.Encrypt(password));
         action.Excute();
         return(action.ReturnCode > 0);
     }
 }