Exemple #1
0
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         //If The Function Return True
         if (CU())
         {
             MessageBox.Show("This person can not be deleted because this uniquename exist in DeletedPersonDataBase, please change the uniquename");
             this.Hide();
             UpdatePerson up = new UpdatePerson();
             up.Show();
         }
         else
         {
             //Using The Function For Deleting A Person From DataBase
             deletePerson();
             ///////////////
             //This logic is used to refresh the page
             //Because after person is deleted its name remains in combobox
             this.Hide();
             MainPage mp = new MainPage();
             mp.Show();
             mp.Hide();
             DeletePerson dp = new DeletePerson();
             dp.Show();
         }
         con.Close();
     }
     catch
     {
         MessageBox.Show("Select one person");
     }
 }
Exemple #2
0
        private void button4_Click(object sender, EventArgs e)
        {
            DeletePerson dp = new DeletePerson();

            this.Hide();
            dp.Show();
        }