Beispiel #1
0
        public async Task <HttpResponseMessage> GetOrderById(Guid orderId)
        {
            try
            {
                HttpResponseMessage response = await _restClient.GetOrderById(orderId);

                if (response.IsSuccessStatusCode)
                {
                    return(response);
                }
                else
                {
                    return(null);
                }
            }
            catch (ApiException ex)
            {
                if (ex.StatusCode == HttpStatusCode.NotFound)
                {
                    return(null);
                }
                else
                {
                    throw;
                }
            }
        }
        public async Task <IActionResult> Details(Guid orderId)
        {
            var orderDetailsFromApi = await _orderManagementApi.GetOrderById(orderId);

            foreach (var order in orderDetailsFromApi.OrderDetails)
            {
                order.ImageString = ConvertAndFormatToString(order.FaceData);
            }
            return(View(orderDetailsFromApi));
        }
Beispiel #3
0
        public async Task <IActionResult> Details(string orderId)
        {
            var order = await _orderManagementApi.GetOrderById(Guid.Parse(orderId));

            order.ImageString = ConvertAndFormatToString(order.ImageData);

            foreach (var detail in order.OrderDetails)
            {
                detail.ImageString = ConvertAndFormatToString(detail.FaceData);
            }
            return(View(order));
        }
Beispiel #4
0
        public async Task <IActionResult> Details(string orderId)
        {
            var order = await _ordersApi.GetOrderById(Guid.Parse(orderId));

            order.ImageString = string.Format("data:image/png;base64,{0}", Convert.ToBase64String(order.ImageData));

            foreach (var detail in order.OrderDetails)
            {
                detail.ImageString = string.Format("data:image/png;base64,{0}",
                                                   Convert.ToBase64String(detail.FaceData));
            }

            return(View(order));
        }
Beispiel #5
0
 public async Task <OrderViewModel> GetOrderById(Guid OrderId)
 {
     try
     {
         return(await _restClient.GetOrderById(OrderId));
     }
     catch (ApiException ex)
     {
         if (ex.StatusCode == System.Net.HttpStatusCode.NotFound)
         {
             return(null);
         }
         throw;
     }
 }
Beispiel #6
0
 public Task <OrderViewModel> GetOrderById(Guid orderId)
 {
     try
     {
         return(_restClient.GetOrderById(orderId));
     }
     catch (ApiException ex)
     {
         if (ex.StatusCode == HttpStatusCode.NotFound)
         {
             return(null);
         }
         throw;
     }
 }
Beispiel #7
0
        public async Task <IActionResult> Details(string orderId)
        {
            var response = await _ordersApi.GetOrderById(Guid.Parse(orderId));

            var return_value = await response.Content.ReadAsStringAsync();

            OrderViewModel order = JsonConvert.DeserializeObject <OrderViewModel>(return_value);

            order.ImageString = string.Format("data:image/png;base64,{0}", Convert.ToBase64String(order.ImageData));

            foreach (var detail in order.OrderDetails)
            {
                detail.ImageString = string.Format("data:image/png;base64,{0}", Convert.ToBase64String(detail.FaceData));
            }
            return(View(order));
        }
 public async Task <OrderViewModel> GetOrderById(Guid id)
 {
     try
     {
         return(await _restClient.GetOrderById(id));
     }
     catch (ApiException ex)
     {
         if (ex.StatusCode == HttpStatusCode.NotFound)
         {
             return(null);
         }
         else
         {
             throw;
         }
     }
 }