示例#1
0
        public async Task <HttpResponseMessage> GetById([FromUri] EduLevelBaseReq req)
        {
            var obj = await EduLevelBE.GetById(req);

            if (obj != null)
            {
                return(this.OkResult(obj));
            }

            return(this.ErrorResult(new Error(EnumError.EduLevelNotExist)));
        }
示例#2
0
        public async Task <EduLevel> GetById(EduLevelBaseReq req)
        {
            var obj = await GetAsync(c => c.EduLevelCode == req.EduLevelCode);

            if (obj != null &&
                obj.Any())
            {
                return(obj.FirstOrDefault());
            }

            return(null);
        }
示例#3
0
        public async Task <HttpResponseMessage> Delete(EduLevelBaseReq req)
        {
            var obj = await EduLevelBE.GetById(req);

            if (obj == null)
            {
                return(this.ErrorResult(new Error(EnumError.EduLevelNotExist)));
            }

            if (EduLevelBE.Delete(obj))
            {
                return(this.OkResult());
            }
            else
            {
                return(this.ErrorResult(new Error(EnumError.DeleteFailse)));
            }
        }