Пример #1
0
        // Users:
        public static int RegisterUser(string username, string password, string email, int countryIndex)
        {
            int       flag        = 0;
            UserDB    userDB      = new UserDB();
            CountryDB countryDB   = new CountryDB();
            string    countryName = countryDB.SelectById(countryIndex).Name;
            User      newUser     = new User();

            newUser.Username    = username;
            newUser.Password    = password;
            newUser.Email       = email;
            newUser.CountryName = countryName;

            bool s = userDB.InsertUser(newUser);

            if (s)
            {
                flag = 1;
            }
            else
            {
                flag = 0;
            }

            return(flag);
        }