示例#1
0
 public PlanWithUser(Plan plan, User user)
 {
     this.ID = plan.ID;
     this.planName = plan.planName;
     this.degreeProgramID = plan.degreeProgramID;
     this.degreeProgram = plan.degreeProgram;
     this.userID = plan.userID;
     this.semesterID = plan.semesterID;
     this.semester = plan.semester;
     this.planCourses = plan.planCourses;
     this.username = user.username;
     this.realName = user.realName;
 }
 public override string CreateUserAndAccount(string userName, string password, bool requireConfirmation, IDictionary<string, object> values)
 {
     if (GetUser(userName, true) == null)
     {
         User user = new User()
         {
             username = userName,
             password = Crypto.HashPassword(password),
             realName = values["realName"] as string
         };
         Request<User>.AddUserRole(user, "A", "B");
         return userName;
     }
     return userName;
 }
 public override MembershipUser CreateUser(string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, out MembershipCreateStatus status)
 {
     if (GetUser(username, true) == null)
     {
         User user = new User()
         {
             username = username,
             password = Crypto.HashPassword(password),
         };
         Request<User>.AddUserRole(user, "A", "B");
         status = MembershipCreateStatus.Success;
         return GetUser(username, true);
     }
     else
     {
         status = MembershipCreateStatus.DuplicateUserName;
         return null;
     }
 }
示例#4
0
 private User createTempUser()
 {
     User user = new User()
     {
         ID = 3,
         username = "******",
         realName = "Test User 3"
     };
     return user;
 }
示例#5
0
 public UserEdit(User user)
 {
     this.ID = user.ID;
     this.username = user.username;
     this.realName = user.realName;
 }