TourIAm/TIAMSharedUI/Pages/User/Hotels/HotelAdmin.razor

49 lines
1.0 KiB
Plaintext

@page "/user/hoteladmin/{id}"
@using TIAMSharedUI.Shared
@using TIAMWebApp.Shared.Application.Interfaces;
@layout AdminLayout
@inject IUserDataService UserDataService
@inject ISessionService SessionService
<PageTitle>HotelAdmin</PageTitle>
<div class="text-center m-5">
<h1>Dashboard</h1>
<h2 style="font-size:small">Have a nice day!</h2>
</div>
<!--We need to check if the user is owner of a swerviceprovider-->
<div class="container">
<HotelComponent Id="@id"></HotelComponent>
<!-- Stats admin-->
<hr />
</div>
@code {
[Parameter] public Guid id { get; set; }
bool isUserLoggedIn;
int userType = 0;
protected override void OnInitialized()
{
//check if Id matches with userproductmapping
if (!SessionService.IsAuthenticated)
{
return;
}
var check = SessionService.User.UserModelDto.UserProductMappings.Any(x => x.ProductId == id);
if (!check)
{
return;
}
base.OnInitialized();
}
}