예제 #1
0
        private void BindGrid(DateTime value)
        {
            date = value;
            HttpResponseMessage responseMessage = ordersService.GetActionResponseDateParam("GetOrdersByDate", date.Day, date.Month, date.Year);

            if (responseMessage.IsSuccessStatusCode)
            {
                List <Order_Result> orders = responseMessage.Content.ReadAsAsync <List <Order_Result> >().Result;
                if (orders.Count() > 0)
                {
                    OrdersGridView.DataSource = orders;
                }
                else
                {
                    OrdersGridView.DataSource = null;
                }
            }
            else
            {
                MessageBox.Show("Error code: " + responseMessage.StatusCode + " Messages: " + responseMessage.ReasonPhrase);
            }
        }