Ejemplo n.º 1
0
        private void Button_MainMenu_Click(object sender, EventArgs e)
        {
            Form_User_MainMenu Form6 = new Form_User_MainMenu();

            Form6.Show();
            this.Hide();
        }
Ejemplo n.º 2
0
        private void Button_Login_Click(object sender, EventArgs e)
        {
            try
            {
                //connection
                string          myConnection = "datasource=localhost;port=3306;username=root;password="******"SELECT * FROM db_berese.admin WHERE Nama= '" + this.TextBox_Login.Text + "' and Password='******' ;", myConn);
                MySqlDataReader myReader;
                myConn.Open();

                myReader = SelectCommand.ExecuteReader();
                int count = 0;
                while (myReader.Read())
                {
                    count = count + 1;
                }
                if (count == 1)
                {
                    MessageBox.Show("WELCOME");
                    //Insert ins = new Insert();
                    Form_Admin_MainMenu   Form2  = new Form_Admin_MainMenu();
                    Form_User_MainMenu    Form6  = new Form_User_MainMenu();
                    Form_Bengkel_MainMenu Form10 = new Form_Bengkel_MainMenu();
                    Form2.Show();
                    Form6.Show();
                    Form10.Show();
                    this.Hide();
                }
                else
                {
                    MessageBox.Show("Wrong username or password");
                }
                myConn.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }