Example #1
0
 private void BtnDeleteIncomeCategory_Click(object sender, EventArgs e)
 {
     if (DBMethods.TypeOfIncomeCategoryExists(listIncomeCategories.Text, UserID))
     {
         DialogResult result = MessageBox.Show("This action will also delete types and incomes of the selected category. Do you wish to continue?",
                                               "Confirm Delete", MessageBoxButtons.YesNo);
         if (result == DialogResult.Yes)
         {
             DBMethods.DeleteTypesAndIncomesofIncomeCategory(listIncomeCategories.Text, UserID);
         }
         else if (result == DialogResult.No)
         {
             return;
         }
     }
     DBMethods.DeleteIncomeCategory(listIncomeCategories.Text, UserID);
     UpdateCategoryListBoxs();
     fm.UpdateUI();
 }