Exemple #1
0
 private void EditRuangan(ListViewItem item) {
     Ruangan ruangan = (Ruangan)item.Tag;
     using (FormRuangan form = new FormRuangan(ruangan)) {
         if (form.ShowDialog() != DialogResult.OK)
             return;
         ruangan.Nama = form.Nama;                
         ruangan.Tipe = form.Tipe;                
         ruangan.Kapasitas = form.Kapasitas;                
         GetAllRuangan();
     }
 }
Exemple #2
0
 private void buttonRuanganTambah_Click(object sender, EventArgs e) {
     using (FormRuangan form = new FormRuangan()) {
         if (form.ShowDialog() != DialogResult.OK)
             return;
         var ruangan = Ruangan.Add(form.Tipe, form.Nama, form.Kapasitas);
         if (ruangan == null) {
             MessageBox.Show("Gagal menambahkan ruangan.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             return;
         }
         GetAllRuangan();
     }
 }