From 481fefb7a14e1edaf4111aed2d4fc33ced48d353 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 13 Mar 2024 19:59:27 +0100 Subject: [PATCH 1/3] bleh --- .../Transfers/TransferDestination.cs | 6 +++-- TIAMResources/TIAMResources.Designer.cs | 18 +++++++++++++ TIAMResources/TIAMResources.resx | 6 +++++ .../User/SysAdmins/TransferDestinations.razor | 4 ++- .../SysAdmins/TransferDestinations.razor.cs | 2 +- TIAMSharedUI/Resources/MyResources.hu.resx | 6 +++++ .../Controllers/TransferDataAPIController.cs | 22 ++++++++++++---- .../TransferDestinationWizardModel.cs | 25 +++++++++++++------ TIAMWebApp/Shared/Utility/ResourceKeys.cs | 2 ++ 9 files changed, 75 insertions(+), 16 deletions(-) diff --git a/TIAM.Entities/Transfers/TransferDestination.cs b/TIAM.Entities/Transfers/TransferDestination.cs index 92b530c6..59e6ef16 100644 --- a/TIAM.Entities/Transfers/TransferDestination.cs +++ b/TIAM.Entities/Transfers/TransferDestination.cs @@ -26,6 +26,8 @@ namespace TIAM.Entities.Transfers //public PriceType PriceType { get; set; } public double Price { get; set; } + public double Price2 { get; set; } + public double Price3 { get; set; } //TEMPORARY!!! public string? AddressString { get; set; } @@ -42,12 +44,12 @@ namespace TIAM.Entities.Transfers Id = id; AddressString = addressString; } - public TransferDestination(Guid id, string name, string addressString) : this(id, addressString) + public TransferDestination(Guid id, string name, string addressString, double price, double price2, double price3) : this(id, addressString) { Name = name; } - public TransferDestination(Guid id, string name, string description, string addressString) : this(id, name, addressString) + public TransferDestination(Guid id, string name, string description, string addressString, double price, double price2, double price3) : this(id, name, addressString, price, price2, price3) { Description = description; } diff --git a/TIAMResources/TIAMResources.Designer.cs b/TIAMResources/TIAMResources.Designer.cs index 1d32329c..a1080ab0 100644 --- a/TIAMResources/TIAMResources.Designer.cs +++ b/TIAMResources/TIAMResources.Designer.cs @@ -339,6 +339,24 @@ namespace TIAM.Resources { } } + /// + /// Looks up a localized string similar to Price 2. + /// + public static string Price2 { + get { + return ResourceManager.GetString("Price2", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Price 3. + /// + public static string Price3 { + get { + return ResourceManager.GetString("Price3", resourceCulture); + } + } + /// /// Looks up a localized string similar to Receiver Id. /// diff --git a/TIAMResources/TIAMResources.resx b/TIAMResources/TIAMResources.resx index 525a9471..7ecef8c6 100644 --- a/TIAMResources/TIAMResources.resx +++ b/TIAMResources/TIAMResources.resx @@ -210,6 +210,12 @@ Price + + Price 2 + + + Price 3 + Receiver Id diff --git a/TIAMSharedUI/Pages/User/SysAdmins/TransferDestinations.razor b/TIAMSharedUI/Pages/User/SysAdmins/TransferDestinations.razor index 548d6d51..14df84f3 100644 --- a/TIAMSharedUI/Pages/User/SysAdmins/TransferDestinations.razor +++ b/TIAMSharedUI/Pages/User/SysAdmins/TransferDestinations.razor @@ -60,7 +60,9 @@ - + + + diff --git a/TIAMSharedUI/Pages/User/SysAdmins/TransferDestinations.razor.cs b/TIAMSharedUI/Pages/User/SysAdmins/TransferDestinations.razor.cs index 98f7583d..641ed50e 100644 --- a/TIAMSharedUI/Pages/User/SysAdmins/TransferDestinations.razor.cs +++ b/TIAMSharedUI/Pages/User/SysAdmins/TransferDestinations.razor.cs @@ -176,7 +176,7 @@ namespace TIAMSharedUI.Pages.User.SysAdmins { //add new transferwizardmodel to transferData array TransferDataFromDb = ((TransferDestinationWizardModel[])TransferDataFromDb).Append( - new TransferDestinationWizardModel(item.Id, item.Name, item.Description, item.AddressString, item.Price, item.PriceType, item.Address)).ToArray(); + new TransferDestinationWizardModel(item.Id, item.Name, item.Description, item.AddressString, item.Price, item.Price2, item.Price3, item.Address)).ToArray(); logToBrowserConsole.LogToBC($"TransferDataFromDb: {item.Name}"); } diff --git a/TIAMSharedUI/Resources/MyResources.hu.resx b/TIAMSharedUI/Resources/MyResources.hu.resx index c2e98cb4..f6f9f667 100644 --- a/TIAMSharedUI/Resources/MyResources.hu.resx +++ b/TIAMSharedUI/Resources/MyResources.hu.resx @@ -174,6 +174,12 @@ Transzfer + + Ár 2 + + + Ár 3 + Regisztráció diff --git a/TIAMWebApp/Server/Controllers/TransferDataAPIController.cs b/TIAMWebApp/Server/Controllers/TransferDataAPIController.cs index 134ee884..c815ab7d 100644 --- a/TIAMWebApp/Server/Controllers/TransferDataAPIController.cs +++ b/TIAMWebApp/Server/Controllers/TransferDataAPIController.cs @@ -52,7 +52,19 @@ namespace TIAMWebApp.Server.Controllers [Route(APIUrls.GetTransferDestinationsRouteName)] public async Task> GetTransferDestinations() { - return await _transferDestinationDal.Context.TransferDestinations.ToListAsync(); + var transferDestinations = await _adminDal.Context.TransferDestinations.ToListAsync(); + foreach (var transferDestination in transferDestinations) + { + Console.WriteLine($"TransferDestination: {transferDestination.Id}"); + Console.WriteLine($"TransferDestination: {transferDestination.AddressId}"); + Console.WriteLine($"TransferDestination: {transferDestination.Name}"); + Console.WriteLine($"TransferDestination: {transferDestination.Price}"); + Console.WriteLine($"TransferDestination: {transferDestination.Price2}"); + Console.WriteLine($"TransferDestination: {transferDestination.Price3}"); + Console.WriteLine($"TransferDestination: {transferDestination.AddressString}"); + Console.WriteLine($"TransferDestination: {transferDestination.Description}"); + } + return transferDestinations; } [AllowAnonymous] @@ -104,7 +116,7 @@ namespace TIAMWebApp.Server.Controllers Console.WriteLine($"TransferDestination to be created: {transferDestination.Price}"); //Console.WriteLine($"TransferDestination to be created: {transferDestination.Price2}"); //Console.WriteLine($"TransferDestination to be created: {transferDestination.Price3}"); - Console.WriteLine($"TransferDestination to be created: {transferDestination.PriceType}"); + //Console.WriteLine($"TransferDestination to be created: {transferDestination.PriceType}"); Console.WriteLine($"TransferDestination to be created: {transferDestination.AddressString}"); Console.WriteLine($"TransferDestination to be created: {transferDestination.Description}"); @@ -160,9 +172,9 @@ namespace TIAMWebApp.Server.Controllers Console.WriteLine($"TransferDestination to be updated: {transferDestination.Id}"); Console.WriteLine($"TransferDestination to be updated new name: {transferDestination.Name}"); Console.WriteLine($"TransferDestination to be updated new price: {transferDestination.Price}"); - //Console.WriteLine($"TransferDestination to be updated new price: {transferDestination.Price2}"); - //Console.WriteLine($"TransferDestination to be updated new price: {transferDestination.Price3}"); - Console.WriteLine($"TransferDestination to be updated new priceType: {transferDestination.PriceType}"); + Console.WriteLine($"TransferDestination to be updated new price: {transferDestination.Price2}"); + Console.WriteLine($"TransferDestination to be updated new price: {transferDestination.Price3}"); + //Console.WriteLine($"TransferDestination to be updated new priceType: {transferDestination.PriceType}"); Console.WriteLine($"TransferDestination to be updated new address: {transferDestination.AddressString}"); Console.WriteLine($"TransferDestination to be updated new description: {transferDestination.Description}"); diff --git a/TIAMWebApp/Shared/Models/ClientSide/UI/WizardModels/TransferDestinationWizardModel.cs b/TIAMWebApp/Shared/Models/ClientSide/UI/WizardModels/TransferDestinationWizardModel.cs index a2d29a81..af8caf35 100644 --- a/TIAMWebApp/Shared/Models/ClientSide/UI/WizardModels/TransferDestinationWizardModel.cs +++ b/TIAMWebApp/Shared/Models/ClientSide/UI/WizardModels/TransferDestinationWizardModel.cs @@ -42,7 +42,16 @@ namespace TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels [DataType("Price")] [Display(Name = ResourceKeys.Price, ResourceType = typeof(TIAMResources))] public double Price { get; set; } - + + [Required(ErrorMessage = "The price should be specified.")] + [DataType("Price")] + [Display(Name = ResourceKeys.Price, ResourceType = typeof(TIAMResources))] + public double Price2 { get; set; } + + [Required(ErrorMessage = "The price should be specified.")] + [DataType("Price")] + [Display(Name = ResourceKeys.Price, ResourceType = typeof(TIAMResources))] + public double Price3 { get; set; } public PriceType PriceType { get; set; } public Address Address { get; set; } @@ -57,9 +66,9 @@ namespace TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels public TransferDestinationWizardModel() { } - public TransferDestinationWizardModel(string name, string description, string addressString, double price, PriceType priceType, Address address) :this(Guid.NewGuid(), name, description, addressString, price, priceType, address) + public TransferDestinationWizardModel(string name, string description, string addressString, double price, double price2, double price3, Address address) :this(Guid.NewGuid(), name, description, addressString, price, price2, price3, address) { } - public TransferDestinationWizardModel(Guid id, string name, string description, string addressString, double price, PriceType priceType, Address address) + public TransferDestinationWizardModel(Guid id, string name, string description, string addressString, double price, double price2, double price3, Address address) { Id = id.ToString(); @@ -67,7 +76,9 @@ namespace TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels Description = description; AddressString = addressString; Price = price; - PriceType = priceType; + Price2 = price2; + Price3 = price3; + //PriceType = priceType; Address = address; } @@ -81,9 +92,9 @@ namespace TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels destination.Description = model.Description; destination.AddressString = model.AddressString; destination.Price = model.Price; - //destination.Price2 = model.Price; - //destination.Price3 = model.Price; - destination.PriceType = model.PriceType; + destination.Price2 = model.Price2; + destination.Price3 = model.Price3; + //destination.PriceType = model.PriceType; destination.Address = model.Address; if (destination.Address == null) diff --git a/TIAMWebApp/Shared/Utility/ResourceKeys.cs b/TIAMWebApp/Shared/Utility/ResourceKeys.cs index b31e631b..3b7e47fe 100644 --- a/TIAMWebApp/Shared/Utility/ResourceKeys.cs +++ b/TIAMWebApp/Shared/Utility/ResourceKeys.cs @@ -22,6 +22,8 @@ public const string ConfirmPasswordReset = "ConfirmPasswordReset"; public const string ConfirmEmail = "ConfirmEmail"; public const string Price = "Price"; + public const string Price2 = "Price 2"; + public const string Price3 = "Price 3"; public const string Driver = "Driver"; //wizard From c0ec3b624f465230344670855f4c769c4ff1a5e1 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 27 Mar 2024 12:39:11 +0100 Subject: [PATCH 2/3] =?UTF-8?q?Whatta=20fuck=3F=20Nem=20is=20volt=20kimen?= =?UTF-8?q?=C5=91m.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TIAMSharedUI/Pages/AppLaunch.razor | 6 +-- .../Pages/Components/AuthComponent.razor.cs | 4 +- TIAMSharedUI/Pages/Index.razor | 2 + .../User/Hotels/CreateAndManageTransfer.razor | 45 ++++++++++++++++ TIAMSharedUI/Shared/SliderItemSelector.razor | 37 ++++++++++--- TIAMSharedUI/Shared/Users/AdminNavMenu.razor | 11 ++-- TIAMWebApp/Client/Services/SupplierService.cs | 2 +- .../Client/Services/UserDataServiceWeb.cs | 14 ++--- TIAMWebApp/Client/Services/WizardProcessor.cs | 3 ++ TIAMWebApp/Server/.config/dotnet-tools.json | 12 +++++ .../Controllers/TransferDataAPIController.cs | 54 +++++++++++++++++++ .../PublishProfiles/FolderProfile1.pubxml | 6 ++- .../Shared/Models/ClientSide/Setting.cs | 4 +- .../TransferDestinationWizardModel.cs | 8 +-- .../UI/WizardModels/TransferWizardModel.cs | 30 +++++++++-- TIAMWebApp/Shared/Models/UserSessionModel.cs | 11 ++-- .../Shared/Services/ImageDataService.cs | 2 +- .../Shared/Services/TransferDataService.cs | 25 ++++++--- 18 files changed, 229 insertions(+), 47 deletions(-) create mode 100644 TIAMSharedUI/Pages/User/Hotels/CreateAndManageTransfer.razor create mode 100644 TIAMWebApp/Server/.config/dotnet-tools.json diff --git a/TIAMSharedUI/Pages/AppLaunch.razor b/TIAMSharedUI/Pages/AppLaunch.razor index 8eb450d7..9bfd818d 100644 --- a/TIAMSharedUI/Pages/AppLaunch.razor +++ b/TIAMSharedUI/Pages/AppLaunch.razor @@ -14,13 +14,12 @@ @inject ISecureStorageHandler SecureStorageHandler @inject ISessionService sessionService; @inject HttpClient http; -

