public static List <Sessao> GetByIdTatuagem(int idTatuagem, Connection conn, SQLiteTransaction transaction) { using (var dao = new SessaoDAO(conn)) { return(dao.GetByIdTatuagem(idTatuagem, transaction)); } }
public bool SetById(int id, Connection conn, SQLiteTransaction transaction) { using (var dao = new SessaoDAO(conn)) { return(dao.SetById(this, id, transaction)); } }
public void MarcarComoPaga(Connection conn, SQLiteTransaction transaction) { using (var dao = new SessaoDAO(conn)) { dao.MarcarComoPaga(this, transaction); } }
public static DateTime?GetDataSessaoOfLastByIdTatuagem(int idTatuagem, Connection conn, SQLiteTransaction transaction) { using (var dao = new SessaoDAO(conn)) { return(dao.GetDataSessaoOfLastByIdTatuagem(idTatuagem, transaction)); } }
public void Remover(Connection conn, SQLiteTransaction transaction) { using (var dao = new SessaoDAO(conn)) { dao.Remove(this, transaction); } }
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; }
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); } }
//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); } }
//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); }
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); } } }
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); }
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); }
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(""); } }
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); } }
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); } }