Example #1
0
        private void btnCUE_Click(object sender, EventArgs e)
        {
            DataTable tabla = new DataTable();

            if (string.IsNullOrEmpty(txtCUE.Text))
            {
                MessageBox.Show("Ingrese un CUE");
                txtCUE.Focus();
                return;
            }
            tabla = new DConectar().consultarRegistroManualmente(txtCUE.Text);

            if (tabla != null)
            {
                if (tabla.Rows.Count > 0)
                {
                    RegistrarAsistencia reg = new RegistrarAsistencia(tabla);
                    reg.ShowDialog();
                }
                else
                {
                    MessageBox.Show("CUE no encontrado");
                }
            }
            else
            {
                MessageBox.Show("CUE no encontrado");
            }
        }
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            if ((string.IsNullOrEmpty(txtCue.Text)) || (string.IsNullOrEmpty(txtNombre.Text)) || (string.IsNullOrEmpty(txtApellido.Text)) || (string.IsNullOrEmpty(txtDni.Text)))
            {
                MessageBox.Show("Todos los campos (menos mail) son obligatorios");
                return;
            }

            string resul = new DConectar().InsertarPersona(txtApellido.Text, txtNombre.Text, txtDni.Text, txtMail.Text, chkDocente.Checked, id);

            if (resul.Equals("ok"))
            {
                MessageBox.Show("La persona fue registrada correctamente");
                this.Dispose();
            }
            else
            {
                MessageBox.Show("Error al registrar a la persona");
            }
        }
Example #3
0
        private void dgvTotal_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            string    cue   = dgvTotal.CurrentRow.Cells["RowCue"].Value.ToString();
            DataTable tabla = new DConectar().consultarRegistroManualmente(cue);

            if (tabla != null)
            {
                if (tabla.Rows.Count > 0)
                {
                    RegistrarAsistencia reg = new RegistrarAsistencia(tabla);
                    reg.ShowDialog();
                }
                else
                {
                    MessageBox.Show("CUE no encontrado");
                }
            }
            else
            {
                MessageBox.Show("CUE no encontrado");
            }
        }
        private void btnRegistrar_Click(object sender, EventArgs e)
        {
            List <string> lista = new List <string>();

            for (int i = 0; i < dgvInscriptos.RowCount; i++)
            {
                if ((bool)dgvInscriptos.Rows[i].Cells["chk"].Value == true)
                {
                    lista.Add(dgvInscriptos.Rows[i].Cells["RowId"].Value.ToString());
                }
            }
            string resul = new DConectar().Insertar(lista);

            if (resul.Equals("ok"))
            {
                MessageBox.Show("Alumnos registrados correctamente", "Registro OK", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Dispose();
            }
            else
            {
                MessageBox.Show("Se produjo un error al guardar el registro", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtCue.Text))
            {
                MessageBox.Show("Ingrese un CUE");
                txtCue.Focus();
                return;
            }
            DataTable tabla = new DataTable();

            tabla = new DConectar().obtenerDatosCole(txtCue.Text);

            if (tabla.Rows.Count > 0)
            {
                id             = tabla.Rows[0][0].ToString();
                lblNombre.Text = tabla.Rows[0][1].ToString();
            }
            else
            {
                MessageBox.Show("No se encontraron colegios con ese CUE. Verifique que cumpla con el formato 140111100");
                txtCue.Focus();
            }
        }