From 10a9a186a1d5c2c342493294c9c56ae97e22f6f2 Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 22 Feb 2024 09:17:20 +0100 Subject: [PATCH] wtf again --- TIAMMobileApp/MainPage.xaml.cs | 13 +- TIAMMobileApp/MauiProgram.cs | 4 +- TIAMMobileApp/Platforms/iOS/Info.plist | 4 + TIAMSharedUI/Pages/Events.razor | 84 +++++ TIAMSharedUI/Pages/Events.razor.css | 288 ++++++++++++++++++ TIAMSharedUI/Pages/Restaurants.razor.css | 2 +- TIAMSharedUI/Pages/Tours.razor | 1 + TIAMSharedUI/Pages/Tours.razor.css | 6 +- TIAMSharedUI/Pages/User/Media.razor | 175 +++++++++++ TIAMSharedUI/Pages/User/Media.razor.css | 32 ++ .../User/SysAdmins/SysAdminComponent.razor | 24 +- .../User/SysAdmins/TransferDestinations.razor | 145 ++++----- .../User/SysAdmins/TransferManagement.razor | 283 ++++++++--------- .../Resources/MyResources.Designer.cs | 9 + TIAMSharedUI/Resources/MyResources.hu.resx | 3 + TIAMSharedUI/Resources/MyResources.resx | 3 + TIAMSharedUI/Shared/Components/Navbar.razor | 8 +- TIAMSharedUI/Shared/EventsComponent.razor | 97 ++++++ TIAMSharedUI/Shared/Users/AdminNavMenu.razor | 6 + TIAMSharedUI/wwwroot/css/TourIAm.css | 23 +- TIAMSharedUI/wwwroot/filePaste.js | 16 + TIAMWebApp/Client/Program.cs | 2 + TIAMWebApp/Client/Services/WizardProcessor.cs | 27 +- TIAMWebApp/Client/TIAMWebApp.Client.csproj | 3 + .../Server/Controllers/EmailAPIController.cs | 6 +- .../Server/Controllers/FileAPIController.cs | 120 ++++++++ .../Server/Controllers/UserAPIController.cs | 2 +- TIAMWebApp/Server/Program.cs | 20 +- TIAMWebApp/Server/TIAMWebApp.Server.csproj | 3 + .../Interfaces/IClientNoticeSenderService.cs | 16 + .../Shared/Interfaces/IImageDataService.cs | 15 + TIAMWebApp/Shared/Models/APIUrls.cs | 12 + .../UI/WizardModels/MessageWizardModel.cs | 37 ++- TIAMWebApp/Shared/Models/Event.cs | 31 ++ .../Services/ClientNoticeSenderService.cs | 17 ++ .../Shared/Services/ImageDataService.cs | 79 +++++ .../TIAMWebApp.Shared.Application.csproj | 1 + 37 files changed, 1360 insertions(+), 257 deletions(-) create mode 100644 TIAMSharedUI/Pages/Events.razor create mode 100644 TIAMSharedUI/Pages/Events.razor.css create mode 100644 TIAMSharedUI/Pages/User/Media.razor create mode 100644 TIAMSharedUI/Pages/User/Media.razor.css create mode 100644 TIAMSharedUI/Shared/EventsComponent.razor create mode 100644 TIAMSharedUI/wwwroot/filePaste.js create mode 100644 TIAMWebApp/Server/Controllers/FileAPIController.cs create mode 100644 TIAMWebApp/Shared/Interfaces/IClientNoticeSenderService.cs create mode 100644 TIAMWebApp/Shared/Interfaces/IImageDataService.cs create mode 100644 TIAMWebApp/Shared/Models/Event.cs create mode 100644 TIAMWebApp/Shared/Services/ClientNoticeSenderService.cs create mode 100644 TIAMWebApp/Shared/Services/ImageDataService.cs diff --git a/TIAMMobileApp/MainPage.xaml.cs b/TIAMMobileApp/MainPage.xaml.cs index d70592bd..519b7629 100644 --- a/TIAMMobileApp/MainPage.xaml.cs +++ b/TIAMMobileApp/MainPage.xaml.cs @@ -1,9 +1,20 @@ -namespace TIAMMobileApp +using Microsoft.AspNetCore.Components.WebView.Maui; + +namespace TIAMMobileApp { public partial class MainPage : ContentPage { + + public MainPage() { + BlazorWebViewHandler.BlazorWebViewMapper.AppendToMapping("CustomBlazorWebViewMapper", (handler, view) => + { +#if IOS + var configs = handler.PlatformView.Configuration; + configs.AllowsInlineMediaPlayback = true; +#endif + }); InitializeComponent(); } } diff --git a/TIAMMobileApp/MauiProgram.cs b/TIAMMobileApp/MauiProgram.cs index 21b1cf04..9ee141c3 100644 --- a/TIAMMobileApp/MauiProgram.cs +++ b/TIAMMobileApp/MauiProgram.cs @@ -28,8 +28,8 @@ namespace TIAMMobileApp #if DEBUG builder.Services.AddBlazorWebViewDeveloperTools(); builder.Logging.AddDebug(); - builder.Services.AddLocalization(); #endif + builder.Services.AddLocalization(); var handler = new HttpClientHandler(); handler.ServerCertificateCustomValidationCallback = (message, certificate, chain, sslPolicyErrors) => true; var client = new HttpClient(handler); @@ -54,7 +54,9 @@ namespace TIAMMobileApp builder.Services.AddScoped(); builder.Services.AddSingleton(); builder.Services.AddScoped(); + builder.Services.AddScoped(); builder.Services.AddScoped(); + builder.Services.AddScoped(); builder.Services.AddSingleton(x => new ResourceManager("TIAMWebApp.Shared.Application.Resources", typeof(Main).Assembly)); builder.Services.Configure(Guid.NewGuid().ToString(), c => { }); diff --git a/TIAMMobileApp/Platforms/iOS/Info.plist b/TIAMMobileApp/Platforms/iOS/Info.plist index ecb7f719..69b98c58 100644 --- a/TIAMMobileApp/Platforms/iOS/Info.plist +++ b/TIAMMobileApp/Platforms/iOS/Info.plist @@ -28,5 +28,9 @@ XSAppIconAssets Assets.xcassets/appicon.appiconset + NSCameraUsageDescription + This app uses camera for... + NSMicrophoneUsageDescription + This app uses microphone to record videos for... diff --git a/TIAMSharedUI/Pages/Events.razor b/TIAMSharedUI/Pages/Events.razor new file mode 100644 index 00000000..9770e251 --- /dev/null +++ b/TIAMSharedUI/Pages/Events.razor @@ -0,0 +1,84 @@ +@page "/events" +@using TIAMSharedUI.Shared +@using TIAMWebApp.Shared.Application.Models + + + +
+
+
+ +

Tours

+

Please select!

+
+ +
+ + + +
+ + + + +@code { + public List MockEvents = new List + { + new Event("HONEYBEAST", "A Honeybeast egyedisége abban rejlik, hogy a popzenét rengeteg különféle irányból közelítik meg - hol vidám, hol szomorú, hol pörgős, hogy lassú, koncertjükön az érzelmek széles skáláját élhetjük át együtt.", "2024.05.03", "Budapest Park", "https://tixa.hu/kepek/0027/320/27870-1_20231214141702.jpg"), + new Event("VAD FRUTTIK", "A kék a tenger és az ég színe, a nyílt terekkel, valamint a képzelettel és tágassággal társul - végtelen kékség május 3-án a Budapest Parkban!", "2024.04.26", "Budapest Park", "https://tixa.hu/kepek/0027/768/27692-1_20231129185842.jpg"), + new Event("DEBORAH DE LUCA", "DEBORAH DE LUCA 2024-ben Magyarországon csak a Budapest Park színpadán", "2024.08.19", "Budapest Park", "https://tixa.hu/kepek/0028/768/28535-1_20240118172423.jpg"), + new Event("TOTAL DANCE CABRIO", "Ha nyár, akkor Total Dance Cabrio! Ülj be mellénk a cabrioba, és hagyd, hogy visszarepítsünk a 90-es és 2000-es évekbe! ", "2024.04.26", "Budapest Park", "https://tixa.hu/kepek/0027/768/27829-1_20231206193253.jpg"), + new Event("HONEYBEAST", "A Honeybeast egyedisége abban rejlik, hogy a popzenét rengeteg különféle irányból közelítik meg - hol vidám, hol szomorú, hol pörgős, hogy lassú, koncertjükön az érzelmek széles skáláját élhetjük át együtt.", "2024.05.03", "Budapest Park", "https://tixa.hu/kepek/0027/320/27870-1_20231214141702.jpg"), + new Event("VAD FRUTTIK", "A kék a tenger és az ég színe, a nyílt terekkel, valamint a képzelettel és tágassággal társul - végtelen kékség május 3-án a Budapest Parkban!", "2024.04.26", "Budapest Park", "https://tixa.hu/kepek/0027/768/27692-1_20231129185842.jpg"), + new Event("DEBORAH DE LUCA", "DEBORAH DE LUCA 2024-ben Magyarországon csak a Budapest Park színpadán", "2024.08.19", "Budapest Park", "https://tixa.hu/kepek/0028/768/28535-1_20240118172423.jpg"), + new Event("TOTAL DANCE CABRIO", "Ha nyár, akkor Total Dance Cabrio! Ülj be mellénk a cabrioba, és hagyd, hogy visszarepítsünk a 90-es és 2000-es évekbe! ", "2024.04.26", "Budapest Park", "https://tixa.hu/kepek/0027/768/27829-1_20231206193253.jpg"), + + + + }; + } \ No newline at end of file diff --git a/TIAMSharedUI/Pages/Events.razor.css b/TIAMSharedUI/Pages/Events.razor.css new file mode 100644 index 00000000..cbf1c4ed --- /dev/null +++ b/TIAMSharedUI/Pages/Events.razor.css @@ -0,0 +1,288 @@ + + +/******* Common Element CSS Start ******/ + + +body { + font-family: "Roboto", sans-serif; + font-size: 16px; +} + +.clear { + clear: both; +} + +img { + max-width: 100%; + border: 0px; +} + +ul, +ol { + list-style: none; +} + +a { + text-decoration: none; + color: inherit; + outline: none; + transition: all 0.4s ease-in-out; + -webkit-transition: all 0.4s ease-in-out; +} + + a:focus, + a:active, + a:visited, + a:hover { + text-decoration: none; + outline: none; + } + + a:hover { + color: #e73700; + } + +h2 { + margin-bottom: 48px; + padding-bottom: 16px; + font-size: 20px; + line-height: 28px; + font-weight: 700; + position: relative; + text-transform: capitalize; +} + +h3 { + margin: 0 0 10px; + font-size: 28px; + line-height: 36px; +} + +button { + outline: none !important; +} +/******* Common Element CSS End *********/ + +/* -------- title style ------- */ +.line-title { + position: relative; + width: 400px; +} + + .line-title::before, + .line-title::after { + content: ""; + position: absolute; + bottom: 0; + left: 0; + height: 4px; + border-radius: 2px; + } + + .line-title::before { + width: 100%; + background: #f2f2f2; + } + + .line-title::after { + width: 32px; + background: #e73700; + } + +/******* Middle section CSS Start ******/ +/* -------- Landing page ------- */ +.game-section { + /*padding: 5px 50px;*/ +} + + .game-section .owl-stage { + margin: 15px 0; + display: flex; + display: -webkit-flex; + } + + .game-section .item { + margin: 0 15px 60px; + width: 320px; + height: 400px; + display: flex; + display: -webkit-flex; + align-items: flex-end; + -webkit-align-items: flex-end; + background: #343434 no-repeat center center / cover; + border-radius: 16px; + overflow: hidden; + position: relative; + transition: all 0.4s ease-in-out; + -webkit-transition: all 0.4s ease-in-out; + cursor: pointer; + box-shadow: 0 8px 32px 0 rgba( 31, 38, 135, 0.57 ); + } + + .game-section .item.active { + width: 500px; + box-shadow: 0 8px 32px 0 rgba( 31, 38, 135, 0.57 ); + -webkit-box-shadow: 0 8px 32px 0 rgba( 31, 38, 135, 0.57 ); + } + + .game-section .item:after { + content: ""; + display: block; + position: absolute; + height: 100%; + width: 100%; + left: 0; + top: 0; + background-image: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 1)); + } + + .game-section .item-desc { + padding: 0 24px 12px; + color: #fff; + position: relative; + z-index: 1; + overflow: hidden; + transform: translateY(calc(100% - 54px)); + -webkit-transform: translateY(calc(100% - 54px)); + transition: all 0.4s ease-in-out; + -webkit-transition: all 0.4s ease-in-out; + } + + .game-section .item.active .item-desc { + transform: none; + -webkit-transform: none; + } + + .game-section .item-desc p { + opacity: 0; + -webkit-transform: translateY(32px); + transform: translateY(32px); + transition: all 0.4s ease-in-out 0.2s; + -webkit-transition: all 0.4s ease-in-out 0.2s; + } + + .game-section .item.active .item-desc p { + opacity: 1; + -webkit-transform: translateY(0); + transform: translateY(0); + } + + .game-section .owl-theme.custom-carousel .owl-dots { + margin-top: -20px; + position: relative; + z-index: 5; + } +/******** Middle section CSS End *******/ + +/***** responsive css Start ******/ + +@media (min-width: 992px) and (max-width: 1199px) { + h2 { + margin-bottom: 32px; + } + + h3 { + margin: 0 0 8px; + font-size: 24px; + line-height: 32px; + } + + /* -------- Landing page ------- */ + .game-section { + /*padding: 50px 5px;*/ + } + + .game-section .item { + margin: 0 12px 60px; + width: 260px; + height: 360px; + } + + .game-section .item.active { + width: 400px; + } + + .game-section .item-desc { + transform: translateY(calc(100% - 46px)); + -webkit-transform: translateY(calc(100% - 46px)); + } +} + +@media (min-width: 768px) and (max-width: 991px) { + h2 { + margin-bottom: 32px; + } + + h3 { + margin: 0 0 8px; + font-size: 24px; + line-height: 32px; + } + + .line-title { + width: 330px; + } + + /* -------- Landing page ------- */ + .game-section { + /*padding: 50px 5px 40px;*/ + } + + .game-section .item { + margin: 0 12px 60px; + width: 240px; + height: 330px; + } + + .game-section .item.active { + width: 360px; + } + + .game-section .item-desc { + transform: translateY(calc(100% - 42px)); + -webkit-transform: translateY(calc(100% - 42px)); + } +} + +@media (max-width: 767px) { + body { + font-size: 14px; + } + + h2 { + margin-bottom: 20px; + } + + h3 { + margin: 0 0 8px; + font-size: 19px; + line-height: 24px; + } + + .line-title { + width: 250px; + } + + /* -------- Landing page ------- */ + .game-section { + padding: 30px 15px 20px; + } + + .game-section .item { + margin: 0 10px 40px; + width: 200px; + height: 280px; + } + + .game-section .item.active { + width: 270px; + box-shadow: 6px 10px 10px rgba(0, 0, 0, 0.25); + -webkit-box-shadow: 6px 10px 10px rgba(0, 0, 0, 0.25); + } + + .game-section .item-desc { + padding: 0 14px 5px; + transform: translateY(calc(100% - 42px)); + -webkit-transform: translateY(calc(100% - 42px)); + } +} diff --git a/TIAMSharedUI/Pages/Restaurants.razor.css b/TIAMSharedUI/Pages/Restaurants.razor.css index 8bed00ba..52c61159 100644 --- a/TIAMSharedUI/Pages/Restaurants.razor.css +++ b/TIAMSharedUI/Pages/Restaurants.razor.css @@ -116,7 +116,7 @@ button { transition: all 0.4s ease-in-out; -webkit-transition: all 0.4s ease-in-out; cursor: pointer; - box-shadow: 3px 3px 3px #b1b1b1, -3px -3px 3px #fff; + /*box-shadow: 3px 3px 3px #b1b1b1, -3px -3px 3px #141414;*/ } .game-section .item.active { diff --git a/TIAMSharedUI/Pages/Tours.razor b/TIAMSharedUI/Pages/Tours.razor index 6407f943..d2a2800c 100644 --- a/TIAMSharedUI/Pages/Tours.razor +++ b/TIAMSharedUI/Pages/Tours.razor @@ -53,6 +53,7 @@ + diff --git a/TIAMSharedUI/Pages/Tours.razor.css b/TIAMSharedUI/Pages/Tours.razor.css index b26524c3..cbf1c4ed 100644 --- a/TIAMSharedUI/Pages/Tours.razor.css +++ b/TIAMSharedUI/Pages/Tours.razor.css @@ -116,13 +116,13 @@ button { transition: all 0.4s ease-in-out; -webkit-transition: all 0.4s ease-in-out; cursor: pointer; - box-shadow: 3px 3px 3px #b1b1b1, -3px -3px 3px #fff; + box-shadow: 0 8px 32px 0 rgba( 31, 38, 135, 0.57 ); } .game-section .item.active { width: 500px; - box-shadow: 12px 40px 40px rgba(0, 0, 0, 0.25); - -webkit-box-shadow: 12px 40px 40px rgba(0, 0, 0, 0.25); + box-shadow: 0 8px 32px 0 rgba( 31, 38, 135, 0.57 ); + -webkit-box-shadow: 0 8px 32px 0 rgba( 31, 38, 135, 0.57 ); } .game-section .item:after { diff --git a/TIAMSharedUI/Pages/User/Media.razor b/TIAMSharedUI/Pages/User/Media.razor new file mode 100644 index 00000000..a7bb2218 --- /dev/null +++ b/TIAMSharedUI/Pages/User/Media.razor @@ -0,0 +1,175 @@ +@*@using TIAMWebApp.Shared.Application.Models +@page "/user/media" +@using TIAMSharedUI.Shared @using TIAMWebApp.Shared.Application.Interfaces +@layout AdminLayout + +@inject NavigationManager NavigationManager +
+
+ + Click the Select Files button to select a file +
+ + +
+ +@code { + int SelectedFilesCount { get; set; } + protected void SelectedFilesChanged(IEnumerable files) + { + SelectedFilesCount = files.ToList().Count; + InvokeAsync(StateHasChanged); + } + protected string GetUploadUrl(string url) + { + return NavigationManager.ToAbsoluteUri(url).AbsoluteUri; + } +} *@ + + +@rendermode RenderMode.InteractiveWebAssembly +@page "/user/media" +@using System.Net.Http.Headers +@using TIAMSharedUI.Shared +@using TIAMWebApp.Shared.Application.Interfaces +@using TIAMWebApp.Shared.Application.Models +@using TIAMWebApp.Shared.Application.Utility +@layout AdminLayout +@inject IJSRuntime JSRuntime; +@inject IImageDataService imageDataService; +@inject LogToBrowserConsole logToBrowserConsole; +@implements IAsyncDisposable + +

File Upload

+ +
+ +
+
+

@ErrorMessage

+
+
+ @foreach (var imageSource in imageSources) + { + + } +
+ + +@code { + ElementReference fileDropContainer; + InputFile inputFile; + + IJSObjectReference _filePasteModule; + IJSObjectReference _filePasteFunctionReference; + + private string HoverClass; + private List imageSources = new(); + private const int maxAllowedFiles = 2; + private string ErrorMessage; + + private MultipartFormDataContent multipartFormData = new MultipartFormDataContent(); + + protected override async Task OnAfterRenderAsync(bool firstRender) + { + if (firstRender) + { + _filePasteModule = await JSRuntime.InvokeAsync("import", "./_content/TIAMSharedUI/filePaste.js"); + + _filePasteFunctionReference = await _filePasteModule.InvokeAsync("initializeFilePaste", fileDropContainer, inputFile.Element); + } + } + + void OnDragEnter(DragEventArgs e) => HoverClass = "hover"; + + void OnDragLeave(DragEventArgs e) => HoverClass = string.Empty; + + async Task OnChange(InputFileChangeEventArgs e) + { + imageSources.Clear(); + ErrorMessage = string.Empty; + + if (e.FileCount > maxAllowedFiles) + { + ErrorMessage = $"Only {maxAllowedFiles} files can be uploaded"; + return; + } + + foreach (var file in e.GetMultipleFiles(maxAllowedFiles)) + { + // using var stream = file.OpenReadStream(); + // using var ms = new MemoryStream(); + // await stream.CopyToAsync(ms); + // imageSources.Add(Convert.ToBase64String(ms.ToArray())); + //imageSources.Add($"data:{file.ContentType};base64,{Convert.ToBase64String(ms.ToArray())}"); + //send the file to the server through an API + + var fileContent = new StreamContent(file.OpenReadStream()); + fileContent.Headers.ContentType = new MediaTypeHeaderValue(file.ContentType); + multipartFormData.Add(fileContent, "file", file.Name); + } + + HoverClass = string.Empty; + } + + async Task UploadFiles() + { + if (multipartFormData.Headers.Count() == 0) + { + ErrorMessage = "No files to upload"; + return; + } + try + { + + //send the files to the server through an API + + + // List streamContents = new List(); + // foreach (var base64Image in imageSources) + // { + // byte[] imageBytes = Convert.FromBase64String(base64Image); + // var streamContent = new StreamContent(new MemoryStream(imageBytes)); + // streamContents.Add(streamContent); + // } + + // var multipartContent = new MultipartFormDataContent(); + // for (int i = 0; i < streamContents.Count; i++) + // { + // multipartContent.Add(streamContents[i], $"file{i}", $"file{i}.jpg"); + // } + + //send the multipartcontent to ImageData service + + await imageDataService.UploadImageAsync(multipartFormData); + } + catch (Exception ex) + { + ErrorMessage = ex.Message; + + logToBrowserConsole.LogToBC(ex.Message); + } + } + + + + public async ValueTask DisposeAsync() + { + if (_filePasteFunctionReference != null) + { + await _filePasteFunctionReference.InvokeVoidAsync("dispose"); + await _filePasteFunctionReference.DisposeAsync(); + } + + if (_filePasteModule != null) + { + await _filePasteModule.DisposeAsync(); + } + } +} diff --git a/TIAMSharedUI/Pages/User/Media.razor.css b/TIAMSharedUI/Pages/User/Media.razor.css new file mode 100644 index 00000000..b4a63d6d --- /dev/null +++ b/TIAMSharedUI/Pages/User/Media.razor.css @@ -0,0 +1,32 @@ +.file-drop-zone { + width: 100%; + border: 3px dotted #fb275d; + display: flex; + align-items: center; + margin-bottom: 2px; + min-height: 100px; +} + +.hover { + border-style: solid; + background-color: #00ca71; +} + +.image-container { + display: flex; + justify-content: center; +} + +.image-container img { + width: 50%; +} + +::deep input[type=file] { + width: 100%; + padding: 20px; +} + +.error-message-container { + color: red; + text-align: center; +} \ No newline at end of file diff --git a/TIAMSharedUI/Pages/User/SysAdmins/SysAdminComponent.razor b/TIAMSharedUI/Pages/User/SysAdmins/SysAdminComponent.razor index 98bf905c..30092abf 100644 --- a/TIAMSharedUI/Pages/User/SysAdmins/SysAdminComponent.razor +++ b/TIAMSharedUI/Pages/User/SysAdmins/SysAdminComponent.razor @@ -8,9 +8,9 @@
- + -
+
@@ -49,8 +49,8 @@
- -
+ +
@@ -87,8 +87,8 @@
- -
+ +
@@ -125,8 +125,8 @@
- -
+ +
@@ -165,8 +165,8 @@
- -
+ +
@@ -208,8 +208,8 @@
- -
+ +
diff --git a/TIAMSharedUI/Pages/User/SysAdmins/TransferDestinations.razor b/TIAMSharedUI/Pages/User/SysAdmins/TransferDestinations.razor index fba21161..548d6d51 100644 --- a/TIAMSharedUI/Pages/User/SysAdmins/TransferDestinations.razor +++ b/TIAMSharedUI/Pages/User/SysAdmins/TransferDestinations.razor @@ -1,5 +1,6 @@ @page "/user/destinations" @using AyCode.Models.Messages +@using BlazorAnimation @using TIAM.Entities.ServiceProviders @using TIAM.Resources @using TIAMSharedUI.Pages.Components @@ -19,82 +20,82 @@
-
-
+
+

@localizer.GetString("TransferDestination")

- -
-
- + +
+
+ +
+ + + + + + + + @{ + var keyField = context.Value; + @context.Value + } + + + + + + + + + + + + @{ + var transfer = (TransferDestinationWizardModel)EditFormContext.EditModel; + } + + + @EditFormContext.GetEditor("Name") + + + @EditFormContext.GetEditor("Description") + + + @EditFormContext.GetEditor("AddressString") + + + @EditFormContext.GetEditor("PriceType") + + + @EditFormContext.GetEditor("Price") + + + + + + + +
- - - - - - - - @{ - var keyField = context.Value; - @context.Value - } - - - - - - - - - - - - @{ - var transfer = (TransferDestinationWizardModel)EditFormContext.EditModel; - } - - - @EditFormContext.GetEditor("Name") - - - @EditFormContext.GetEditor("Description") - - - @EditFormContext.GetEditor("AddressString") - - - @EditFormContext.GetEditor("PriceType") - - - @EditFormContext.GetEditor("Price") - - - - - - - - -
- +
- +
diff --git a/TIAMSharedUI/Pages/User/SysAdmins/TransferManagement.razor b/TIAMSharedUI/Pages/User/SysAdmins/TransferManagement.razor index 3b5d7f83..020ecb73 100644 --- a/TIAMSharedUI/Pages/User/SysAdmins/TransferManagement.razor +++ b/TIAMSharedUI/Pages/User/SysAdmins/TransferManagement.razor @@ -1,9 +1,11 @@ @page "/user/transfers" @using AyCode.Models.Messages +@using BlazorAnimation @using TIAM.Entities.ServiceProviders @using TIAM.Resources @using TIAMSharedUI.Pages.Components @using TIAMSharedUI.Shared +@using TIAMWebApp.Shared.Application.Interfaces @using TIAMWebApp.Shared.Application.Models @using TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels @using TIAMWebApp.Shared.Application.Models.ClientSide.Messages @@ -11,6 +13,7 @@ @layout AdminLayout @inject LogToBrowserConsole logToBrowserConsole @inject IStringLocalizer localizer +@inject IWizardProcessor wizardProcessor Transfers
@@ -19,147 +22,150 @@
-
+
-
- - - - - - - - - + +
-
-
- -
- - - + + + + + + + + - - - +
+
+ +
+ + + + + + + + @{ + var keyField = context.Value; + @context.Value + } + + + + + + + + + + @{ + var keyField = context.Value; + var keyItem = (TransferWizardModel)context.DataItem; + string buttonText = "Contact"; + + } + + + + + @{ + DriverModel keyField = (DriverModel)context.Value; + string driverText = keyField.Name; +

@driverText

+ } +
+
+ +
+ + @{ - var keyField = context.Value; - @context.Value + var transfer = (TransferWizardModel)EditFormContext.EditModel; } - - - - - - - - - - @{ - var keyField = context.Value; - string buttonText = "Contact"; - - } - - - - - @{ - DriverModel keyField = (DriverModel)context.Value; - string driverText = keyField.Name; -

@driverText

- } -
-
- - - - - @{ - var transfer = (TransferWizardModel)EditFormContext.EditModel; - } - - - @EditFormContext.GetEditor("Destination") - - - @EditFormContext.GetEditor("PickupAddress") - - - @EditFormContext.GetEditor("TripDate") - - - @EditFormContext.GetEditor("NumberOfPassengers") - - - @EditFormContext.GetEditor("FullName") - - - @EditFormContext.GetEditor("PhoneNumber") - - - @EditFormContext.GetEditor("EmailAddress") - - - + + @EditFormContext.GetEditor("Destination") + + + @EditFormContext.GetEditor("PickupAddress") + + + @EditFormContext.GetEditor("TripDate") + + + @EditFormContext.GetEditor("NumberOfPassengers") + + + @EditFormContext.GetEditor("FullName") + + + @EditFormContext.GetEditor("PhoneNumber") + + + @EditFormContext.GetEditor("EmailAddress") + + + - - + + - - + +
-
+ -
+
- -
+ +
+
- +
@@ -177,11 +183,15 @@ bool PopupVisible { get; set; } public List ignoreList = new List { - "ReceiverId" + "ReceiverEmailAddress", + "ReceiverId", + "SenderEmailAddress", + "SenderId", + "ContextId" }; public MessageWizardModel messageWizardModel = new MessageWizardModel(); - + //IEnumerable drivers { get; set; } @@ -189,7 +199,7 @@ new DriverModel(Guid.NewGuid(), Guid.NewGuid(), "John Doe"), new DriverModel(Guid.NewGuid(), Guid.NewGuid(), "Jane Doe"), new DriverModel(Guid.NewGuid(), Guid.NewGuid(), "James Doe") - }; + }; object? TransferData = new TransferWizardModel[] { @@ -203,9 +213,9 @@ }; - void SendMail(object emailAddress) + void SendMail(TransferWizardModel Item) { - logToBrowserConsole.LogToBC($"Sending mail to {emailAddress}"); + logToBrowserConsole.LogToBC($"Sending mail to {Item.EmailAddress}"); PopupVisible = true; } @@ -231,7 +241,8 @@ public async Task SubmitForm(object Result) { - //await WizardProcessor.ProcessWizardAsync(Result.GetType(), Result); + var email = await wizardProcessor.ProcessWizardAsync(Result.GetType(), Result); + logToBrowserConsole.LogToBC($"Submitted nested form: {Result.GetType().FullName}"); } @@ -281,9 +292,9 @@ } - - //await NwindDataService.UpdateEmployeeAsync((EditableEmployee)e.DataItem, (EditableEmployee)e.EditModel); - + + //await NwindDataService.UpdateEmployeeAsync((EditableEmployee)e.DataItem, (EditableEmployee)e.EditModel); + await UpdateDataAsync(); } async Task Grid_DataItemDeleting(GridDataItemDeletingEventArgs e) @@ -304,8 +315,8 @@ { base.OnInitialized(); - - + + } diff --git a/TIAMSharedUI/Resources/MyResources.Designer.cs b/TIAMSharedUI/Resources/MyResources.Designer.cs index 447e310b..08e6429b 100644 --- a/TIAMSharedUI/Resources/MyResources.Designer.cs +++ b/TIAMSharedUI/Resources/MyResources.Designer.cs @@ -177,6 +177,15 @@ namespace TIAMSharedUI.Resources { } } + /// + /// Looks up a localized string similar to Events. + /// + public static string NavMenu_Events { + get { + return ResourceManager.GetString("NavMenu.Events", resourceCulture); + } + } + /// /// Looks up a localized string similar to Home. /// diff --git a/TIAMSharedUI/Resources/MyResources.hu.resx b/TIAMSharedUI/Resources/MyResources.hu.resx index fb6fe0a7..c2e98cb4 100644 --- a/TIAMSharedUI/Resources/MyResources.hu.resx +++ b/TIAMSharedUI/Resources/MyResources.hu.resx @@ -156,6 +156,9 @@ Adminisztráció + + Események + Főoldal diff --git a/TIAMSharedUI/Resources/MyResources.resx b/TIAMSharedUI/Resources/MyResources.resx index 8cca7c97..86c56661 100644 --- a/TIAMSharedUI/Resources/MyResources.resx +++ b/TIAMSharedUI/Resources/MyResources.resx @@ -156,6 +156,9 @@ Admin + + Events + Home diff --git a/TIAMSharedUI/Shared/Components/Navbar.razor b/TIAMSharedUI/Shared/Components/Navbar.razor index 7759e8bd..3c33e035 100644 --- a/TIAMSharedUI/Shared/Components/Navbar.razor +++ b/TIAMSharedUI/Shared/Components/Navbar.razor @@ -23,7 +23,13 @@ @localizer.GetString("NavMenu.Transfer") - + +
+ +