示例#1
0
        private void GetByIdOperation()
        {
            long id = -1;

            while (id < 0)
            {
                id = view.EnterId();
            }
            switch (view.entity)
            {
            case Entity.Pupil:
                List <Pupil> pupils = new List <Pupil>()
                {
                    pupilDAO.Get(id)
                };
                view.PrintPupils(pupils);
                break;

            case Entity.Teacher:
                List <Teacher> teachers = new List <Teacher>()
                {
                    teacherDAO.Get(id)
                };
                view.PrintTeachers(teachers);
                break;
            }
        }
示例#2
0
        private void GetByIdOperation()
        {
            long id = -1;

            while (id < 0)
            {
                id = view.EnterId();
            }
            switch (view.entity)
            {
            case Entity.Ticket:
                List <Ticket> tickets = new List <Ticket>()
                {
                    ticketDAO.Get(id)
                };
                view.PrintTicket(tickets);
                break;

            case Entity.Seance:
                List <Seance> seances = new List <Seance>()
                {
                    seanceDAO.Get(id)
                };
                view.PrintSeances(seances);
                break;

            case Entity.Movie:
                List <Movie> movies = new List <Movie>()
                {
                    movieDAO.Get(id)
                };
                view.PrintMovies(movies);
                break;
            }
        }
        private void GetOperation()
        {
            int id = -1;

            while (id < 0)
            {
                id = view.EnterId();
            }
            switch (view.entity)
            {
            case Entity.Room:
                List <Room> r_table = new List <Room>()
                {
                    roomDAO.Get(id)
                };
                view.PrintTable(view.Rooms_table(r_table));
                break;

            case Entity.Guest:
                List <Guest> g_table = new List <Guest>()
                {
                    guestDAO.Get(id)
                };
                view.PrintTable(view.Guests_table(g_table));
                break;

            case Entity.Booking:
                List <Booking> b_table = new List <Booking>()
                {
                    bookingDAO.Get(id)
                };
                view.PrintTable(view.Booking_table(b_table));
                break;
            }
            view.Success();
        }