public List <ManagerRole> GetListByCondition(ManagerRoleRequestModel model)
        {
            string conditions = "where IsDelete=0 ";//未删除的

            if (!model.Key.IsNullOrWhiteSpace())
            {
                conditions += $"and RoleName like '%{model.Key}%'";
            }
            return(_repository.GetList(conditions).ToList());
        }
Example #2
0
        public async Task <List <ManagerRole> > GetListByConditionAsync(ManagerRoleRequestModel model)
        {
            string conditions = $"where IsDelete=0 ";//未删除的

            if (!model.Key.IsNullOrWhiteSpace())
            {
                conditions += $"and RoleName like '%'+@Key+'%'";
            }
            return((await _repository.GetListAsync(conditions, new
            {
                Key = model.Key,
            })).AsList());
        }
        /// <summary>
        /// 根据查询条件获取数据
        /// </summary>
        /// <param name="model">查询实体</param>
        /// <returns></returns>
        public TableDataModel LoadData(ManagerRoleRequestModel model)
        {
            string conditions = "where IsDelete=0 ";//未删除的

            if (!model.Key.IsNullOrWhiteSpace())
            {
                conditions += $"and RoleName like '%{model.Key}%'";
            }
            return(new TableDataModel
            {
                count = _repository.RecordCount(conditions),
                data = _repository.GetListPaged(model.Page, model.Limit, conditions, "Id desc"),
            });
        }
Example #4
0
        /// <summary>
        /// 根据查询条件获取数据
        /// </summary>
        /// <param name="model">查询实体</param>
        /// <returns></returns>
        public async Task <TableDataModel> LoadDataAsync(ManagerRoleRequestModel model)
        {
            string conditions = "where IsDelete=0 ";//未删除的

            if (!model.Key.IsNullOrWhiteSpace())
            {
                conditions += "and RoleName like '%'+@Key+'%'";
            }
            return(new TableDataModel
            {
                count = await _repository.RecordCountAsync(conditions, new
                {
                    Key = model.Key,
                }),
                data = await _repository.GetListPagedAsync(model.Page, model.Limit, conditions, "Id desc", new
                {
                    Key = model.Key,
                }),
            });
        }
Example #5
0
 public string LoadData([FromQuery] ManagerRoleRequestModel model)
 {
     return(JsonHelper.ObjectToJSON(_service.LoadData(model)));
 }
Example #6
0
 public async Task <string> LoadDataAsync([FromQuery] ManagerRoleRequestModel model)
 {
     return(JsonHelper.ObjectToJSON(await _service.LoadDataAsync(model)));
 }
Example #7
0
 public TableDataModel LoadData(ManagerRoleRequestModel model)
 {
     throw new NotImplementedException();
 }
Example #8
0
 public List <managerrole> GetListByCondition(ManagerRoleRequestModel model)
 {
     throw new NotImplementedException();
 }