예제 #1
0
        public async Task <IActionResult> PrenumerantFormular(int p_id)
        {
            PrenumerantDetails  prenumerant = new PrenumerantDetails();
            HttpClient          client      = _api.Initial();
            HttpResponseMessage res         = await client.GetAsync("api/Values/" + p_id.ToString());

            if (res.IsSuccessStatusCode)
            {
                var result = res.Content.ReadAsStringAsync().Result;
                prenumerant = JsonConvert.DeserializeObject <PrenumerantDetails>(result);
            }
            return(View(prenumerant));
        }
예제 #2
0
        public async Task <IActionResult> Index()
        {
            List <CustomerPriceDetails> Customers = new List <CustomerPriceDetails>();
            HttpClient          client            = _api.Initial();
            HttpResponseMessage res = await client.GetAsync("api/Values");

            if (res.IsSuccessStatusCode)
            {
                var result = res.Content.ReadAsStringAsync().Result;
                Customers = JsonConvert.DeserializeObject <List <CustomerPriceDetails> >(result);
            }
            return(View(Customers));
        }
예제 #3
0
        public async Task <IActionResult> Cusstomer()
        {
            List <Customer>     listCustomer = new List <Customer>();
            HttpClient          client       = customerAPI.Initial();
            HttpResponseMessage res          = await client.GetAsync("api/Customer").ConfigureAwait(false);;

            if (res.IsSuccessStatusCode)
            {
                Console.WriteLine(res.ToString());
                var result = res.Content.ReadAsStringAsync().Result;
                listCustomer = JsonConvert.DeserializeObject <List <Customer> >(result);
            }

            return(View(listCustomer));
        }
예제 #4
0
        public async Task <IActionResult> Index()
        {
            List <Invoice>      invoices = new List <Invoice>();
            HttpClient          client   = api.Initial();
            HttpResponseMessage res      = await client.GetAsync("api/Customer/GetInvoicesDetail");

            if (res.IsSuccessStatusCode)
            {
                var result = res.Content.ReadAsStringAsync().Result;
                invoices = JsonConvert.DeserializeObject <List <Invoice> >(result);
            }

            // return View(invoices);
            return(Json(new { data = invoices }));
        }
        public async Task <IActionResult> Index()
        {
            List <CustomerData> customers = new List <CustomerData>();
            HttpClient          client    = _api.Initial();
            HttpResponseMessage res       = await client.GetAsync("customers");

            if (res.IsSuccessStatusCode)
            {
                var results = res.Content.ReadAsStringAsync().Result;
                customers = JsonConvert.DeserializeObject <List <CustomerData> >(results);
            }
            return(View(customers));
        }