예제 #1
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);
        }
예제 #2
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();
 }