public bool Update(Teacher teacher) { bool Result = false; using (var Repository = WayuuRepositoryFactory.GetWayuuRepository()) { Result = Repository.Update(teacher); } return(Result); }
public bool Update(School school) { bool Result = false; using (var Repository = WayuuRepositoryFactory.GetWayuuRepository()) { Result = Repository.Update(school); } return(Result); }
public bool Update(Student studentData) { bool Result = false; using (var Repository = WayuuRepositoryFactory.GetWayuuRepository()) { Result = Repository.Update(studentData); } return(Result); }
public bool Update(Course course) { bool Result = false; using (var Repository = WayuuRepositoryFactory.GetWayuuRepository()) { Result = Repository.Update(course); } return(Result); }
public bool Delete(int studentId) { bool Result = false; using (var Repository = WayuuRepositoryFactory.GetWayuuRepository()) { Result = Repository.Delete(new Student { Id = studentId }); } return(Result); }
public bool Delete(int id) { bool Result = false; using (var Repository = WayuuRepositoryFactory.GetWayuuRepository()) { Result = Repository.Delete(new Teacher { Id = id }); } return(Result); }
public bool Delete(int courseId) { bool Result = false; using (var Repository = WayuuRepositoryFactory.GetWayuuRepository()) { Result = Repository.Delete(new School { Id = courseId }); } return(Result); }
public Course RetrieveById(int courseId) { Course Result = null; if (courseId > 0) { using (var Repository = WayuuRepositoryFactory.GetWayuuRepository()) { Result = Repository.RetrieveById <Course>(courseId); } } return(Result); }
public School RetrieveById(int id) { School Result = null; if (id > 0) { using (var Repository = WayuuRepositoryFactory.GetWayuuRepository()) { Result = Repository.RetrieveById <School>(id); } } return(Result); }
public Student RetrieveById(int studentId) { Student Result = null; if (studentId > 0) { using (var Repository = WayuuRepositoryFactory.GetWayuuRepository()) { Result = Repository.RetrieveById <Student>(studentId); } } return(Result); }
public Teacher RetrieveById(int id) { Teacher Result = null; if (id > 0) { using (var Repository = WayuuRepositoryFactory.GetWayuuRepository()) { Result = Repository.RetrieveById <Teacher>(id); } } return(Result); }
public Course Create(Course course) { if (!string.IsNullOrWhiteSpace(course.Name)) { using (var Repository = WayuuRepositoryFactory.GetWayuuRepository()) { course = Repository.Create(course); } } else { course = null; } return(course); }
public School Create(School school) { if (!string.IsNullOrWhiteSpace(school.Name)) { using (var Repository = WayuuRepositoryFactory.GetWayuuRepository()) { school = Repository.Create(school); } } else { school = null; } return(school); }
public Student Create(Student student) { if (!string.IsNullOrWhiteSpace(student.Name)) { using (var Repository = WayuuRepositoryFactory.GetWayuuRepository()) { student = Repository.Create(student); } } else { student = null; } return(student); }
public Teacher Create(Teacher teacher) { if (!string.IsNullOrWhiteSpace(teacher.Name)) { using (var Repository = WayuuRepositoryFactory.GetWayuuRepository()) { teacher = Repository.Create(teacher); } } else { teacher = null; } return(teacher); }
public bool DeleteWithLog(int courseId) { bool Result = false; using (var Repository = WayuuRepositoryFactory.GetWayuuRepository(true)) { Repository.Delete(new Course { Id = courseId }); Log Log = new Log { Type = LogType.DeleteCourse, Message = $"ID: {courseId}" }; Repository.Create(Log); Result = Repository.SaveChanges() == 2; } return(Result); }
public List <Course> GetAll() { return(WayuuRepositoryFactory .GetWayuuRepository() .GetAll <Course>()); }
public List <School> GetAll() { return(WayuuRepositoryFactory .GetWayuuRepository() .GetAll <School>()); }
public List <Student> GetAll() { return(WayuuRepositoryFactory .GetWayuuRepository() .GetAll <Student>()); }
public List <Teacher> GetAll() { return(WayuuRepositoryFactory .GetWayuuRepository() .GetAll <Teacher>()); }
public List <Log> GetAll() { return(WayuuRepositoryFactory .GetWayuuRepository() .GetAll <Log>()); }