public UUser agregarMateria(Materia materia, string sesion, int selIdioma)////aqui { UUser user = new UUser(); DMReg datos = new DMReg(); UIdioma encId = new UIdioma(); LMIdioma idioma = new LMIdioma(); Int32 FORMULARIO = 10; Materia mat = new Materia(); DMSeguridad dmseg = new DMSeguridad(); MEncMateria mencmateria = new MEncMateria(); encId = idioma.obtIdioma(FORMULARIO, selIdioma); user.Mensaje = " "; bool ok = datos.validaMateria(materia); if (ok == true) { materia.sesion = sesion; materia.ultima_modificacion = DateTime.Now.ToShortDateString(); datos.insertarMateria(materia, sesion); //this.Page.Response.Write("<script language='JavaScript'>window.alert('Materia Insertada con Exito');</script>"); user.Mensaje = encId.CompIdioma["L_Error_falta_materia"].ToString(); //"Materia Insertada con Exito"; mencmateria.nombre_materia_nuevo = materia.nombre_materia; mencmateria.sesion_nuevo = materia.sesion; dmseg.fiel_auditoria_agrega_materia("INSERT", sesion, mencmateria); } else { user.Mensaje = encId.CompIdioma["L_Error_materia_ya_esta"].ToString(); //"La Materia ya se encuentra en nuestra Base de Datos"; } return(user); }
public UUser subirNota(string alumno, string materia, string curso, string nota1, string nota2, string nota3, int selIdioma, string sesion) { DMReg datos = new DMReg(); UUser enc = new UUser(); UIdioma encId = new UIdioma(); Nota not = new Nota(); LMIdioma idioma = new LMIdioma(); DMSeguridad dmseg = new DMSeguridad(); MEncNota mencnota = new MEncNota(); Int32 FORMULARIO = 39; encId = idioma.obtIdioma(FORMULARIO, selIdioma); enc.Mensaje = " "; if (alumno == "0" || materia == "0" || curso == "0") { enc.Mensaje = encId.CompIdioma["L_Falta_Selec"].ToString(); //"Falta seleccionar"; } else { enc.Id_estudiante = alumno; enc.Materia = materia; enc.Curso = curso; List <Nota> registros = datos.obtenerNota(enc); //DataTable registros = datos.obtenerNota(enc); foreach (Nota no in registros) { enc.IdNota = no.id_nota.ToString(); not.id_nota = no.id_nota; } Double n1 = Convert.ToDouble(nota1); Double n2 = Convert.ToDouble(nota2); Double n3 = Convert.ToDouble(nota3); Double nd = (n1 + n2 + n3) / 3.0; enc.Nota1 = n1.ToString(); enc.Nota2 = n2.ToString(); enc.Nota3 = n3.ToString(); enc.Notadef = nd.ToString(); not.nota1 = n1; not.nota2 = n2; not.nota3 = n3; not.notadef = nd; datos.insertarNota(not); mencnota.nota1_nuevo = not.nota1.ToString(); mencnota.nota2_nuevo = not.nota2.ToString(); mencnota.nota3_nuevo = nota3.ToString(); mencnota.notadef_nuevo = not.notadef.ToString(); dmseg.fiel_auditoria_registro_nota("INSERT", sesion, mencnota); } return(enc); }
public UUser insertObservacion(string id, string observacion, string sesion) { DMReg datos = new DMReg(); UUser enc = new UUser(); Observador obd = new Observador(); DMSeguridad dmseg = new DMSeguridad(); MEnsObservador mencob = new MEnsObservador(); enc.Id_estudiante = id; enc.Observacion = observacion; datos.insertarObservacion(enc); mencob.id_estudiante_nuevo = int.Parse(id); mencob.observacion_nuevo = observacion; dmseg.fiel_auditoria_agrega_orservador("INSERT", sesion, mencob); return(enc); }
public UUser agregarEstudianteACurso(string anio, string curso, string sesion, int cont, GridView GridView1, int selIdioma) { DMUser datos = new DMUser(); UUser enc = new UUser(); DMReg mreg = new DMReg(); UIdioma encId = new UIdioma(); LMIdioma idioma = new LMIdioma(); DMSeguridad dmseg = new DMSeguridad(); MEncEstCurso mencest = new MEncEstCurso(); Int32 FORMULARIO = 9; encId = idioma.obtIdioma(FORMULARIO, selIdioma); enc.Mensaje = ""; enc.MensajeAcudiente = ""; if (anio == "0" || curso == "0") { enc.Mensaje = encId.CompIdioma["L_ErrorUsuario_aceptar"].ToString(); //"Debe Elegir un Curso"; } else { for (int i = 0; i < cont; i++) { CheckBox ch = (CheckBox)GridView1.Rows[i].FindControl("CBest"); Label lb = (Label)GridView1.Rows[i].FindControl("label1"); if (ch.Checked == true) { enc.Documento = lb.Text; //DataTable reg = datos.obtenerUsuarioMod(enc); enc = datos.obtenerUsuarioMod(enc); enc.Id_estudiante = enc.IdUsua; enc.Curso = curso; EstudianteCurso ecur = new EstudianteCurso(); ecur.id_ec_curso = int.Parse(curso); ecur.id_ec_estudiante = int.Parse(enc.Id_estudiante); mreg.insertarEstudianteCurso(ecur); List <Materia> materias = mreg.obtener_MatCur(enc); foreach (Materia m in materias) { enc.Materia = m.id_materia.ToString(); mreg.insertarNotaMateria(enc); } //int n = materias.DefaultView.Count; //for (int k = 0; k < n; k++) //{ // enc.Materia = materias.Rows[k]["id_materia"].ToString(); // mreg.insertarNotaMateria(enc); //} //L_ErrorUsuario.Text = "Debe Elegir un Curso"; enc.MensajeAcudiente = encId.CompIdioma["L_OkUsuario_aceptar"].ToString(); //"Estudiantes Agregados al curso"; mencest.id_ec_estudiante_nuevo = ecur.id_ec_estudiante; mencest.id_ec_curso_nuevo = ecur.id_ec_curso; dmseg.fiel_auditoria_agrega_estudiantes_curso("INSERT", sesion, mencest); } } } return(enc); }