Esempio n. 1
0
 public Collection <Contact> addNew(Collection <Contact> pb, string name, string surname, string phone, string email)
 {
     if (name.Trim() != "" && surname.Trim() != "")
     {
         pb.Add(new Contact(name, surname, phone, email));
         sr.serialisation(pb);
         Console.WriteLine("Added!");
     }
     else
     {
         Console.WriteLine("Name and surname can't be empty!!!");
     }
     return(pb);
 }
Esempio n. 2
0
        static void Main()
        {
            program m  = new program();
            serial  sr = new serial();
            // Uncoment if .dat file is empty
            Collection <Contact> startPb = new Collection <Contact>();

            startPb.Add(new Contact("Ilya", "Bondar", "12312412532", "asdasd@gmail,com"));
            sr.serialisation(startPb);
            m.consoleUI();
        }