public Product()
 {
     ASIN           = "";
     Name           = "";
     ReferencePrice = null;
     Price          = null;
     PriceSaving    = null;
     NewStockCount  = 0;
     NewStockPrice  = null;
     UsedStockCount = 0;
     UsedStockPrice = null;
     MerchantStatus = 0;
     Ranking        = "";
     Status         = "";
     PriceHistory   = new Dictionary <DateTime, int?>();
 }
        string GetStatusValue(MerchantStatus status)
        {
            switch (status)
            {
            case MerchantStatus.Active:
                return("A");

            case MerchantStatus.Inactive:
                return("P");

            case MerchantStatus.Suspend:
                return("S");

            case MerchantStatus.All:
                return(null);
            }
            return(null);
        }
        public Result <PagedMerchant> SearchMerchant(int pageNo, int pageSize, MerchantSearchOrderBy orderBy, String name, MerchantStatus status)
        {
            IList <string> validationErrs = ValidatePageSizeAndPageNo(pageSize, pageNo);

            if (validationErrs.Count > 0)
            {
                return(new Result <PagedMerchant>(validationErrs));
            }
            RestRequest request = new RestRequest(SEARCH_MERCHANT_URL, Method.GET);

            request.AddParameter(Constants.PAGINATION_PAGE_NO, pageNo.ToString());
            request.AddParameter(Constants.PAGINATION_PAGE_LIMIT, pageSize.ToString());
            request.AddParameter("orderBy", GetOrderValue(orderBy));
            request.AddParameter("name", name);
            request.AddParameter("status", GetStatusValue(status));
            var responseContent = Execute(request);
            MerchantPageResponse   merchantPageDTO = JsonConvert.DeserializeObject <MerchantPageResponse>(responseContent);
            Result <PagedMerchant> result          = new Result <PagedMerchant>(merchantPageDTO);

            return(result);
        }