Exemple #1
0
 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());
     }
 }
Exemple #3
0
 public List <AlumnoInscripcion> GetAllInscripciones()
 {
     using (var context = new AcademiaContext())
     {
         return(context.AlumnoInscripciones.Include("Alumno").Include("Curso").ToList());
     }
 }
Exemple #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());
     }
 }
Exemple #5
0
 public List <Plan> GetAll()
 {
     using (var context = new AcademiaContext())
     {
         return(context.Plan.Include("Especialidad").ToList());
     }
 }
Exemple #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();
     }
 }
Exemple #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());
     }
 }
Exemple #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);
     }
 }
Exemple #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());
     }
 }
Exemple #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());
     }
 }
Exemple #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());
     }
 }
Exemple #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());
     }
 }
Exemple #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());
     }
 }
Exemple #14
0

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