Exemple #1
0
        public ResponseResult GetEntities()
        {
            var result = new ResponseResult();

            try
            {
                var entities = _baseRespository.GetEntities();

                if (entities != null)
                {
                    result.Data      = entities;
                    result.ErrorCode = Enum.ErrorCode.NONE;
                    result.UserMsg   = Resources.ResourceMessage.Get_Success;
                }
                else
                {
                    result.IsSuccess = false;
                    result.UserMsg   = Resources.ResourceMessage.NotFound;
                    result.DevMsg    = Resources.ResourceMessage.NoContent;
                    result.ErrorCode = Enum.ErrorCode.NOCONTENT;
                }
            }
            catch (Exception ex)
            {
                result.OnException(result, ex);
            }

            return(result);
        }
        public IActionResult Get(int pageSize, int pageIndex)
        {
            var responseResult = new ResponseResult();

            try
            {
                responseResult = _storeService.GetStorePaging(pageSize, pageIndex);
            }
            catch (Exception e)
            {
                responseResult.OnException(responseResult, e);
            }

            return(Ok(responseResult));
        }
        public IActionResult Get(string storeCode)
        {
            var responseResult = new ResponseResult();

            try
            {
                responseResult = _storeService.GetStoreByStoreCode(storeCode);
            }
            catch (Exception e)
            {
                responseResult.OnException(responseResult, e);
            }

            return(Ok(responseResult));
        }
        public IActionResult Get([FromQuery] FilterStoreParams filterparams)
        {
            var responseResult = new ResponseResult();

            try
            {
                responseResult = _storeService.GetStoreFilter(
                    filterparams.storeCode,
                    filterparams.storeName,
                    filterparams.address,
                    filterparams.phoneNumber,
                    filterparams.status);
            }
            catch (Exception e)
            {
                responseResult.OnException(responseResult, e);
            }
            return(Ok(responseResult));
        }