public static UserAccount Authorize(string userName, string password, UserAccountTypes userType) { IUserAccountDAL userAccountDB; switch (userType) { case UserAccountTypes.Employee: userAccountDB = new EmployeeUserAccountDAL(connectionstring); break; case UserAccountTypes.Customer: userAccountDB = new CustomerUserAccountDAL(connectionstring); break; default: throw new Exception("usertype is not valid"); } return(userAccountDB.Authorize(userName, password)); }
public static bool SetCode(string email, string code, UserAccountTypes userType) { IUserAccountDAL userAccountDB; switch (userType) { case UserAccountTypes.Employee: userAccountDB = new EmployeeUserAccountDAL(connectionstring); break; case UserAccountTypes.Customer: userAccountDB = new CustomerUserAccountDAL(connectionstring); break; default: throw new Exception("usertype is not valid"); } return(userAccountDB.SetCode(email, code)); }
public static UserProfile Account_GetEmployee(Account account, UserAccountTypes userType) { IUserAccountDAL userAccountDB; switch (userType) { case UserAccountTypes.Employee: userAccountDB = new EmployeeUserAccountDAL(connectionstring); break; case UserAccountTypes.Customer: userAccountDB = new CustomerUserAccountDAL(connectionstring); break; default: throw new Exception("usertype is not valid"); } return(userAccountDB.GetEmployee(account)); }
public static UserAccount GetAccount(string email, UserAccountTypes userTypes) { IUserAccountDAL userAccountDB; switch (userTypes) { case UserAccountTypes.Employee: userAccountDB = new EmployeeUserAccountDAL(_connectionString); break; case UserAccountTypes.Customer: userAccountDB = new CustomerUserAccountDAL(_connectionString); break; default: return(null); } return(userAccountDB.GetAccount(email)); }
public static UserAccount Authenticate(string email, string password, UserAccountTypes userTypes) { IUserAccountDAL userAccountDB; switch (userTypes) { case UserAccountTypes.Employee: userAccountDB = new EmployeeUserAccountDAL(_connectionString); break; case UserAccountTypes.Customer: userAccountDB = new CustomerUserAccountDAL(_connectionString); break; default: return(null); } return(userAccountDB.Authenticate(email, password)); }
public static UserAccount Authorize(string userName, string password, UserAccountTypes userType) { IUserAccountDAL userAccountDB; switch (userType) { case UserAccountTypes.Employee: userAccountDB = new EmployeeUserAccountDAL(_connectString); break; case UserAccountTypes.Customer: userAccountDB = new CustomerUserAccountDAL(_connectString); break; default: return(null); } return(userAccountDB.Authorize(userName, password)); }
public static bool ResetPassword(string userName, string password, UserAccountTypes userType) { IUserAccountDAL userAccountDB; switch (userType) { case UserAccountTypes.Customer: userAccountDB = new CustomerUserAccountDAL(_connectionString); break; case UserAccountTypes.Employee: userAccountDB = new EmployeeUserAccountDAL(_connectionString); break; default: return(false); } return(userAccountDB.ResetPassword(userName, password)); }
public static bool FindUserName(string userName, UserAccountTypes userType) { IUserAccountDAL userAccountDB; switch (userType) { case UserAccountTypes.Customer: userAccountDB = new CustomerUserAccountDAL(_connectionString); break; case UserAccountTypes.Employee: userAccountDB = new EmployeeUserAccountDAL(_connectionString); break; default: return(false); } return(userAccountDB.FindEmail(userName)); }
public static bool Account_Get(Account account, UserAccountTypes userType) { IUserAccountDAL userAccountDB; switch (userType) { case UserAccountTypes.Employee: userAccountDB = new EmployeeUserAccountDAL(connectionstring); break; case UserAccountTypes.Customer: userAccountDB = new CustomerUserAccountDAL(connectionstring); break; default: throw new Exception("usertype is not valid"); } //return userAccountDB.Authorize(userName, password); return(userAccountDB.Get(account)); }