This commit is contained in:
jozsef.b@aycode.com 2024-02-27 18:55:16 +01:00
commit 2e60b13e95
37 changed files with 1360 additions and 257 deletions

View File

@ -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();
}
}

View File

@ -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<ISessionService, SessionServiceMobile>();
builder.Services.AddSingleton<IComponentUpdateService, ComponentUpdateServiceMobile>();
builder.Services.AddScoped<IServiceProviderDataService, ServiceProviderDataService>();
builder.Services.AddScoped<IClientNoticeSenderService, ClientNoticeSenderService>();
builder.Services.AddScoped<IWizardProcessor, WizardProcessor>();
builder.Services.AddScoped<IImageDataService, ImageDataService>();
builder.Services.AddSingleton(x => new ResourceManager("TIAMWebApp.Shared.Application.Resources", typeof(Main).Assembly));
builder.Services.Configure<AnimationOptions>(Guid.NewGuid().ToString(), c => { });

View File

@ -28,5 +28,9 @@
</array>
<key>XSAppIconAssets</key>
<string>Assets.xcassets/appicon.appiconset</string>
<key>NSCameraUsageDescription</key>
<string>This app uses camera for...</string>
<key>NSMicrophoneUsageDescription</key>
<string>This app uses microphone to record videos for...</string>
</dict>
</plist>

View File

@ -0,0 +1,84 @@
@page "/events"
@using TIAMSharedUI.Shared
@using TIAMWebApp.Shared.Application.Models
<HeroSlider></HeroSlider>
<div class="container">
<section class="game-section" style="max-width: 100%; overflow-x:hidden">
<div class="text-center">
<h1>Tours</h1>
<h2>Please select!</h2>
</div>
<div class="owl-carousel custom-carousel owl-theme">
@{
foreach (var item in MockEvents)
{
<div class="item" style="background-image: url(@item.ImageUrl);">
<div class="item-desc" style="height: 100%; background-color: rgba(0,0,0,0.3);">
<!--h3>item.Name</h3-->
<h3 class="card-title" style="margin-top: 80px;">@item.Name</h3>
<p>@item.DateAndTime</p>
<p>@item.Description</p>
<p>@item.Location</p>
<div class="glass" style="position: absolute; top:0px; left:0px; padding:10px; width:100%">
<span>by</span>
<svg width="30%" viewBox="0 0 112 33" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;"><g id="Logó"><path d="M99.636,13.719c-0.569,1.804 -1.048,3.323 -1.542,4.889l3.215,0c-0.549,-1.606 -1.062,-3.104 -1.673,-4.889m11.754,11.595c-2.575,0 -4.95,0.027 -7.323,-0.036c-0.267,-0.007 -0.637,-0.476 -0.76,-0.805c-0.592,-1.582 -0.567,-1.591 -2.263,-1.592c-1.452,0 -2.903,0 -4.316,0c-0.913,2.437 -0.913,2.437 -3.473,2.437l-3.674,0c2.395,-6.454 4.723,-12.727 7.07,-19.049c2.38,0 4.725,-0.037 7.065,0.044c0.312,0.01 0.736,0.565 0.884,0.953c2.099,5.504 4.159,11.022 6.228,16.537c0.16,0.426 0.318,0.854 0.562,1.511" style="fill:#fff;fill-opacity:0.8;fill-rule:nonzero;"></path><path d="M89.146,6.271c-2.087,2.974 -4.038,5.753 -6.039,8.604c1.968,3.411 3.942,6.833 6.02,10.434c-2.908,0 -5.596,0.014 -8.284,-0.025c-0.228,-0.003 -0.526,-0.317 -0.663,-0.559c-0.559,-0.986 -1.068,-2.001 -1.698,-3.202c-0.649,1.062 -1.269,1.982 -1.786,2.957c-0.348,0.658 -0.797,0.87 -1.523,0.853c-1.934,-0.045 -3.869,-0.015 -6.019,-0.015c1.733,-2.622 3.245,-5.103 4.963,-7.431c0.923,-1.251 0.94,-2.138 0.063,-3.432c-1.751,-2.579 -3.285,-5.306 -4.969,-8.072c0.297,-0.045 0.516,-0.107 0.735,-0.108c2.344,-0.007 4.689,0.018 7.032,-0.019c0.622,-0.009 0.972,0.195 1.247,0.741c0.475,0.94 1.019,1.846 1.607,2.898c0.707,-1.095 1.311,-2.088 1.982,-3.033c0.192,-0.269 0.577,-0.558 0.879,-0.565c2.058,-0.05 4.117,-0.026 6.453,-0.026" style="fill:#fff;fill-opacity:0.8;fill-rule:nonzero;"></path><path d="M59.654,6.335l0,5.691l-5.73,0l0,13.193l-7.515,0l0,-13.147l-5.731,0l0,-5.737l18.976,0Z" style="fill:#fff;fill-opacity:0.8;fill-rule:nonzero;"></path><rect x="61.187" y="6.342" width="6.698" height="18.911" style="fill:#fff;fill-opacity:0.8;"></rect><path d="M28.354,21.366c0.306,4.69 -5.098,5.2 -6.831,2.855c-2.169,-2.934 -5.05,-2.797 -6.619,-1.438c-1.569,-1.359 -4.449,-1.496 -6.618,1.438c-1.733,2.345 -7.137,1.835 -6.831,-2.855c0,0 -2.763,4.258 0.611,8.055c3.263,3.671 8.689,3.784 12.032,0.918c0.305,-0.262 0.568,-0.53 0.806,-0.802c0.238,0.272 0.501,0.54 0.807,0.802c3.343,2.866 8.768,2.753 12.031,-0.918c3.375,-3.796 0.612,-8.055 0.612,-8.055Z" style="fill:#fff;fill-opacity:0.8;fill-rule:nonzero;"></path><path d="M28.354,11.37c0.306,-4.69 -5.098,-5.2 -6.831,-2.855c-2.169,2.934 -5.05,2.797 -6.619,1.438c-1.569,1.359 -4.449,1.496 -6.618,-1.438c-1.733,-2.345 -7.137,-1.835 -6.831,2.855c0,0 -2.763,-4.258 0.611,-8.055c3.263,-3.671 8.689,-3.784 12.032,-0.918c0.305,0.262 0.568,0.53 0.806,0.802c0.238,-0.272 0.501,-0.54 0.807,-0.802c3.343,-2.866 8.768,-2.753 12.031,0.918c3.375,3.796 0.612,8.055 0.612,8.055Z" style="fill:#fff;fill-opacity:0.8;fill-rule:nonzero;"></path><circle cx="12.241" cy="16.368" r="1.332" style="fill:#fff;fill-opacity:0.8;"></circle><circle cx="16.902" cy="16.368" r="1.332" style="fill:#fff;fill-opacity:0.8;"></circle></g></svg>
</div>
</div>
</div>
}
}
<a href="login">
</a>
</div>
</section>
<FeaturedItems ItemType="0"></FeaturedItems>
</div>
<script>
$(".custom-carousel").owlCarousel({
autoWidth: true,
loop: true
});
$(document).ready(function () {
$(".custom-carousel .item").click(function () {
$(".custom-carousel .item").not($(this)).removeClass("active");
$(this).toggleClass("active");
});
});
</script>
@code {
public List<Event> MockEvents = new List<Event>
{
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"),
};
}

