private void button1_Click(object sender, EventArgs e) { if (txtnewpasss.Text != null && txtretypepas.Text != null) { if (txtnewpasss.Text == txtretypepas.Text) { DialogResult R = MessageBox.Show("Save your New password ?", "RESET CONFIRMATION", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (DialogResult.Yes == R) { string del = "UPDATE [dbo].[REGISTRATION] SET [PASSWORDS] ='" + txtretypepas.Text + "' WHERE ACCOUNTID = '" + lblaccountid.Text + "'"; string del2 = "UPDATE [dbo].[USERLOGIN] SET [PASSWORDS] = '" + txtretypepas.Text + "' WHERE ACCOUNTID = '" + lblaccountid.Text + "'"; clsSQLClientFunctions.GlobalExecuteCommand(clsDeclaration.sLclSystemConnection, del); clsSQLClientFunctions.GlobalExecuteCommand(clsDeclaration.sLclSystemConnection, del2); MessageBox.Show("New Password Successfully Save!"); txtfname.Text = txtlname.Text = txtmname.Text = txtnewpasss.Text = txtretypepas.Text = null; lblaccountid.Text = lblusername.Text = "0000000000"; cmbusertype.Text = null; txtfname.Focus(); LOGIN_FORM main = (LOGIN_FORM)Application.OpenForms["LOGIN_FORM"]; main.Visible = true; this.Dispose(); } } else { MessageBox.Show("Password did not match", "NOTICE", MessageBoxButtons.OK, MessageBoxIcon.Information); } } }
private void button2_Click(object sender, EventArgs e) { LOGIN_FORM FLogin = new LOGIN_FORM(2); FLogin.ShowDialog(); if (!FLogin.LoginStatus) return; Properties.Settings.Default.ParameterHis = ""; Properties.Settings.Default.Save(); comboBox1.Items.Clear(); }
private void btnlogout_Click(object sender, EventArgs e) { DialogResult dr = MessageBox.Show("Are you sure you want to logout?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dr == DialogResult.Yes) { logout(); LOGIN_FORM main = (LOGIN_FORM)Application.OpenForms["LOGIN_FORM"]; main.Visible = true; this.Dispose(); } }
private void FUpdateDb_Load(object sender, EventArgs e) { FLogin = new LOGIN_FORM(2); FLogin.ShowDialog(); if (!FLogin.LoginStatus) { this.Close(); } User = new AppUser(); User = FLogin.User; }