コード例 #1
0
    protected void btnChangePassword_Click(object sender, EventArgs e)
    {
        try
        {
            usersTableAdapters.GetSpecificUserTableAdapter user = new usersTableAdapters.GetSpecificUserTableAdapter();
            users.GetSpecificUserRow tblUser = user.GetSpecificUser(MySessionManager.CurrentUser.UserID)[0];

            if (tblUser.datPassword == txtOldPassword.Text)
            {
                if (txtNewPassword.Text == txtConfirmPassword.Text)
                {
                    usersTableAdapters.UsersTableAdapter userData = new usersTableAdapters.UsersTableAdapter();
                    userData.UpdatePassword(txtNewPassword.Text,
                                            MySessionManager.CurrentUser.UserID);
                }
                else
                {
                    ShowMessageBox("The password provided and the Confirmed password does not match");
                }
            }
            else
            {
                ShowMessageBox("The Old password is incorrect");
            }
        }
        catch (Exception ex) { }
    }
コード例 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            usersTableAdapters.GetSpecificUserTableAdapter user = new usersTableAdapters.GetSpecificUserTableAdapter();
            users.GetSpecificUserRow tblUser = user.GetSpecificUser(MySessionManager.CurrentUser.UserID)[0];

            lblName.InnerHtml       = "<b>" + util.displayValue("opt_titles", tblUser.datTitle) + tblUser.datFirstnames.ToString() + "  " + tblUser.datSurname.ToString() + "</b>";
            lblEmail.InnerHtml      = "<b>" + tblUser.datEmailAddress.ToString() + "</b>";
            lblCellNumber.InnerHtml = "<b>" + tblUser.datCellNumber.ToString() + "</b>";
        }
        catch (Exception ex) { }
    }
コード例 #3
0
    public void loadUser(int userID)
    {
        try
        {
            usersTableAdapters.GetSpecificUserTableAdapter User = new usersTableAdapters.GetSpecificUserTableAdapter();
            users.GetSpecificUserRow tblUser = User.GetSpecificUser(userID)[0];

            txtBirthdate.Text  = tblUser.datDateOfBirth.ToShortDateString();
            txtfirstname.Value = tblUser.datFirstnames.ToString();
            txtsurname.Value   = tblUser.datSurname.ToString();
            txtEmail.Value     = tblUser.datEmailAddress.ToString();
            if (tblUser.datTitle != "0")
            {
                ddlTitle.SelectedValue = tblUser.datTitle.ToString();
            }
            if (tblUser.datTeam > 0)
            {
                ddlTeam.SelectedValue = tblUser.datTeam.ToString();
            }
        }
        catch (Exception ex) { }
    }