示例#1
0
        private void buttonSearch_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(textboxSearch.Text))
            {
                MessageBox.Show("Enter Order ID", "Search not Possible");
            }
            else
            {
                Order order = OrderDA.Search(Convert.ToInt32(textboxSearch.Text));

                if (order != null)
                {
                    textboxOrderId.Text   = order.OrderID.ToString();
                    textboxClientId.Text  = order.ClientID.ToString();
                    textboxBookId.Text    = order.BookID.ToString();
                    textboxbQuantity.Text = order.Quantity.ToString();
                    textboxSearch.Clear();
                }
                else
                {
                    MessageBox.Show("Order Not Found", "Search Failed");
                    textboxSearch.Clear();
                }
            }
        }
示例#2
0
        private void btn_Search_Click(object sender, EventArgs e)
        {
            Order cust = OrderDA.Search(Convert.ToInt32(txt_input.Text));

            if (cust != null)
            {
                txt_OrID.Text  = (cust.OrderID).ToString();
                txt_title.Text = (cust.Title);
                txt_que.Text   = cust.quentity;
                txt_phone.Text = cust.phone;
            }
            else
            {
                MessageBox.Show("Order not Found");
                txt_input.Clear();
                txt_input.Focus();
            }
        }
示例#3
0
        private void buttonSearchOrder_Click(object sender, EventArgs e)
        {
            Order order = OrderDA.Search(Convert.ToInt32(buttonSearchOrder.Text));

            if (order != null)
            {
                textBoxOrderId.Text   = (order.orderId).ToString();
                textBoxOrderDate.Text = order.orderDate;
                textBoxClientId.Text  = (order.clientId).ToString();
                textBoxTakenBy.Text   = order.orderTakenBy;
                textBoxIsbn.Text      = (order.ISBN).ToString();
            }

            else
            {
                MessageBox.Show("Order not Found!");
                textBoxSearch.Clear();
                buttonSearchOrder.Focus();
            }
        }
        private void buttonSearchOrder_Click(object sender, EventArgs e)
        {
            {
                int choice = comboBoxSearchOrder.SelectedIndex;
                switch (choice)
                {
                case -1:     // The user didn't select any search option
                    MessageBox.Show("Please select the search option");
                    break;

                case 0:     //The user selected the search by Customer ID
                    Orders orders = OrderDA.Search(Convert.ToInt32(textBoxInfoOrder.Text));
                    if (orders != null)
                    {
                        textBoxOnumber.Text            = (orders.OrderNumber).ToString();
                        textBoxISBN.Text               = (orders.ISBNProduct).ToString();
                        textBoxOProductTitle.Text      = orders.ProductTitle;
                        textBoxProductDescription.Text = orders.ProductDescription;
                        comboBoxClientID.Text          = orders.ClientName;
                        dateTimePickerOdate.Text       = orders.OrderDate;
                        dateTimePickerSDate.Text       = orders.ShippingDate;
                        textBoxOQty.Text               = orders.OrderQuantity.ToString();
                        textBoxProductPrice.Text       = orders.ProductPrice.ToString();
                        textBoxFinalAmount.Text        = orders.FinalAmount.ToString();
                        textBoxInfoOrder.Clear();
                    }
                    else
                    {
                        MessageBox.Show("Order not Found!");
                        textBoxInfoOrder.Clear();
                        textBoxInfoOrder.Focus();
                    }
                    break;

                default:
                    break;
                }
            }
        }