AppLaunch

@{ if (string.IsNullOrWhiteSpace(TrackingId)) { TrackingId = ""; -

Loading...

+ //

Loading...

} else { @@ -28,7 +27,6 @@ } } -Loading.... @code { @@ -57,7 +55,7 @@ Loading.... logToBrowserConsole = new LogToBrowserConsole(JSRuntime); //wait for 5 seconds - await Task.Delay(1000); + //await Task.Delay(1000); if (!string.IsNullOrWhiteSpace(userDetailsStr)) { diff --git a/TIAMSharedUI/Pages/Components/AuthComponent.razor.cs b/TIAMSharedUI/Pages/Components/AuthComponent.razor.cs index df029ad0..9b1452c3 100644 --- a/TIAMSharedUI/Pages/Components/AuthComponent.razor.cs +++ b/TIAMSharedUI/Pages/Components/AuthComponent.razor.cs @@ -20,13 +20,13 @@ namespace TIAMSharedUI.Pages.Components [CascadingParameter] private PopupMessageBox PopupMessageBox { get; set; } = default!; - public bool IsVisible = true; + public bool IsVisible = false; protected override async Task OnInitializedAsync() { await base.OnInitializedAsync(); IsLoggedIn = sessionService.IsAuthenticated; - await PopupMessageBox.ShowAsync("AuthComponent", "Initialized", null, null, null, PopupMessageBox.ButtonOk); + //await PopupMessageBox.ShowAsync("AuthComponent", "Initialized", null, null, null, PopupMessageBox.ButtonOk); //if (await PopupMessageBox.Show("Cancel", "Cancel this stuff", //PopupMessageBox.ButtonNo, PopupMessageBox.ButtonYes) == PopupMessageBox.ButtonNo) diff --git a/TIAMSharedUI/Pages/Index.razor b/TIAMSharedUI/Pages/Index.razor index ac23d498..66667f38 100644 --- a/TIAMSharedUI/Pages/Index.razor +++ b/TIAMSharedUI/Pages/Index.razor @@ -117,6 +117,8 @@ public async Task SubmitForm(object Result) { + + var transfer = await WizardProcessor.ProcessWizardAsync(Result.GetType(), Result); logToBrowserConsole.LogToBC($"Submitted nested form: {Result.GetType().FullName}"); navManager.NavigateTo("/transfer2/" + transfer.Id); diff --git a/TIAMSharedUI/Pages/User/Hotels/CreateAndManageTransfer.razor b/TIAMSharedUI/Pages/User/Hotels/CreateAndManageTransfer.razor new file mode 100644 index 00000000..399b7da6 --- /dev/null +++ b/TIAMSharedUI/Pages/User/Hotels/CreateAndManageTransfer.razor @@ -0,0 +1,45 @@ +@page "/user/createAndManageTransfer" +@using TIAMSharedUI.Shared +@using TIAMWebApp.Shared.Application.Models; +@using TIAMWebApp.Shared.Application.Interfaces; +@layout AdminLayout +@inject IPopulationStructureDataProvider DataProvider +@inject ISupplierService SupplierService +@inject IUserDataService UserDataService +Transfer + + + + +
+ + + + +
+ +
+
+ +
+ +
+ + + +
+ + +@code { + string Id = "2312-32132121-32123"; + bool isUserLoggedIn; + int userType = 0; + + protected override void OnInitialized() + { + base.OnInitialized(); + + } + +} + diff --git a/TIAMSharedUI/Shared/SliderItemSelector.razor b/TIAMSharedUI/Shared/SliderItemSelector.razor index 4863dd3d..1d432f77 100644 --- a/TIAMSharedUI/Shared/SliderItemSelector.razor +++ b/TIAMSharedUI/Shared/SliderItemSelector.razor @@ -55,8 +55,25 @@ + + @{ + + for (int i = 0; i < Destinations.Count; i++) + { + var destination = Destinations[i]; + var j = i + 1; +
+
+

@destination.Name

+

@destination.AddressString

+
+
+ } + + + } -
+ @*

Liszt Ferenc Airport

@@ -73,7 +90,7 @@

Chain Bridge

-
+
*@

Please type an address or swipe to select from preset destinations!

@@ -222,10 +239,10 @@ { if(firstRender) { - var dotNetObjRef = DotNetObjectReference.Create(this); - JSRuntime.InvokeVoidAsync("setOwlId", OwlId); - JSRuntime.InvokeVoidAsync("InitOwl", OwlId); - JSRuntime.InvokeVoidAsync("CStoJSCall", dotNetObjRef); + // var dotNetObjRef = DotNetObjectReference.Create(this); + // JSRuntime.InvokeVoidAsync("setOwlId", OwlId); + // JSRuntime.InvokeVoidAsync("InitOwl", OwlId); + // JSRuntime.InvokeVoidAsync("CStoJSCall", dotNetObjRef); } @@ -277,7 +294,15 @@ { Destinations = await TransferDataService.GetDestinationsAsync(); Content = TextValue; + InitOwl(); } + private void InitOwl() + { + var dotNetObjRef = DotNetObjectReference.Create(this); + JSRuntime.InvokeVoidAsync("setOwlId", OwlId); + JSRuntime.InvokeVoidAsync("InitOwl", OwlId); + JSRuntime.InvokeVoidAsync("CStoJSCall", dotNetObjRef); + } } diff --git a/TIAMSharedUI/Shared/Users/AdminNavMenu.razor b/TIAMSharedUI/Shared/Users/AdminNavMenu.razor index 2ea7d92c..0be24562 100644 --- a/TIAMSharedUI/Shared/Users/AdminNavMenu.razor +++ b/TIAMSharedUI/Shared/Users/AdminNavMenu.razor @@ -48,12 +48,6 @@ - - +