Beispiel #1
0
        static void SearchForName()
        {
            string search;

            Console.Write("Unesite termin za pretragu (mora sadrzati najmanje 3 slova) > ");
            search = Console.ReadLine();
            if ((search == "") || (search.Length < 3))
            {
                return;
            }
            List <string> searchResults = new List <string>();
            List <string> listOfNames   = FileManagement.Read();

            foreach (string name in listOfNames)
            {
                if (name.ToUpper().Contains(search.ToUpper()))
                {
                    searchResults.Add(name);
                }
            }
            DisplayNames(searchResults);
        }
Beispiel #2
0
        static void AddNewName()
        {
            string firstName, lastName, address, phone, choice;

            do
            {
                Console.Write("Unesite ime > ");
                firstName = Console.ReadLine();
                Console.Write("Unesite prezime > ");
                lastName = Console.ReadLine();
                Console.Write("Unesite adresu > ");
                address = Console.ReadLine();
                Console.Write("Unesite telefon > ");
                phone = Console.ReadLine();

                FileManagement.Store(firstName, lastName, address, phone);

                Console.WriteLine("\nDa li zelite unos nove osobe? Ukoliko zelite, otkucajte slovo 'Y' i ENTER, ili samo ENTER ukoliko zelite da prekinete.");
                choice = Console.ReadLine();
                Console.WriteLine("");
            } while (choice.ToUpper() == "Y");
        }
Beispiel #3
0
 static void ListNames()
 {
     Console.Clear();
     DisplayNames(FileManagement.Read());
 }