예제 #1
0
        private void driverSearchBtn_Click(object sender, EventArgs e)
        {
            IEnumerable <Driver> drivers = OnlineDrivers.GetAllDrivers();

            if (driverId.Text != string.Empty)
            {
                drivers = drivers.Where(d => d.Id.ToString() == driverId.Text);
            }

            if (driverModel.Text != string.Empty)
            {
                drivers = drivers.Where(d => d.Model.IndexOf(driverModel.Text) != -1);
            }

            if (driverName.Text != string.Empty)
            {
                drivers = drivers.Where(d => d.Name.IndexOf(driverName.Text) != -1);
            }

            if (driverName.Text != string.Empty)
            {
                drivers = drivers.Where(d => d.Name.IndexOf(driverName.Text) != -1);
            }

            if (driverStatus.Text != string.Empty && driverStatus.SelectedIndex != 0)
            {
                drivers = drivers.Where(d => d.Status == (DriverStatuses)driverStatus.SelectedIndex);
            }

            LoadDrivers(drivers);
        }
예제 #2
0
        private void AdminForm_Load(object sender, EventArgs e)
        {
            LoadCalls();

            userCombobox.Items.AddRange(User.GetAllUsersFromDB().Select(u => u.Name).ToArray());

            LoadOrders(Order.GetAllOrders());

            LoadUsers(User.GetAllUsersFromDB());

            LoadDrivers(OnlineDrivers.GetAllDrivers());

            callsContMenuRefresh.Click += CallsContMenuRefresh_Click;

            ordersContMenuRefresh.Click += OrdersContMenuRefresh_Click;

            usersContMenuRefresh.Click += UsersContMenuRefresh_Click;

            usersContMenuShowPassword.Click += UsersContMenuShowPassword_Click;

            driversContMenuRefresh.Click += DriversContMenuRefresh_Click;

            userNameLabel.Text += CurrentUser.Name;
        }
예제 #3
0
 private void DriversContMenuRefresh_Click(object sender, EventArgs e) => LoadDrivers(OnlineDrivers.GetAllDrivers());