private void buttonEditJenisSurat_Click(object sender, EventArgs e)
        {
            Database        db      = new Database();
            string          strconn = db.getString();
            MySqlConnection conn    = new MySqlConnection(strconn);

            conn.Open();
            string       query = "UPDATE jenis_surat SET nama_jenis = @nama_jenis WHERE id_jenis = @id_jenis";
            MySqlCommand cmd   = new MySqlCommand(query, conn);

            cmd.Parameters.AddWithValue("@id_jenis", id_jenis);
            cmd.Parameters.AddWithValue("@nama_jenis", textBoxEditJenisSurat.Text);
            //MessageBox.Show(query);
            int sukses = cmd.ExecuteNonQuery();

            if (sukses > 0)
            {
                MessageBox.Show("Data berhasil diupdate", "Sukses");
                frm1.getAllJenisSurat();
            }
            else
            {
                MessageBox.Show("Data gagal diupdate", "Gagal");
            }
            conn.Close();
        }
        private void tambahJenisSurat()
        {
            JenisSurat j = new JenisSurat();

            j.setJenis(textBoxJenis.Text);
            string jenis = j.getJenis();

            Database        db      = new Database();
            string          strconn = db.getString();
            MySqlConnection conn    = new MySqlConnection(strconn);

            conn.Open();
            string       query = "INSERT INTO jenis_surat VALUES(NULL, @jenis)";
            MySqlCommand cmd   = new MySqlCommand(query, conn);

            cmd.Parameters.AddWithValue("@jenis", jenis);
            int hasil = cmd.ExecuteNonQuery();

            if (hasil > 0)
            {
                MessageBox.Show("Data berhasil ditambah", "Sukses");
                frm1.getAllJenisSurat();
            }
            else
            {
                MessageBox.Show("Data gagal ditambah", "Gagal");
            }

            conn.Close();
        }