コード例 #1
0
        /// <summary>
        /// Retrieving All Payments for View Page
        /// </summary>
        /// <params>page number</params>
        public ActionResult Index(int?page)
        {
            //var listCustomer = new List<Customer>();
            var listPayment          = new List <PaymentDTO>();
            var listPaymentViewModel = new List <PaymentViewModel>();

            try
            {
                HttpClientHelper <PaymentDTO> httpClientHelper = new Helper.HttpClientHelper <PaymentDTO>();

                //listCustomer = HttpClientHelper<Customer>.GetAll(BaseAddress + "Customer/GetCustomers");
                listPayment = httpClientHelper.GetAll(new Uri(BaseAddress + "Payment/GetAllPayment"));

                listPaymentViewModel = (from p in listPayment
                                        select new PaymentViewModel
                {
                    Id = p.Id.ToString(new CultureInfo("en-US")),
                    CustomerName = p.CustomerName,
                    ContactNumber = p.ContactNumber,
                    AccountNumber = p.AccountNumber,
                    TransactionId = p.TransactionId,
                    PaymentAmount = p.PaymentAmount
                }).OrderByDescending(m => m.Id).ToList();
            }
            catch (WebException)
            {
            }
            return(View(listPaymentViewModel.ToPagedList(page ?? 1, 7)));
        }
コード例 #2
0
        /// <summary>
        /// Retrieving All Customers for View Page
        /// </summary>
        /// <params>page number</params>
        public ActionResult Index(int?page)
        {
            var list = new List <Customer>();
            HttpClientHelper <Customer> httpClientHelper = new Helper.HttpClientHelper <Customer>();

            try
            {
                list = httpClientHelper.GetAll(new Uri(BaseAddress + "Customer/GetCustomers")).OrderByDescending(m => m.Id).ToList();
            }
            catch (WebException)
            {
            }
            return(View(list.ToPagedList(page ?? 1, 7)));
        }