Beispiel #1
0
        public uint CreateUser()
        {
            uint userID = userAccess.CreateUser();

            bankDb.SaveToDisk();
            return(userID);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        public uint CreateUser()
        {
            uint userID = userAccess.CreateUser();

            return(userID);
        }