Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public User Login() // returns an instance of its own class
- {
- var us = ie.users.FirstOrDefault(u => u.emailaddress == emailaddress);
- User user = new User();
- if (us == null)
- {
- throw new Exception("Invalid email address and/or password.");
- }
- if (Hashing.ValidatePassword(password, us.password))
- {
- user.userid = us.userid;
- user.storeid = us.storeid;
- user.role = us.role;
- }
- else
- {
- throw new ValidationException("Invalid email address and/or password.");
- }
- return user;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement