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 Register(ESTUDIANTE model) { try { using (var ctx = new AdminContext()) { ctx.Entry(model).State = System.Data.Entity.EntityState.Added; return(ctx.SaveChanges()); } } catch (Exception) { throw; } }
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; } }
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; } }
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; } }