protected void btnDuplicatesNext_Click( object sender, EventArgs e ) { int personId = Int32.Parse( Request.Form["DuplicatePerson"] ); if ( personId > 0 ) { Rock.Model.UserService userService = new Rock.Model.UserService(); var users = userService.GetByPersonId(personId).ToList(); if (users.Count > 0) DisplaySendLogin( personId, Direction.Forward ); else DisplayConfirmation( personId ); } else { DisplaySuccess( CreateUser( CreatePerson(), true ) ); } }
protected void btnUserInfoNext_Click(object sender, EventArgs e) { Password = tbPassword.Text; PasswordConfirm = tbPasswordConfirm.Text; if (Page.IsValid) { Rock.Model.UserService userService = new Rock.Model.UserService(); Rock.Model.UserLogin user = userService.GetByUserName(tbUserName.Text); if (user == null) { DisplayDuplicates(Direction.Forward); } else { ShowErrorMessage("Username already exists"); } } }
protected void btnDuplicatesNext_Click(object sender, EventArgs e) { int personId = Int32.Parse(Request.Form["DuplicatePerson"]); if (personId > 0) { Rock.Model.UserService userService = new Rock.Model.UserService(); var users = userService.GetByPersonId(personId).ToList(); if (users.Count > 0) { DisplaySendLogin(personId, Direction.Forward); } else { DisplayConfirmation(personId); } } else { DisplaySuccess(CreateUser(CreatePerson(), true)); } }
private Rock.Model.UserLogin CreateUser( Person person, bool confirmed ) { Rock.Model.UserService userService = new Rock.Model.UserService(); return userService.Create( person, Rock.Model.AuthenticationServiceType.Internal, "Rock.Security.Authentication.Database", tbUserName.Text, Password, confirmed, CurrentPersonId ); }
protected void btnUserInfoNext_Click( object sender, EventArgs e ) { Password = tbPassword.Text; PasswordConfirm = tbPasswordConfirm.Text; if ( Page.IsValid ) { Rock.Model.UserService userService = new Rock.Model.UserService(); Rock.Model.UserLogin user = userService.GetByUserName( tbUserName.Text ); if ( user == null ) DisplayDuplicates( Direction.Forward ); else ShowErrorMessage( "Username already exists" ); } }
private Rock.Model.UserLogin CreateUser(Person person, bool confirmed) { Rock.Model.UserService userService = new Rock.Model.UserService(); return(userService.Create(person, Rock.Model.AuthenticationServiceType.Internal, "Rock.Security.Authentication.Database", tbUserName.Text, Password, confirmed, CurrentPersonId)); }