/** * @author Anthony Scheeres */ internal string validateMailAgain(string token) { string failResponse = ResponseR.fail.ToString(); string response = failResponse; UserDao userDao = DaoProvider.getUser(); string email = null; email = userDao.getEmailUsingTokenThrowNewException(token); if (email != null) { validateAUsersEmailUsingAValidationEmaill(email, "Gebruiker", token); response = ResponseR.success.ToString(); } return(response); }
/** * @author Anthony Scheeres */ internal string customerAcceptPendingReservationPotential(ReservationModel reservation, string token) { if (reservation == null) { throw new ArgumentNullException(nameof(reservation)); } string successResponse, failResponse, response; successResponse = ResponseR.success.ToString(); failResponse = ResponseR.fail.ToString(); response = failResponse; //default failed response //check if user his email is validated UserDao userDao = DaoProvider.getUser(); bool isEmaillValid = userDao.isEnailValideByModel(token); if (isEmaillValid) { // token to user id here double userId = TokenToUserId(token); reservationDao.customerAcceptPendingReservationPotentialInDatabase(userId, reservation.id); response = successResponse; } return(response); }