View File

@ -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));
}
}

View File

@ -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 {

View File

@ -53,6 +53,7 @@
</div>
</div>
</section>
<EventsComponent ItemType="0"></EventsComponent>
<FeaturedItems ItemType="0"></FeaturedItems>
</div>

View File

@ -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 {

View File

@ -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
<div class="upload-container">
<div style="@(SelectedFilesCount > 0 ? "display: none" : string.Empty)">
<span class="drop-file-icon mb-3"></span>
<span class="mb-3">Click the Select Files button to select a file</span>
</div>
<DxUpload Name="myFile"
UploadMode="@UploadMode.OnButtonClick"
AllowMultiFileUpload="true"
UploadUrl="@GetUploadUrl(APIUrls.UploadImage)"
SelectedFilesChanged="@SelectedFilesChanged"
MaxFileSize="15000000"
CssClass="@(SelectedFilesCount > 0 ? "w-100" : string.Empty)">
</DxUpload>
</div>
@code {
int SelectedFilesCount { get; set; }
protected void SelectedFilesChanged(IEnumerable<UploadFileInfo> 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
<h3>File Upload</h3>
<div @ref="fileDropContainer" class="file-drop-zone @HoverClass glass" @ondragenter="OnDragEnter" @ondragleave="OnDragLeave" @ondragover="OnDragEnter">
<InputFile OnChange="@OnChange" @ref="inputFile" multiple />
</div>
<div class="error-message-container">
<p>@ErrorMessage</p>
</div>
<div class="image-container">
@foreach (var imageSource in imageSources)
{
<img src="@imageSource" />
}
</div>
<DxButton Text="Upload" Click="@UploadFiles" />
@code {
ElementReference fileDropContainer;
InputFile inputFile;
IJSObjectReference _filePasteModule;
IJSObjectReference _filePasteFunctionReference;
private string HoverClass;
private List<string> 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<IJSObjectReference>("import", "./_content/TIAMSharedUI/filePaste.js");
_filePasteFunctionReference = await _filePasteModule.InvokeAsync<IJSObjectReference>("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<StreamContent> streamContents = new List<StreamContent>();
// 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();
}
}
}

View File

@ -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;
}

View File

@ -8,9 +8,9 @@
<div class="row py-3">
<div class=" col-12 col-xl-3 col-lg-6">
<Animation Effect="@Effect.FadeInUp" Speed="@Speed.Fast" Delay="@TimeSpan.FromMilliseconds(250)">
<Animation Effect="@Effect.FadeInUp" Class="glass" Speed="@Speed.Fast" Delay="@TimeSpan.FromMilliseconds(250)">
<div class="card glass card-admin" style="border-radius: 16px;">
<div class="card card-admin" style="border-radius: 16px;">
<div class="card-header py-2 px-4">
<div class="d-flex justify-content-between align-items-center">
<div>
@ -49,8 +49,8 @@
</div>
<div class=" col-12 col-xl-3 col-lg-6">
<Animation Effect="@Effect.FadeInUp" Speed="@Speed.Fast" Delay="@TimeSpan.FromMilliseconds(250)">
<div class="card glass card-admin" style="border-radius: 16px;">
<Animation Effect="@Effect.FadeInUp" Class="glass" Speed="@Speed.Fast" Delay="@TimeSpan.FromMilliseconds(250)">
<div class="card card-admin" style="border-radius: 16px;">
<div class="card-header py-2 px-4">
<div class="d-flex justify-content-between align-items-center">
<div>
@ -87,8 +87,8 @@
</Animation>
</div>
<div class=" col-12 col-xl-3 col-lg-6">
<Animation Effect="@Effect.FadeInUp" Speed="@Speed.Fast" Delay="@TimeSpan.FromMilliseconds(250)">
<div class="card glass card-admin" style="border-radius: 16px;">
<Animation Effect="@Effect.FadeInUp" Class="glass" Speed="@Speed.Fast" Delay="@TimeSpan.FromMilliseconds(250)">
<div class="card card-admin" style="border-radius: 16px;">
<div class="card-header py-2 px-4">
<div class="d-flex justify-content-between align-items-center">
<div>
@ -125,8 +125,8 @@
</Animation>
</div>
<div class=" col-12 col-xl-3 col-lg-6">
<Animation Effect="@Effect.FadeInUp" Speed="@Speed.Fast" Delay="@TimeSpan.FromMilliseconds(250)">
<div class="card glass card-admin" style="border-radius: 16px;">
<Animation Effect="@Effect.FadeInUp" Class="glass" Speed="@Speed.Fast" Delay="@TimeSpan.FromMilliseconds(250)">
<div class="card card-admin" style="border-radius: 16px;">
<div class="card-header py-2 px-4">
<div class="d-flex justify-content-between align-items-center">
<div>
@ -165,8 +165,8 @@
</Animation>
</div>
<div class="col-12 col-xl-6">
<Animation Effect="@Effect.FadeInUp" Speed="@Speed.Fast" Delay="@TimeSpan.FromMilliseconds(250)">
<div class="card glass card-admin" style="border-radius: 16px;">
<Animation Effect="@Effect.FadeInUp" Class="glass" Speed="@Speed.Fast" Delay="@TimeSpan.FromMilliseconds(250)">
<div class="card card-admin" style="border-radius: 16px;">
<div class="card-header py-2 px-4">
<div class="d-flex justify-content-between align-items-center">
<div>
@ -208,8 +208,8 @@
</Animation>
</div>
<div class="col-12 col-xl-6">
<Animation Effect="@Effect.FadeInUp" Speed="@Speed.Fast" Delay="@TimeSpan.FromMilliseconds(250)">
<div class="card glass card-admin" style="border-radius: 16px;">
<Animation Effect="@Effect.FadeInUp" Class="glass" Speed="@Speed.Fast" Delay="@TimeSpan.FromMilliseconds(250)">
<div class="card card-admin" style="border-radius: 16px;">
<div class="card-header py-2 px-4">
<div class="d-flex justify-content-between align-items-center">
<div>

View File

@ -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 @@
</div>
<div class="container">
<div class="row">
<div class=" col-12">
<div class="row">
<div class="col-12">
<h3>@localizer.GetString("TransferDestination")</h3>
<div class="d-flex flex-column mb-4 pb-2">
<div class="align-self-end pl-2 pb-2">
<DxButton Text="Column Chooser"
RenderStyle="ButtonRenderStyle.Secondary"
IconCssClass="btn-column-chooser"
Click="ColumnChooserButton_Click" />
<Animation Effect="@Effect.FadeInUp" Class="glass" Speed="@Speed.Fast" Delay="@TimeSpan.FromMilliseconds(250)">
<div class="d-flex flex-column mb-4 pb-2">
<div class="align-self-end pl-2 pb-2">
<DxButton Text="Column Chooser"
RenderStyle="ButtonRenderStyle.Secondary"
IconCssClass="btn-column-chooser"
Click="ColumnChooserButton_Click" />
</div>
<DxGrid @ref="Grid"
Data="TransferDataFromDb"
PageSize="8"
KeyFieldName="Id"
ValidationEnabled="false"
CustomizeElement="Grid_CustomizeElement"
CustomizeEditModel="Grid_CustomizeEditModel"
EditModelSaving="Grid_EditModelSaving"
DataItemDeleting="Grid_DataItemDeleting"
EditMode="GridEditMode.EditForm"
ColumnResizeMode="GridColumnResizeMode.ColumnsContainer"
KeyboardNavigationEnabled="true"
ShowFilterRow="true">
<Columns>
<DxGridCommandColumn Width="8%" FixedPosition="GridColumnFixedPosition.Left" />
<DxGridDataColumn FieldName="Id" MinWidth="80" Width="20%" Visible="false" />
<DxGridDataColumn FieldName="Name" FixedPosition="GridColumnFixedPosition.Left" MinWidth="80" Width="20%">
<CellDisplayTemplate>
@{
var keyField = context.Value;
<a class="d-block text-left" href="transferdetails">@context.Value</a>
}
</CellDisplayTemplate>
</DxGridDataColumn>
<DxGridDataColumn FieldName="Description" FixedPosition="GridColumnFixedPosition.Left" MinWidth="80" Width="20%" />
<DxGridDataColumn FieldName="AddressString" MinWidth="80" Width="20%" />
<DxGridDataColumn FieldName="PriceType" MinWidth="80" Width="20%" />
<DxGridDataColumn FieldName="Price" MinWidth="80" Width="20%" />
</Columns>
<EditFormTemplate Context="EditFormContext">
@{
var transfer = (TransferDestinationWizardModel)EditFormContext.EditModel;
}
<DxFormLayout CssClass="w-100">
<DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.DestinationName) ColSpanMd="6">
@EditFormContext.GetEditor("Name")
</DxFormLayoutItem>
<DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.Destination) ColSpanMd="6">
@EditFormContext.GetEditor("Description")
</DxFormLayoutItem>
<DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.DestinationAddress) ColSpanMd="6">
@EditFormContext.GetEditor("AddressString")
</DxFormLayoutItem>
<DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.Price) ColSpanMd="6">
@EditFormContext.GetEditor("PriceType")
</DxFormLayoutItem>
<DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.Price) ColSpanMd="6">
@EditFormContext.GetEditor("Price")
</DxFormLayoutItem>
</DxFormLayout>
</EditFormTemplate>
</DxGrid>
</div>
<DxGrid @ref="Grid"
Data="TransferDataFromDb"
PageSize="8"
KeyFieldName="Id"
ValidationEnabled="false"
CustomizeElement="Grid_CustomizeElement"
CustomizeEditModel="Grid_CustomizeEditModel"
EditModelSaving="Grid_EditModelSaving"
DataItemDeleting="Grid_DataItemDeleting"
EditMode="GridEditMode.EditForm"
ColumnResizeMode="GridColumnResizeMode.ColumnsContainer"
KeyboardNavigationEnabled="true"
ShowFilterRow="true">
<Columns>
<DxGridCommandColumn Width="8%" FixedPosition="GridColumnFixedPosition.Left" />
<DxGridDataColumn FieldName="Id" MinWidth="80" Width="20%" Visible="false" />
<DxGridDataColumn FieldName="Name" FixedPosition="GridColumnFixedPosition.Left" MinWidth="80" Width="20%">
<CellDisplayTemplate>
@{
var keyField = context.Value;
<a class="d-block text-left" href="transferdetails">@context.Value</a>
}
</CellDisplayTemplate>
</DxGridDataColumn>
<DxGridDataColumn FieldName="Description" FixedPosition="GridColumnFixedPosition.Left" MinWidth="80" Width="20%" />
<DxGridDataColumn FieldName="AddressString" MinWidth="80" Width="20%" />
<DxGridDataColumn FieldName="PriceType" MinWidth="80" Width="20%" />
<DxGridDataColumn FieldName="Price" MinWidth="80" Width="20%" />
</Columns>
<EditFormTemplate Context="EditFormContext">
@{
var transfer = (TransferDestinationWizardModel)EditFormContext.EditModel;
}
<DxFormLayout CssClass="w-100">
<DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.DestinationName) ColSpanMd="6">
@EditFormContext.GetEditor("Name")
</DxFormLayoutItem>
<DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.Destination) ColSpanMd="6">
@EditFormContext.GetEditor("Description")
</DxFormLayoutItem>
<DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.DestinationAddress) ColSpanMd="6">
@EditFormContext.GetEditor("AddressString")
</DxFormLayoutItem>
<DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.Price) ColSpanMd="6">
@EditFormContext.GetEditor("PriceType")
</DxFormLayoutItem>
<DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.Price) ColSpanMd="6">
@EditFormContext.GetEditor("Price")
</DxFormLayoutItem>
</DxFormLayout>
</EditFormTemplate>
</DxGrid>
</div>
</Animation>
</div>
<div class=" col-12 col-xl-6">
</div>

