public DeletePaymentType DeletePaymentType(DeletePaymentType obj) { var returnModel = new DeletePaymentType(); var PaymentType = _PaymentTypesRepo.Get(obj.PaymentTypeId); if (PaymentType != null) { _PaymentTypesRepo.Delete(PaymentType); returnModel.Message = "Delete Successful."; } return(returnModel); }
public async Task <IActionResult> DeletePaymentType(long PaymentTypeId) { try { var model = new DeletePaymentType() { PaymentTypeId = PaymentTypeId }; await Task.Run(() => _PaymentTypesServ.DeletePaymentType(model)); } catch (Exception) { return(BadRequest()); } return(RedirectToAction("PaymentTypesList")); }