Ejemplo n.º 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            string insertQuery = "insert into karyawan values('" + textBox3.Text + "','" + textBox1.Text + "','" + comboBox1.Text + "','" + richTextBox1.Text + "','" + textBox6.Text + "','" + textBox2.Text + "')";

            con.Open();
            MySqlCommand command = new MySqlCommand(insertQuery, con);

            try
            {
                if (command.ExecuteNonQuery() == 1)
                {
                    MessageBox.Show("Welcome , Have a Great Work!\nPlease,Login Immediately!");
                    awal f1 = new awal();
                    f1.Show();
                    this.Hide();
                }
                else
                {
                    MessageBox.Show("Data is invalid \n Please Try Again!");
                    createuser f2 = new createuser();
                    f2.Show();
                    this.Hide();
                }
            }catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }


            con.Close();
        }
Ejemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            i = 0;
            con.Open();
            MySqlCommand cmd = con.CreateCommand();

            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "select*from karyawan where username='******' and password ='******'";
            cmd.ExecuteNonQuery();
            DataTable        dt = new DataTable();
            MySqlDataAdapter da = new MySqlDataAdapter(cmd);

            da.Fill(dt);
            i = Convert.ToInt32(dt.Rows.Count.ToString());
            if (i != 0)
            {
                MessageBox.Show("Login Successful!");
                Form1 f4 = new Form1(textBox1.Text);
                f4.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Username and Password is invalid (or Create a New Account)");
                awal f1 = new awal();
                f1.Show();
                this.Hide();
            }
            con.Close();
        }
Ejemplo n.º 3
0
        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            awal f1 = new awal();

            f1.Show();
            this.Hide();
        }
Ejemplo n.º 4
0
        private void bunifuFlatButton7_Click(object sender, EventArgs e)
        {
            awal f3 = new awal();

            f3.Show();
            this.Hide();
        }