private void btnTambah_Click(object sender, EventArgs e)
        {
            adrCon = new AddressBookController();
            FrmTambahData form = new FrmTambahData(true);

            if (form.Run(form))
            {
                adrCon.LoadData(dgvData);
            }
        }
Example #2
0
 public void EditData(DataGridView dgvData)
 {
     if (dgvData.SelectedRows.Count > 0)
     {
         DataGridViewRow row = form1.dgvData.SelectedRows[0];
         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))
         {
             LoadData(dgvData);
         }
     }
 }
Example #3
0
 public bool Run(FrmTambahData form)
 {
     form.ShowDialog();
     return(_result);
 }