public uint CreateUser() { uint userID = userAccess.CreateUser(); bankDb.SaveToDisk(); return(userID); }
public uint CreateUser([FromBody] UserDetailStruct newUser) { if (newUser.firstName.Length < 1 || newUser.lastName.Length < 1) { // User's name cannot be empty var response = new HttpResponseMessage(HttpStatusCode.BadRequest) { Content = new StringContent("User could not be created"), ReasonPhrase = "User cannot have an empty first or last name" }; throw new HttpResponseException(response); } UserDetailStruct result = new UserDetailStruct(); result.userID = access.CreateUser(); access.SelectUser(result.userID); access.SetUserName(newUser.firstName, newUser.lastName); return(result.userID); }
public uint CreateUser() { uint userID = userAccess.CreateUser(); return(userID); }