public IActionResult GetAll() { var result = _creditCardService.GetAll(); if (result.Success) { return Ok(result); } return BadRequest(result); }
public IActionResult GetAllById(int customerId) { var result = _creditCardService.GetAll(customerId); if (result.Success) { return(Ok(result)); } return(BadRequest(result)); }
public IActionResult GetAll() { var result = _cardService.GetAll(); if (result.Success) { return(Ok(result.Data)); } return(BadRequest(result.Message)); }
public IActionResult CreditCardAll() { var result = _creditCardManager.GetAll(); if (result.Success) { return(Ok(result)); } return(BadRequest(result.Message)); }
private IResult CheckIsCardValid(string cardNumber, DateTime expirationDate, string securityCode) { if (!_creditCardService.GetAll().Data.Any( c => c.CreditCardNumber == cardNumber && c.ExpirationDate == expirationDate && c.SecurityCode == securityCode)) { return(new ErrorResult(Messages.CardInvalid)); } return(new SuccessResult()); }
private IResult CheckIsCreditCardExist(string cardNumber, string expirationDate, string securityCode) { if (!_creditCardService.GetAll().Data.Any( x => x.CreditCardNumber == cardNumber && x.ExpirationDate == expirationDate && x.SecurityCode == securityCode )) { return(new ErrorResult(Messages.NotExist + "credit card")); } return(new SuccessResult()); }
private IResult CheckIsCreditCardExist(string cardNumber, string expirationDate, string cVV) { if (!_creditCardService.GetAll().Data.Any( cc => cc.CreditCardNumber == cardNumber && cc.ExpirationDate == expirationDate && cc.CVV == cVV )) { return(new ErrorResult(Messages.NotExist + "credit card")); } return(new SuccessResult()); }
// GET: CreditCard public ActionResult Index() { if (Session["LoginedUser"] == null) { return(RedirectToAction(actionName: "Login", controllerName: "Login")); } if (string.IsNullOrEmpty(Session["LoginedUser"].ToString())) { return(RedirectToAction(actionName: "Login", controllerName: "Login")); } var list = _creditCardService.GetAll().ToList(); return(View(list)); }
public IActionResult GetAllById(int customerId) { var userId = _customerService.GetById(customerId); if (userId.Data == null) { return(BadRequest()); } var result = _cardService.GetAll(userId.Data.UserId); if (result.Success) { return(Ok(result)); } return(BadRequest(result)); }