Beispiel #1
0
 public Section GetSection(int SectionId)
 {
     using (var db = new LibarysystemDBcontext())
     {
         return(db.Sections.Where(x => x.SectionId == SectionId).FirstOrDefault());
     }
 }
Beispiel #2
0
 public List <Program> GetPrograms()
 {
     using (var db = new LibarysystemDBcontext())
     {
         return(db.Programs.ToList());
     }
 }
Beispiel #3
0
 public Person GetUser(string username, string password)
 {
     using (var db = new LibarysystemDBcontext())
     {
         return(db.Persons.Where(x => x.Username == username && x.Password == password).FirstOrDefault());
     }
 }
Beispiel #4
0
 public Employee GetEmployee(int PersId)
 {
     using (var db = new LibarysystemDBcontext())
     {
         return(db.Persons.OfType <Employee>().Where(x => x.PersonId == PersId).FirstOrDefault());
     }
 }
Beispiel #5
0
 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);
 }
Beispiel #6
0
        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);
                }
            }
        }
Beispiel #7
0
 public AlumnusRepository(LibarysystemDBcontext libarysystemDBcontext) : base(libarysystemDBcontext)
 {
 }
 public EmployeeRepository(LibarysystemDBcontext libarysystemDBcontext) : base(libarysystemDBcontext)
 {
 }
Beispiel #9
0
 public BusinessManager()
 {
     libary     = new LibarysystemDBcontext();
     UnitOfWork = new UnitOfWork(libary);
 }
 public GenericRepository(LibarysystemDBcontext libarysystemDBcontext)
 {
     LibarysystemDBcontext = libarysystemDBcontext;
 }
Beispiel #11
0
 public SectionRepository(LibarysystemDBcontext libarysystemDBcontext) : base(libarysystemDBcontext)
 {
 }
Beispiel #12
0
 public ProgramRepository(LibarysystemDBcontext libarysystemDBcontext) : base(libarysystemDBcontext)
 {
 }
Beispiel #13
0
 public PersonRepository(LibarysystemDBcontext libarysystemDBcontext) : base(libarysystemDBcontext)
 {
 }
Beispiel #14
0
 public ActivitiesRepository(LibarysystemDBcontext libarysystemDBcontext) : base(libarysystemDBcontext)
 {
 }