private void ButtonHapusUser_Click(object sender, EventArgs e) { user u = new user(); string title = "Konfirmasi Penghapusan Data"; string konten = "Apakah Anda yakin ingin menghapus data?"; DialogResult result = MessageBox.Show(konten, title, MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == System.Windows.Forms.DialogResult.Yes) { u.hapusUser(id_user); setDataTable(u.getAllUser()); } }
private void ButtonSimpanTambah_Click(object sender, EventArgs e) { user u = new user(); user.hak_akses = comboBoxHakAkses.GetItemText(comboBoxHakAkses.SelectedItem); u.username = txtBoxusername.Text; u.nama = txtBoxnama.Text; u.password = txtBoxpassword.Text; if (cekValid()) { return; } else { u.tambahUser(); frm2.setDataTable(u.getAllUser()); } }
private void ButtonUserEdit_Click(object sender, EventArgs e) { user u = new user(); u.username = txtBoxUserEdit.Text; u.nama = txtBoxNamaLengkapUser.Text; // user.hak_akses = comboBoxHakAkses.GetItemText(comboBoxHakAkses.SelectedText).ToString(); u.password = textBoxPasswordBaru.Text; u.id_user = id_user; if (cekValid()) { return; } else { //MessageBox.Show(user.hak_akses); u.editUser(); frm2.setDataTable(u.getAllUser()); } }
private void FormUser_Load(object sender, EventArgs e) { user u = new user(); setDataTable(u.getAllUser()); }