예제 #1
0
 public Plan GetOne(int ID)
 {
     using (var context = new AcademiaContext())
     {
         return(context.Planes.Include("Especialidad").FirstOrDefault(x => x.ID == ID));
     }
 }
예제 #2
0
 public List <Comision> GetAll()
 {
     using (var context = new AcademiaContext())
     {
         return(context.Comisiones.Include("Plan").ToList());
     }
 }
예제 #3
0
 public List <AlumnoInscripcion> GetAllInscripciones()
 {
     using (var context = new AcademiaContext())
     {
         return(context.AlumnoInscripciones.Include("Alumno").Include("Curso").ToList());
     }
 }
예제 #4
0
 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());
     }
 }
예제 #5
0
 public List <Plan> GetAll()
 {
     using (var context = new AcademiaContext())
     {
         return(context.Plan.Include("Especialidad").ToList());
     }
 }
예제 #6
0
 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();
     }
 }
예제 #7
0
 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());
     }
 }
예제 #8
0
 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);
     }
 }
예제 #9
0
 public Business.Entities.Comision GetOne(int ID)
 {
     using (var context = new AcademiaContext())
     {
         return(context.Comision.Include("Plan").Where(i => i.ID == ID).First());
     }
 }
예제 #10
0
 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());
     }
 }
예제 #11
0
 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());
     }
 }
예제 #12
0
 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());
     }
 }
예제 #13
0
 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());
     }
 }
예제 #14
0

        
예제 #15
0
 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);
     }
 }
예제 #16
0
 public List <Persona> GetAll()
 {
     using (var context = new AcademiaContext())
     {
         return(context.Persona.ToList());
     }
 }
예제 #17
0
 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);
     }
 }
예제 #18
0
 public Business.Entities.Persona GetOne(int ID)
 {
     using (var context = new AcademiaContext())
     {
         return(context.Persona.Where(i => i.ID == ID).First());
     }
 }
예제 #19
0
 public List <DocenteCurso> GetAll()
 {
     using (var context = new AcademiaContext())
     {
         return(context.DocenteCurso.Include("Docente").Include("Curso").ToList());
     }
 }
예제 #20
0
 public Persona FindByLegajo(int legajo)
 {
     using (var context = new AcademiaContext())
     {
         return(context.Persona.Where(i => i.Legajo == legajo).FirstOrDefault());
     }
 }
예제 #21
0
 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());
     }
 }
예제 #22
0
 public List <Curso> GetAll()
 {
     using (var context = new AcademiaContext())
     {
         return(context.Curso.Include("Comision").Include("Materia").ToList());
     }
 }
예제 #23
0
 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);
     }
 }
예제 #24
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());
     }
 }
예제 #25
0
 public Business.Entities.Plan GetOne(int ID)
 {
     using (var context = new AcademiaContext())
     {
         return(context.Plan.Include("Especialidad").Where(i => i.ID == ID).First());
     }
 }
예제 #26
0
 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());
     }
 }
예제 #27
0
 public Comision GetOne(int ID)
 {
     using (var context = new AcademiaContext())
     {
         return(context.Comisiones.Include("Plan").FirstOrDefault(x => x.ID == ID));
     }
 }
예제 #28
0
 public int CantInscriptos(Curso curso)
 {
     using (var context = new AcademiaContext())
     {
         return(context.AlumnoInscripto.Count(a => a.Curso.ID == curso.ID));
     }
 }
예제 #29
0
 public List <Usuario> GetAll()
 {
     using (var context = new AcademiaContext())
     {
         return(context.Database.SqlQuery <Usuario>("UsuarioGetAll").ToList());
     }
 }
예제 #30
0
 public List <Especialidad> GetAll()
 {
     using (var context = new AcademiaContext())
     {
         return(context.Especialidades.Include("Planes").ToList());
     }
 }