public Section GetSection(int SectionId) { using (var db = new LibarysystemDBcontext()) { return(db.Sections.Where(x => x.SectionId == SectionId).FirstOrDefault()); } }
public List <Program> GetPrograms() { using (var db = new LibarysystemDBcontext()) { return(db.Programs.ToList()); } }
public Person GetUser(string username, string password) { using (var db = new LibarysystemDBcontext()) { return(db.Persons.Where(x => x.Username == username && x.Password == password).FirstOrDefault()); } }
public Employee GetEmployee(int PersId) { using (var db = new LibarysystemDBcontext()) { return(db.Persons.OfType <Employee>().Where(x => x.PersonId == PersId).FirstOrDefault()); } }
public UnitOfWork(LibarysystemDBcontext libarysystemDBcontext) { _context = libarysystemDBcontext; activities = new ActivitiesRepository(_context); alumnus = new AlumnusRepository(_context); program = new ProgramRepository(_context); section = new SectionRepository(_context); employee = new EmployeeRepository(_context); person = new PersonRepository(_context); }
public bool IsAlumnus(Person currentUser) { using (var db = new LibarysystemDBcontext()) { if (db.Persons.OfType <Alumnus>().ToList().Where(x => x.PersonId == currentUser.PersonId).FirstOrDefault() != null) { return(true); } else { return(false); } } }
public AlumnusRepository(LibarysystemDBcontext libarysystemDBcontext) : base(libarysystemDBcontext) { }
public EmployeeRepository(LibarysystemDBcontext libarysystemDBcontext) : base(libarysystemDBcontext) { }
public BusinessManager() { libary = new LibarysystemDBcontext(); UnitOfWork = new UnitOfWork(libary); }
public GenericRepository(LibarysystemDBcontext libarysystemDBcontext) { LibarysystemDBcontext = libarysystemDBcontext; }
public SectionRepository(LibarysystemDBcontext libarysystemDBcontext) : base(libarysystemDBcontext) { }
public ProgramRepository(LibarysystemDBcontext libarysystemDBcontext) : base(libarysystemDBcontext) { }
public PersonRepository(LibarysystemDBcontext libarysystemDBcontext) : base(libarysystemDBcontext) { }
public ActivitiesRepository(LibarysystemDBcontext libarysystemDBcontext) : base(libarysystemDBcontext) { }