Exemple #1
0
        public int AddMovie(string name)
        {
            var movie = new Movie();

            movie.Name = name;
            _movieDAO.Create(movie);
            return(movie.Id);
        }
Exemple #2
0
        private void AddOperation()
        {
            switch (view.entity)
            {
            case Entity.Movie:
                Movie m = view.MovieAddOrUpdateEnter();
                movieDAO.Create(m);
                break;

            case Entity.Seance:
                Seance s = view.SeanceAddOrUpdateEnter(movieDAO.GetList(), hallDAO.GetHalls());
                seanceDAO.Create(s);
                break;

            case Entity.Ticket:
                Ticket t       = view.TicketAddOrUpdateGetSeance(seanceDAO.GetList());
                long   hall_id = seanceDAO.Get(t.Seance_id).Hall_id;
                t = view.TicketAddOrUpdateGetSeat(hallDAO.GetSeatsInHall(hall_id), t);
                ticketDAO.Create(t);
                break;
            }
        }