Ejemplo n.º 1
0
        public void MultipleTrainerInput()
        {
            bool valid = true;

            do
            {
                TrainerDataCapture trainerCapture = new TrainerDataCapture();
                trainers           trainer        = trainerCapture.Capture();

                using (privateschoolEntities dbContex = new privateschoolEntities())
                {
                    dbContex.trainers.Add(trainer);
                    dbContex.SaveChanges();
                }
                Console.WriteLine();
                Music.EndBeep();
                Console.ForegroundColor = ConsoleColor.Cyan;
                Console.WriteLine("TRAINER HAS BEEN CREATED");
                Console.ForegroundColor = ConsoleColor.Yellow;
                Console.WriteLine("Do you want to create another Trainer?  Press 'NO' or 'no' to exit.");
                Console.WriteLine("Type anything else to continue creating another Trainer");
                Console.ForegroundColor = ConsoleColor.White;
                string value = Console.ReadLine();


                if (value == "NO" || value == "No" || value == "no")
                {
                    valid = false;
                }
            } while (valid);
        }
Ejemplo n.º 2
0
 public InputTrainer()
 {
     Trainer = new trainers();
 }
 public void Show(trainers trainer)
 {
     Console.WriteLine($"{trainer.firstname,-15 } | {trainer.lastname,-20} | {trainer.subject,-30} |");
 }