Ejemplo n.º 1
0
 public void Run()
 {
     var operations = new Operations();
     bool exit = false;
     while(!exit)
     {
         Console.Clear();
         CWMenu();
         exit = Select(operations);
         Console.ReadKey();
     }
 }
Ejemplo n.º 2
0
        public bool Select(Operations operations)
        {
            string userEnter = Console.ReadLine();
            switch (userEnter)
            {
                case INSERT:
                    operations.Insert();
                    Console.WriteLine("Press any key to continue...");
                    return false;

                case SHOWALL:
                    operations.Show();
                    Console.WriteLine("Press any key to continue...");
                    return false;

                case FINDBYNAME:
                    operations.FindByName();
                    Console.WriteLine("Press any key to continue...");
                    return false;

                case FINDBYID:
                    operations.FindById();
                    Console.WriteLine("Press any key to continue...");
                    return false;

                case UPDATE:
                    operations.Update();
                    Console.WriteLine("Press any key to continue...");
                    return false;

                case DELETE:
                    operations.Delete();
                    Console.WriteLine("Press any key to continue...");
                    return false;

                case TXT:
                    operations.SaveTxt();
                    Console.WriteLine("Press any key to continue...");
                    return false;

                case EXIT:
                    Console.WriteLine("Press any key to exit...");
                    return true;

                default:
                    Console.WriteLine("Invalid operation...");
                    return false;
            }
        }