Exemplo n.º 1
0
 public object Register(ESTUDIANTE model)
 {
     try
     {
         using (var ctx = new AdminContext())
         {
             ctx.Entry(model).State = System.Data.Entity.EntityState.Added;
             return(ctx.SaveChanges());
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemplo n.º 2
0
 public object Delete(ESTUDIANTE model)
 {
     try
     {
         using (var ctx = new AdminContext())
         {
             var entry = ctx.Estudiantes.Where(e => e.ID == model.ID).First();
             ctx.Entry(entry).State = System.Data.Entity.EntityState.Deleted;
             return(ctx.SaveChanges());
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemplo n.º 3
0
 public object Delete(PROFESOR model)
 {
     try
     {
         using (var ctx = new AdminContext())
         {
             var entry = ctx.Profesores.Where(e => e.ID == model.ID).First();
             ctx.Entry(entry).State = System.Data.Entity.EntityState.Deleted;
             var ctxs = ctx.SaveChanges();
             return(ctx.SaveChanges());
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
        public object Modify(CURSOESTUDIANTE model)
        {
            try
            {
                using (var ctx = new AdminContext())
                {
                    var entry = ctx.CursosEstudiantes.Where(e => e.ID == model.ID).First();
                    entry.CALIFICACION = model.CALIFICACION;

                    ctx.Entry(entry).State = System.Data.Entity.EntityState.Modified;
                    return(ctx.SaveChanges());
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemplo n.º 5
0
 public object Modify(PROFESOR model)
 {
     try
     {
         using (var ctx = new AdminContext())
         {
             var entry = ctx.Profesores.Where(e => e.ID == model.ID).First();
             entry.NOMBRE           = model.NOMBRE;
             entry.APELLIDOS        = model.APELLIDOS;
             entry.DIRECCION        = model.DIRECCION;
             entry.SALARIO          = model.SALARIO;
             entry.TIENEPLAZA       = model.TIENEPLAZA;
             ctx.Entry(entry).State = System.Data.Entity.EntityState.Modified;
             return(ctx.SaveChanges());
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemplo n.º 6
0
 public StudentDAO()
 {
     queryCtx = new AdminContext();
 }
Exemplo n.º 7
0
 public TeacherDAO()
 {
     queryCtx = new AdminContext();
 }