public void Start()
        {
            while (true)
            {
                while (true)
                {
                    Entity entity = view.EntitiesMenu();
                    if (entity == Entity.Null)
                    {
                        break;
                    }
                    else if (entity != Entity.Exception)
                    {
                        while (true)
                        {
                            int operation = view.OperationsMenu();
                            if (operation == 0)
                            {
                                break;
                            }
                            try
                            {
                                switch ((Operation)operation)
                                {
                                case Operation.Add:
                                    AddOperation();
                                    break;

                                case Operation.Get:
                                    GetOperation();
                                    break;

                                case Operation.GetAll:
                                    GetAllOperation();
                                    break;

                                case Operation.Update:
                                    UpdateOperation();
                                    break;

                                case Operation.Delete:
                                    DeleteOperation();
                                    break;

                                case Operation.Search:
                                    SearchBookingOperation();
                                    break;
                                }
                            }
                            catch (Exception e)
                            {
                                view.Error(e.Message.ToString());
                            }
                            view.Wait();
                        }
                    }
                }
            }
        }
Пример #2
0
        public void Start()
        {
            while (true)
            {
                int mode = view.MainMenu();
                if (mode == 0)
                {
                    break;
                }
                else if (mode == 2)
                {
                    FullTextSearch();
                    view.Wait();
                }
                else if (mode == 3)
                {
                    SearchTicketOperation();
                    view.Wait();
                }
                else if (mode == 1)
                {
                    while (true)
                    {
                        Entity entity = view.EntitiesMenu();
                        if (entity == Entity.Null)
                        {
                            break;
                        }
                        else if (entity != Entity.Exception)
                        {
                            while (true)
                            {
                                int operation = view.OperationsMenu();
                                if (operation == 0)
                                {
                                    break;
                                }
                                try
                                {
                                    switch ((Operation)operation)
                                    {
                                    case Operation.Add:
                                        AddOperation();
                                        break;

                                    case Operation.GetById:
                                        GetByIdOperation();
                                        break;

                                    case Operation.GetAll:
                                        GetListOperation();
                                        break;

                                    case Operation.Update:
                                        UpdateOperation();
                                        break;

                                    case Operation.Delete:
                                        DeleteOperation();
                                        break;
                                    }
                                }
                                catch (Exception e)
                                {
                                    view.Error(e.Message.ToString());
                                }
                                if (operation != 2)
                                {
                                    view.Wait();
                                }
                            }
                        }
                    }
                }
            }
        }