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