Esempio n. 1
0
        private void LoginButton_Click(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\Test_Database.mdf;Integrated Security=True;Connect Timeout=30");

            // Counts how many matches
            con.Open();
            SqlDataAdapter sda = new SqlDataAdapter("Select Count(*) From Login where Username ='******' and Password = '******'", con);
            DataTable      dt  = new DataTable();

            sda.Fill(dt);
            //if it doesn't match then it won't log in.
            if (dt.Rows[0][0].ToString() == "1" && count <= 5)
            {
                PasswordInput.Text = String.Empty;
                this.Hide();
                DashBoard db = new DashBoard();
                db.RefToLogin = this;
                this.Visible  = false;
                db.Show();
            }
            else if (count <= 5)
            {
                MessageBox.Show("Please Check your Username and Password!");
                count += 1;
            }
            else
            {
                MessageBox.Show("You have been locked out, please contact admin");
            }
        }
Esempio n. 2
0
        private void DashBoardButton_Click(object sender, EventArgs e)
        {
            DashBoard DashBoardLink = new DashBoard();

            DashBoardLink.Show();
            DashBoardLink.RefToLogin = this.RefToLogin;
            this.Close();
        }
Esempio n. 3
0
        private void SideBtn_Dashboard_Click(object sender, EventArgs e)
        {
            DashBoard DB = new DashBoard();

            DB.Show();
            DB.RefToLogin = this.RefToLogin;
            this.Close();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            this.Hide();

            DashBoard DashBoardLink = new DashBoard();

            DashBoardLink.Show();
        }
Esempio n. 5
0
        private void button1_Click(object sender, EventArgs e)
        {
            con.Open();
            SqlCommand cmd = con.CreateCommand();

            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "Update Login SET Password = '******' Where Username = '******'";
            cmd.ExecuteNonQuery();
            con.Close();

            MessageBox.Show("Password successfully updated");

            DashBoard Updated_DB = new DashBoard();

            this.Close();
            Updated_DB.Show();
        }