View File

@ -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<TIAMResources> localizer
@inject IWizardProcessor wizardProcessor
<PageTitle>Transfers</PageTitle>
<div class="text-center m-5">
@ -19,147 +22,150 @@
</div>
<div class="container">
<div class="row">
<div class="row">
<div class=" col-12">
<div class="card glass">
<DxPopup CssClass="popup-demo-events"
@bind-Visible="@PopupVisible"
ShowFooter="true"
CloseOnEscape="true"
CloseOnOutsideClick="false"
ShowCloseButton="false"
HeaderText="MessageBox"
Closing="EulaPopupClosing"
Closed="EulaPopupClosed">
<BodyContentTemplate>
<InputWizard Data=@messageWizardModel
OnSubmit="SubmitForm"
IgnoreReflection=@ignoreList
TitleResourceString="NewMessage"
SubtitleResourceString="NewMessageSubtitle"
SubmitButtonText="ButtonSend"></InputWizard>
</BodyContentTemplate>
<FooterContentTemplate Context="Context">
<div class="popup-demo-events-footer">
<!--DxCheckBox CssClass="popup-demo-events-checkbox" @bind-Checked="@EulaAccepted">I accept the terms of the EULA</!--DxCheckBox-->
<!--DxButton CssClass="popup-demo-events-button ms-2" RenderStyle="ButtonRenderStyle.Primary" Text="OK" Click="Context.CloseCallback" /-->
<DxButton CssClass="popup-demo-events-button ms-2" RenderStyle="ButtonRenderStyle.Secondary" Text="Cancel" Click="CancelCreateClick" />
</div>
</FooterContentTemplate>
</DxPopup>
<Animation Effect="@Effect.FadeInUp" Class="glass" Speed="@Speed.Fast" Delay="@TimeSpan.FromMilliseconds(250)">
<div class="card">
<div class="d-flex flex-column mb-4 pb-2">
<div class="align-self-end pl-2 pb-2">
<DxButton Text="Column Chooser"
RenderStyle="ButtonRenderStyle.Secondary"
IconCssClass="btn-column-chooser"
Click="ColumnChooserButton_Click" />
</div>
<DxGrid @ref="Grid"
Data="TransferData"
PageSize="8"
KeyFieldName="Id"
ValidationEnabled="false"
CustomizeEditModel="Grid_CustomizeEditModel"
EditModelSaving="Grid_EditModelSaving"
DataItemDeleting="Grid_DataItemDeleting"
EditMode="GridEditMode.EditForm"
ColumnResizeMode="GridColumnResizeMode.NextColumn"
KeyboardNavigationEnabled="true"
ShowFilterRow="true">
<Columns>
<DxGridCommandColumn Width="8%" FixedPosition="GridColumnFixedPosition.Left" />
<DxPopup CssClass="popup-demo-events"
@bind-Visible="@PopupVisible"
ShowFooter="true"
CloseOnEscape="true"
CloseOnOutsideClick="false"
ShowCloseButton="false"
HeaderText="MessageBox"
Closing="EulaPopupClosing"
Closed="EulaPopupClosed">
<BodyContentTemplate>
<InputWizard Data=@messageWizardModel
OnSubmit="SubmitForm"
IgnoreReflection=@ignoreList
TitleResourceString="NewMessage"
SubtitleResourceString="NewMessageSubtitle"
SubmitButtonText="ButtonSend"></InputWizard>
</BodyContentTemplate>
<FooterContentTemplate Context="Context">
<div class="popup-demo-events-footer">
<!--DxCheckBox CssClass="popup-demo-events-checkbox" @bind-Checked="@EulaAccepted">I accept the terms of the EULA</!--DxCheckBox-->
<!--DxButton CssClass="popup-demo-events-button ms-2" RenderStyle="ButtonRenderStyle.Primary" Text="OK" Click="Context.CloseCallback" /-->
<DxButton CssClass="popup-demo-events-button ms-2" RenderStyle="ButtonRenderStyle.Secondary" Text="Cancel" Click="CancelCreateClick" />
</div>
</FooterContentTemplate>
</DxPopup>
<DxGridDataColumn FieldName="Id" MinWidth="80" Width="10%" Visible="false" />
<DxGridDataColumn FieldName="Destination" FixedPosition="GridColumnFixedPosition.Left" MinWidth="80" Width="10%">
<CellDisplayTemplate>
<div class="d-flex flex-column mb-4 pb-2">
<div class="align-self-end pl-2 pb-2">
<DxButton Text="Column Chooser"
RenderStyle="ButtonRenderStyle.Secondary"
IconCssClass="btn-column-chooser"
Click="ColumnChooserButton_Click" />
</div>
<DxGrid @ref="Grid"
Data="TransferData"
PageSize="8"
KeyFieldName="Id"
ValidationEnabled="false"
CustomizeEditModel="Grid_CustomizeEditModel"
EditModelSaving="Grid_EditModelSaving"
DataItemDeleting="Grid_DataItemDeleting"
EditMode="GridEditMode.EditForm"
ColumnResizeMode="GridColumnResizeMode.NextColumn"
KeyboardNavigationEnabled="true"
ShowFilterRow="true">
<Columns>
<DxGridCommandColumn Width="8%" FixedPosition="GridColumnFixedPosition.Left" />
<DxGridDataColumn FieldName="Id" MinWidth="80" Width="10%" Visible="false" />
<DxGridDataColumn FieldName="Destination" FixedPosition="GridColumnFixedPosition.Left" MinWidth="80" Width="10%">
<CellDisplayTemplate>
@{
var keyField = context.Value;
<a class="d-block text-left" href="transferdetails">@context.Value</a>
}
</CellDisplayTemplate>
</DxGridDataColumn>
<DxGridDataColumn FieldName="PickupAddress" FixedPosition="GridColumnFixedPosition.Left" MinWidth="80" Width="15%" />
<DxGridDataColumn FieldName="TripDate" MinWidth="80" Width="10%" />
<DxGridDataColumn FieldName="NumberOfPassengers" MinWidth="40" Width="3%" />
<DxGridDataColumn FieldName="FullName" MinWidth="80" />
<DxGridDataColumn FieldName="PhoneNumber" MinWidth="80" Width="10%" />
<DxGridDataColumn FieldName="EmailAddress" MinWidth="80" Width="10%">
<CellDisplayTemplate>
@{
var keyField = context.Value;
var keyItem = (TransferWizardModel)context.DataItem;
string buttonText = "Contact";
<DxButton Click="() => SendMail(keyItem)" Text="@buttonText" RenderStyle="ButtonRenderStyle.Primary" />
}
</CellDisplayTemplate>
</DxGridDataColumn>
<DxGridDataColumn FieldName="Driver" FixedPosition="GridColumnFixedPosition.Right" MinWidth="80" Width="15%">
<CellDisplayTemplate>
@{
DriverModel keyField = (DriverModel)context.Value;
string driverText = keyField.Name;
<p>@driverText</p>
}
</CellDisplayTemplate>
</DxGridDataColumn>
</Columns>
<EditFormTemplate Context="EditFormContext">
@{
var keyField = context.Value;
<a class="d-block text-left" href="transferdetails">@context.Value</a>
var transfer = (TransferWizardModel)EditFormContext.EditModel;
}
</CellDisplayTemplate>
</DxGridDataColumn>
<DxGridDataColumn FieldName="PickupAddress" FixedPosition="GridColumnFixedPosition.Left" MinWidth="80" Width="15%" />
<DxGridDataColumn FieldName="TripDate" MinWidth="80" Width="10%" />
<DxGridDataColumn FieldName="NumberOfPassengers" MinWidth="40" Width="3%" />
<DxGridDataColumn FieldName="FullName" MinWidth="80" />
<DxGridDataColumn FieldName="PhoneNumber" MinWidth="80" Width="10%" />
<DxGridDataColumn FieldName="EmailAddress" MinWidth="80" Width="10%">
<CellDisplayTemplate>
@{
var keyField = context.Value;
string buttonText = "Contact";
<DxButton Click="() => SendMail(keyField)" Text="@buttonText" RenderStyle="ButtonRenderStyle.Primary" />
}
</CellDisplayTemplate>
</DxGridDataColumn>
<DxGridDataColumn FieldName="Driver" FixedPosition="GridColumnFixedPosition.Right" MinWidth="80" Width="15%">
<CellDisplayTemplate>
@{
DriverModel keyField = (DriverModel)context.Value;
string driverText = keyField.Name;
<p>@driverText</p>
}
</CellDisplayTemplate>
</DxGridDataColumn>
</Columns>
<EditFormTemplate Context="EditFormContext">
@{
var transfer = (TransferWizardModel)EditFormContext.EditModel;
}
<DxFormLayout CssClass="w-100">
<DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.DestinationAddress) ColSpanMd="6">
@EditFormContext.GetEditor("Destination")
</DxFormLayoutItem>
<DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.PickupAddress) ColSpanMd="6">
@EditFormContext.GetEditor("PickupAddress")
</DxFormLayoutItem>
<DxFormLayoutItem Caption="Trip date:" ColSpanMd="6">
@EditFormContext.GetEditor("TripDate")
</DxFormLayoutItem>
<DxFormLayoutItem Caption="Passengers:" ColSpanMd="6">
@EditFormContext.GetEditor("NumberOfPassengers")
</DxFormLayoutItem>
<DxFormLayoutItem Caption="Full name:" ColSpanMd="6">
@EditFormContext.GetEditor("FullName")
</DxFormLayoutItem>
<DxFormLayoutItem Caption="Phone number:" ColSpanMd="6">
@EditFormContext.GetEditor("PhoneNumber")
</DxFormLayoutItem>
<DxFormLayoutItem Caption="Email:" ColSpanMd="6">
@EditFormContext.GetEditor("EmailAddress")
</DxFormLayoutItem>
<DxFormLayoutItem Caption="Driver:" ColSpanMd="6">
<DxComboBox Data="@drivers"
NullText="Select driver..."
FilteringMode="DataGridFilteringMode.Contains"
TextFieldName="Name"
ValueFieldName="Name"
Value="@transfer.Driver.Name"
ValueChanged="(string newCellValue) => {
<DxFormLayout CssClass="w-100">
<DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.DestinationAddress) ColSpanMd="6">
@EditFormContext.GetEditor("Destination")
</DxFormLayoutItem>
<DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.PickupAddress) ColSpanMd="6">
@EditFormContext.GetEditor("PickupAddress")
</DxFormLayoutItem>
<DxFormLayoutItem Caption="Trip date:" ColSpanMd="6">
@EditFormContext.GetEditor("TripDate")
</DxFormLayoutItem>
<DxFormLayoutItem Caption="Passengers:" ColSpanMd="6">
@EditFormContext.GetEditor("NumberOfPassengers")
</DxFormLayoutItem>
<DxFormLayoutItem Caption="Full name:" ColSpanMd="6">
@EditFormContext.GetEditor("FullName")
</DxFormLayoutItem>
<DxFormLayoutItem Caption="Phone number:" ColSpanMd="6">
@EditFormContext.GetEditor("PhoneNumber")
</DxFormLayoutItem>
<DxFormLayoutItem Caption="Email:" ColSpanMd="6">
@EditFormContext.GetEditor("EmailAddress")
</DxFormLayoutItem>
<DxFormLayoutItem Caption="Driver:" ColSpanMd="6">
<DxComboBox Data="@drivers"
NullText="Select driver..."
FilteringMode="DataGridFilteringMode.Contains"
TextFieldName="Name"
ValueFieldName="Name"
Value="@transfer.Driver.Name"
ValueChanged="(string newCellValue) => {
transfer.Driver = drivers.FirstOrDefault(x => x.Name == newCellValue);
logToBrowserConsole.LogToBC(newCellValue);
}">
</DxComboBox>
</DxFormLayoutItem>
</DxComboBox>
</DxFormLayoutItem>
</DxFormLayout>
</EditFormTemplate>
</DxFormLayout>
</EditFormTemplate>
</DxGrid>
</DxGrid>
</div>
</div>
</div>
</div>
</Animation>
</div>
<div class=" col-12 col-xl-6">
</div>
@ -177,11 +183,15 @@
bool PopupVisible { get; set; }
public List<string> ignoreList = new List<string>
{
"ReceiverId"
"ReceiverEmailAddress",
"ReceiverId",
"SenderEmailAddress",
"SenderId",
"ContextId"
};
public MessageWizardModel messageWizardModel = new MessageWizardModel();
//IEnumerable<DriverModel> 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<MessageWizardModel>(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();
}

