public static DataTable cui(string textobuscar) { DAlumno Obj = new DAlumno(); Obj.TextoBuscar = textobuscar; return(Obj.cui(Obj)); }
public static DataTable ApellidoEditar(string textobuscar) { DAlumno Obj = new DAlumno(); Obj.TextoBuscar = textobuscar; return(Obj.ApellidoEditar(Obj)); }
public ActionResult Create(Persona p) { try { // TODO: Add insert logic here string carreraCombo = Request.Form["Carreras"].ToString(); string grupoCombo = Request.Form["Grupos"].ToString(); string sexoCombo = Request.Form["Generos"].ToString(); p.sexo = (sexoCombo.Equals("Masculino")) ? 'H' : 'M'; //asignamos el valor dependiendo del genero Alumno a = new Alumno(); a.idCarrera = DCarrera.ObtenerIdCarreraPNombre(carreraCombo); System.Diagnostics.Debug.WriteLine("ID ALUMNO " + a.idAlumno); System.Diagnostics.Debug.WriteLine("ID CARRERA " + a.idCarrera); a.idGrupo = DGrupo.ObtenerIdGrupoPNombre(grupoCombo); a.Persona = p; System.Diagnostics.Debug.WriteLine(DAlumno.InsertarAlumno(a)); return(RedirectToAction("Index")); } catch (Exception e) { System.Diagnostics.Debug.WriteLine(e.StackTrace); LlenarViewBagCmb(); return(View()); } }
public ActionResult Edit(Persona persona, FormCollection collection) { try { // TODO: Add update logic here string password = Convert.ToString(collection["password"]); string carreraCombo = Request.Form["Carreras"].ToString(); string grupoCombo = Request.Form["Grupos"].ToString(); string sexoCombo = Request.Form["Generos"].ToString(); persona.sexo = (sexoCombo.Equals("Masculino")) ? 'H' : 'M'; //asignamos el valor dependiendo del genero Alumno a = new Alumno(); a.idCarrera = DCarrera.ObtenerIdCarreraPNombre(carreraCombo); a.idGrupo = DGrupo.ObtenerIdGrupoPNombre(grupoCombo); a.idAlumno = Convert.ToInt32(collection["idAlumno"]); a.Persona = persona; System.Diagnostics.Debug.WriteLine(DAlumno.AcutalizarAlumno(a, password)); return(RedirectToAction("Index")); } catch (Exception e) { return(RedirectToAction("Index")); } }
public ActionResult Edit(int id) { string genero = ""; int idCarrera; int idGrupo; DataTable dt = DAlumno.ObtenerAlumno(id); if (dt.Rows.Count == 1) { Persona persona = new Persona(); persona.nombre = Convert.ToString(dt.Rows[0][0].ToString()); persona.apPaterno = Convert.ToString(dt.Rows[0][1].ToString()); persona.apMaterno = Convert.ToString(dt.Rows[0][2].ToString()); persona.direccion = Convert.ToString(dt.Rows[0][3].ToString()); persona.codigoPostal = Convert.ToInt32(dt.Rows[0][4].ToString()); persona.telefono = Convert.ToString(dt.Rows[0][5].ToString()); genero = Convert.ToString(dt.Rows[0][6].ToString()); idCarrera = Convert.ToInt32(dt.Rows[0][7].ToString()); idGrupo = Convert.ToInt32(dt.Rows[0][8].ToString()); DataTable dtCarrera = DCarrera.ObtenerCarreraPorId(idCarrera); DataTable dtGrupo = DGrupo.ObtenerGrupoPorId(idGrupo); string _genero = (genero.Equals("H")) ? "Masculino" : "Femenino"; string nombreCarrera = Convert.ToString(dtCarrera.Rows[0][2]); string nombreGrupo = Convert.ToString(dtGrupo.Rows[0][2]);; ViewBag.genero = _genero; ViewBag.idAlumno = Convert.ToString(dt.Rows[0][9].ToString()); ViewBag.nombreCarrera = nombreCarrera; ViewBag.nombreGrupo = nombreGrupo; ViewBag.password = Convert.ToString(dt.Rows[0][10].ToString()); LlenarViewBagCmb(); // este viewbag llenara el dropdown (combobox) return(View(persona)); } else { return(RedirectToAction("Index")); } }
public static string Insertar(string codigo_alumno, string cui, string nombre1, string nombre2, string nombre3, string apellido1, string apellido2, string apellido3, DateTime fecha_nac, string sexo, string direccion, int id_municipio, string telefono, byte[] foto, int id_encargado, string Estado) { DAlumno Obj = new DAlumno(); Obj.Codigo_Alumno = codigo_alumno; Obj.CUI = cui; Obj.Nombre1 = nombre1; Obj.Nombre2 = nombre2; Obj.Nombre3 = nombre3; Obj.Apellido1 = apellido1; Obj.Apellido2 = apellido2; Obj.Apellido3 = apellido3; Obj.Fecha_Nac = fecha_nac; Obj.Sexo = sexo; Obj.Direccion = direccion; Obj.Id_Municipio = id_municipio; Obj.Telefono = telefono; Obj.Foto = foto; Obj.Id_Encargado = id_encargado; Obj.Estado = Estado; return(Obj.Insertar(Obj)); }
public SP_GE_ListarAlumnoById_Result ListarAlumno_BL(int idAlumno) { oDAlumno = new DAlumno(); return(oDAlumno.ListarAlumno_DAL(idAlumno)); }
// GET: Alumno public ActionResult Index() { DataTable dt = DAlumno.ListarAlumnos(); return(View(dt)); }