private void ClearData() { IdPegawaiText.Clear(); ComboBoxRolePegawai.SelectedIndex = -1; NamaPegawaiText.Clear(); AlamatPegawaiText.Clear(); NomorPegawaiText.Clear(); DatePickTglLahir.SelectedDate = null; UsernameText.Clear(); PasswordText.Clear(); }
private void DeleteButton_Click(object sender, RoutedEventArgs e) { try { ds = new DataSet(); adapter = new MySqlDataAdapter("delete from jenis_hewan where ID_JENIS_HEWAN = " + IdJenisHewanText.Text, conn); adapter.Fill(ds, "jenis_hewan"); GetRecords(); MessageBox.Show("Berhasil Dihapus!"); IdJenisHewanText.Clear(); IdPegawaiText.Clear(); NamaJenisHewanText.Clear(); } catch (Exception d) { MessageBox.Show(d.Message); } }
private void EditButton_Click(object sender, RoutedEventArgs e) { try { ds = new DataSet(); adapter = new MySqlDataAdapter("update jenis_hewan set ID_PEGAWAI = '" + IdPegawaiText.Text + "', NAMA_JENIS = '" + NamaJenisHewanText.Text + "'where ID_JENIS_HEWAN = " + IdJenisHewanText.Text + "", conn); adapter.Fill(ds, "jenis_hewan"); GetRecords(); MessageBox.Show("Berhasil Diedit!"); IdJenisHewanText.Clear(); IdPegawaiText.Clear(); NamaJenisHewanText.Clear(); } catch (Exception d) { MessageBox.Show(d.Message); } }