Ejemplo n.º 1
0
        private void btnChange_Click(object sender, EventArgs e)
        {
            BusinessLayer.blUserAdmin blAdmin = new blUserAdmin();

            if (oldpassowrd == txtOld.Text)
            {
                if (txtNew.Text == txtNewtry.Text)
                {
                    DialogResult msg;
                    msg = MessageBox.Show("Are you sure you want to change your password?", "Inventory", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation);

                    if (msg == DialogResult.Yes)
                    {
                        blAdmin.changePassword(lblUsername.Text, txtNew.Text);
                        MessageBox.Show("Successfully change password", "new password", MessageBoxButtons.OK, MessageBoxIcon.Information);

                        blAdmin.UpdateAuditTrail(lblUsername.Text, "Change Password", "Change Password", "", "");

                        frmChangePassword frm = new frmChangePassword();
                        this.Close();
                    }
                }
                else
                {
                    MessageBox.Show("mismatch password", "Error Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }

            else
            {
                MessageBox.Show("invalid old password", "Error Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 2
0
        private void changePasswordToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmChangePassword frm = new frmChangePassword();

            frm.Show();
            frm.MdiParent = this;
        }