コード例 #1
0
        public async Task <ActionResult> Index(String customerID)
        {
            List <OrderDO> orders = await OrderDO.GetOrdersAsync(customerID);

            ViewBag.Orders = orders;

            return(View());
        }
コード例 #2
0
        //Async method for load client date. Mouse event for click on the buton

        private async void button1_MouseClickAsync(object sender, MouseEventArgs e)
        {
            loadingLabel.Text         = "Loading, please wait...";
            loadingLabel.Visible      = true;
            orderDataGridView.Visible = false;

            if (textCustomerBox.Text != null)
            {
                List <OrderDO> data = await OrderDO.GetOrdersAsync(textCustomerBox.Text);

                //Check if exist any data from db
                if (data.Any())
                {
                    orderDOBindingSource.DataSource = data;
                    orderDataGridView.Visible       = true;
                    loadingLabel.Visible            = false;
                }
                else
                {
                    loadingLabel.Text = "No data";
                }
            }
        }
コード例 #3
0
        private async void clickMeButton_Click(object sender, RoutedEventArgs e)
        {
            loadingLabel.Content     = "Loading, please wait...";
            loadingLabel.Visibility  = Visibility.Visible;
            orderDataGrid.Visibility = Visibility.Hidden;

            if (textCustomerBox.Text != null)
            {
                List <OrderDO> data = await OrderDO.GetOrdersAsync(textCustomerBox.Text);

                //Check if exist any data from db
                if (data.Any())
                {
                    orderDataGrid.ItemsSource = data;

                    orderDataGrid.Visibility = Visibility.Visible;
                    loadingLabel.Visibility  = Visibility.Hidden;
                }
                else
                {
                    loadingLabel.Content = "No data";
                }
            }
        }