Exemple #1
0
        private void btnAgregar_Click_1(object sender, EventArgs e)
        {
            try
            {
                if (txtPaterno.Text == "" || txtMaterno.Text == "" || txtNombre.Text == "" || txtCurp.Text == "" ||
                    txtTelefono.Text == "" || txtExt.Text == "" || txtInt.Text == "" || txtCP.Text == "" ||
                    txtCalle.Text == "" || cbLocalidad.Text == "" || txtMatricula.Text == "" || cbCarrera.Text == ""
                    )
                {
                    MessageBox.Show("No puede ingresar Alumno, aún faltan datos por completar", "Datos incompletos",
                                    MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
                else
                {
                    CN_Personas _CN_Personas = new CN_Personas();
                    _CN_Personas.AgregarPersonas(txtPaterno.Text, txtMaterno.Text, txtNombre.Text, dtpFechaNac.Value,
                                                 cbSexo.SelectedIndex.ToString(), txtCurp.Text, txtTelefono.Text, txtExt.Text, txtInt.Text, txtCP.Text,
                                                 cbEdoCivil.SelectedIndex.ToString(), cbDiscapacidad.SelectedIndex.ToString(), txtCalle.Text,
                                                 cbLocalidad.SelectedValue.ToString());
                    IDPersona = _CN_Personas.ultimoID();

                    _CN_Alumnos.agregar_alumno(txtMatricula.Text, IDPersona, Convert.ToInt32(cbCarrera.SelectedValue.ToString()),
                                               IDProfesor, Convert.ToInt32(cbEspecialidad.SelectedValue.ToString()),
                                               Convert.ToInt32(cbEstatus.SelectedIndex));
                    mostrar_alumnos();
                    limpiar();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #2
0
 private void btnAgregar_Click(object sender, EventArgs e)
 {
     if (txtPaterno.Text == "" || txtMaterno.Text == "" || txtNombre.Text == "" || dtpFechaNac.Text == "" || cbSexo.Text == "" || txtCurp.Text == "" ||
         txtTelefono.Text == "" || txtExt.Text == "" || txtInt.Text == "" || txtCP.Text == "" || cbEdoCivil.Text == "" || cbDiscapacidad.Text == "" || txtCalle.Text == "" ||
         cbLocalidad.Text == "")
     {
         MessageBox.Show("No puede ingresar un empleado, aún faltan datos por completar", "Datos incompletos",
                         MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
     else
     {
         CN_Personas   _CN_Personas   = new CN_Personas();
         CN_Profesores _CN_Profesores = new CN_Profesores();
         _CN_Personas.AgregarPersonas(txtPaterno.Text, txtMaterno.Text, txtNombre.Text, dtpFechaNac.Value,
                                      cbSexo.SelectedIndex.ToString(), txtCurp.Text, txtTelefono.Text, txtExt.Text, txtInt.Text, txtCP.Text,
                                      cbEdoCivil.SelectedIndex.ToString(), cbDiscapacidad.SelectedIndex.ToString(), txtCalle.Text,
                                      cbLocalidad.SelectedValue.ToString());
         IDPersona = _CN_Personas.ultimoID();
         _CN_Empleados.Agregarempleados(IDPersona.ToString(), cbEmpleo.SelectedValue.ToString());
         IDEmpleado = _CN_Empleados.UltimoID();
         _CN_Profesores.AgregarProfesores(txtIDProfesor.Text, IDEmpleado.ToString(), cbAcademia.SelectedValue.ToString(),
                                          cbTipoMemb.SelectedIndex.ToString());
         MostrarEmpleados();
         limpiar();
     }
 }
Exemple #3
0
        private void btnAgregar_Click(object sender, EventArgs e)
        {
            CN_Personas _CN_Personas = new CN_Personas();

            _CN_Personas.AgregarPersonas(txtPaterno.Text, txtMaterno.Text, txtNombre.Text, dtpFechaNac.Value,
                                         cbSexo.SelectedIndex.ToString(), txtCurp.Text, txtTelefono.Text, txtExt.Text, txtInt.Text, txtCP.Text,
                                         cbEdoCivil.SelectedIndex.ToString(), cbDiscapacidad.SelectedIndex.ToString(), txtCalle.Text,
                                         cbLocalidad.SelectedValue.ToString());
            IDPersona = _CN_Personas.ultimoID();

            _CN_Alumnos.agregar_alumno(txtMatricula.Text, IDPersona, Convert.ToInt32(cbCarrera.SelectedValue.ToString()), IDProfesor, Convert.ToInt32(cbEspecialidad.SelectedValue.ToString()), Convert.ToInt32(cbEstatus.SelectedIndex));
            mostrar_alumnos();
            limpiar();
        }
Exemple #4
0
        private void btnAgregar_Click(object sender, EventArgs e)
        {
            CN_Personas   _CN_Personas   = new CN_Personas();
            CN_Profesores _CN_Profesores = new CN_Profesores();

            _CN_Personas.AgregarPersonas(txtPaterno.Text, txtMaterno.Text, txtNombre.Text, dtpFechaNac.Value,
                                         cbSexo.SelectedIndex.ToString(), txtCurp.Text, txtTelefono.Text, txtExt.Text, txtInt.Text, txtCP.Text,
                                         cbEdoCivil.SelectedIndex.ToString(), cbDiscapacidad.SelectedIndex.ToString(), txtCalle.Text,
                                         cbLocalidad.SelectedValue.ToString());
            IDPersona = _CN_Personas.ultimoID();
            _CN_Empleados.Agregarempleados(IDPersona.ToString(), cbEmpleo.SelectedValue.ToString());
            IDEmpleado = _CN_Empleados.UltimoID();
            _CN_Profesores.AgregarProfesores(txtIDProfesor.Text, IDEmpleado.ToString(), cbAcademia.SelectedValue.ToString(),
                                             cbTipoMemb.SelectedIndex.ToString());
            MostrarEmpleados();
        }
Exemple #5
0
        private void btnEditar_Click(object sender, EventArgs e)
        {
            var         fe           = dtpFechaNac.Value;
            var         fe2          = DateTime.Parse(fe.ToString());
            var         final        = fe2.ToShortDateString();
            CN_Personas _CN_Personas = new CN_Personas();

            IDPersona = _CN_Personas.ultimoID();

            _CN_Personas.EditarPersonas(Convert.ToString(IDPersona), txtPaterno.Text, txtMaterno.Text, txtNombre.Text,
                                        dtpFechaNac.Value, cbSexo.SelectedIndex.ToString(), txtCurp.Text, txtTelefono.Text, txtExt.Text,
                                        txtInt.Text, txtCP.Text, cbEdoCivil.SelectedIndex.ToString(), cbDiscapacidad.SelectedIndex.ToString(), txtCalle.Text, cbLocalidad.SelectedIndex.ToString());



            _CN_Alumnos.editar_alumno(txtMatricula.Text, IDPersona, Convert.ToInt32(cbCarrera.SelectedValue.ToString()), IDProfesor, Convert.ToInt32(cbEspecialidad.SelectedValue.ToString()), Convert.ToInt32(cbEstatus.SelectedIndex));
            mostrar_alumnos();
            limpiar();
        }
Exemple #6
0
        private void btnEditar_Click_1(object sender, EventArgs e)
        {
            try
            {
                if (txtPaterno.Text == "" || txtMaterno.Text == "" || txtNombre.Text == "" || txtCurp.Text == "" ||
                    txtTelefono.Text == "" || txtExt.Text == "" || txtInt.Text == "" || txtCP.Text == "" ||
                    txtCalle.Text == "" || cbLocalidad.Text == "" || txtMatricula.Text == "" || cbCarrera.Text == ""
                    )
                {
                    MessageBox.Show("No puede editar Alumno, aún faltan datos por completar", "Datos incompletos",
                                    MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
                else
                {
                    var         fe           = dtpFechaNac.Value;
                    var         fe2          = DateTime.Parse(fe.ToString());
                    var         final        = fe2.ToShortDateString();
                    CN_Personas _CN_Personas = new CN_Personas();
                    IDPersona = _CN_Personas.ultimoID();

                    IDPersona = Convert.ToInt32(dgvAlumnos.CurrentRow.Cells["idPersona"].Value.ToString());

                    _CN_Personas.EditarPersonas(Convert.ToString(IDPersona), txtPaterno.Text, txtMaterno.Text, txtNombre.Text,
                                                dtpFechaNac.Value, cbSexo.SelectedIndex.ToString(), txtCurp.Text, txtTelefono.Text, txtExt.Text,
                                                txtInt.Text, txtCP.Text, cbEdoCivil.SelectedIndex.ToString(), cbDiscapacidad.SelectedIndex.ToString(), txtCalle.Text, cbLocalidad.SelectedIndex.ToString());

                    deshabilitarEdicion();

                    _CN_Alumnos.editar_alumno(txtMatricula.Text, IDPersona, Convert.ToInt32(cbCarrera.SelectedValue.ToString()), IDProfesor, Convert.ToInt32(cbEspecialidad.SelectedValue.ToString()), Convert.ToInt32(cbEstatus.SelectedIndex));
                    mostrar_alumnos();
                    limpiar();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #7
0
        private void MostrarPersonas()
        {
            CN_Personas _CN_Personas = new CN_Personas();

            dtgPersonas.DataSource = _CN_Personas.MostrarPersonas();
        }