diff --git a/TIAMMobileApp/wwwroot/index.html b/TIAMMobileApp/wwwroot/index.html index 6e5321e8..c242fcc1 100644 --- a/TIAMMobileApp/wwwroot/index.html +++ b/TIAMMobileApp/wwwroot/index.html @@ -40,6 +40,15 @@ return /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini|mobile/i.test(navigator.userAgent); } + diff --git a/TIAMSharedUI/Pages/TransferPage.razor b/TIAMSharedUI/Pages/TransferPage.razor index 72f6ef96..06412237 100644 --- a/TIAMSharedUI/Pages/TransferPage.razor +++ b/TIAMSharedUI/Pages/TransferPage.razor @@ -24,8 +24,150 @@
-
+ + @{ + if (displayHelp) + { +
+ +
+ +
+

+ Step 1: Choose Your Transfer Direction +

+

At the top of the form, select whether you need a transfer "To the Airport" or "From the Airport" by clicking on the corresponding tab.

+
+
+ + +
+ + +
+

+ + Step 2: Enter the Destination (or Pickup) Address + +

+

In the PickupAddress section, select your address:

+
    +
  • Preset addresses: Click on the dropdown menu under “Preset addresses” and choose an address from the list. For example, you may see options like "Széchenyi fürdő."
  • +
  • Custom address: If your address is not listed, click on the "Custom address" tab to manually enter your address.
  • +
+
+
+ + +
+ + +
+

+ Step 3: Confirm the Destination +

+

Once you select or enter the address, the form will display it as the "Selected address." Make sure this is correct before proceeding.

+
+
+ + +
+ + +
+

+ Step 4: Enter Flight Information (Optional) +

+

If applicable, fill in your FlightNumber. This is optional, so you can leave it blank if you don't have or don’t want to provide it.

+
+
+ + +
+ + +
+

+ Step 5: Specify the Number of Passengers +

+

In the NumberOfPassengers field, enter the number of people who will be traveling. The default is set to 1, but you can change it as needed.

+
+
+ + +
+ + +
+

+ Step 6: Indicate the Amount of Luggage +

+

In the NumberOfLuggage field, enter the total number of luggage items you will be bringing.

+
+
+ + +
+ + +
+

+ Step 7: Fill in Your Personal Information +

+

Under FullName, enter your first and last name in the respective fields. Provide your PhoneNumber in the designated field. The phone number appears to be pre-filled with a sample number ("+11234567890"), so be sure to update it with your actual contact number. Enter your EmailAddress to receive confirmation and any further communication regarding your transfer.

+
+
+ + +
+ + +
+

+ Step 8: Add Additional Comments (Optional) +

+

If you have any special requests or additional information you’d like to provide, use the Comment section to do so.

+
+
+ + +
+ + +
+

+ Step 9: Submit Your Request +

+

Once all fields are filled in correctly, click the Submit button at the bottom of the form to place your transfer order.

+
+
+ + +
+ + +
+

+ Step 10: Confirmation +

+ +

After submitting, you should receive a confirmation email or message. Ensure all the details are correct, and you’re all set!

+
+
+
+ } + } + +
+ + + + + + + + @@ -37,19 +179,21 @@ - @* *@ - -
+ +
+ +
- +
@@ -66,7 +210,7 @@
  • Comfortable Vehicles: Clean, modern, and well-maintained cars.
  • - +
    @@ -74,15 +218,15 @@
    -
    +

    How to Book

    Booking your airport transfer is easy! Simply visit our booking page, enter your details, and confirm your reservation. You can also contact us at info@touriam.com or call us at (123) 456-7890 for assistance.

    Experience the convenience and reliability of Tour I Am. Book your airport transfer today and travel with peace of mind!

    -
    - +
    + @@ -115,7 +259,7 @@ new HeroSliderItem { "Id", "Destination", - "UserId", + "UserId", "ProductId", "PaymentId", "TripDate", @@ -125,7 +269,7 @@ new HeroSliderItem "UserProductToCarId", "ReferralId", "Price" - }; + }; public List TransferIgnorList2 = new List { @@ -150,6 +294,8 @@ new HeroSliderItem private bool toAirport = true; + private bool displayHelp = false; + public void ToAirport() { toAirport = true; @@ -172,14 +318,14 @@ new HeroSliderItem resModel.UserId = user.Id; //user exists already - if(_sessionService.User != null) + if (_sessionService.User != null) { - if(_sessionService.User.UserId == user.Id) + if (_sessionService.User.UserId == user.Id) { //I have ordered for myself resModel.ReferralId = null; - } + } else { //if I am logged in and different user I become referrer (if no referrer already) @@ -196,9 +342,9 @@ new HeroSliderItem //user has no referrer so I am the referrer resModel.ReferralId = userDetail.UserDto.RefferalId; - } + } } - } + } } else { @@ -210,7 +356,7 @@ new HeroSliderItem registration.Email = resModel.EmailAddress; registration.PhoneNumber = resModel.PhoneNumber; registration.Password = password; - //get list with one member! + //get list with one member! var createResult = await UserDataService.CreateGuestUser(registration); if (createResult.isSuccess) @@ -218,24 +364,24 @@ new HeroSliderItem if (createResult.user != null) { if (_sessionService.User != null) - { + { //if I am logged in user I become referrer var userDetail = await UserDataService.GetUserDetailByIdAsync(_sessionService.User.UserId); var createdUserDetail = await UserDataService.GetUserDetailByIdAsync(createResult.user.Id); - if(createdUserDetail != null) + if (createdUserDetail != null) { createdUserDetail.UserDto.RefferalId = userDetail.UserDto.RefferalId; var updatedNewUser = await _adminSignalRClient.PostDataAsync(SignalRTags.UpdateUserModelDtoDetail, userDetail); if (updatedNewUser != null) { //referral set - } + } else { //something wrong } } - resModel.ReferralId = userDetail.UserDto.RefferalId; + resModel.ReferralId = userDetail.UserDto.RefferalId; } resModel.UserId = createResult.user.Id; @@ -245,7 +391,7 @@ new HeroSliderItem { //some error handling } - } + } } var transfer = await WizardProcessor.ProcessWizardAsync(Result.GetType(), Result); BrowserConsoleLogWriter.Info($"Submitted nested form: {Result.GetType().FullName}"); @@ -258,5 +404,10 @@ new HeroSliderItem return base.OnInitializedAsync(); } + private void ShowHelp_Click() + { + displayHelp = !displayHelp; + } + } diff --git a/TIAMSharedUI/Pages/User/SysAdmins/ProductDetailGridComponent.razor b/TIAMSharedUI/Pages/User/SysAdmins/ProductDetailGridComponent.razor index d1a2e006..7a436f9e 100644 --- a/TIAMSharedUI/Pages/User/SysAdmins/ProductDetailGridComponent.razor +++ b/TIAMSharedUI/Pages/User/SysAdmins/ProductDetailGridComponent.razor @@ -134,15 +134,6 @@ - @code { [Parameter] public Guid? ContextId { get; set; } diff --git a/TIAMSharedUI/Pages/User/SysAdmins/ProductGridComponent.razor b/TIAMSharedUI/Pages/User/SysAdmins/ProductGridComponent.razor index 48315e8b..c17c9960 100644 --- a/TIAMSharedUI/Pages/User/SysAdmins/ProductGridComponent.razor +++ b/TIAMSharedUI/Pages/User/SysAdmins/ProductGridComponent.razor @@ -1,4 +1,5 @@ -@using TIAM.Entities.Products +@using AyCode.Core.Helpers +@using TIAM.Entities.Products @using TIAM.Entities.ServiceProviders @using TIAM.Entities.Transfers @using TIAM.Entities.Drivers @@ -20,6 +21,7 @@ @inject IStringLocalizer Localizer @inject IEnumerable LogWriters @inject AdminSignalRClient AdminSignalRClient; +@inject IJSRuntime JsRuntime; + + + @{ + //check if has transferdestination + var AddressId = ((Product)context.DataItem).Profile.AddressId; + var result = CheckDestinations(AddressId); + //if not, display button + + Product product = (Product)context.DataItem; + var _url = $"{Setting.BaseUrl}/public/transfer/{product.ServiceProvider.AffiliateId}/{product.Id}"; + + Copy referral url + + if (!result) + { + //

    Address:

    + //

    @(((Product)context.DataItem).Profile.Address.AddressText)

    + + } + // else + // { + //

    Address: @(((Product)context.DataItem).Profile.Address.AddressText)

    + // } + + if (product.ProductType == TIAM.Core.Enums.ProductType.Hotel) + { + + } + else if (product.ProductType == TIAM.Core.Enums.ProductType.Transfer) + { + + } + + } + +
    +
    + + + @@ -95,16 +137,71 @@
    + + @code { [Parameter] public EventCallback OnGridEditModelSaving { get; set; } [Parameter] public GridDetailExpandButtonDisplayMode DetailExpandButtonDisplayMode { get; set; } = GridDetailExpandButtonDisplayMode.Never; + private List destinations = []; + private ProductGrid _productGrid = null!; private LoggerClient _logger = null!; + + + private async Task CopyUrl(string url) + { + + await JsRuntime.InvokeVoidAsync("copyToClipboard", url); + } + protected override void OnInitialized() { _logger = new LoggerClient(LogWriters.ToArray()); + AdminSignalRClient.GetAllIntoAsync(destinations, SignalRTags.GetAllTransferDestinations).Forget(); + } + + private bool CheckDestinations(Guid addressId) + { + + + if (destinations != null) + { + if (destinations.Any(d => d.AddressId == addressId)) + { + return true; + } + else + { + return false; + } + } + else + { + return false; + } + + } + + private async Task SaveAsDestination(Address address, Product product) + { + TransferDestination transferDestination = new TransferDestination(); + transferDestination.Id = Guid.NewGuid(); + transferDestination.Name = product.Name; + if (!string.IsNullOrEmpty(product.Profile.Description)) + { + transferDestination.Description = product.Profile.Description; + } + else + { + transferDestination.Description = "No description available"; + } + transferDestination.AddressId = address.Id; + transferDestination.AddressString = address.AddressText; + var result = await AdminSignalRClient.PostDataAsync(SignalRTags.CreateTransferDestination, transferDestination); + _productGrid.Reload(); + await InvokeAsync(StateHasChanged); } protected override async Task OnParametersSetAsync() diff --git a/TIAMSharedUI/Pages/User/SysAdmins/TransferDestinationGridComponent.razor b/TIAMSharedUI/Pages/User/SysAdmins/TransferDestinationGridComponent.razor index fe7cc083..2237f928 100644 --- a/TIAMSharedUI/Pages/User/SysAdmins/TransferDestinationGridComponent.razor +++ b/TIAMSharedUI/Pages/User/SysAdmins/TransferDestinationGridComponent.razor @@ -64,30 +64,31 @@ var transfer = (TransferDestination)editFormContext.EditModel; } - + @editFormContext.GetEditor("Name") - - @editFormContext.GetEditor("Description") - - + + @editFormContext.GetEditor("AddressString") - + @editFormContext.GetEditor("Price") - + @editFormContext.GetEditor("Price2") - + @editFormContext.GetEditor("Price3") - + @editFormContext.GetEditor("ProductCommis") - + @editFormContext.GetEditor("ExtraPrice") + + @editFormContext.GetEditor("Description") + diff --git a/TIAMSharedUI/Shared/Users/AdminNavMenu.razor b/TIAMSharedUI/Shared/Users/AdminNavMenu.razor index 6c23d578..3079ac10 100644 --- a/TIAMSharedUI/Shared/Users/AdminNavMenu.razor +++ b/TIAMSharedUI/Shared/Users/AdminNavMenu.razor @@ -15,7 +15,7 @@
    - @@ -28,12 +28,7 @@ string url3 = $"user/messages/{userId}"; - @* - - - *@ + @if (IsSysAdmin) { - - @{ - if (userHasCompany) - { - - } - if (userHasHotels) - { - - } - } + + + + + + + @* *@ - - @@ -164,12 +153,12 @@ private bool expandHotelAdminNav = false; private string? NavMenuCssClass => collapseNavMenu ? "collapse" : null; + private bool userHasCompany; + private bool userHasHotels; + private bool IsDriver; private bool IsDevAdmin; private bool IsSysAdmin; - private bool IsDriver; - private bool userHasCompany = false; - private bool userHasHotels = false; private string? userEmail; private string? userFullName; private Guid? userId; @@ -193,18 +182,6 @@ { _isMobile = await jsRuntime.InvokeAsync("isDevice"); _logger = new LoggerClient(LogWriters.ToArray()); - //_logger.Debug($"UserId: {SessionService.User.UserModelDto.Id}"); //errorokat dobott - IsDevAdmin = SessionService.IsDevAdmin; - //_logger.Debug($"UserId: {SessionService.IsDevAdmin}"); - IsSysAdmin = SessionService.IsSysAdmin; - //_logger.Debug($"UserId: {SessionService.IsSysAdmin}"); - IsDriver = SessionService.IsDriver; - //_logger.Debug($"UserId: {SessionService.IsDriver}"); - userHasCompany = SessionService.HasCompany; - if (SessionService.GetHotels().Count() > 0) - { - userHasHotels = true; - } if (SessionService.User != null) { @@ -216,6 +193,19 @@ userFullName = SessionService.User.UserModelDto.ProfileDto.FullName; } } + //_logger.Debug($"UserId: {SessionService.User.UserModelDto.Id}"); //errorokat dobott + userHasCompany = SessionService.HasCompany; + if (SessionService.GetHotels().Count() > 0) + { + userHasHotels = true; + } + IsDriver = SessionService.IsDriver; + //_logger.Debug($"UserId: {SessionService.IsDriver}"); + + IsDevAdmin = SessionService.IsDevAdmin; + //_logger.Debug($"UserId: {SessionService.IsDevAdmin}"); + IsSysAdmin = SessionService.IsSysAdmin; + //_logger.Debug($"UserId: {SessionService.IsSysAdmin}"); await base.OnInitializedAsync(); } diff --git a/TIAMWebApp/Client/wwwroot/index.html b/TIAMWebApp/Client/wwwroot/index.html index e2ead78a..abf2ad23 100644 --- a/TIAMWebApp/Client/wwwroot/index.html +++ b/TIAMWebApp/Client/wwwroot/index.html @@ -41,6 +41,15 @@ return /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini|mobile/i.test(navigator.userAgent); } +