Exemple #1
0
        public void Register()
        {
            if (BazaDanych.uzytkownicy.Count != 0)
            {
                userID = BazaDanych.uzytkownicy[BazaDanych.uzytkownicy.Count - 1].userID + 100;
            }
            else
            {
                userID = 1;
            }
            do
            {
                System.Console.WriteLine("Podaj Login");
                login = System.Console.ReadLine();
            } while (BazaDanych.sprawdzLogin(login) == true);

            do
            {
                System.Console.WriteLine("Podaj Hasło");
                password = System.Console.ReadLine();
            } while (BazaDanych.sprawdzHaslo(password) == true);


            System.Console.WriteLine("Podaj Imię");
            name = System.Console.ReadLine();

            System.Console.WriteLine("Podaj Nazwisko");
            surname = System.Console.ReadLine();

            System.Console.WriteLine("Podaj Miasto");
            city = System.Console.ReadLine();

            System.Console.WriteLine("Podaj Adres");
            address = System.Console.ReadLine();

            do
            {
                System.Console.WriteLine("Podaj E-Mail");
                email = System.Console.ReadLine();
            } while (BazaDanych.sprawdzEmail(email) == true);



            Console.WriteLine("Twoje dane:");



            System.Console.WriteLine(name);
            System.Console.WriteLine(surname);
            System.Console.WriteLine(city);
            System.Console.WriteLine(address);
            System.Console.WriteLine(email);
            System.Console.WriteLine(login);
            System.Console.WriteLine(password);



            BazaDanych.dodajUzytkownika(this);
        }
Exemple #2
0
        public User(string _login, string _password, string _name, string _surname, string _address, string _city, string _email, string _phone)
        {
            if (BazaDanych.uzytkownicy.Count != 0)
            {
                userID = BazaDanych.uzytkownicy[BazaDanych.uzytkownicy.Count - 1].userID + 100;
            }
            else
            {
                userID = 1;
            }

            login    = _login;
            password = _password;
            name     = _name;
            surname  = _surname;
            address  = _address;
            city     = _city;
            email    = _email;
            phone    = _phone;

            BazaDanych.dodajUzytkownika(this);
        }