private static void OutMenu(DataAccessReis Reis, CCashier Cashier)
        {
            Console.WriteLine("МЕНЮ");
            Console.WriteLine("1 - Генерация новых рейсов");
            Console.WriteLine("2 - Продать билет");
            Console.WriteLine("3 - Бронировать билет");
            Console.WriteLine("4 - Завершить бронирование билета");
            Console.WriteLine("5 - Выход");

            Console.Write("Выберите действие: ");
            string str = Console.ReadLine();
            switch (str)
            {
                case "1":
                    Reis.GenerateReises();
                    OutMenu(Reis, Cashier);
                    break;
                case "2":
                    Cashier.Sell();
                    OutMenu(Reis, Cashier);
                    break;
                case "3":
                    Cashier.Reserve();
                    OutMenu(Reis, Cashier);
                    break;
                case "4":
                    Cashier.FinishReserve();
                    OutMenu(Reis, Cashier);
                    break;
                default:
                    break;
            }
        }
 public CCashier(ref DataAccessBank bank,ref DataAccessBasicReis basicReis, ref DataAccessReis reis, ref DataAccessClients clients, ref DataAccessPlains aircrafts)
 {
     BankEntitie = bank;
     ReisEntitie = reis;
     ClientsEntitie = clients;
     BasicReisEntitie = basicReis;
     PlainsEntitie = aircrafts;
 }
        public HomeController()
        {
            //Инициализуруем и заполняем необходимые объекты
            DataAccessBank Bank = new DataAccessBank();
            DataAccessBasicReis BasicReis = new DataAccessBasicReis();
            DataAccessReis Reis = new DataAccessReis();
            DataAccessClients Clients = new DataAccessClients();
            DataAccessPlains Plains = new DataAccessPlains();

            Cashier = new CCashier(ref Bank, ref BasicReis, ref Reis, ref Clients, ref Plains);
        }
        static void Main(string[] args)
        {
            //Инициализуруем и заполняем необходимые объекты
            DataAccessBank Bank = new DataAccessBank();
            DataAccessBasicReis BasicReis = new DataAccessBasicReis();
            DataAccessReis Reis = new DataAccessReis();
            DataAccessClients Clients = new DataAccessClients();
            DataAccessPlains Plains = new DataAccessPlains();

            CCashier Cashier = new CCashier(ref Bank, ref BasicReis, ref Reis, ref Clients, ref Plains);

            OutMenu(Reis, Cashier);
        }
        public void TestReisAddGetUpdateDelete()
        {
            //Add-Get-Тест
            DateTime date = DateTime.Now;
            Reis expectedReis = new Reis();
            expectedReis.Date = date;

            DataAccessReis reis = new DataAccessReis();
            reis.AddElement(expectedReis);
            var actualReis = reis.GetAll().Last();
            Assert.AreEqual(expectedReis, actualReis);

            //Update - Тест
            expectedReis = actualReis;
            expectedReis.Date = date.AddDays(2);
            reis.UpdateElement(expectedReis);
            actualReis = reis.GetElement(expectedReis.CodeReis);
            Assert.AreEqual(expectedReis, actualReis);

            //Delete-Тест
            int expectedCount = reis.GetAll().Count() - 1;
            reis.DeleteElement(actualReis);
            int actualCount = reis.GetAll().Count();
            Assert.AreEqual(expectedCount, actualCount);
        }