private void btnCreateAdopter_Click(object sender, EventArgs e) { AdopterDetail newF = new AdopterDetail(true, null); this.Hide(); newF.ShowDialog(); this.Show(); if (newF.IsAction) { RefreshAdopterList(); } }
//This function will show adopter detail form when click eye icon private void dgvListAdopters_CellClick(object sender, DataGridViewCellEventArgs e) { //skip column header if (e.ColumnIndex == 3 && e.RowIndex != -1) { if (dgvListAdopters.CurrentCell != null && dgvListAdopters.CurrentCell.Value != null) { string username = dgvListAdopters.CurrentRow.Cells[0].Value.ToString(); this.Hide(); AdopterDetail frm = new AdopterDetail(adopters.Find(x => x.username == username)); frm.ShowDialog(); this.Show(); } } }
private void lvListAdopters_DoubleClick(object sender, EventArgs e) { String username = lvListAdopters.SelectedItems[0].SubItems[0].Text; tblAccount adopter = TblAccountDAO.Instance.GetAccountByUsername(username); this.Hide(); AdopterDetail form = new AdopterDetail(false, adopter); form.ShowDialog(); this.Show(); if (form.IsAction) { RefreshAdopterList(); } }