Пример #1
0
 private void dgvPets_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex != -1)
     {
         int pID = (int)dgvPets.CurrentRow.Cells[0].Value;
         try {
             tblPet pet = TblPetDAO.Instance.GetPetByID(pID);
             this.Hide();
             PetDetail frm = new PetDetail(false, pet);
             frm.ShowDialog();
             this.Show();
             if (frm.IsAction)
             {
                 RefreshDgv();
             }
         } catch (Exception) {
         }
     }
 }
Пример #2
0
        private void btnCreatePet_Click(object sender, EventArgs e)
        {
            try
            {
                this.Hide();
                PetDetail newForm = new PetDetail();
                newForm.ShowDialog();
                this.Show();
                if (newForm.IsAction)
                {
                    RefreshDgv();
                }
            }
            catch (Exception)
            {
                // ignored
            }

            // Thread t = new Thread(new ThreadStart(ShowCreatePet));
            // t.Start();
            // this.Close();
        }