private void Buscar()
        {
            cFunciones fun        = new Clases.cFunciones();
            DateTime   FechaHasta = Convert.ToDateTime(txtFechaHasta.Text);
            DateTime   FechaDesde = Convert.ToDateTime(txtFechaDesde.Text);
            cTurno     turno      = new cTurno();
            DataTable  trdo       = turno.GetTurnos(FechaDesde, FechaHasta);

            Grilla.DataSource = trdo;
            string Col = "0;15;15;10;10;25;15;10";

            fun.AnchoColumnas(Grilla, Col);
        }
        private void btnEliminar_Click(object sender, EventArgs e)
        {
            if (Grilla.CurrentRow == null)
            {
                Mensaje("Debe seleccionar un registro");
                return;
            }
            Int32  CodTurno = Convert.ToInt32(Grilla.CurrentRow.Cells[0].Value);
            cTurno turno    = new cTurno();

            turno.Borrar(CodTurno);
            Mensaje("Turno Eliminado Correctamente");
            Buscar();
        }
Esempio n. 3
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            if (txtApellido.Text == "")
            {
                Mensaje("Debe ingresar un apellido");
                return;
            }
            if (txtNombre.Text == "")
            {
                Mensaje("Debe ingresar un nombre");
                return;
            }
            if (txtPatente.Text == "")
            {
                Mensaje("Debe ingresar una patente");
                return;
            }
            cFunciones fun = new Clases.cFunciones();

            if (fun.ValidarFecha(txtFecha.Text) == false)
            {
                Mensaje("La Fecha Ingrsada es incorrecta");
                return;
            }
            string   Apellido    = txtApellido.Text;
            string   Nombre      = txtNombre.Text;
            string   Patente     = txtPatente.Text;
            string   Descripcion = txtDescripcion.Text;
            DateTime Fecha       = Convert.ToDateTime(txtFecha.Text);
            string   Telefono    = txtTelefono.Text;
            string   Hora        = txtHora.Text;
            cTurno   turno       = new cTurno();

            turno.Insertar(Apellido, Nombre, Patente, Descripcion, Fecha, Telefono, Hora);
            Mensaje("Datos grabados correctamente");
            txtApellido.Text    = "";
            txtNombre.Text      = "";
            txtPatente.Text     = "";
            txtDescripcion.Text = "";
            txtTelefono.Text    = "";
        }