Exemple #1
0
 public User(AccountsPrincipal existingPrincipal)
 {
     this.dataUser     = new LTP.Accounts.Data.User();
     this.departmentID = "-1";
     this.userID       = ((SiteIdentity)existingPrincipal.Identity).UserID;
     this.LoadFromID();
 }
Exemple #2
0
 public User(int existingUserID)
 {
     this.dataUser     = new LTP.Accounts.Data.User();
     this.departmentID = "-1";
     this.userID       = existingUserID;
     this.LoadFromID();
 }
 public AccountsPrincipal(string userName)
 {
     this.dataUser         = new LTP.Accounts.Data.User();
     this.identity         = new SiteIdentity(userName);
     this.permissionList   = this.dataUser.GetEffectivePermissionList(((SiteIdentity)this.identity).UserID);
     this.permissionListid = this.dataUser.GetEffectivePermissionListID(((SiteIdentity)this.identity).UserID);
     this.roleList         = this.dataUser.GetUserRoles(((SiteIdentity)this.identity).UserID);
 }
        public static AccountsPrincipal ValidateLogin(string userName, string password)
        {
            byte[] encPassword          = EncryptPassword(password);
            LTP.Accounts.Data.User user = new LTP.Accounts.Data.User();
            int userID = user.ValidateLogin(userName, encPassword);

            if (userID > 0)
            {
                return(new AccountsPrincipal(userID));
            }
            return(null);
        }
Exemple #5
0
 public SiteIdentity(string currentUserName)
 {
     this.dataUser = new LTP.Accounts.Data.User();
     DataRow row = this.dataUser.Retrieve(currentUserName);
     if (row != null)
     {
         this.userName = currentUserName;
         this.trueName = (string) row["TrueName"];
         this.email = (string) row["Email"];
         this.userID = (int) row["UserID"];
         this.password = (byte[]) row["Password"];
         this.sex = (string) row["Sex"];
     }
 }
Exemple #6
0
        public SiteIdentity(string currentUserName)
        {
            this.dataUser = new LTP.Accounts.Data.User();
            DataRow row = this.dataUser.Retrieve(currentUserName);

            if (row != null)
            {
                this.userName = currentUserName;
                this.trueName = (string)row["TrueName"];
                this.email    = (string)row["Email"];
                this.userID   = (int)row["UserID"];
                this.password = (byte[])row["Password"];
                this.sex      = (string)row["Sex"];
            }
        }
Exemple #7
0
        public User(string UserName)
        {
            this.dataUser     = new LTP.Accounts.Data.User();
            this.departmentID = "-1";
            DataRow row = this.dataUser.Retrieve(UserName);

            if (row != null)
            {
                this.userID       = (int)row["UserID"];
                this.trueName     = (string)row["TrueName"];
                this.sex          = (string)row["Sex"];
                this.phone        = (string)row["Phone"];
                this.email        = (string)row["Email"];
                this.employeeID   = (int)row["EmployeeID"];
                this.departmentID = (string)row["DepartmentID"];
                this.activity     = (bool)row["Activity"];
                this.userType     = (string)row["UserType"];
                this.password     = (byte[])row["Password"];
                this.style        = (int)row["Style"];
            }
        }
Exemple #8
0
 public User()
 {
     this.dataUser     = new LTP.Accounts.Data.User();
     this.departmentID = "-1";
 }