Esempio n. 1
0
        public static Address SetData()
        {
            var address = new Address();

            Console.WriteLine("Wprowadź dane nowego adresu");

            address.SetData(Toolbox.InputString("Podaj ulicę: ", false),
                            Toolbox.InputString("Podaj Miasto: ", false),
                            Toolbox.InputString("Podaj Kod Pocztowy: ", false),
                            Toolbox.InputInteger("Nr Domu: ", 1, 200));

            return(address);
        }
Esempio n. 2
0
        public Pet CreatePet()
        {
            var result = new Dog();

            Console.WriteLine("=== Wprowadź dane nowego psa ===");

            result.SetData(Toolbox.InputString("Podaj imie psa :", false),
                           Toolbox.InputInteger("Podaj wiek psa:", 0, 20),
                           TypeOfPet.NoData,
                           Toolbox.InputString("Gatunek psa :", false),
                           Toolbox.InputString("Rasa psa :", false)
                           );

            return(result);
        }
Esempio n. 3
0
        public static Person CreatePerson()
        {
            var result = new Person();

            Console.WriteLine("=== Wprowadź dane nowej osoby ===");

            result.SetData(Toolbox.InputString("Podaj imie:", false),
                           Toolbox.InputString("Podaj nazwisko:", false),
                           Toolbox.InputInteger("Podaj wiek", 0, 120),
                           Toolbox.InputEmail("Podaj email: "));

            result.Address.SetData(Toolbox.InputString("Podaj ulice:", false),
                                   Toolbox.InputString("Podaj miasto:", false),
                                   Toolbox.InputString("Podaj kod pocztowy:", false),
                                   Toolbox.InputInteger("Podaj nr domu:", 1, int.MaxValue));

            return(result);
        }
Esempio n. 4
0
 public Person(TypesGender gender, string name, string surname, string age, string email) : this()
 {
     this.Gender = gender;
     this.SetData(Toolbox.InputString(name, false), Toolbox.InputString(surname, false), Toolbox.InputInteger(age, 0, 99), Toolbox.InputEmail(email));
     this.Address = new Address();
 }