Ejemplo n.º 1
0
        private void btnGrabar_Click(object sender, EventArgs e)
        {
            Funcion funcion = new Funcion();

            funcion.IdPelicula = Convert.ToInt32(cboPelicula.SelectedValue);
            funcion.IdSala     = Convert.ToInt32(cboSala.SelectedValue);
            funcion.IdIdioma   = Convert.ToInt32(cboIdioma.SelectedValue);
            funcion.FechaProy  = fechaYHora();

            if (funcion.FechaProy < Pelicula.ConsultarFechaHasta(funcion.IdPelicula) && funcion.FechaProy >= Pelicula.ConsultarFechaDesde(funcion.IdPelicula))
            {
                string mensaje = Funcion.Agregar(funcion);
                MessageBox.Show(mensaje);
            }
            else
            {
                MessageBox.Show("Fecha de funcion fuera del rango aceptado.");
            }
        }