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()); } }