示例#1
0
        public async Task <ActionResult <PublicApi.v1.DTO.Return> > GetReturn(int id)
        {
            var @return = await _bll.Returns.FindWithProductsReturnedByIdAndShopAsync(id, User.GetShopId());

            if (@return == null)
            {
                return(NotFound());
            }

            return(ReturnMapper.MapFromBLL(@return));
        }
示例#2
0
        public async Task <ActionResult <IEnumerable <PublicApi.v1.DTO.IdAndNameDTO.ReturnIdName> > > GetReturnIdName()
        {
            var @return = (await _bll.Returns.GetAllIdAndDescAsyncByShopDTO(User.GetShopId())).Select(e => ReturnMapper.MapFromBLL(e)).ToList();

            return(@return);
        }
示例#3
0
        public async Task <ActionResult <IEnumerable <PublicApi.v1.DTO.Return> > > GetReturns(string search, int?pageIndex, int?pageSize)
        {
            if ((pageIndex != null && pageIndex < 1) || (pageSize != null && pageSize < 1))
            {
                return(BadRequest());
            }
            var @return = (await _bll.Returns.GetAllWithProductsReturnedByShopAsync(User.GetShopId(), search, pageIndex, pageSize)).Select(e => ReturnMapper.MapFromBLL(e)).ToList();

            return(@return);
        }