예제 #1
0
        private void btnTambah_Click(object sender, EventArgs e)
        {
            FrmTambahData form = new FrmTambahData(true);

            form.ShowDialog();
            this.Show();
            FrmAddressBook_Load(null, null);
        }
예제 #2
0
 private void btnEdit_Click(object sender, EventArgs e)
 {
     if (this.dgvData.SelectedRows.Count > 0)
     {
         DataGridViewRow row      = this.dgvData.SelectedRows[0];
         AddressBook     addrBook = new AddressBook();
         addrBook.Nama         = row.Cells[0].Value.ToString();
         addrBook.Alamat       = row.Cells[1].Value.ToString();
         addrBook.Kota         = row.Cells[2].Value.ToString();
         addrBook.NoHp         = row.Cells[3].Value.ToString();
         addrBook.TanggalLahir = Convert.ToDateTime(row.Cells[4].Value).Date;
         addrBook.Email        = row.Cells[5].Value.ToString();
         FrmTambahData form = new FrmTambahData(false, addrBook);
         if (form.Run(form))
         {
             FrmAddressBook_Load(null, null);
         }
     }
 }
예제 #3
0
 public bool Run(FrmTambahData form)
 {
     form.ShowDialog();
     return(_result);
 }