Affiliate information
@{
- if (Context.ServiceProviderId != null)
+ if (Product?.ServiceProviderId != null)
{
- var _url = $"{Setting.BaseUrl}/public/transfer/{Context.ServiceProvider.AffiliateId}/{Context.Id}";
+ var _url = $"{Setting.BaseUrl}/public/transfer/{Product.ServiceProvider.AffiliateId}/{Product.Id}";
Use this link to send it in an email to the client
@_url
@@ -66,24 +66,21 @@
@{
- if (Context.ProductType == TIAM.Core.Enums.ProductType.Hotel)
+ if (Product.ProductType == ProductType.Hotel)
{
- string url = $"user/hoteladmin/{Context.Id}";
+ var url = $"user/hoteladmin/{Product.Id}";
Manage
}
- else if (Context.ProductType == TIAM.Core.Enums.ProductType.Transfer)
+ else if (Product.ProductType == ProductType.Transfer)
{
- string url = $"user/transferadmin/{Context.Id}";
+ var url = $"user/transferadmin/{Product.Id}";
Manage
}
}
@{
- if (!_isAddressTransferDestination)
- {
-
- }
+
}
@@ -113,7 +110,7 @@
@code {
- [Parameter] public Product Context { get; set; }
+ [Parameter] public Product Product { get; set; }
[Parameter] public EventCallback
DataChanged { get; set; }
@@ -125,7 +122,7 @@
private readonly List _destinations = [];
string _msg;
private bool _isSaveActive = false;
- private bool _isAddressTransferDestination = false;
+ private bool _isAddressTransferDestination = true;
private async Task CopyUrl(string url)
{
@@ -139,21 +136,22 @@
protected override async Task OnInitializedAsync()
{
- await AdminSignalRClient.GetTransferDestinationsAsync(_destinations);
- var productOwner = await AdminSignalRClient.GetByIdAsync>(SignalRTags.GetCompaniesById, Context.ServiceProviderId);
- var productProfiles = await AdminSignalRClient.GetByIdAsync>(SignalRTags.GetProfileById, Context.ProfileId);
+ var productOwner = await AdminSignalRClient.GetByIdAsync>(SignalRTags.GetCompaniesById, Product.ServiceProviderId);
+ var productProfiles = await AdminSignalRClient.GetByIdAsync>(SignalRTags.GetProfileById, Product.ProfileId);
+
+ await AdminSignalRClient.GetTransferDestinationsAsync(_destinations, () =>
+ {
+ if (productProfiles == null) return;
+
+ _productProfile = productProfiles[0];
+ _isAddressTransferDestination = CheckDestinations(Product.Id);
+ });
+
if (productOwner != null)
{
- ImageSource = await ServiceProviderDataService.GetQRCodeByProductIdAndOwnerAffiliateIdAsync([productOwner[0].AffiliateId, Context.Id]);
+ ImageSource = await ServiceProviderDataService.GetQRCodeByProductIdAndOwnerAffiliateIdAsync([productOwner[0].AffiliateId, Product.Id]);
}
-
- if (productProfiles != null)
- {
- _productProfile = productProfiles[0];
- _isAddressTransferDestination = CheckDestinations(_productProfile.AddressId);
- }
-
await base.OnInitializedAsync();
}
@@ -176,30 +174,24 @@
;
}
- private bool CheckDestinations(Guid addressId)
+ private bool CheckDestinations(Guid productId)
{
- return _destinations.Any(d => d.AddressId == addressId);
+ return _destinations.Any(d => d.ProductId == productId);
}
private async Task SaveAsDestination(Address address, Product product)
{
- var transferDestination = new TransferDestination();
- transferDestination.Id = Guid.NewGuid();
- transferDestination.Name = product.Name;
-
- if (!string.IsNullOrEmpty(product.Profile.Description))
+ var transferDestination = new TransferDestination
{
- transferDestination.Description = product.Profile.Description;
- }
- else
- {
- transferDestination.Description = "No description available";
- }
+ Id = Guid.NewGuid(),
+ Name = product.Name,
+ ProductId = product.Id,
+ Description = !string.IsNullOrEmpty(product.Profile.Description) ? product.Profile.Description : "No description available",
+ AddressId = address.Id,
+ AddressString = address.AddressText
+ };
- transferDestination.AddressId = address.Id;
- transferDestination.AddressString = address.AddressText;
-
- var result = await AdminSignalRClient.PostDataAsync
(SignalRTags.CreateTransferDestination, transferDestination);
+ await AdminSignalRClient.PostDataAsync(SignalRTags.CreateTransferDestination, transferDestination);
await InvokeAsync(StateHasChanged);
}
}
diff --git a/TIAMSharedUI/Pages/User/MyServiceProviders.razor b/TIAMSharedUI/Pages/User/MyServiceProviders.razor
index 6e1cace2..81fb0cf6 100644
--- a/TIAMSharedUI/Pages/User/MyServiceProviders.razor
+++ b/TIAMSharedUI/Pages/User/MyServiceProviders.razor
@@ -48,7 +48,7 @@
-
+