private void set(String type, int id_tank, int id) throws Exception{
            int tankTypeID = garage.getTankID(id_tank);
            if(type == null){
                close();
            }else if(type.equals("$armor$")){
                if(tankTypeID == dataBaseConnector.getTankIDForArmor(id)){
                    garage.setArmor(id_tank, id);
                    dataBaseConnector.setTankArmor(id_tank,id);
                }
                else
                    throw new Exception();
            }else if(type.equals("$engine$")){
                if(tankTypeID == dataBaseConnector.getTankIDForEngine(id)){
                    garage.setEngine(id_tank, id);
                    dataBaseConnector.setTankEngine(id_tank, id);
                }
                else
                    throw new Exception();
            }else if(type.equals("$first_weapon$")){
                if(tankTypeID == dataBaseConnector.getTankIDForFirstWeapon(id)){
                    garage.setFirstWeapon(id_tank, id);
                    dataBaseConnector.setTankFirstWeapon(id_tank, id);
                }
                else
                    throw new Exception();
            }else if(type.equals("$second_weapon$")){
                if(tankTypeID == dataBaseConnector.getTankIDForSecondWeapon(id)){
                    garage.setSecondWeapon(id_tank, id);
                    dataBaseConnector.setTankSecondWeapon(id_tank, id);
                }
                else
                    throw new Exception();
            }else
                close();
        }