/// <summary> /// Add Information to Register the user /// Return the status true ro false /// </summary> /// <param name="Info"></param> /// <returns></returns> public bool AddUser(Users Info) { try { string Encrypted = Info.Password; Info.Password = EncryptedPassword.EncodePasswordToBase64(Encrypted); //Password get Encrypted var Result = User.AddUser(Info); if (!Result.Equals(null)) { return(true); } else { return(false); } } catch (Exception e) { throw new Exception(e.Message); } }
//method to register new user public UserRegistration register(UserRegistration user) { try { string Encrypted = user.Password; user.Password = EncryptedPassword.EncodePasswordToBase64(Encrypted); var Result = parkingLot.AddUser(user); if (!Result.Equals(null)) { return(user); } else { throw new Exception("Not found"); } } catch (Exception exception) { throw new Exception(exception.Message); } }