Пример #1
0
 private void btnGuardar_Click(object sender, RoutedEventArgs e)
 {
     ///Metodo para guardar un alumno
     ///
     try
     {
         e_alumno al = new e_alumno();
         //informacion personal
         al.nombre           = txtApellidoPaterno.Text + " " + txtApellidoMaterno.Text + " " + txtNombre.Text;
         al.sexo             = char.Parse(((ComboBoxItem)cmbSexos.SelectedItem).Tag.ToString());
         al.fecha_nacimiento = mtxtFechaNacimiento.SelectedDate.Value;
         al.id_municipio     = int.Parse(cmbMunicipios.SelectedValue.ToString());
         al.curp             = txtCurp.Text;
         al.rfc       = txtRFC.Text;
         al.direccion = txtDireccion.Text;
         al.celular   = txtCelular.Text;
         al.telefono  = txtTelefono.Text;
         al.correo    = txtCorreo.Text;
         //informacion academica
         al.cuenta        = txtCuenta.Text;
         al.cohorte       = cmbCohorte.Text;
         al.id_semestre   = int.Parse(cmb_semestre.Text);
         al.id_carrera    = int.Parse(((ComboBoxItem)cmb_carrera.SelectedItem).Tag.ToString());
         al.id_grupo      = int.Parse(cmb_grupo.Text);
         al.turno         = cmb_turno.Text;
         al.fecha_ingreso = txtFEchaIngreso.SelectedDate.Value;
         //informacion de procedencia
         al.id_prepa        = ObtenerCodigoPrepa();
         al.id_preparatoria = ObtenerCodigoPrepa();
         al.promedio_prepa  = decimal.Parse(txtPromedioPrepa.Text);
         al.ceneval         = decimal.Parse(txtPromedioCeneval.Text);
         //tutor
         al.tutor           = txtNombreTutor.Text;
         al.telefono_tutor  = txtTelefonoTutor.Text;
         al.direccion_tutor = txtDireccionTutor.Text;
         //otros
         al.seguro                = "";
         al.tipo_seguro           = "";
         al.lugar_origen          = "";
         al.desertor              = 0;
         al.baja                  = 0;
         al.rezagado              = 0;
         al.egresado              = "No";
         al.titulado              = "No";
         al.eficiencia_titulacion = "No";
         al.servicio_social       = "No";
         al.practicas             = "No";
         new cn_alumnos().Insertar(al);
         MessageBox.Show("Alumno Guardado");
         this.Close();
     }
     catch (Exception err)
     {
         MessageBox.Show("Por favor no deje campos vacios\n" + err.Message);
     }
 }
Пример #2
0
 public void Insertar(e_alumno a)
 {
     using (contexto = new DataClassesTrayectoriaDataContext())
     {
         try
         {
             contexto.insAlumno(a.cuenta, a.nombre, a.id_grupo, a.id_carrera, a.sexo, a.promedio_prepa,
                                a.ceneval, a.fecha_ingreso, a.turno, a.id_prepa, a.fecha_nacimiento, a.telefono, a.celular, a.correo, a.rfc,
                                a.curp, a.seguro, a.tipo_seguro, a.lugar_origen, a.id_municipio, a.direccion, a.tutor, a.direccion_tutor,
                                a.telefono_tutor, a.id_semestre, 0, a.cohorte);
         }
         catch (Exception ex)
         {
             throw ex;
         }
     }
 }