private void Add()
        {
            Person person = new Person();         
            Console.WriteLine("\n\rWprowadź dane nowej osoby.\n\r");
            Console.WriteLine("Podaj imię: ");
            person.Imie = Console.ReadLine();
            Console.WriteLine("Podaj nazwisko: ");
            person.Nazwisko = Console.ReadLine();
            Console.WriteLine("Podaj wiek: ");
            person.Wiek = int.Parse(Console.ReadLine());         
            Console.WriteLine("Podaj pesel: ");
            try
            {
                person.Pesel = Console.ReadLine();
            }
            catch (Exception ex)
            {
                Console.WriteLine("Użytkownik nie zostanie dodany do bazy. Powód: {0}", ex.Message);
                return;
            }

            try
            {
                _storage.AddPerson(person);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
        public static bool PersonNotEmpty(Person person)
        {
            bool result = false;

            if ((person.Imie != null) && (person.Nazwisko != null) && (person.Wiek != 0) && (person.Pesel !=null))
            {
                result =true;
            }
            return result;
        }
 public void AddPerson(Person person)
 {
     if (File.Exists(path))
     {
         List<Person> people = GetAllPersons();
         people.Add(person);
         XMLSerializer.Serialization(people, path);                
     }
     else
     {
         List<Person> people = new List<Person>();
         people.Add(person);
         XMLSerializer.Serialization(people, path);
     }
 }
 public List<Zadanie1Piotrek.PersonManager.Person> GetAllPersons()
 {
     List<Zadanie1Piotrek.PersonManager.Person> people = new List<Zadanie1Piotrek.PersonManager.Person>();
     
     using (DatabaseEntities context = new DatabaseEntities())
     {
         var dbList = context.People.ToList();
         foreach (var i in dbList)
         {
             Zadanie1Piotrek.PersonManager.Person person = new Zadanie1Piotrek.PersonManager.Person();
             person.Imie = i.FirstName;
             person.Nazwisko = i.LastName;
             person.Wiek = i.Age;
             person.Pesel = i.Pesel;
             people.Add(person);
         }
     }
     return people;
 }
 public void AddPerson(Person person)
 {         
     people.Add(person);            
 }