SHARE
TWEET

Untitled

Ortund Apr 9th, 2014 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using imajPOSData; // Class Library project... Handles data work with the database
  6.  
  7. /// <summary>
  8. /// Summary description for User
  9. /// </summary>
  10. public class User
  11. {
  12.     public int userid { get; protected set; }
  13.     public int storeid { get; protected set; }
  14.     public string emailaddress { get; protected set; }
  15.     public string password { get; protected set; }
  16.     public string role { get; protected set; }
  17.  
  18.         public User()
  19.         {
  20.                 //
  21.                 // TODO: Add constructor logic here
  22.                 //
  23.         }
  24.  
  25.     public bool Login()
  26.     {
  27.         POSUser user = new POSUser(emailaddress, password);
  28.         POSUser loggedIn = user.Login();
  29.  
  30.         bool result = false;
  31.         if (loggedIn != null)
  32.         {
  33.             processLogin(loggedIn);
  34.         }
  35.  
  36.         return result;
  37.     }
  38.  
  39.     private void processLogin(POSUser loggedIn)
  40.     {
  41.         HttpContext.Current.Session["userid"] = loggedIn.userid;
  42.         HttpContext.Current.Session["storeid"] = loggedIn.storeid;
  43.         HttpContext.Current.Session["role"] = loggedIn.role;
  44.     }
  45. }
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
 
Top