public Plan GetOne(int ID) { using (var context = new AcademiaContext()) { return(context.Planes.Include("Especialidad").FirstOrDefault(x => x.ID == ID)); } }
public List <Comision> GetAll() { using (var context = new AcademiaContext()) { return(context.Comisiones.Include("Plan").ToList()); } }
public List <AlumnoInscripcion> GetAllInscripciones() { using (var context = new AcademiaContext()) { return(context.AlumnoInscripciones.Include("Alumno").Include("Curso").ToList()); } }
public List <DocenteCurso> ListByDocente(Persona docente) { using (var context = new AcademiaContext()) { return(context.DocenteCurso.Where(d => d.Docente.ID == docente.ID).Include("Curso").Include("Docente").ToList()); } }
public List <Plan> GetAll() { using (var context = new AcademiaContext()) { return(context.Plan.Include("Especialidad").ToList()); } }
protected void Update(Curso entity) { using (var context = new AcademiaContext()) { if (isRepeated(entity)) { throw new Exception("Repeated entity"); } entity.Materia.Plan = null; var local = context.Set <Materia>() .Local .FirstOrDefault(f => f.ID == entity.Materia.ID); if (local != null) { context.Entry(local).State = EntityState.Detached; } context.Entry(entity.Materia).State = System.Data.Entity.EntityState.Unchanged; entity = context.Curso.Attach(entity); entity.Comision = context.Comision.Attach(entity.Comision); entity.Materia = context.Materia.Attach(entity.Materia); var entry = context.Entry(entity); // Gets the entry for entity inside context entry.State = EntityState.Modified; context.SaveChanges(); } }
public Business.Entities.DocenteCurso GetOne(int ID) { using (var context = new AcademiaContext()) { return(context.DocenteCurso.Include("Docente").Include("Curso").Where(i => i.ID == ID).First()); } }
protected bool isRepeated(AlumnoInscripto alumno) { using (var context = new AcademiaContext()) { return(context.AlumnoInscripto.Count(a => a.ID != alumno.ID && a.Curso.ID == alumno.Curso.ID && a.Alumno.ID == alumno.Alumno.ID) > 0); } }
public Business.Entities.Comision GetOne(int ID) { using (var context = new AcademiaContext()) { return(context.Comision.Include("Plan").Where(i => i.ID == ID).First()); } }
public List <AlumnoInscripto> ListByCursoAndNoNota(Curso curso) { using (var context = new AcademiaContext()) { return(context.AlumnoInscripto.Where(a => a.Curso.ID == curso.ID && a.Nota == 0).Include("Alumno").Include("Curso").ToList()); } }
public Business.Entities.AlumnoInscripto GetOne(int ID) { using (var context = new AcademiaContext()) { return(context.AlumnoInscripto.Include("Alumno").Include("Curso").Where(i => i.ID == ID).First()); } }
public List <AlumnoInscripto> ListByAlumno(Persona alumno) { using (var context = new AcademiaContext()) { return(context.AlumnoInscripto.Where(a => a.Alumno.ID == alumno.ID).Include("Alumno").Include("Curso").ToList()); } }
public List <AlumnoInscripto> ListByCursoAndCondicion(Curso curso, AlumnoInscripto.Condiciones[] condiciones) { using (var context = new AcademiaContext()) { return(context.AlumnoInscripto.Where(a => a.Curso.ID == curso.ID && condiciones.Any(c => a.Condicion == c)).Include("Alumno").Include("Curso").ToList()); } }
public bool AlumnoIsInCurso(Persona alumno, Curso curso) { using (var context = new AcademiaContext()) { return(context.AlumnoInscripto.Count(a => a.Curso.ID == curso.ID && a.Alumno.ID == alumno.ID) == 1); } }
public List <Persona> GetAll() { using (var context = new AcademiaContext()) { return(context.Persona.ToList()); } }
protected bool isRepeated(Curso curso) { using (var context = new AcademiaContext()) { return(context.Curso.Count(a => a.ID != curso.ID && a.Materia.ID == curso.Materia.ID && a.Comision.ID == curso.Comision.ID && a.AñoCalendario == curso.AñoCalendario) > 0); } }
public Business.Entities.Persona GetOne(int ID) { using (var context = new AcademiaContext()) { return(context.Persona.Where(i => i.ID == ID).First()); } }
public List <DocenteCurso> GetAll() { using (var context = new AcademiaContext()) { return(context.DocenteCurso.Include("Docente").Include("Curso").ToList()); } }
public Persona FindByLegajo(int legajo) { using (var context = new AcademiaContext()) { return(context.Persona.Where(i => i.Legajo == legajo).FirstOrDefault()); } }
public List <DocenteCurso> ListByCurso(Curso curso) { using (var context = new AcademiaContext()) { return(context.DocenteCurso.Where(d => d.Curso.ID == curso.ID).Include("Docente").Include("Curso").ToList()); } }
public List <Curso> GetAll() { using (var context = new AcademiaContext()) { return(context.Curso.Include("Comision").Include("Materia").ToList()); } }
protected bool isRepeated(DocenteCurso docente) { using (var context = new AcademiaContext()) { return(context.DocenteCurso.Count(a => a.ID != docente.ID && a.Curso.ID == docente.Curso.ID && a.Docente.ID == docente.Docente.ID) > 0); } }
public List <Curso> ListByAño(int año) { using (var context = new AcademiaContext()) { return(context.Curso.Where(c => c.AñoCalendario == año).Include("Comision").Include("Materia").ToList()); } }
public Business.Entities.Plan GetOne(int ID) { using (var context = new AcademiaContext()) { return(context.Plan.Include("Especialidad").Where(i => i.ID == ID).First()); } }
public Business.Entities.Curso GetOne(int ID) { using (var context = new AcademiaContext()) { return(context.Curso.Include("Comision").Include("Materia").Where(i => i.ID == ID).First()); } }
public Comision GetOne(int ID) { using (var context = new AcademiaContext()) { return(context.Comisiones.Include("Plan").FirstOrDefault(x => x.ID == ID)); } }
public int CantInscriptos(Curso curso) { using (var context = new AcademiaContext()) { return(context.AlumnoInscripto.Count(a => a.Curso.ID == curso.ID)); } }
public List <Usuario> GetAll() { using (var context = new AcademiaContext()) { return(context.Database.SqlQuery <Usuario>("UsuarioGetAll").ToList()); } }
public List <Especialidad> GetAll() { using (var context = new AcademiaContext()) { return(context.Especialidades.Include("Planes").ToList()); } }