/// <summary>
        ///
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task <GetProductAllResponse> GetProductAll(GetProductAllRequest request)
        {
            var response = new GetProductAllResponse();

            var param = new GetProductAllParameter()
            {
                StartPage = request.StartPage,
            };

            switch (request.Type)
            {
            case 0:
                response = CheckTypeByDateASC(param);
                break;

            case 1:
                response = CheckTypeByPriceASC(param);
                break;

            case 2:
                response = CheckTypeByPriceDESC(param);
                break;

            case 3:
                response = CheckTypeByDateASC(param);
                break;

            case 4:
                response = CheckTypeByDateDESC(param);
                break;
            }
            return(await Task.FromResult(response));
        }
        private GetProductAllResponse CheckTypeByDateDESC(GetProductAllParameter param)
        {
            var response = new GetProductAllResponse();

            try
            {
                var result = _dataAccess.GetListProductAll(param);
                if (result != null)
                {
                    response.ListProductAll = MapList <GETPRODUCTALL_Result, GetProductAllDto>(result.ToList());
                    response.Success        = true;
                }
            }
            catch (Exception ex)
            {
                response.Success = false;
            }
            return(response);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// GetListProductAll
 /// </summary>
 /// <param name="param">GetProductAllParameter</param>
 /// <returns>GETPRODUCTALL_Result</returns>
 public IEnumerable <GETPRODUCTALL_Result> GetListProductAll(GetProductAllParameter param)
 {
     return(db.GETPRODUCTALL(param.StartPage));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// GetListProductByPriceASC
 /// </summary>
 /// <param name="param">GetProductAllParameter</param>
 /// <returns>GETPRODUCT_BY_TYPE_PRICE_DESC_Result</returns>
 public IEnumerable <GETPRODUCT_BY_TYPE_PRICE_DESC_Result> GetListProductByPriceDESC(GetProductAllParameter param)
 {
     return(db.GETPRODUCT_BY_TYPE_PRICE_DESC(param.StartPage));
 }
Ejemplo n.º 5
0
 /// <summary>
 /// GetListProductByDateASC
 /// </summary>
 /// <param name="param">GetProductAllParameter</param>
 /// <returns>GETPRODUCT_BY_TYPE_DATE_ASC_Result</returns>
 public IEnumerable <GETPRODUCT_BY_TYPE_DATE_ASC_Result> GetListProductByDateASC(GetProductAllParameter param)
 {
     return(db.GETPRODUCT_BY_TYPE_DATE_ASC(param.StartPage));
 }