예제 #1
0
        //Search Customer with pagination
        public async Task <dynamic> SearchCustomersWithPagination(CustomerDetailModel model)
        {
            SecurityToken token = await GetSecurityToken();

            var client = new PaymentGateway.IeBizServiceClient();

            model.start = (model.pageno - 1) * model.pagesize;
            model.limit = model.pagesize;
            var data = await client.SearchCustomerListAsync(token, model.searchFilters, model.start, model.limit, model.sort, model.includeCustomerToken, model.includePaymentMethodProfile, model.countOnly);

            return(data);
        }
예제 #2
0
        //Search All Customer
        public async Task <dynamic> SearchCustomerDetails(CustomerDetailModel model)
        {
            SecurityToken token = await GetSecurityToken();

            var client = new PaymentGateway.IeBizServiceClient();
            List <CustomerReturnModel> customerReturnModels = new List <CustomerReturnModel>();
            int length     = 0;
            int lengthnode = 0;

            do
            {
                lengthnode++;
                var data = await client.SearchCustomerListAsync(token, model.searchFilters, model.start, model.limit, model.sort, model.includeCustomerToken, model.includePaymentMethodProfile, model.countOnly);

                length = data.Count;
                CustomerReturnModel customerReturn = new CustomerReturnModel();
                customerReturn.customers = data.CustomerList.ToList();
                customerReturnModels.Add(customerReturn);
                model.start = Int32.Parse(lengthnode + "000");
                model.limit = Int32.Parse(lengthnode + "999");
            } while (length >= 1000);
            return(customerReturnModels);
        }