Exemple #1
0
        static void Main(string[] args)
        {
            stocareDate.CitireFisier("date.txt", medList);

            bool close = true;

            while (close)
            {
                Console.WriteLine("\nMenu\n" +
                                  "1)Adauga medicament\n" +
                                  "2)Editare Medicament\n" +
                                  "3)Sterge medicament\n" +
                                  "4)Cauta medicament\n" +
                                  "5)Afisare medicamente\n" +
                                  "6)Exit\n\n");
                Console.Write("Alegeti optiunea:");

                int option = int.Parse(Console.ReadLine());

                if (option == 1)
                {
                    AdaugareMed();
                }
                else if (option == 2)
                {
                    EditareMed();
                }
                else if (option == 3)
                {
                    StergereMed();
                }
                else if (option == 4)
                {
                    CautareMed();
                }
                else if (option == 5)
                {
                    AfisareMed();
                }
                else if (option == 6)
                {
                    Console.WriteLine("Exit");
                    close = false;
                    break;
                }
                else
                {
                    Console.WriteLine("Optiunea invalida!");
                }
            }

            stocareDate.ScrieFisier("output.txt", medList);
        }