Exemplo n.º 1
0
        // GET: CompanyUsers
        public async Task <IActionResult> Index()
        {
            if (!_sessionService.IsAuthenticated())
            {
                return(RedirectToAction("Register", "Company"));
            }
            var appDbContext = _context.CompanyUsers
                               .Include(c => c.Company)
                               .Where(x => x.CompanyId == _sessionService.User().CompanyId);

            return(View(await appDbContext.ToListAsync()));
        }
Exemplo n.º 2
0
 public IActionResult Update()
 {
     if (!_sessionService.IsAuthenticated())
     {
         return(RedirectToAction("Register", "Company"));
     }
     return(View(_sessionService.User().Company));
 }
Exemplo n.º 3
0
        public IActionResult Index()
        {
            if (!_sessionService.IsAuthenticated())
            {
                return(RedirectToAction("Register", "Company"));
            }
            var bookings = _db.ServiceBookings
                           .Include(x => x.User)
                           .Include(x => x.Service)
                           .Where(x => x.Service.CompanyId == _sessionService.User().CompanyId)
                           .OrderByDescending(x => x.Id)
                           .ToList();

            return(View(bookings));
        }