Beispiel #1
0
        public override async Task <IActionResult> PagerQueryAsync(OutCashQuery query)
        {
            PagerQueryBefore(query);
            var result = await OutCashService.PagerQueryOutCashAsync(query);

            return(Success(ToPagerQueryResult(result)));
        }
Beispiel #2
0
        public async Task <IActionResult> CreateAsync([FromBody] OutCashCreateRequest request)
        {
            if (request == null)
            {
                return(Fail(WebResource.CreateRequestIsEmpty));
            }
            var id = await OutCashService.CreateAsync(request);

            return(Success(id));
        }
Beispiel #3
0
        public async Task <IActionResult> UpdateAsync(string id, [FromBody] OutCashUpdateRequest request)
        {
            if (request == null)
            {
                return(Fail(WebResource.UpdateRequestIsEmpty));
            }

            if (id.IsEmpty() && request.OutCashId.IsEmpty())
            {
                return(Fail(WebResource.IdIsEmpty));
            }

            if (request.OutCashId.IsEmpty())
            {
                request.OutCashId = id.ToGuid();
            }

            await OutCashService.UpdateAsync(request);

            OutCashDto byIdAsync = await OutCashService.GetByIdAsync(request.OutCashId);

            return(Success(byIdAsync));
        }
Beispiel #4
0
        public override async Task <IActionResult> GetAsync(string id)
        {
            var byIdAsync = await OutCashService.GetOutCashByIdAsync(id.ToGuid());

            return(Success(byIdAsync));
        }
Beispiel #5
0
        public async Task <IActionResult> BatchDeleteAsync([FromBody] string ids)
        {
            await OutCashService.DeleteOutCash(ids);

            return(Success());
        }
Beispiel #6
0
        public async Task <IActionResult> DeleteAsync(string id)
        {
            await OutCashService.DeleteOutCash(id);

            return(Success());
        }
Beispiel #7
0
        public async Task <IActionResult> RefuseAsync(string id)
        {
            await OutCashService.RefuseOutCash(id);

            return(Success("ok"));
        }