Пример #1
0
 public static List <Sessao> GetByIdTatuagem(int idTatuagem, Connection conn, SQLiteTransaction transaction)
 {
     using (var dao = new SessaoDAO(conn))
     {
         return(dao.GetByIdTatuagem(idTatuagem, transaction));
     }
 }
Пример #2
0
 public bool SetById(int id, Connection conn, SQLiteTransaction transaction)
 {
     using (var dao = new SessaoDAO(conn))
     {
         return(dao.SetById(this, id, transaction));
     }
 }
Пример #3
0
 public void MarcarComoPaga(Connection conn, SQLiteTransaction transaction)
 {
     using (var dao = new SessaoDAO(conn))
     {
         dao.MarcarComoPaga(this, transaction);
     }
 }
Пример #4
0
 public static DateTime?GetDataSessaoOfLastByIdTatuagem(int idTatuagem, Connection conn, SQLiteTransaction transaction)
 {
     using (var dao = new SessaoDAO(conn))
     {
         return(dao.GetDataSessaoOfLastByIdTatuagem(idTatuagem, transaction));
     }
 }
Пример #5
0
 public void Remover(Connection conn, SQLiteTransaction transaction)
 {
     using (var dao = new SessaoDAO(conn))
     {
         dao.Remove(this, transaction);
     }
 }
Пример #6
0
        private void FormRelatorioSessao_Load(object sender, EventArgs e)
        {
            SessaoDAO        dao    = new SessaoDAO();
            List <Sessão>    list   = dao.ListAll();
            RelatorioSessões report = new RelatorioSessões();

            report.SetDataSource(list);
            crystalReportViewer1.ReportSource = report;
        }
Пример #7
0
        private void GetSessao(Sala sa)
        {
            SessaoDAO     dao = new SessaoDAO();
            List <Sessão> s   = dao.FindBySala(sa.Id);

            foreach (Sessão se in s)
            {
                sa.AddSessao(se);
            }
        }
Пример #8
0
        //Esvazia a lista de sessões dos filmes
        private void CleanList(Filme f)
        {
            SessaoDAO     DAO     = new SessaoDAO();
            List <Sessão> sessoes = DAO.FindByFilme(f.Id);

            foreach (Sessão s in sessoes)
            {
                f.RmvSessao(s);
            }
        }
Пример #9
0
        //Abre a Janela de vender ingressos
        private void btnProximoS_Click(object sender, EventArgs e)
        {
            SessaoDAO DAo = new SessaoDAO();

            pnSessões.Visible = false;
            pnFilmes.Visible  = true;
            Sessão         s = DAo.Read(int.Parse(dgvSessoes.CurrentRow.Cells[0].Value.ToString()));
            VenderIngresso V = new VenderIngresso(s);

            V.StartPosition = FormStartPosition.CenterParent;
            V.ShowDialog(this);
        }
Пример #10
0
 public void Salvar(Connection conn, SQLiteTransaction transaction)
 {
     using (var dao = new SessaoDAO(conn))
     {
         if (Id == 0)
         {
             dao.Insert(this, transaction);
         }
         else
         {
             dao.Update(this, transaction);
         }
     }
 }
Пример #11
0
        private void ListaSessoes_Load(object sender, EventArgs e)
        {
            dtSessoes = SessaoDAO.Selecionar();
            listaSessoes.dgvLista.DataSource        = dtSessoes;
            listaSessoes.dgvLista.CellContentClick += new DataGridViewCellEventHandler(dgvLista_CellContentClick);

            var exibir = new DataGridViewButtonColumn();

            exibir.Text       = "Exibir";
            exibir.HeaderText = "Exibir";
            exibir.Name       = "clmEditar";
            exibir.UseColumnTextForButtonValue = true;
            listaSessoes.dgvLista.Columns.Add(exibir);
        }
