Exemplo n.º 1
0
 public bool Delete(int lessonId, int teacherId)
 {
     using (var _dbContext = new simpleDbContext())
     {
         _dbContext.LessonsInfo.Remove(Get(lessonId, teacherId));
         return(_dbContext.SaveChanges() > 0);
     }
 }
Exemplo n.º 2
0
 public bool Update(LessonsInfo entity)
 {
     using (var _dbContext = new simpleDbContext())
     {
         _dbContext.LessonsInfo.AddOrUpdate(entity);
         return(_dbContext.SaveChanges() > 0);
     }
 }
Exemplo n.º 3
0
 public bool Update(Teachers entity)
 {
     using (var _dbContext = new simpleDbContext())
     {
         _dbContext.Teachers.AddOrUpdate(entity);
         return(_dbContext.SaveChanges() > 0);
     }
 }
Exemplo n.º 4
0
 public bool Delete(int id)
 {
     using (var _dbContext = new simpleDbContext())
     {
         _dbContext.Teachers.Remove(Get(id));
         return(_dbContext.SaveChanges() > 0);
     }
 }
Exemplo n.º 5
0
 public LessonsInfo Create(LessonsInfo entity)
 {
     using (var _dbContext = new simpleDbContext())
     {
         _dbContext.LessonsInfo.Add(entity);
         _dbContext.SaveChanges();
         return(entity);
     }
 }
Exemplo n.º 6
0
 public Teachers Create(Teachers entity)
 {
     using (var _dbContext = new simpleDbContext())
     {
         _dbContext.Teachers.Add(entity);
         _dbContext.SaveChanges();
         return(entity);
     }
 }
 public Students Create(Students entity)
 {
     using (var _dbContext = new simpleDbContext())
     {
         _dbContext.Students.Add(entity);
         _dbContext.SaveChanges();
         return(entity);
     }
 }