public void DeleteTest() { List <UserPayment> paymethods = UserPaymentManager.Load(); UserPayment paymethod = paymethods.Where(c => c.CardHolderName == "John Test Hancook").FirstOrDefault(); int actual = UserPaymentManager.Delete(paymethod.Id); Assert.IsTrue(actual > 0); }
private void btnDelete_Click(object sender, RoutedEventArgs e) { int result = UserPaymentManager.Delete(payment.Id); if (result >= 1) { MessageBox.Show("Payment deleted."); this.Close(); } else { MessageBox.Show("An error occurred when deleting."); } }
// DELETE: api/UserPayment/5 public void Delete(Guid id) { UserPaymentManager.Delete(id); }