Ejemplo n.º 1
0
        private void btnBack_Click(object sender, EventArgs e)
        {
            this.Hide();
            Form_Main nextForm = new Form_Main();

            nextForm.Show();
        }
Ejemplo n.º 2
0
 private void Updating()
 {
     try
     {
         Objects.con.Open();
         Objects.cmd             = new OleDbCommand("UPDATE [tbl_Users] set [password]=@password  where [username]=@username ", Objects.con);
         Objects.cmd.CommandType = System.Data.CommandType.Text;
         Objects.cmd.Parameters.Add(new OleDbParameter("@password", txtNewPassword.Text));
         Objects.cmd.Parameters.Add(new OleDbParameter("@username", usernameGetter));
         Objects.cmd.ExecuteNonQuery();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         Objects.con.Close();
         MessageBox.Show("SUCCESSFULLY UPDATED", "ATTENTION", MessageBoxButtons.OK, MessageBoxIcon.Information);
         passwordGetter = txtNewPassword.Text;
         this.Hide();
         Reset();
         var nextForm = new Form_Main();
         nextForm.Show();
     }
 }
Ejemplo n.º 3
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            if ((txtUsername.Text == "" && txtPassword.Text == ""))
            {
                MessageBox.Show("No Username and Password Found", "ATTENTION", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.ActiveControl = txtUsername;
            }
            else if ((txtUsername.Text == ""))
            {
                MessageBox.Show("No Username Found", "ATTENTION", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.ActiveControl = txtUsername;
            }
            else if ((txtPassword.Text == ""))
            {
                MessageBox.Show("No Password Found", "ATTENTION", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.ActiveControl = txtPassword;
            }
            else
            {
                try
                {
                    Objects.con.Open();
                    Objects.cmd             = new OleDbCommand("SELECT * FROM [tbl_Users] WHERE [username]=[@username] AND StrComp([password],@password , 0) = 0 ", Objects.con);
                    Objects.cmd.CommandType = System.Data.CommandType.Text;
                    Objects.cmd.Parameters.Add(new OleDbParameter("@username", txtUsername.Text));
                    Objects.cmd.Parameters.Add(new OleDbParameter("@password", txtPassword.Text));
                    Objects.dr = Objects.cmd.ExecuteReader();
                    int count = 0;
                    while (Objects.dr.Read())
                    {
                        count = count + 1;
                    }
                    switch (count)
                    {
                    case 1:
                        Form_ChangePassword.usernameGetter = this.txtUsername.Text;
                        Form_ChangePassword.passwordGetter = this.txtPassword.Text;
                        Objects.con.Close();
                        this.Hide();
                        var myForm = new Form_Main();
                        myForm.Show();
                        break;

                    default:
                        MessageBox.Show("Invalid Details", "ATTENTION", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        Reset();
                        Objects.con.Close();
                        break;
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
            }
        }
Ejemplo n.º 4
0
        private void btnBack_Click(object sender, EventArgs e)
        {
            this.Hide();
            var nextForm = new Form_Main();

            nextForm.Show();
            this.txtCurrentPassword.Clear();
            this.txtNewPassword.Clear();
            this.txtConfirmNewPassword.Clear();
        }
Ejemplo n.º 5
0
        private void btnBack_Click(object sender, EventArgs e)
        {
            this.Hide();
            var nextForm = new Form_Main();

            nextForm.Show();
            this.txtUsername.Clear();
            this.txtPassword.Clear();
            this.cmbboxSecretQuestion.Text = "";
            this.txtSecretAnswer.Clear();
            this.chckbox_ShowPassword.Checked     = false;
            this.chckbox_ShowSecretAnswer.Checked = false;
        }