private void btnconsultartodo_Click(object sender, EventArgs e) { CapaNegocio.Promociones Promociones = new CapaNegocio.Promociones(); DataTable dtPromociones = new DataTable(); dtPromociones = Promociones.BuscarPromociones(); dtgpromociones.DataSource = dtPromociones; }
private void btnconsultar_Click(object sender, EventArgs e) { CapaNegocio.Promociones Promociones = new CapaNegocio.Promociones(); DataTable dtPromociones = new DataTable(); dtPromociones = Promociones.buscarPromocion(Int32.Parse(txtidpromo.Text)); dtgpromociones.DataSource = dtPromociones; }
private void btnactualizar_Click(object sender, EventArgs e) { CapaNegocio.Promociones Promociones = new CapaNegocio.Promociones(); if (Promociones.actualizarPromociones(Int32.Parse(txtidpromo.Text), txtnombre.Text, Int32.Parse(txtidpelicula.Text), txtrestriciones.Text, txtfechaini.Text, txtfechafin.Text, txtdescripcion.Text)) { MessageBox.Show("Promocion modificada correctamente"); Limpiar(); } else { MessageBox.Show("Error Desconocido"); } }
private void btnborar_Click(object sender, EventArgs e) { CapaNegocio.Promociones Promociones = new CapaNegocio.Promociones(); try { Promociones.eliminarPromociones(Int32.Parse(txtidpromo.Text)); MessageBox.Show("Promocion Eliminada"); Limpiar(); } catch { MessageBox.Show("Error Desconocido"); } }
private void btnagregar_Click(object sender, EventArgs e) { CapaNegocio.Promociones Cartelera = new CapaNegocio.Promociones(); try { Cartelera.insertarPromociones(Int32.Parse(txtidpromo.Text), txtnombre.Text, Int32.Parse(txtidpelicula.Text), txtrestriciones.Text, txtfechaini.Text, txtfechafin.Text, txtdescripcion.Text); MessageBox.Show("Promoción agregada correctamente"); Limpiar(); } catch (Exception ex) { MessageBox.Show("Error Desconocido"); Limpiar(); } }