private void btnSiguienteEncargado_Click(object sender, EventArgs e)
        {
            if (identidadEncargado != "")
            {
                txtIdentidad.Text = identidadEncargado;
                dbConn.llenarTextBox(txtprimerNombre, "select primerNombre from datosEncargado where identidadEncargado = '" + txtIdentidad.Text + "'");
                dbConn.llenarTextBox(txtsegundoNombre, "select segundoNombre from datosEncargado where identidadEncargado = '" + txtIdentidad.Text + "'");
                dbConn.llenarTextBox(txtprimerApellido, "select primerApellido from datosEncargado where identidadEncargado = '" + txtIdentidad.Text + "'");
                dbConn.llenarTextBox(txtsegundoApellido, "select segundoApellido from datosEncargado where identidadEncargado = '" + txtIdentidad.Text + "'");
                dbConn.llenarTextBox(txtCorreoElectronico, "select correoElectronico from datosEncargado where identidadEncargado = '" + txtIdentidad.Text + "'");
                txtfechaNacimiento.Text = dbConn.obtenerVariableDate("select fechaNacimiento from datosEncargado where identidadEncargado = '" + txtIdentidad.Text + "'").ToString("dd/MM/yyyy");
                txtprimerTelefono.Text  = dbConn.obtenerVariableString("select numeroTelefono from datosEncargado where identidadEncargado = '" + txtIdentidad.Text + "'");
                txtsegundoTelefono.Text = dbConn.obtenerVariableString("select numeroTelefonoAlt from datosEncargado where identidadEncargado = '" + txtIdentidad.Text + "'");
                dbConn.llenarTextBox(txtDireccion, "select direccionTrabajo from datosEncargado where identidadEncargado = '" + txtIdentidad.Text + "'");

                gbListadoEncargado.Visible = false;
                gbEncargados.Visible       = true;
                txtLikeIdentidad.Clear();
            }
            else
            {
                messageWarning.lblError.Text = "SELECCIONE UN ENCARGADO";
                messageWarning.ShowDialog();
            }
        }
Exemplo n.º 2
0
        public void verificarFecha()
        {
            try
            {
                DateTime ultimaFacturacion;

                if (dbConn.obtenerVariableString("SELECT CONVERT(VARCHAR(25), MAX(fechaFacturacion)) FROM detalleMensualidades") != "")
                {
                    ultimaFacturacion = dbConn.obtenerVariableDate("SELECT MAX(fechaFacturacion) FROM detalleMensualidades");

                    if (ultimaFacturacion.Month < DateTime.Now.Month && (ultimaFacturacion.Year == DateTime.Now.Year || ultimaFacturacion.Year < DateTime.Now.Year))
                    {
                        if (dbConn.PAGeneracionPagos(DateTime.Now))
                        {
                            Console.WriteLine("Pagos Mensuales Generados");
                        }
                        else
                        {
                            Console.WriteLine("Error al Facturar");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
        private void dgvHistorialPagos_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            int idMensualidad = Convert.ToInt32(dgvHistorialPagos.CurrentRow.Cells[0].Value);
            frmMostrarImagenEvidencia frmImagen = new frmMostrarImagenEvidencia();

            frmImagen.pictureBox1.Image = dbConn.obtenerImagen("SELECT comprobantePago FROM detalleMensualidades WHERE id_Estudiante = '" + txtNoIdentidadEstudiante.Text + "' " +
                                                               "AND id_Mensualidad = '" + idMensualidad + "' ");

            var fecha = dgvHistorialPagos.CurrentRow.Cells[2].Value.ToString();

            if (fecha != "")
            {
                DateTime f = dbConn.obtenerVariableDate("SELECT fechaPago FROM detalleMensualidades WHERE" + " id_Estudiante = '" + txtNoIdentidadEstudiante.Text + "' AND id_Mensualidad = '" + idMensualidad + "' ");
                frmImagen.label2.Text = "Fecha de Ingreso: " + f.ToString("dd/MM/yyyy");
            }
            else
            {
                frmImagen.label2.Text = "Fecha de Ingreso: Pendiente de Pago";
            }


            frmImagen.pictureBox1.SizeMode = PictureBoxSizeMode.Zoom;
            frmImagen.Show();
        }