Beispiel #1
0
 public User(int existingUserID)
 {
     this.dataUser = new JiaJiao.Data.User();
     this.departmentID = "-1";
     this.userID = existingUserID;
     this.LoadFromID();
 }
Beispiel #2
0
 public User(AccountsPrincipal existingPrincipal)
 {
     this.dataUser = new JiaJiao.Data.User();
     this.departmentID = "-1";
     this.userID = ((SiteIdentity) existingPrincipal.Identity).UserID;
     this.LoadFromID();
 }
Beispiel #3
0
 public AccountsPrincipal(string userName)
 {
     this.dataUser = new JiaJiao.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);
 }
Beispiel #4
0
 public SiteIdentity(string currentUserName)
 {
     this.dataUser = new JiaJiao.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"];
     }
 }
Beispiel #5
0
 public User(string UserName)
 {
     this.dataUser = new JiaJiao.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"];
     }
 }
Beispiel #6
0
 public static AccountsPrincipal ValidateLogin(string userName, string password)
 {
     byte[] encPassword = EncryptPassword(password);
     JiaJiao.Data.User user = new JiaJiao.Data.User();
     int userID = user.ValidateLogin(userName, encPassword);
     if (userID > 0)
     {
         return new AccountsPrincipal(userID);
     }
     return null;
 }
Beispiel #7
0
 public User()
 {
     this.dataUser = new JiaJiao.Data.User();
     this.departmentID = "-1";
 }