public async Task <IActionResult> VerifyAccount(string Cdestino) { var account = await _productsrepository.GetAllCuentaForVerify(); var resul = account.FirstOrDefault(a => a.Id.Trim() == Cdestino.Trim()); if (resul == null) { return(Json($"Esta cuenta no existe.")); } return(Json(true)); }
public async Task <IActionResult> VerifyAccount(int newbeneficiario) { var account = await _productsrepository.GetAllCuentaForVerify(); var resul = account.FirstOrDefault(a => a.Id.Trim() == newbeneficiario.ToString().Trim()); if (resul == null) { return(Json($"Esta cuenta no existe.")); } var usercreador = await _userManager.FindByNameAsync(User.Identity.Name); var beneficiarios = await _beneficiariosrepository.GetAll(); var Beneficiarios = beneficiarios.FirstOrDefault(A => (A.Idcreador.Trim() == usercreador.Id.Trim() && A.NoCuenta.Trim() == newbeneficiario.ToString().Trim())); if (Beneficiarios != null) { return(Json($"Ya tienes esta cuenta agregada.")); } return(Json(true)); }