SHARE
TWEET

Untitled

Ortund Apr 9th, 2014 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     public class POSUser
  2.     {
  3.         public int userid { get; protected set; }
  4.         public int storeid { get; protected set; }
  5.         public string emailaddress { get; protected set; }
  6.         public string password { get; protected set; }
  7.         public string role { get; protected set; }
  8.  
  9.         public imajposEntities ie = new imajposEntities(); // this is the DbContext
  10.  
  11.         public POSUser()
  12.         {
  13.  
  14.         }
  15.         public POSUser(int UserID)
  16.         {
  17.             userid = UserID;
  18.         }
  19.         public POSUser(string EmailAddress, string Password)
  20.         {
  21.             emailaddress = EmailAddress;
  22.             password = Password;
  23.         }
  24.  
  25.         public POSUser Login()
  26.         {
  27.             var user = (from u in ie.users
  28.                         where u.emailaddress == emailaddress && u.password == password
  29.                         select u).FirstOrDefault();
  30.  
  31.             POSUser result = new POSUser();
  32.  
  33.             if (user != null)
  34.             {
  35.                 result.userid = user.userid;
  36.                 result.storeid = user.storeid;
  37.                 result.emailaddress = user.emailaddress;
  38.                 result.password = user.password;
  39.                 result.role = user.role;
  40.             }
  41.  
  42.             return result;
  43.         }
  44. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top