예제 #1
0
파일: home.cs 프로젝트: rayanbey/Projects
        private void homeLabel_Click(object sender, EventArgs e)
        {
            home a = new home();

            this.Hide();
            a.Show();
        }
예제 #2
0
        private void label5_Click(object sender, EventArgs e)
        {
            home h = new home();

            this.Hide();
            h.Show();
        }
예제 #3
0
        private void loginButton_Click(object sender, EventArgs e)
        {
            using (SqlConnection Connection = dbUtil.GetSqlConnection(dbUtil.GetConnectionString()))
            {
                using (SqlCommand sqlCommand = new SqlCommand("SELECT * FROM Users where username='******'and password = '******'", Connection))
                {
                    using (SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand))
                    {
                        SqlDataReader read = sqlCommand.ExecuteReader();


                        int c = 0;
                        while (read.Read())
                        {
                            c++;
                        }

                        if (c > 0)
                        {
                            MessageBox.Show("Login Success");
                            home h1 = new home();
                            this.Hide();
                            h1.Show();
                        }



                        else
                        {
                            MessageBox.Show("Incorrect login");
                            userNameTextbox.Text = "";
                            passwordTexbox.Text  = "";
                        }
                    }
                }
            }
        }