private void delete_Click(object sender, EventArgs e)
        {
            string titlu = titluT.Text;

            FilmService film = new FilmService();

            film.deleteFilm(titlu);
        }
        private void update_Click(object sender, EventArgs e)
        {
            string titlu      = titluT.Text;
            string premiera   = premieraT.Text;
            int    nrBilete   = int.Parse(BileteT.Text);
            string dataFinala = finalT.Text;
            String ora        = difuzareT.Text;

            FilmService film = new FilmService();

            film.updateFilm(titlu, premiera, nrBilete, dataFinala, ora);
        }
        public Boolean addTicket(string titlu, int rand, int loc, string data)
        {
            FilmService f  = new FilmService();
            int         id = ticketDAO.findIDFilm(titlu);

            if (validateTicket(titlu, rand, loc))
            {
                ticketDAO.insertTicket(id, rand, loc, data);
                f.updateBilete(titlu, f.getNrBilete(titlu) - 1);
                return(true);
            }
            return(false);
        }
        public Boolean validateTicket(string titlu, int rand, int loc)
        {
            List <Ticket> tickets  = ticketDAO.viewTickets();
            FilmService   f        = new FilmService();
            int           nrBilete = f.getNrBilete(titlu);

            foreach (Ticket t in tickets)
            {
                if ((rand == t.getRand()) && (loc == t.getLoc()) && (nrBilete != 0))
                {
                    return(false);
                }
            }

            return(true);
        }
        private void read_Click(object sender, EventArgs e)
        {
            FilmService f     = new FilmService();
            List <Film> films = f.viewFilm();
            DataTable   dt    = new DataTable();

            dt.Columns.Add("Titlu", typeof(string));
            dt.Columns.Add("Regia", typeof(string));
            dt.Columns.Add("Distributia", typeof(string));
            dt.Columns.Add("Premiera", typeof(string));
            dt.Columns.Add("nrBilete", typeof(string));
            dt.Columns.Add("dataFinala", typeof(string));
            dt.Columns.Add("ora", typeof(string));

            foreach (Film f1 in films)
            {
                dt.Rows.Add(new object[] { f1.getTitlu(), f1.getRegia(), f1.getDistributia(), f1.getPremiera(), f1.getBilete(), f1.getDatafinala(), f1.getOra() });
            }

            tabel.DataSource = dt;
        }