Exemplo n.º 1
0
        private void Add_Click(object sender, EventArgs e)
        {
            var insertor = new Insertor();

            switch (CurrentTable)
            {
            case Table.Orders:
                insertor.InsertOrder(lvData);
                break;

            case Table.Customers:
                insertor.InsertCustomer(lvData);
                break;

            case Table.Operators:
                insertor.InsertOperator(lvData);
                break;

            case Table.Couriers:
                insertor.InsertCourier(lvData);
                break;

            case Table.Employees:
                insertor.InsertEmployee(lvData);
                break;

            case Table.Restaurants:
                insertor.InsertNewRestaurants(lvData);
                break;

            case Table.Users:
                UsersCode.Insert(lvData);
                break;
            }
        }
Exemplo n.º 2
0
        private void Delete_Click(object sender, EventArgs e)
        {
            var deleter = new Deleter();

            switch (CurrentTable)
            {
            case Table.Orders:
                deleter.DeleteOrders(lvData);
                break;

            case Table.Customers:
                deleter.DeleteCustomers(lvData);
                break;

            case Table.Operators:
                deleter.DeleteOperators(lvData);
                break;

            case Table.Couriers:
                deleter.DeleteCouriers(lvData);
                break;

            case Table.Employees:
                deleter.DeleteStaff(lvData);
                break;

            case Table.Restaurants:
                deleter.DeleteRestaurant(lvData);
                break;

            case Table.Users:
                UsersCode.Delete(lvData);
                break;
            }
        }
Exemplo n.º 3
0
        private void GoUsers() // 6 - пользователи
        {
            if (CurrentTable == Table.Users)
            {
                return;
            }

            lvData.Visible = true;
            Hello.Visible  = false;

            Restaurant.Visible = false;
            lvDish.Visible     = false;
            button1.Visible    = false;
            button2.Visible    = false;
            lvData.Height      = 250;
            CurrentTable       = Table.Users;
            Text = "Пользователи";
            UsersCode.InitializeListView(lvData);
            switch (CurrentAccessType)
            {
            case AccessType.Admin:
                Add.Visible         = true;
                Delete.Visible      = true;
                Edit.Visible        = true;
                DishInOrder.Visible = false;
                break;
            }
        }
Exemplo n.º 4
0
        private void Edit_Click(object sender, EventArgs e)
        {
            var editor = new Editor();
            var filler = new ListViewFiller();

            switch (CurrentTable)
            {
            case Table.Orders:
                editor.OrdersEdit(lvData);
                filler.FillOrders(lvData);
                break;

            case Table.Customers:
                editor.CustomersEdit(lvData);
                filler.FillCustomers(lvData);
                break;

            case Table.Operators:
                editor.OperatorsEdit(lvData);
                filler.FillOperators(lvData);
                break;

            case Table.Couriers:
                editor.CouriersEdit(lvData);
                filler.FillCouriers(lvData);
                break;

            case Table.Employees:
                editor.EmployeeEdit(lvData);
                filler.FillStaff(lvData);
                break;

            //case Table.Restaurants:
            //    editor.
            //    filler.FillRestaurants(lvData);
            //    break;
            case Table.Users:
                UsersCode.Edit(lvData);
                break;
            }
        }