Ejemplo n.º 1
0
    protected void UserAccounts_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        Guid id = (Guid)e.Keys[0];
        GridViewRow row = UserAccounts.Rows[e.RowIndex];
        string fullname = (row.FindControl("txtFullname") as TextBox).Text;
        string email = (row.FindControl("txtEmail") as TextBox).Text;
        string phone = (row.FindControl("txtPhone") as TextBox).Text;
        string comment = (row.FindControl("txtComment") as TextBox).Text;

        bool isApproved = (row.FindControl("chkIsApproved") as CheckBox).Checked;

        MembershipUser user = Membership.GetUser(id);

        if (user == null) return;

        user.Email = email;
        user.Comment = comment;
        user.IsApproved = isApproved;

        Membership.UpdateUser(user);

        aspnet_UserProfilesBLL bll = new aspnet_UserProfilesBLL();
        bll.UpdateProfile(user.UserName, fullname, phone);

        //LinqDataSource1.DataBind();
    }
Ejemplo n.º 2
0
    protected void UserAccounts_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        Guid        id       = (Guid)e.Keys[0];
        GridViewRow row      = UserAccounts.Rows[e.RowIndex];
        string      fullname = (row.FindControl("txtFullname") as TextBox).Text;
        string      email    = (row.FindControl("txtEmail") as TextBox).Text;
        string      phone    = (row.FindControl("txtPhone") as TextBox).Text;
        string      comment  = (row.FindControl("txtComment") as TextBox).Text;

        bool isApproved = (row.FindControl("chkIsApproved") as CheckBox).Checked;

        MembershipUser user = Membership.GetUser(id);

        if (user == null)
        {
            return;
        }

        user.Email      = email;
        user.Comment    = comment;
        user.IsApproved = isApproved;

        Membership.UpdateUser(user);

        aspnet_UserProfilesBLL bll = new aspnet_UserProfilesBLL();

        bll.UpdateProfile(user.UserName, fullname, phone);

        //LinqDataSource1.DataBind();
    }
    protected void RegisterUser_CreatedUser(object sender, EventArgs e)
    {
        aspnet_UserProfilesBLL = new aspnet_UserProfilesBLL();

        TextBox txtFullname = RegisterUser.FindControl("CreateUserStepContainer").FindControl("txtFullname") as TextBox;
        TextBox txtPhone = RegisterUser.FindControl("CreateUserStepContainer").FindControl("Phone") as TextBox;

        aspnet_UserProfilesBLL.NewProfile(RegisterUser.UserName, txtFullname.Text, txtPhone.Text);
    }
Ejemplo n.º 4
0
    protected void RegisterUser_CreatedUser(object sender, EventArgs e)
    {
        aspnet_UserProfilesBLL = new aspnet_UserProfilesBLL();

        TextBox txtFullname = RegisterUser.FindControl("CreateUserStepContainer").FindControl("txtFullname") as TextBox;
        TextBox txtPhone    = RegisterUser.FindControl("CreateUserStepContainer").FindControl("Phone") as TextBox;

        aspnet_UserProfilesBLL.NewProfile(RegisterUser.UserName, txtFullname.Text, txtPhone.Text);
    }