private void BindGrid(int id)
        {
            HttpResponseMessage reservationResp = reservationsService.GetActionResponseIdParam("GetReservationByClient", id);

            if (reservationResp.IsSuccessStatusCode)
            {
                reservations = reservationResp.Content.ReadAsAsync <List <Reservation_Result> >().Result;
                if (reservations.Count != 0)
                {
                    ReservationGridView.DataSource = reservations;
                }
                else
                {
                    ReservationGridView.DataSource = null;
                }
            }
            else
            {
                MessageBox.Show("Error Code" +
                                reservationResp.StatusCode + " : Message - " + reservationResp.ReasonPhrase);
            }
        }
Exemple #2
0
        private void BindGrid()
        {
            HttpResponseMessage rsp = menuItemsService.GetActionResponseIdParam("GetItemsByMenuID", menu.MenuID);

            if (rsp.IsSuccessStatusCode)
            {
                List <MenuItem_Result> menuItems = rsp.Content.ReadAsAsync <List <MenuItem_Result> >().Result;
                MenuItemsGrid.DataSource = menuItems;
            }
            else
            {
                MessageBox.Show("Error code: " + rsp.StatusCode + " Message: " + rsp.ReasonPhrase);
            }
        }
        private void OrderDetailsForm_Load(object sender, EventArgs e)
        {
            HttpResponseMessage responseMessage = ordersService.GetActionResponseIdParam("GetOrderDetailsByOrderID", order.OrderID);

            if (responseMessage.IsSuccessStatusCode)
            {
                orderDetails = responseMessage.Content.ReadAsAsync <List <OrderDetails_Result> >().Result;


                OrderDetailsDataGrid.DataSource = orderDetails;
            }
            else
            {
                MessageBox.Show("Error code: " + responseMessage.StatusCode + " Message: " + responseMessage.ReasonPhrase);
            }
        }