From 4ac6b2475bd7ec7aefb36199c1ea9081e02a790d Mon Sep 17 00:00:00 2001 From: "Chris.Watts90@outlook.com" Date: Fri, 3 Feb 2017 12:21:21 +0000 Subject: [PATCH] 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.... --- DataCenter_Windows/WindowsDataCenter/Interfaces/User.cs | 2 ++ .../WindowsDataCenter/SQLiteRepository/SQLiteRepository.cs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/DataCenter_Windows/WindowsDataCenter/Interfaces/User.cs b/DataCenter_Windows/WindowsDataCenter/Interfaces/User.cs index 0b74df6..96e2a0e 100644 --- a/DataCenter_Windows/WindowsDataCenter/Interfaces/User.cs +++ b/DataCenter_Windows/WindowsDataCenter/Interfaces/User.cs @@ -7,6 +7,8 @@ namespace Interfaces public User() { AssociatedIdentifiers = new List(); + FirstName = ""; + LastName = ""; } public int UserId { get; set; } public string FirstName { get; set; } diff --git a/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/SQLiteRepository.cs b/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/SQLiteRepository.cs index 3ce17fb..68fadbf 100644 --- a/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/SQLiteRepository.cs +++ b/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/SQLiteRepository.cs @@ -114,7 +114,7 @@ namespace SQLiteRepository //TODO: add method which returns userId? maybe as ref? public OperationResponse UpdateUser(User user) { - if(user.UserId <=0) return OperationResponse.FAILED; + //if(user.UserId <=0) return OperationResponse.FAILED; var ret = OperationResponse.NONE; var cardIds = new List();