private void DirectReceiveOrder(object sender, MouseEventArgs mouseEventArgs)
        {
            var list = (ListBox) sender;

            var x = list.SelectedItem;
            var receive = new ReceiveOrder(Convert.ToInt32(x));
            ReceiveOrder(receive);
            LoadOrderList();
        }
 private void button2_Click(object sender, EventArgs e)
 {
     var receive = new ReceiveOrder();
     ReceiveOrder(receive);
     LoadOrderList();
 }
 private void ReceiveOrder(ReceiveOrder receive)
 {
     if (receive.ShowDialog(this) != DialogResult.OK) return;
     var orderListId = receive.cueTextBox1.Text;
     var findOrderlist = DatabaseConnection.DatabaseRecord.Tables["orderlist"].Select("idorderlist ='"
                                                                                      + orderListId + "'");
     if (findOrderlist.Length > 0)
     {
         var orderReceive = Convert.ToBoolean(findOrderlist[0]["orderDelivered"]);
         if (!orderReceive)
         {
             InputOrders(orderListId);
             DirectUpdate(orderListId);
             MessageBox.Show("OrderList No.: " + orderListId + " has been receive");
         }
         else
         {
             MessageBox.Show("Orders already Delivered", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     else
     {
         MessageBox.Show("Order does not exist");
     }
 }