Пример #12
0
        private void FrmEditar_Load(object sender, EventArgs e)
        {
            dtSessoes = SessaoDAO.Selecionar("Id", "IdCinema", "IdFilme", "Hora_Inicial", "Hora_Final", "Data");

            sessoes = new List <Sessao>();

            for (int i = 0; i < dtSessoes.Rows.Count; i++)
            {
                Sessao s = new Sessao();
                s.Id          = int.Parse(dtSessoes.Rows[i]["Id"].ToString());
                s.IdCinema    = dtSessoes.Rows[i]["IdCinema"].ToString();
                s.IdFilme     = int.Parse(dtSessoes.Rows[i]["IdFilme"].ToString());
                s.HoraInicial = DateTime.Parse(dtSessoes.Rows[i]["Hora_Inicial"].ToString());
                s.HoraFinal   = DateTime.Parse(dtSessoes.Rows[i]["Hora_final"].ToString());
                s.Data        = DateTime.Parse(dtSessoes.Rows[i]["Data"].ToString());
                sessoes.Add(s);
            }

            var id = listaSessoes.dgvLista.SelectedCells[0];

            Sessao sessao = sessoes.Single(s => s.Id == int.Parse(id.Value.ToString()));

            frmEditar.dtpData.Text        = sessao.Data.ToString();
            frmEditar.mtbHoraInicial.Text = sessao.HoraInicial.ToString();
            frmEditar.mtbHoraFinal.Text   = sessao.HoraFinal.ToString();
            frmEditar.tboCinema.Text      = sessao.IdCinema;
            frmEditar.tboFilme.Text       = sessao.IdFilme.ToString();

            frmEditar.dtpData.Enabled        = false;
            frmEditar.mtbHoraInicial.Enabled = false;
            frmEditar.mtbHoraFinal.Enabled   = false;
            frmEditar.tboCinema.Enabled      = false;
            frmEditar.tboFilme.Enabled       = false;
            frmEditar.btnFilme.Enabled       = false;
            frmEditar.btnCinema.Enabled      = false;
            frmEditar.btnSalvar.Enabled      = false;
            frmEditar.btnSalvar.Size         = new Size(94, 23);
            frmEditar.btnSalvar.Location     = new Point(345, 186);

            frmEditar.btnCancelar.Location = new Point(100, 186);
            frmEditar.btnCancelar.Size     = new Size(94, 23);

            Button btnEditar = new Button();

            btnEditar.Location = new Point(240, 186);
            btnEditar.Size     = new Size(94, 23);
            btnEditar.Text     = "Editar";
            btnEditar.Click   += BtnEditar_Click;
            frmEditar.Controls.Add(btnEditar);
        }
Пример #13
0
        private void btnExcluir_Click(object sender, EventArgs e)
        {
            Filme         f    = DAO.Read(int.Parse(dgvFilmes.CurrentRow.Cells[0].Value.ToString()));
            SessaoDAO     daos = new SessaoDAO();
            List <Sessão> list = daos.FindByFilme(f.Id);

            if (list.Count > 0)
            {
                MessageBox.Show("Impossivel apagar Filme,pois existem sesões em andamento ", "Inconsistencia", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                DAO.Delete(f.Id);
                LoadDatabase();
                Fill("");
            }
        }
Пример #14
0
        private void btnSalvar_Click(object sender, EventArgs e)
        {
            try
            {
                Sessao sessao = new Sessao();
                sessao.Data        = dtpData.Value.Date;
                sessao.HoraInicial = DateTime.Parse(mtbHoraInicial.Text);
                sessao.HoraFinal   = DateTime.Parse(mtbHoraFinal.Text);
                sessao.IdCinema    = cinemas.Single(c => c.Nome == tboCinema.Text).Id;
                sessao.IdFilme     = filmes.Single(c => c.Titulo == tboFilme.Text).Id;
                sessao.IdSala      = cboSala.SelectedItem.ToString();

                SessaoDAO.Inserir(sessao);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Erro: " + ex.Message);
            }
        }
Пример #15
0
        private void updateSessões(Sala s)
        {
            int       newValor = 0;
            SessaoDAO dao      = new SessaoDAO();

            foreach (Sessão a in s.GetList())
            {
                newValor = a.LugaresDisponiveis - s.QtddLugares;
                Console.WriteLine(newValor);
                if (newValor < 0)
                {
                    a.LugaresDisponiveis = newValor * -1;
                }
                else
                {
                    a.LugaresDisponiveis = newValor;
                }

                dao.Update(a);
            }
        }