Added initialisation for User object to set First and Last names to an empty string.

removed line to check if user id is valid, as when creating a user id, it will be -1....
This commit is contained in:
Chris.Watts90@outlook.com 2017-02-03 12:21:21 +00:00
parent 86a1618819
commit 4ac6b2475b
2 changed files with 3 additions and 1 deletions

View File

@ -7,6 +7,8 @@ namespace Interfaces
public User() public User()
{ {
AssociatedIdentifiers = new List<Identifier>(); AssociatedIdentifiers = new List<Identifier>();
FirstName = "";
LastName = "";
} }
public int UserId { get; set; } public int UserId { get; set; }
public string FirstName { get; set; } public string FirstName { get; set; }

View File

@ -114,7 +114,7 @@ namespace SQLiteRepository
//TODO: add method which returns userId? maybe as ref? //TODO: add method which returns userId? maybe as ref?
public OperationResponse UpdateUser(User user) public OperationResponse UpdateUser(User user)
{ {
if(user.UserId <=0) return OperationResponse.FAILED; //if(user.UserId <=0) return OperationResponse.FAILED;
var ret = OperationResponse.NONE; var ret = OperationResponse.NONE;
var cardIds = new List<int>(); var cardIds = new List<int>();