Exemplo n.º 1
0
 public IQueryable <Tower> GetAll(string emailId)
 {
     if (AnraCommon.IsAdmin(emailId, _context) || string.IsNullOrEmpty(emailId))
     {
         return(_context.Towers);
     }
     else
     {
         return(_context.Towers.Where(p => p.UserId == _context.Users.FirstOrDefault(a => a.Email == emailId).Id));
     }
 }
Exemplo n.º 2
0
 public IQueryable <Organization> GetAll(string emailId)
 {
     if (AnraCommon.IsAdmin(emailId, _context) || string.IsNullOrEmpty(emailId))
     {
         return(_context.Organizations);
     }
     else
     {
         return(_context.Organizations.Where(o => o.OrganizationId == _context.Users.FirstOrDefault(u => u.Email == emailId).OrganizationId));
     }
 }
Exemplo n.º 3
0
 public IQueryable <Incident> GetAll(string EmailId)
 {
     if (AnraCommon.IsAdmin(EmailId, _context) || string.IsNullOrEmpty(EmailId))
     {
         return(_context.Incidents);
     }
     else
     {
         return(_context.Incidents.Where(p => p.OrganizationId == _context.Users.Where(a => a.Email == EmailId).FirstOrDefault().OrganizationId));
     }
 }