private void BtnDelete_Click(object sender, RoutedEventArgs e) { if (LBTitle.Text == "Bicycle") { TBikeDAL MyDAL = new TBikeDAL(); ConfirmWindow confirm = new ConfirmWindow(ImageType.Question, "Delete?", "Are you sure to delete this bicycle?", "Yes", "No! Turn Back!"); if (confirm.Confirmed) { MyDAL.DeleteBicycleByID(LBID.Text); PopulateBikeDataTable(); PopWindow pop = new PopWindow(ImageType.Information, "Bicycle Deleted", "Bicycle: " + LBName.Text + " Has been Deleted By " + TLUsername.Text, "Okay"); pop.ShowDialog(); } } else if (LBTitle.Text == "Snacks") { TBikeDAL MyDAL = new TBikeDAL(); ConfirmWindow confirm = new ConfirmWindow(ImageType.Question, "Delete?", "Are you sure to delete this Snack?", "Yes", "No! Turn Back!"); if (confirm.Confirmed) { MyDAL.DeleteSnackByID(LBID.Text); PopulateBikeDataTable(); PopWindow pop = new PopWindow(ImageType.Information, "Snack Deleted", "Snack: " + LBName.Text + " Has been Deleted By " + TLUsername.Text, "Okay"); pop.ShowDialog(); } } }