Exemple #1
0
 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 ) );
     }
 }
Exemple #2
0
        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");
                }
            }
        }
Exemple #3
0
        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));
            }
        }
Exemple #4
0
 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 );
 }
Exemple #5
0
        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" );
            }
        }
Exemple #6
0
 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));
 }