Beispiel #1
0
 public void CreateNewAirline(LoginToken <Administrator> token, AirlineCompanies airline)
 {
     if (token != null)
     {
         if (_airlineDAO != null)
         {
             _airlineDAO.Add(airline);
         }
         else
         {
             _airlineDAO = new AirlineCompaniesDAOPGSQL();
             _airlineDAO.Add(airline);
         }
     }
 }
Beispiel #2
0
 public void UpdateAirlineDetails(LoginToken <Administrator> token, AirlineCompanies airline)
 {
     if (token != null)
     {
         if (_airlineDAO != null)
         {
             _airlineDAO.Update(airline);
         }
         else
         {
             _airlineDAO = new AirlineCompaniesDAOPGSQL();
             _airlineDAO.Update(airline);
         }
     }
 }
Beispiel #3
0
 public void ModifyAirlineDetails(LoginToken <AirlineCompanies> token, AirlineCompanies airline)
 {
     if (token != null)
     {
         if (_airlineDAO != null)
         {
             _airlineDAO.Update(airline);
         }
         else
         {
             _airlineDAO = new AirlineCompaniesDAOPGSQL();
             _airlineDAO.Update(airline);
         }
     }
 }
Beispiel #4
0
        public IList <AirlineCompanies> GetAllAirlineCompanies()
        {
            IList <AirlineCompanies> airlineCompanies = new List <AirlineCompanies>();

            if (_airlineDAO != null)
            {
                airlineCompanies = _airlineDAO.GetAll();
            }
            else
            {
                _airlineDAO      = new AirlineCompaniesDAOPGSQL();
                airlineCompanies = _airlineDAO.GetAll();
            }
            return(airlineCompanies);
        }
Beispiel #5
0
        public AirlineCompanies GetAirlineById(LoginToken <Administrator> token, int id)
        {
            AirlineCompanies air = new AirlineCompanies();

            if (token != null)
            {
                if (_airlineDAO != null)
                {
                    air = _airlineDAO.GetById(id);
                }
                else
                {
                    _airlineDAO = new AirlineCompaniesDAOPGSQL();
                    air         = _airlineDAO.GetById(id);
                }
            }
            return(air);
        }
Beispiel #6
0
 public void RemoveAirline(LoginToken <Administrator> token, AirlineCompanies airline)
 {
     if (token != null)
     {
         if (token.User.Level >= 2)
         {
             if (_airlineDAO != null)
             {
                 _airlineDAO.Remove(airline.ID);
             }
             else
             {
                 _airlineDAO = new AirlineCompaniesDAOPGSQL();
                 _airlineDAO.Remove(airline.ID);
             }
         }
         else
         {
             Console.WriteLine("Your level of administration is too low,you must be level 2 or higher");
         }
     }
 }