public IActionResult Delete(CreditCard creditCard) { var result = _creditCardService.Delete(creditCard); if (result.Success) { return(Ok(result)); } return(BadRequest(result)); }
public IActionResult CreditCardDelete([FromForm] CreditCard creditCard) { var result = _creditCardManager.Delete(creditCard); if (result.Success) { return(Ok(result)); } return(BadRequest(result.Message)); }
public async Task <IActionResult> Delete(CreditCard creditCard) { var result = await _creditCardService.Delete(creditCard); if (result.Success) { return(Ok(result)); } return(BadRequest(result)); }
public ActionResult Delete(int id, CreditCard card) { try { _creditCardService.Delete(id); return(RedirectToAction("Index")); } catch { return(View()); } }
public IActionResult DeleteById(int id) { var result1 = _creditCardService.GetById(id); var creditCard = result1.Data; if (!result1.Success || creditCard == null) { return(BadRequest(result1)); } var result2 = _creditCardService.Delete(creditCard); if (result2.Success) { return(Ok(result2)); } else { return(BadRequest(result2)); } }
public ActionResult Remove(string creditCardId) { _creditCardService.Delete(creditCardId); return(RedirectToAction("Index")); }