Esempio n. 1
0
        public FacadeBase Login(string username, string pwd, out ILoginToken loginToken)
        {
            LoginService lS = new LoginService();

            if (username == null || username == "") //added the OR when i added the WPF
            {
                loginToken = null;
                return(new AnonymousUserFacade());
            }
            if (lS.TryAdminLogin(username, pwd, out LoginToken <Administrator> adminToken))
            {
                loginToken = adminToken;
                return(new LoggedInAdministratorFacade());
            }
            if (lS.TryAirlineLogin(username, pwd, out LoginToken <AirlineCompany> airlineToken))
            {
                loginToken = airlineToken;
                return(new LoggedInAirlineFacade());
            }
            if (lS.TryCustomerLogin(username, pwd, out LoginToken <Customer> customerToken))
            {
                loginToken = customerToken;
                return(new LoggedInCustomerFacade());
            }
            loginToken = null;
            return(null);
        }
        public FacadeBase Login(string username, string pwd, out ILoginToken loginToken)
        {
            LoginService lS = new LoginService();

            if (username == null || username == "") //added the OR when i added the WPF
            {
                loginToken = null;
                return(new AnonymousUserFacade());
            }
            if (username == "testAnonymous" && pwd == "99999") //added the OR when i added the WPF
            {
                loginToken = null;
                return(new AnonymousUserFacade(true));
            }
            if (lS.TryAdminLogin(username, pwd, out LoginToken <Administrator> adminToken))
            {
                bool testMode = (username == "testadmin");
                loginToken = adminToken;
                return(new LoggedInAdministratorFacade(testMode));
            }
            if (lS.TryAirlineLogin(username, pwd, out LoginToken <AirlineCompany> airlineToken))
            {
                bool testMode = (username == "AlphaUser" || username == "BetaUser");
                loginToken = airlineToken;
                return(new LoggedInAirlineFacade(testMode));
            }
            if (lS.TryCustomerLogin(username, pwd, out LoginToken <Customer> customerToken))
            {
                bool testMode = (username == "AhronUser" || username == "BernardUser" || username == "CharlieUser");
                loginToken = customerToken;
                return(new LoggedInCustomerFacade(testMode));
            }
            loginToken = null;
            return(null);
        }
Esempio n. 3
0
        public FacadeBase Login(string username, string pwd, out ILoginToken loginToken)
        {
            LoginService LS = new LoginService();

            LS.TryAdminLogin(username, pwd, out LoginToken <Administrator> AdminToken);
            LS.TryAirlineLogin(username, pwd, out LoginToken <AirlineCompany> AirlineToken);
            LS.TryCustomerLogin(username, pwd, out LoginToken <Customer> CustomerToken);
            loginToken = null;
            return(null);
            //still not done here... will probably need help here
            //oh yeah btw unrelated, create ticket history and flight history
        }
        public FacadeBase Login(string username, string pwd, out ILoginToken loginToken)
        {
            LoginService LS = new LoginService();

            if (LS.TryAdminLogin(username, pwd, out LoginToken <Administrator> adminToken))
            {
                loginToken = adminToken;
                return(new LoggedInAdministratorFacade());
            }
            if (LS.TryAirlineLogin(username, pwd, out LoginToken <AirlineCompany> airlineToken))
            {
                loginToken = airlineToken;
                return(new LoggedInAirlineFacade());
            }
            if (LS.TryCustomerLogin(username, pwd, out LoginToken <Customer> customerToken))
            {
                loginToken = customerToken;
                return(new LoggedInCustomerFacade());
            }
            loginToken = null;
            return(null);
        }