Beispiel #1
0
        public void CreateUser(string username, string password, string fullName, string address, string phoneNumber)
        {
            int?userTypeId = userTypeRep.GetUserTypeId();

            if (userTypeId != null)
            {
                userRep.Create(new User
                {
                    Username    = username,
                    Password    = password,
                    UserTypeId  = userTypeId.Value,
                    FullName    = fullName,
                    Address     = address,
                    PhoneNumber = phoneNumber
                });
            }
            else
            {
                throw new Exception("add userType for user in db");
            }
        }