public IActionResult Update() { if (!_sessionService.IsAuthenticated()) { return(RedirectToAction("Register", "Company")); } return(View(_sessionService.User().Company)); }
// 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())); }
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)); }