internal void AuthenticateAndGetTokenAndGetFacade(out LoginToken <AirlineCompany> tokenAirline, out LoggedsInAirlineFacade fasadeAirline) { // after we learned authentication // 1. validate token // 2. retrieve LoginToken<Customer> // 3. get Customer facade tokenAirline = GetLoginToken(); // before we learn authentication // 1. perform login -- use real user-name + pwd // 2. get the token + facade //ILoginService loginService = new LoginService(); // loginService.TryAirlineLogin("airline99", "LiGpmH", out tokenAirline); fasadeAirline = FlightsCenterSystem.GetInstance().GetFacade(tokenAirline) as LoggedsInAirlineFacade; }
public LoggedsInAirlineFacade GetAirlineFacade(string Name, string Pass, out LoginToken <AirLineCompanyLogin> token) { try { LoginService _log = new LoginService(); token = new LoginToken <AirLineCompanyLogin>(); LoggedsInAirlineFacade facade = new LoggedsInAirlineFacade(); if (_log.TryArilineLogin(Name, Pass, out token) == true) { return(facade); } return(null); }catch (Exception ex) { throw ex; } }
public void getTokenAndGetFacade(out LoginToken <Admin> tokenAdmin, out LoggedInAdministratorFacade facadeAdmin, out LoginToken <AirlineCompany> tokenAirline, out LoggedsInAirlineFacade fasadeAirline) { AnonymousUserFacade facade = FlightsCenterSystem.GetInstance().GetFacade <Anonymous>(null) as AnonymousUserFacade; ILoginService loginService = new LoginService(); loginService.TryAdminLogin(FlightCenterConfig.ADMIN_NAME, FlightCenterConfig.ADMIN_PASSWORD, out tokenAdmin); facadeAdmin = FlightsCenterSystem.GetInstance().GetFacade(tokenAdmin) as LoggedInAdministratorFacade; facadeAdmin.CreateNewAirline(tokenAdmin, CreateAirlineCompanyForTest()); AirlineCompany airline = airlineCompanyDAOPGSQL.GetAirlineByUserame(TestData.CreateAirlineUser_Username); tokenAirline = new LoginToken <AirlineCompany>() { User = airline }; fasadeAirline = FlightsCenterSystem.GetInstance().GetFacade(tokenAirline) as LoggedsInAirlineFacade; }