View File

@ -177,6 +177,15 @@ namespace TIAMSharedUI.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Events.
/// </summary>
public static string NavMenu_Events {
get {
return ResourceManager.GetString("NavMenu.Events", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Home.
/// </summary>

View File

@ -156,6 +156,9 @@
<data name="NavMenu.Admin" xml:space="preserve">
<value>Adminisztráció</value>
</data>
<data name="NavMenu.Events" xml:space="preserve">
<value>Események</value>
</data>
<data name="NavMenu.Home" xml:space="preserve">
<value>Főoldal</value>
</data>

View File

@ -156,6 +156,9 @@
<data name="NavMenu.Admin" xml:space="preserve">
<value>Admin</value>
</data>
<data name="NavMenu.Events" xml:space="preserve">
<value>Events</value>
</data>
<data name="NavMenu.Home" xml:space="preserve">
<value>Home</value>
</data>

View File

@ -23,7 +23,13 @@
<NavLink class="nav-link" href="transfer">
@localizer.GetString("NavMenu.Transfer")
</NavLink>
</li><li class="nav-item">
</li>
<li class="nav-item">
<NavLink class="nav-link" href="events">
@localizer.GetString("NavMenu.Events")
</NavLink>
</li>
<li class="nav-item">
<NavLink class="nav-link" href="swagger">
API
</NavLink>

View File

@ -0,0 +1,97 @@
@using TIAMWebApp.Shared.Application.Models
@{
if (ItemType == 0)
{
typeVariable = "Featured Events";
}
else
{
typeVariable = "Featured partner restaurants";
}
}
<section class="py-5">
@{
if (DisplayTitle)
{
<h2 class="fw-bolder mb-4"> @typeVariable</h2>
}
}
<style>
.imagecontainer {
height: 170px;
overflow-y: hidden;
flex-wrap: wrap;
vertical-align: middle;
align-content: center;
}
</style>
<div class="row">
@{
foreach (var item in MockEvents)
{
<div class="col-xl-3 col-lg-4 col-md-4 col-xs-6 col-12">
<div class="card my-5">
<div class="imagecontainer">
<img src="@item.ImageUrl" class="card-img-top" alt="@item.Name">
</div>
<div class="card-body" style="height: 200px;">
<h5 class="card-title">@item.Name</h5>
<p>@item.DateAndTime</p>
<p class="card-text">@item.Description</p>
<p>@item.Location</p>
<div class="glass" style="position: absolute; top:0px; left:0px; padding:10px; width:100%">
<span>by</span>
<svg width="30%" viewBox="0 0 112 33" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;"><g id="Logó"><path d="M99.636,13.719c-0.569,1.804 -1.048,3.323 -1.542,4.889l3.215,0c-0.549,-1.606 -1.062,-3.104 -1.673,-4.889m11.754,11.595c-2.575,0 -4.95,0.027 -7.323,-0.036c-0.267,-0.007 -0.637,-0.476 -0.76,-0.805c-0.592,-1.582 -0.567,-1.591 -2.263,-1.592c-1.452,0 -2.903,0 -4.316,0c-0.913,2.437 -0.913,2.437 -3.473,2.437l-3.674,0c2.395,-6.454 4.723,-12.727 7.07,-19.049c2.38,0 4.725,-0.037 7.065,0.044c0.312,0.01 0.736,0.565 0.884,0.953c2.099,5.504 4.159,11.022 6.228,16.537c0.16,0.426 0.318,0.854 0.562,1.511" style="fill:#fff;fill-opacity:0.8;fill-rule:nonzero;"></path><path d="M89.146,6.271c-2.087,2.974 -4.038,5.753 -6.039,8.604c1.968,3.411 3.942,6.833 6.02,10.434c-2.908,0 -5.596,0.014 -8.284,-0.025c-0.228,-0.003 -0.526,-0.317 -0.663,-0.559c-0.559,-0.986 -1.068,-2.001 -1.698,-3.202c-0.649,1.062 -1.269,1.982 -1.786,2.957c-0.348,0.658 -0.797,0.87 -1.523,0.853c-1.934,-0.045 -3.869,-0.015 -6.019,-0.015c1.733,-2.622 3.245,-5.103 4.963,-7.431c0.923,-1.251 0.94,-2.138 0.063,-3.432c-1.751,-2.579 -3.285,-5.306 -4.969,-8.072c0.297,-0.045 0.516,-0.107 0.735,-0.108c2.344,-0.007 4.689,0.018 7.032,-0.019c0.622,-0.009 0.972,0.195 1.247,0.741c0.475,0.94 1.019,1.846 1.607,2.898c0.707,-1.095 1.311,-2.088 1.982,-3.033c0.192,-0.269 0.577,-0.558 0.879,-0.565c2.058,-0.05 4.117,-0.026 6.453,-0.026" style="fill:#fff;fill-opacity:0.8;fill-rule:nonzero;"></path><path d="M59.654,6.335l0,5.691l-5.73,0l0,13.193l-7.515,0l0,-13.147l-5.731,0l0,-5.737l18.976,0Z" style="fill:#fff;fill-opacity:0.8;fill-rule:nonzero;"></path><rect x="61.187" y="6.342" width="6.698" height="18.911" style="fill:#fff;fill-opacity:0.8;"></rect><path d="M28.354,21.366c0.306,4.69 -5.098,5.2 -6.831,2.855c-2.169,-2.934 -5.05,-2.797 -6.619,-1.438c-1.569,-1.359 -4.449,-1.496 -6.618,1.438c-1.733,2.345 -7.137,1.835 -6.831,-2.855c0,0 -2.763,4.258 0.611,8.055c3.263,3.671 8.689,3.784 12.032,0.918c0.305,-0.262 0.568,-0.53 0.806,-0.802c0.238,0.272 0.501,0.54 0.807,0.802c3.343,2.866 8.768,2.753 12.031,-0.918c3.375,-3.796 0.612,-8.055 0.612,-8.055Z" style="fill:#fff;fill-opacity:0.8;fill-rule:nonzero;"></path><path d="M28.354,11.37c0.306,-4.69 -5.098,-5.2 -6.831,-2.855c-2.169,2.934 -5.05,2.797 -6.619,1.438c-1.569,1.359 -4.449,1.496 -6.618,-1.438c-1.733,-2.345 -7.137,-1.835 -6.831,2.855c0,0 -2.763,-4.258 0.611,-8.055c3.263,-3.671 8.689,-3.784 12.032,-0.918c0.305,0.262 0.568,0.53 0.806,0.802c0.238,-0.272 0.501,-0.54 0.807,-0.802c3.343,-2.866 8.768,-2.753 12.031,0.918c3.375,3.796 0.612,8.055 0.612,8.055Z" style="fill:#fff;fill-opacity:0.8;fill-rule:nonzero;"></path><circle cx="12.241" cy="16.368" r="1.332" style="fill:#fff;fill-opacity:0.8;"></circle><circle cx="16.902" cy="16.368" r="1.332" style="fill:#fff;fill-opacity:0.8;"></circle></g></svg>
</div>
</div>
<div class="card-footer">
<a href="Restaurants" class="btn btn-primary">See all</a>
</div>
</div>
</div>
}
}
</div>
</section>
@code {
[Parameter]
public int ItemType { get; set; }
[Parameter]
public bool DisplayTitle { get; set; } = true;
public List<Event> MockEvents = new List<Event>
{
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"),
};
public string typeVariable;
}

View File

@ -42,6 +42,12 @@
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="user/media">
Media
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="user/cards">
Cards

View File

@ -59,7 +59,8 @@ select {
.card {
border-radius: 16px;
/*box-shadow: 3px 3px 3px #b1b1b1, -3px -3px 3px #fff;*/
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 );
overflow: hidden;
background-color: rgba( 255, 255, 255, 0.15 );
/*color: #58457b;*/
@ -67,23 +68,21 @@ select {
}
.glass {
border-radius: 16px;
/*box-shadow: 3px 3px 3px #b1b1b1, -3px -3px 3px #fff;*/
overflow: hidden;
background: rgba( 255, 255, 255, 0.55 );
box-shadow: 0 8px 32px 0 rgba( 31, 38, 135, 0.57 );
background: rgba( 255, 255, 255, 0.25 );
backdrop-filter: blur( 8px );
-webkit-backdrop-filter: blur( 8px );
border-radius: 10px;
border: 1px solid rgba( 255, 255, 255, 0.18 );
/*color: #58457b;*/
font-size: small;
}
.card .card-body {
padding: 10px;
}
.card .card-body {
padding: 10px;
border: 1px solid rgba( 255, 255, 255, 0.18 );
}
.inputwizardwrapper {
/*max-width: 450px;*/

View File

@ -0,0 +1,16 @@
export function initializeFilePaste(fileDropContainer, inputFile) {
function onPaste(e) {
inputFile.files = e.clipboardData.files;
const event = new Event('change', { bubbles: true });
inputFile.dispatchEvent(event);
}
fileDropContainer.addEventListener('paste', onPaste);
return {
dispose: () => {
fileDropContainer.removeEventListener('paste', onPaste);
}
}
}

View File

@ -28,7 +28,9 @@ builder.Services.AddBlazoredLocalStorage();
builder.Services.AddSingleton<ISessionService, SessionServiceWeb>();
builder.Services.AddSingleton<IComponentUpdateService, ComponentUpdateServiceWeb>();
builder.Services.AddScoped<IServiceProviderDataService, ServiceProviderDataService>();
builder.Services.AddScoped<IClientNoticeSenderService, ClientNoticeSenderService>();
builder.Services.AddScoped<IWizardProcessor, WizardProcessor>();
builder.Services.AddScoped<IImageDataService, ImageDataService>();
//WebSpecific
builder.Services.AddScoped<SessionStorageAccessor>();
builder.Services.AddSingleton(x => new ResourceManager("TIAMWebApp.Client.Resources.MyResources", typeof(Program).Assembly));

View File

@ -1,19 +1,26 @@
using TIAM.Entities.Transfers;
using AyCode.Interfaces.Enums;
using AyCode.Interfaces.Messages;
using AyCode.Models.Messages;
using TIAM.Entities.TransferDestinations;
using TIAMWebApp.Shared.Application.Interfaces;
using TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels;
using static AyCode.Interfaces.Enums.IMessageTypes;
namespace TIAMWebApp.Client.Services
{
public class WizardProcessor : IWizardProcessor
{
public ITransferDataService transferDataService { get; set; }
public IUserDataService userDataService { get; set; }
public ITransferDataService TransferDataService { get; set; }
public IUserDataService UserDataService { get; set; }
public WizardProcessor(ITransferDataService transferDataService, IUserDataService userDataService)
public IClientNoticeSenderService MessageSenderService { get; set; }
public WizardProcessor(ITransferDataService transferDataService, IUserDataService userDataService, IClientNoticeSenderService messageSenderService)
{
this.transferDataService = transferDataService;
this.userDataService = userDataService;
this.TransferDataService = transferDataService;
this.UserDataService = userDataService;
this.MessageSenderService = messageSenderService;
}
public async Task<TModelType?> ProcessWizardAsync<TModelType>(Type type, object data) where TModelType: class
@ -21,13 +28,17 @@ namespace TIAMWebApp.Client.Services
switch (type.Name)
{
case "TransferDestinationWizardModel":
var result = await transferDataService.CreateTransferDestination((TransferDestination)data);
var result = await TransferDataService.CreateTransferDestination((TransferDestination)data);
return result as TModelType;
case "TransferWizardModel":
var transferResult = await transferDataService.CreateTransfer((TransferWizardModel)data);
var transferResult = await TransferDataService.CreateTransfer((TransferWizardModel)data);
return transferResult as TModelType;
case "MessageWizardModel":
var messageResult = await MessageSenderService.SendNoticeAsync((EmailMessage)data, 1);
return messageResult as TModelType;
case "ServiceProvider":
return null;
default:

View File

@ -5,6 +5,9 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<PropertyGroup>
<WasmEnableSIMD>false</WasmEnableSIMD>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Blazored.LocalStorage" Version="4.4.0" />

View File

@ -27,6 +27,7 @@ using AyCode.Entities.Messages;
using TIAMWebApp.Shared.Application.Models.ClientSide.Messages;
using AyCode.Models.Messages;
using AyCode.Models.Enums;
using TIAM.Database.DataLayers.Admins;
namespace TIAMWebApp.Server.Controllers
{
@ -35,6 +36,7 @@ namespace TIAMWebApp.Server.Controllers
[Route("api/v1/[controller]")]
public class MessageAPIController : ControllerBase
{
private AdminDal _adminDal;
private readonly IConfiguration _configuration;
private readonly IWebHostEnvironment _webHostEnvironment;
private IMessageSenderService _messageSenderService;
@ -42,8 +44,9 @@ namespace TIAMWebApp.Server.Controllers
private readonly ILogger<MessageAPIController> _logger;
public MessageAPIController(ILogger<MessageAPIController> logger, IConfiguration configuration, IWebHostEnvironment webHostEnvironment, IMessageSenderService messageSenderService)
public MessageAPIController(ILogger<MessageAPIController> logger, IConfiguration configuration, IWebHostEnvironment webHostEnvironment, IMessageSenderService messageSenderService, AdminDal adminDal)
{
_adminDal = adminDal;
_logger = logger;
_configuration = configuration;
_webHostEnvironment = webHostEnvironment;
@ -66,6 +69,7 @@ namespace TIAMWebApp.Server.Controllers
Console.WriteLine($"EmailMessage!!!");
var result = await _messageSenderService.SendMessageAsync(SerializedMessageSenderModel.Message, (int)SerializedMessageSenderModel.MessageType);
//_adminDal.AddEmailMessageAsync((TIAM.Entities.Emails.EmailMessage)SerializedMessageSenderModel.Message);
Console.WriteLine("SendEmail result: " + result);
return Ok(result);

View File

@ -0,0 +1,120 @@
using AyCode.Core.Logger;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Mvc;
using System.Drawing;
using TIAM.Database.DataLayers.Admins;
using TIAM.Database.DataLayers.Auctions;
using TIAM.Entities.Auctions;
using TIAMWebApp.Shared.Application.Models;
namespace TIAMWebApp.Server.Controllers
{
[Authorize]
[ApiController]
[EnableCors("_myAllowSpecificOrigins")]
[Route("api/v1/[controller]")]
public class FileAPIController : ControllerBase
{
private AdminDal _adminDal;
private readonly IConfiguration _configuration;
private readonly IWebHostEnvironment _webHostEnvironment;
private readonly ILogger<FileAPIController> _logger;
public FileAPIController(ILogger<FileAPIController> logger, IConfiguration configuration, IWebHostEnvironment webHostEnvironment, AdminDal adminDal)
{
_logger = logger;
_configuration = configuration;
_webHostEnvironment = webHostEnvironment;
_adminDal = adminDal;
}
const long MaxFileSize = 4_000_000;
readonly string[] imageExtensions = { ".JPG", ".JPEG", ".GIF", ".PNG" };
[AllowAnonymous]
[HttpPost]
[Route(APIUrls.UploadImageRouteName)]
public ActionResult UploadImage([FromForm] IFormFile file)
{
Console.WriteLine($"Upload file called: {file.FileName}");
if (file == null || file.Length == 0)
return BadRequest("File not selected");
string folderPath = @"C:\CDN";
string fileName = Path.GetFileNameWithoutExtension(file.FileName);
string extension = Path.GetExtension(file.FileName).ToUpper();
Console.WriteLine(extension);
var isValidExtenstion = imageExtensions.Contains(extension);
var isValidSize = file.Length <= MaxFileSize;
if (!isValidExtenstion || !isValidSize)
{
return BadRequest("Invalid file");
}
string filePath = Path.Combine(folderPath, file.FileName);
if (!Directory.Exists(folderPath))
{
Directory.CreateDirectory(folderPath);
}
int count = 1;
while (System.IO.File.Exists(filePath))
{
string tempFileName = string.Format("{0}({1})", fileName, count++);
filePath = Path.Combine(folderPath, tempFileName + extension);
}
using (var stream = new FileStream(filePath, FileMode.Create))
{
file.CopyTo(stream);
}
return Ok(new { filePath });
}
[AllowAnonymous]
[HttpGet]
[Route(APIUrls.GetImagesRouteName)]
public IActionResult GetAllMedia()
{
string folderPath = @"C:\CDN";
if (!Directory.Exists(folderPath))
{
return NotFound("Directory not found");
}
var files = Directory.GetFiles(folderPath)
.Select(Path.GetFileName)
.ToList();
return Ok(files);
}
[AllowAnonymous]
//[HttpGet("Image/{name}")]
[HttpGet("{APIUrls.GetImageRouteName}/{name}")]
public IActionResult GetImage(string name)
{
string folderPath = @"C:\CDN";
string filePath = Path.Combine(folderPath, name);
if (!System.IO.File.Exists(filePath))
{
return NotFound("Image not found");
}
var image = System.IO.File.OpenRead(filePath);
return File(image, "image/jpeg");
}
}
}

View File

@ -57,7 +57,7 @@ namespace TIAMWebApp.Server.Controllers
[AllowAnonymous]
[HttpPost]
[Route("AuthenticateUser")]
[Route(APIUrls.AuthenticateUserRouteName)]
public async Task<IActionResult> AuthenticateUser([FromBody] JsonElement SerializedLoginModel)
{
Console.WriteLine("AuthenticateUser called");

View File

@ -1,5 +1,6 @@
using AyCode.Interfaces.Messages;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.IdentityModel.Tokens;
using Microsoft.OpenApi.Models;
using System.Text;
@ -12,6 +13,8 @@ using TIAMWebApp.Server.Services;
var builder = WebApplication.CreateBuilder(args);
string MyAllowSpecificOrigins = "_myAllowSpecificOrigins";
// Add services to the container.
builder.Services.AddControllersWithViews();
@ -20,9 +23,15 @@ builder.Services.AddRazorPages();
builder.Services.AddScoped<UserDal>();
builder.Services.AddScoped<AdminDal>();
builder.Services.AddScoped<AuctionDal>();
//builder.Services.AddScoped<ServiceProviderDal>();
builder.Services.AddScoped<TransferDestinationDal>();
builder.Services.AddCors(options => {
options.AddPolicy(MyAllowSpecificOrigins,
builder => {
builder.AllowAnyOrigin();
});
});
builder.Services.AddSwaggerGen(swagger =>
{
swagger.SwaggerDoc("v1",
@ -74,7 +83,10 @@ builder.Services.AddAuthentication(f =>
};
});
builder.Services.Configure<FormOptions>(options =>
{
options.MultipartBodyLengthLimit = 200000000; // Increase the limit to 200MB
});
builder.Services.AddScoped<IMessageSenderService, NoticeSenderService>();
builder.Services.AddEndpointsApiExplorer();
@ -90,6 +102,8 @@ builder.Services.ConfigureApplicationCookie(options =>
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
@ -116,6 +130,8 @@ app.UseStaticFiles();
app.UseAuthentication();
app.UseRouting();
//cors
app.UseCors(MyAllowSpecificOrigins);
app.UseAuthorization();
app.UsePathBase("/");
app.MapRazorPages();

View File

@ -5,6 +5,9 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<PropertyGroup>
<WasmEnableSIMD>false</WasmEnableSIMD>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="GoogleApi" Version="5.3.1" />

View File

@ -0,0 +1,16 @@
using AyCode.Interfaces.Messages;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static AyCode.Interfaces.Enums.IMessageTypes;
namespace TIAMWebApp.Shared.Application.Interfaces
{
public interface IClientNoticeSenderService
{
public Task<string> SendNoticeAsync<TNotice>(TNotice message, int messageType) where TNotice : class, INoticeBase;
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TIAMWebApp.Shared.Application.Interfaces
{
public interface IImageDataService
{
Task<string> UploadImageAsync(MultipartContent image);
Task<Stream> GetImageAsync(string name);
Task<List<string>> GetImagesAsync(string userId);
}
}

View File

@ -13,6 +13,7 @@ namespace TIAMWebApp.Shared.Application.Models
public const string TransferDataAPI = BaseUrlWithSlashAndVersion + "TransferDataAPI/";
public const string ServiceProviderAPI = BaseUrlWithSlashAndVersion + "ServiceProviderAPI/";
public const string UserPermissionAPI = BaseUrlWithSlashAndVersion + "UserPermissionAPI/";
public const string FileAPI = BaseUrlWithSlashAndVersion + "FileAPI/";
//userdata
public const string UserTestRouteName = "test1";
@ -108,5 +109,16 @@ namespace TIAMWebApp.Shared.Application.Models
//12
public const string GetPermissionGroupsForContextByContextIdRouteName = "GetPermissionGroupsForContextByContextId";
public const string GetPermissionGroupsForContextByContextId = ServiceProviderAPI+GetPermissionGroupsForContextByContextIdRouteName;
//file upload
public const string UploadImageRouteName = "UploadImage";
public const string UploadImage = FileAPI+UploadImageRouteName;
//get images
public const string GetImagesRouteName = "GetAllMedia";
public const string GetImages = FileAPI+GetImagesRouteName;
//get image by name
public const string GetImageRouteName = "GetImage";
public const string GetImage = FileAPI+GetImageRouteName;
}
}

View File

@ -1,10 +1,12 @@
using System;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using TIAM.Entities.Emails;
using TIAM.Resources;
namespace TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
@ -12,9 +14,11 @@ namespace TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
public class MessageWizardModel
{
[DataType(DataType.Text)]
[Display(Name = "ReceiverId", ResourceType = typeof(TIAMResources))]
public string ReceiverId { get; set; }
public string ReceiverEmailAddress { get; set; }
public Guid ReceiverId { get; set; }
public string SenderEmailAddress { get; set; }
public Guid SenderId { get; set; }
public Guid ContextId { get; set; }
[Required(ErrorMessage = "The subject value should be specified.")]
[DataType(DataType.Text)]
[Display(Name = "Subject", ResourceType = typeof(TIAMResources))]
@ -25,11 +29,32 @@ namespace TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
public string Content { get; set; }
public MessageWizardModel() { }
public MessageWizardModel(string receiverId, string subject, string content)
public MessageWizardModel(string receiverEmailAddress, Guid receiverId, string senderEmailAddress, Guid senderId, string subject, string content)
{
ReceiverEmailAddress = receiverEmailAddress;
ReceiverId = receiverId;
SenderEmailAddress = senderEmailAddress;
SenderId = senderId;
Subject = subject;
Content = content;
Content = content;
}
public static EmailMessage ConvertToNewEmailMessage(MessageWizardModel message)
{
var id = Guid.NewGuid();
return new EmailMessage
{
Id = id,
SenderId = message.SenderId,
ContextId = message.ContextId,
Subject = message.Subject,
Text = message.Content,
SenderEmailAddress = message.SenderEmailAddress,
Recipients = new List<EmailRecipient> { new EmailRecipient(
Guid.NewGuid(), message.ReceiverId, id) }
};
}
}
}

View File

@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TIAMWebApp.Shared.Application.Models
{
public class Event
{
public string Name { get; set; }
public string Description { get; set; }
public string DateAndTime { get; set; }
public string Location { get; set; }
public string ImageUrl { get; set; }
public Event()
{
}
public Event(string name, string description, string dateAndTime, string location, string imageUrl)
{
Name = name;
Description = description;
DateAndTime = dateAndTime;
Location = location;
ImageUrl = imageUrl;
}
}
}

View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TIAMWebApp.Shared.Application.Interfaces;
namespace TIAMWebApp.Shared.Application.Services
{
public class ClientNoticeSenderService : IClientNoticeSenderService
{
Task<string> IClientNoticeSenderService.SendNoticeAsync<TNotice>(TNotice message, int messageType)
{
throw new NotImplementedException();
}
}
}

View File

@ -0,0 +1,79 @@
using Azure;
using Microsoft.AspNetCore.Http;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion.Internal;
using Microsoft.IdentityModel.Tokens;
using Microsoft.SqlServer.Server;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http.Headers;
using System.Net.Http.Json;
using System.Text;
using System.Threading.Tasks;
using TIAM.Entities.TransferDestinations;
using TIAMWebApp.Shared.Application.Interfaces;
using TIAMWebApp.Shared.Application.Models.ClientSide;
using TIAMWebApp.Shared.Application.Models;
using static System.Net.WebRequestMethods;
using static System.Runtime.InteropServices.JavaScript.JSType;
namespace TIAMWebApp.Shared.Application.Services
{
public class ImageDataService : IImageDataService
{
private readonly HttpClient _http;
public ImageDataService(HttpClient httpClient)
{
_http = httpClient;
}
public async Task<List<string>> GetImagesAsync(string userId)
{
var response = await _http.GetAsync("images");
if (response.IsSuccessStatusCode)
{
var fileNames = await response.Content.ReadFromJsonAsync<List<string>>();
return fileNames;
}
throw new ApplicationException($"Status code: {response.StatusCode}, Error: {response.ReasonPhrase}");
}
public async Task<Stream> GetImageAsync(string name)
{
var response = await _http.GetAsync($"image/{name}");
if (response.IsSuccessStatusCode)
{
var stream = await response.Content.ReadAsStreamAsync();
return stream;
}
throw new ApplicationException($"Status code: {response.StatusCode}, Error: {response.ReasonPhrase}");
}
public async Task<string> UploadImageAsync(MultipartContent image)
{
var url = $"{Setting.BaseUrl}/{APIUrls.UploadImage}";
var response = await _http.PostAsync(url, image);
//var result = new WizardProcessorResult();
//if (response.IsSuccessStatusCode)
//{
// result.IsSucces = true;
// result.ResultJson = await response.Content.ReadAsStringAsync();
//}
if (!response.IsSuccessStatusCode)
return "Oops, something wrong";
var result = await response.Content.ReadAsStringAsync();
return result;
}
}
}

View File

@ -18,6 +18,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="8.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Http.Features" Version="5.0.17" />
<PackageReference Include="Microsoft.JSInterop" Version="8.0.1" />
<PackageReference Include="SkiaSharp" Version="2.88.7" />
<PackageReference Include="SkiaSharp.Views.Desktop.Common" Version="2.88.7" />