Пример #1
0
 public AddOrder()
 {
     InitializeComponent();
     if (File.Exists("order.xml"))
     {
         OrderServices os1 = new OrderServices();
         allOrders = os1.Import();
     }
 }
Пример #2
0
        private void SearchButton_Click(object sender, EventArgs e)
        {
            flowLayoutPanel1.Controls.Clear();
            int searchByIndex = SearchByComboBox.SelectedIndex;

            if (File.Exists("order.xml"))
            {
                OrderServices os1 = new OrderServices();
                allOrders = os1.Import();

                if (searchByIndex == 0)
                {
                    string uname = inputUsernameTextBox.Text;
                    allOrders = os1.searchOrderByName(uname, allOrders);
                }
                else
                {
                    int max = Convert.ToInt32(inputMaxPriceTextBox.Text);
                    int min = Convert.ToInt32(inputMinPriceTextBox.Text);
                    allOrders = os1.searchOrderByMoney(min, max, allOrders);
                }
            }
            showAllOds();
        }