wtf again
This commit is contained in:
parent
553759039f
commit
10a9a186a1
|
|
@ -1,9 +1,20 @@
|
||||||
namespace TIAMMobileApp
|
using Microsoft.AspNetCore.Components.WebView.Maui;
|
||||||
|
|
||||||
|
namespace TIAMMobileApp
|
||||||
{
|
{
|
||||||
public partial class MainPage : ContentPage
|
public partial class MainPage : ContentPage
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
public MainPage()
|
public MainPage()
|
||||||
{
|
{
|
||||||
|
BlazorWebViewHandler.BlazorWebViewMapper.AppendToMapping("CustomBlazorWebViewMapper", (handler, view) =>
|
||||||
|
{
|
||||||
|
#if IOS
|
||||||
|
var configs = handler.PlatformView.Configuration;
|
||||||
|
configs.AllowsInlineMediaPlayback = true;
|
||||||
|
#endif
|
||||||
|
});
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,8 +28,8 @@ namespace TIAMMobileApp
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
builder.Services.AddBlazorWebViewDeveloperTools();
|
builder.Services.AddBlazorWebViewDeveloperTools();
|
||||||
builder.Logging.AddDebug();
|
builder.Logging.AddDebug();
|
||||||
builder.Services.AddLocalization();
|
|
||||||
#endif
|
#endif
|
||||||
|
builder.Services.AddLocalization();
|
||||||
var handler = new HttpClientHandler();
|
var handler = new HttpClientHandler();
|
||||||
handler.ServerCertificateCustomValidationCallback = (message, certificate, chain, sslPolicyErrors) => true;
|
handler.ServerCertificateCustomValidationCallback = (message, certificate, chain, sslPolicyErrors) => true;
|
||||||
var client = new HttpClient(handler);
|
var client = new HttpClient(handler);
|
||||||
|
|
@ -54,7 +54,9 @@ namespace TIAMMobileApp
|
||||||
builder.Services.AddScoped<ISessionService, SessionServiceMobile>();
|
builder.Services.AddScoped<ISessionService, SessionServiceMobile>();
|
||||||
builder.Services.AddSingleton<IComponentUpdateService, ComponentUpdateServiceMobile>();
|
builder.Services.AddSingleton<IComponentUpdateService, ComponentUpdateServiceMobile>();
|
||||||
builder.Services.AddScoped<IServiceProviderDataService, ServiceProviderDataService>();
|
builder.Services.AddScoped<IServiceProviderDataService, ServiceProviderDataService>();
|
||||||
|
builder.Services.AddScoped<IClientNoticeSenderService, ClientNoticeSenderService>();
|
||||||
builder.Services.AddScoped<IWizardProcessor, WizardProcessor>();
|
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.AddSingleton(x => new ResourceManager("TIAMWebApp.Shared.Application.Resources", typeof(Main).Assembly));
|
||||||
|
|
||||||
builder.Services.Configure<AnimationOptions>(Guid.NewGuid().ToString(), c => { });
|
builder.Services.Configure<AnimationOptions>(Guid.NewGuid().ToString(), c => { });
|
||||||
|
|
|
||||||
|
|
@ -28,5 +28,9 @@
|
||||||
</array>
|
</array>
|
||||||
<key>XSAppIconAssets</key>
|
<key>XSAppIconAssets</key>
|
||||||
<string>Assets.xcassets/appicon.appiconset</string>
|
<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>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -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));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -116,7 +116,7 @@ button {
|
||||||
transition: all 0.4s ease-in-out;
|
transition: all 0.4s ease-in-out;
|
||||||
-webkit-transition: all 0.4s ease-in-out;
|
-webkit-transition: all 0.4s ease-in-out;
|
||||||
cursor: pointer;
|
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 {
|
.game-section .item.active {
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
<EventsComponent ItemType="0"></EventsComponent>
|
||||||
<FeaturedItems ItemType="0"></FeaturedItems>
|
<FeaturedItems ItemType="0"></FeaturedItems>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -116,13 +116,13 @@ button {
|
||||||
transition: all 0.4s ease-in-out;
|
transition: all 0.4s ease-in-out;
|
||||||
-webkit-transition: all 0.4s ease-in-out;
|
-webkit-transition: all 0.4s ease-in-out;
|
||||||
cursor: pointer;
|
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 {
|
.game-section .item.active {
|
||||||
width: 500px;
|
width: 500px;
|
||||||
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: 12px 40px 40px rgba(0, 0, 0, 0.25);
|
-webkit-box-shadow: 0 8px 32px 0 rgba( 31, 38, 135, 0.57 );
|
||||||
}
|
}
|
||||||
|
|
||||||
.game-section .item:after {
|
.game-section .item:after {
|
||||||
|
|
|
||||||
|
|
@ -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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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;
|
||||||
|
}
|
||||||
|
|
@ -8,9 +8,9 @@
|
||||||
|
|
||||||
<div class="row py-3">
|
<div class="row py-3">
|
||||||
<div class=" col-12 col-xl-3 col-lg-6">
|
<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="card-header py-2 px-4">
|
||||||
<div class="d-flex justify-content-between align-items-center">
|
<div class="d-flex justify-content-between align-items-center">
|
||||||
<div>
|
<div>
|
||||||
|
|
@ -49,8 +49,8 @@
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class=" col-12 col-xl-3 col-lg-6">
|
<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="card-header py-2 px-4">
|
||||||
<div class="d-flex justify-content-between align-items-center">
|
<div class="d-flex justify-content-between align-items-center">
|
||||||
<div>
|
<div>
|
||||||
|
|
@ -87,8 +87,8 @@
|
||||||
</Animation>
|
</Animation>
|
||||||
</div>
|
</div>
|
||||||
<div class=" col-12 col-xl-3 col-lg-6">
|
<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="card-header py-2 px-4">
|
||||||
<div class="d-flex justify-content-between align-items-center">
|
<div class="d-flex justify-content-between align-items-center">
|
||||||
<div>
|
<div>
|
||||||
|
|
@ -125,8 +125,8 @@
|
||||||
</Animation>
|
</Animation>
|
||||||
</div>
|
</div>
|
||||||
<div class=" col-12 col-xl-3 col-lg-6">
|
<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="card-header py-2 px-4">
|
||||||
<div class="d-flex justify-content-between align-items-center">
|
<div class="d-flex justify-content-between align-items-center">
|
||||||
<div>
|
<div>
|
||||||
|
|
@ -165,8 +165,8 @@
|
||||||
</Animation>
|
</Animation>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-xl-6">
|
<div class="col-12 col-xl-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="card-header py-2 px-4">
|
||||||
<div class="d-flex justify-content-between align-items-center">
|
<div class="d-flex justify-content-between align-items-center">
|
||||||
<div>
|
<div>
|
||||||
|
|
@ -208,8 +208,8 @@
|
||||||
</Animation>
|
</Animation>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-xl-6">
|
<div class="col-12 col-xl-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="card-header py-2 px-4">
|
||||||
<div class="d-flex justify-content-between align-items-center">
|
<div class="d-flex justify-content-between align-items-center">
|
||||||
<div>
|
<div>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
@page "/user/destinations"
|
@page "/user/destinations"
|
||||||
@using AyCode.Models.Messages
|
@using AyCode.Models.Messages
|
||||||
|
@using BlazorAnimation
|
||||||
@using TIAM.Entities.ServiceProviders
|
@using TIAM.Entities.ServiceProviders
|
||||||
@using TIAM.Resources
|
@using TIAM.Resources
|
||||||
@using TIAMSharedUI.Pages.Components
|
@using TIAMSharedUI.Pages.Components
|
||||||
|
|
@ -20,79 +21,79 @@
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class=" col-12">
|
<div class="col-12">
|
||||||
<h3>@localizer.GetString("TransferDestination")</h3>
|
<h3>@localizer.GetString("TransferDestination")</h3>
|
||||||
|
|
||||||
|
<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 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>
|
</div>
|
||||||
<DxGrid @ref="Grid"
|
</Animation>
|
||||||
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>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class=" col-12 col-xl-6">
|
<div class=" col-12 col-xl-6">
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
@page "/user/transfers"
|
@page "/user/transfers"
|
||||||
@using AyCode.Models.Messages
|
@using AyCode.Models.Messages
|
||||||
|
@using BlazorAnimation
|
||||||
@using TIAM.Entities.ServiceProviders
|
@using TIAM.Entities.ServiceProviders
|
||||||
@using TIAM.Resources
|
@using TIAM.Resources
|
||||||
@using TIAMSharedUI.Pages.Components
|
@using TIAMSharedUI.Pages.Components
|
||||||
@using TIAMSharedUI.Shared
|
@using TIAMSharedUI.Shared
|
||||||
|
@using TIAMWebApp.Shared.Application.Interfaces
|
||||||
@using TIAMWebApp.Shared.Application.Models
|
@using TIAMWebApp.Shared.Application.Models
|
||||||
@using TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
@using TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
||||||
@using TIAMWebApp.Shared.Application.Models.ClientSide.Messages
|
@using TIAMWebApp.Shared.Application.Models.ClientSide.Messages
|
||||||
|
|
@ -11,6 +13,7 @@
|
||||||
@layout AdminLayout
|
@layout AdminLayout
|
||||||
@inject LogToBrowserConsole logToBrowserConsole
|
@inject LogToBrowserConsole logToBrowserConsole
|
||||||
@inject IStringLocalizer<TIAMResources> localizer
|
@inject IStringLocalizer<TIAMResources> localizer
|
||||||
|
@inject IWizardProcessor wizardProcessor
|
||||||
<PageTitle>Transfers</PageTitle>
|
<PageTitle>Transfers</PageTitle>
|
||||||
|
|
||||||
<div class="text-center m-5">
|
<div class="text-center m-5">
|
||||||
|
|
@ -21,143 +24,146 @@
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class=" col-12">
|
<div class=" col-12">
|
||||||
<div class="card glass">
|
<Animation Effect="@Effect.FadeInUp" Class="glass" Speed="@Speed.Fast" Delay="@TimeSpan.FromMilliseconds(250)">
|
||||||
|
<div class="card">
|
||||||
|
|
||||||
<DxPopup CssClass="popup-demo-events"
|
<DxPopup CssClass="popup-demo-events"
|
||||||
@bind-Visible="@PopupVisible"
|
@bind-Visible="@PopupVisible"
|
||||||
ShowFooter="true"
|
ShowFooter="true"
|
||||||
CloseOnEscape="true"
|
CloseOnEscape="true"
|
||||||
CloseOnOutsideClick="false"
|
CloseOnOutsideClick="false"
|
||||||
ShowCloseButton="false"
|
ShowCloseButton="false"
|
||||||
HeaderText="MessageBox"
|
HeaderText="MessageBox"
|
||||||
Closing="EulaPopupClosing"
|
Closing="EulaPopupClosing"
|
||||||
Closed="EulaPopupClosed">
|
Closed="EulaPopupClosed">
|
||||||
<BodyContentTemplate>
|
<BodyContentTemplate>
|
||||||
<InputWizard Data=@messageWizardModel
|
<InputWizard Data=@messageWizardModel
|
||||||
OnSubmit="SubmitForm"
|
OnSubmit="SubmitForm"
|
||||||
IgnoreReflection=@ignoreList
|
IgnoreReflection=@ignoreList
|
||||||
TitleResourceString="NewMessage"
|
TitleResourceString="NewMessage"
|
||||||
SubtitleResourceString="NewMessageSubtitle"
|
SubtitleResourceString="NewMessageSubtitle"
|
||||||
SubmitButtonText="ButtonSend"></InputWizard>
|
SubmitButtonText="ButtonSend"></InputWizard>
|
||||||
</BodyContentTemplate>
|
</BodyContentTemplate>
|
||||||
<FooterContentTemplate Context="Context">
|
<FooterContentTemplate Context="Context">
|
||||||
<div class="popup-demo-events-footer">
|
<div class="popup-demo-events-footer">
|
||||||
<!--DxCheckBox CssClass="popup-demo-events-checkbox" @bind-Checked="@EulaAccepted">I accept the terms of the EULA</!--DxCheckBox-->
|
<!--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.Primary" Text="OK" Click="Context.CloseCallback" /-->
|
||||||
<DxButton CssClass="popup-demo-events-button ms-2" RenderStyle="ButtonRenderStyle.Secondary" Text="Cancel" Click="CancelCreateClick" />
|
<DxButton CssClass="popup-demo-events-button ms-2" RenderStyle="ButtonRenderStyle.Secondary" Text="Cancel" Click="CancelCreateClick" />
|
||||||
</div>
|
</div>
|
||||||
</FooterContentTemplate>
|
</FooterContentTemplate>
|
||||||
</DxPopup>
|
</DxPopup>
|
||||||
|
|
||||||
<div class="d-flex flex-column mb-4 pb-2">
|
<div class="d-flex flex-column mb-4 pb-2">
|
||||||
<div class="align-self-end pl-2 pb-2">
|
<div class="align-self-end pl-2 pb-2">
|
||||||
<DxButton Text="Column Chooser"
|
<DxButton Text="Column Chooser"
|
||||||
RenderStyle="ButtonRenderStyle.Secondary"
|
RenderStyle="ButtonRenderStyle.Secondary"
|
||||||
IconCssClass="btn-column-chooser"
|
IconCssClass="btn-column-chooser"
|
||||||
Click="ColumnChooserButton_Click" />
|
Click="ColumnChooserButton_Click" />
|
||||||
</div>
|
</div>
|
||||||
<DxGrid @ref="Grid"
|
<DxGrid @ref="Grid"
|
||||||
Data="TransferData"
|
Data="TransferData"
|
||||||
PageSize="8"
|
PageSize="8"
|
||||||
KeyFieldName="Id"
|
KeyFieldName="Id"
|
||||||
ValidationEnabled="false"
|
ValidationEnabled="false"
|
||||||
CustomizeEditModel="Grid_CustomizeEditModel"
|
CustomizeEditModel="Grid_CustomizeEditModel"
|
||||||
EditModelSaving="Grid_EditModelSaving"
|
EditModelSaving="Grid_EditModelSaving"
|
||||||
DataItemDeleting="Grid_DataItemDeleting"
|
DataItemDeleting="Grid_DataItemDeleting"
|
||||||
EditMode="GridEditMode.EditForm"
|
EditMode="GridEditMode.EditForm"
|
||||||
ColumnResizeMode="GridColumnResizeMode.NextColumn"
|
ColumnResizeMode="GridColumnResizeMode.NextColumn"
|
||||||
KeyboardNavigationEnabled="true"
|
KeyboardNavigationEnabled="true"
|
||||||
ShowFilterRow="true">
|
ShowFilterRow="true">
|
||||||
<Columns>
|
<Columns>
|
||||||
<DxGridCommandColumn Width="8%" FixedPosition="GridColumnFixedPosition.Left" />
|
<DxGridCommandColumn Width="8%" FixedPosition="GridColumnFixedPosition.Left" />
|
||||||
|
|
||||||
<DxGridDataColumn FieldName="Id" MinWidth="80" Width="10%" Visible="false" />
|
<DxGridDataColumn FieldName="Id" MinWidth="80" Width="10%" Visible="false" />
|
||||||
<DxGridDataColumn FieldName="Destination" FixedPosition="GridColumnFixedPosition.Left" MinWidth="80" Width="10%">
|
<DxGridDataColumn FieldName="Destination" FixedPosition="GridColumnFixedPosition.Left" MinWidth="80" Width="10%">
|
||||||
<CellDisplayTemplate>
|
<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;
|
var transfer = (TransferWizardModel)EditFormContext.EditModel;
|
||||||
<a class="d-block text-left" href="transferdetails">@context.Value</a>
|
|
||||||
}
|
}
|
||||||
</CellDisplayTemplate>
|
<DxFormLayout CssClass="w-100">
|
||||||
</DxGridDataColumn>
|
<DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.DestinationAddress) ColSpanMd="6">
|
||||||
<DxGridDataColumn FieldName="PickupAddress" FixedPosition="GridColumnFixedPosition.Left" MinWidth="80" Width="15%" />
|
@EditFormContext.GetEditor("Destination")
|
||||||
<DxGridDataColumn FieldName="TripDate" MinWidth="80" Width="10%" />
|
</DxFormLayoutItem>
|
||||||
<DxGridDataColumn FieldName="NumberOfPassengers" MinWidth="40" Width="3%" />
|
<DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.PickupAddress) ColSpanMd="6">
|
||||||
<DxGridDataColumn FieldName="FullName" MinWidth="80" />
|
@EditFormContext.GetEditor("PickupAddress")
|
||||||
<DxGridDataColumn FieldName="PhoneNumber" MinWidth="80" Width="10%" />
|
</DxFormLayoutItem>
|
||||||
<DxGridDataColumn FieldName="EmailAddress" MinWidth="80" Width="10%">
|
<DxFormLayoutItem Caption="Trip date:" ColSpanMd="6">
|
||||||
<CellDisplayTemplate>
|
@EditFormContext.GetEditor("TripDate")
|
||||||
@{
|
</DxFormLayoutItem>
|
||||||
var keyField = context.Value;
|
<DxFormLayoutItem Caption="Passengers:" ColSpanMd="6">
|
||||||
string buttonText = "Contact";
|
@EditFormContext.GetEditor("NumberOfPassengers")
|
||||||
<DxButton Click="() => SendMail(keyField)" Text="@buttonText" RenderStyle="ButtonRenderStyle.Primary" />
|
</DxFormLayoutItem>
|
||||||
}
|
<DxFormLayoutItem Caption="Full name:" ColSpanMd="6">
|
||||||
</CellDisplayTemplate>
|
@EditFormContext.GetEditor("FullName")
|
||||||
</DxGridDataColumn>
|
</DxFormLayoutItem>
|
||||||
<DxGridDataColumn FieldName="Driver" FixedPosition="GridColumnFixedPosition.Right" MinWidth="80" Width="15%">
|
<DxFormLayoutItem Caption="Phone number:" ColSpanMd="6">
|
||||||
<CellDisplayTemplate>
|
@EditFormContext.GetEditor("PhoneNumber")
|
||||||
@{
|
</DxFormLayoutItem>
|
||||||
DriverModel keyField = (DriverModel)context.Value;
|
<DxFormLayoutItem Caption="Email:" ColSpanMd="6">
|
||||||
string driverText = keyField.Name;
|
@EditFormContext.GetEditor("EmailAddress")
|
||||||
<p>@driverText</p>
|
</DxFormLayoutItem>
|
||||||
}
|
<DxFormLayoutItem Caption="Driver:" ColSpanMd="6">
|
||||||
</CellDisplayTemplate>
|
<DxComboBox Data="@drivers"
|
||||||
</DxGridDataColumn>
|
NullText="Select driver..."
|
||||||
|
FilteringMode="DataGridFilteringMode.Contains"
|
||||||
</Columns>
|
TextFieldName="Name"
|
||||||
|
ValueFieldName="Name"
|
||||||
<EditFormTemplate Context="EditFormContext">
|
Value="@transfer.Driver.Name"
|
||||||
@{
|
ValueChanged="(string newCellValue) => {
|
||||||
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) => {
|
|
||||||
transfer.Driver = drivers.FirstOrDefault(x => x.Name == newCellValue);
|
transfer.Driver = drivers.FirstOrDefault(x => x.Name == newCellValue);
|
||||||
logToBrowserConsole.LogToBC(newCellValue);
|
logToBrowserConsole.LogToBC(newCellValue);
|
||||||
}">
|
}">
|
||||||
</DxComboBox>
|
</DxComboBox>
|
||||||
</DxFormLayoutItem>
|
</DxFormLayoutItem>
|
||||||
|
|
||||||
</DxFormLayout>
|
</DxFormLayout>
|
||||||
</EditFormTemplate>
|
</EditFormTemplate>
|
||||||
|
|
||||||
</DxGrid>
|
</DxGrid>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
</Animation>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class=" col-12 col-xl-6">
|
<div class=" col-12 col-xl-6">
|
||||||
|
|
@ -177,7 +183,11 @@
|
||||||
bool PopupVisible { get; set; }
|
bool PopupVisible { get; set; }
|
||||||
public List<string> ignoreList = new List<string>
|
public List<string> ignoreList = new List<string>
|
||||||
{
|
{
|
||||||
"ReceiverId"
|
"ReceiverEmailAddress",
|
||||||
|
"ReceiverId",
|
||||||
|
"SenderEmailAddress",
|
||||||
|
"SenderId",
|
||||||
|
"ContextId"
|
||||||
};
|
};
|
||||||
|
|
||||||
public MessageWizardModel messageWizardModel = new MessageWizardModel();
|
public MessageWizardModel messageWizardModel = new MessageWizardModel();
|
||||||
|
|
@ -189,7 +199,7 @@
|
||||||
new DriverModel(Guid.NewGuid(), Guid.NewGuid(), "John Doe"),
|
new DriverModel(Guid.NewGuid(), Guid.NewGuid(), "John Doe"),
|
||||||
new DriverModel(Guid.NewGuid(), Guid.NewGuid(), "Jane Doe"),
|
new DriverModel(Guid.NewGuid(), Guid.NewGuid(), "Jane Doe"),
|
||||||
new DriverModel(Guid.NewGuid(), Guid.NewGuid(), "James Doe")
|
new DriverModel(Guid.NewGuid(), Guid.NewGuid(), "James Doe")
|
||||||
};
|
};
|
||||||
|
|
||||||
object? TransferData = new TransferWizardModel[]
|
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;
|
PopupVisible = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -231,7 +241,8 @@
|
||||||
|
|
||||||
public async Task SubmitForm(object Result)
|
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}");
|
logToBrowserConsole.LogToBC($"Submitted nested form: {Result.GetType().FullName}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -282,7 +293,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//await NwindDataService.UpdateEmployeeAsync((EditableEmployee)e.DataItem, (EditableEmployee)e.EditModel);
|
//await NwindDataService.UpdateEmployeeAsync((EditableEmployee)e.DataItem, (EditableEmployee)e.EditModel);
|
||||||
|
|
||||||
await UpdateDataAsync();
|
await UpdateDataAsync();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Home.
|
/// Looks up a localized string similar to Home.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -156,6 +156,9 @@
|
||||||
<data name="NavMenu.Admin" xml:space="preserve">
|
<data name="NavMenu.Admin" xml:space="preserve">
|
||||||
<value>Adminisztráció</value>
|
<value>Adminisztráció</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="NavMenu.Events" xml:space="preserve">
|
||||||
|
<value>Események</value>
|
||||||
|
</data>
|
||||||
<data name="NavMenu.Home" xml:space="preserve">
|
<data name="NavMenu.Home" xml:space="preserve">
|
||||||
<value>Főoldal</value>
|
<value>Főoldal</value>
|
||||||
</data>
|
</data>
|
||||||
|
|
|
||||||
|
|
@ -156,6 +156,9 @@
|
||||||
<data name="NavMenu.Admin" xml:space="preserve">
|
<data name="NavMenu.Admin" xml:space="preserve">
|
||||||
<value>Admin</value>
|
<value>Admin</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="NavMenu.Events" xml:space="preserve">
|
||||||
|
<value>Events</value>
|
||||||
|
</data>
|
||||||
<data name="NavMenu.Home" xml:space="preserve">
|
<data name="NavMenu.Home" xml:space="preserve">
|
||||||
<value>Home</value>
|
<value>Home</value>
|
||||||
</data>
|
</data>
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,13 @@
|
||||||
<NavLink class="nav-link" href="transfer">
|
<NavLink class="nav-link" href="transfer">
|
||||||
@localizer.GetString("NavMenu.Transfer")
|
@localizer.GetString("NavMenu.Transfer")
|
||||||
</NavLink>
|
</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">
|
<NavLink class="nav-link" href="swagger">
|
||||||
API
|
API
|
||||||
</NavLink>
|
</NavLink>
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -42,6 +42,12 @@
|
||||||
</NavLink>
|
</NavLink>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="nav-item px-3">
|
||||||
|
<NavLink class="nav-link" href="user/media">
|
||||||
|
Media
|
||||||
|
</NavLink>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="nav-item px-3">
|
<div class="nav-item px-3">
|
||||||
<NavLink class="nav-link" href="user/cards">
|
<NavLink class="nav-link" href="user/cards">
|
||||||
Cards
|
Cards
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,8 @@ select {
|
||||||
|
|
||||||
.card {
|
.card {
|
||||||
border-radius: 16px;
|
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;
|
overflow: hidden;
|
||||||
background-color: rgba( 255, 255, 255, 0.15 );
|
background-color: rgba( 255, 255, 255, 0.15 );
|
||||||
/*color: #58457b;*/
|
/*color: #58457b;*/
|
||||||
|
|
@ -67,23 +68,21 @@ select {
|
||||||
}
|
}
|
||||||
|
|
||||||
.glass {
|
.glass {
|
||||||
border-radius: 16px;
|
|
||||||
/*box-shadow: 3px 3px 3px #b1b1b1, -3px -3px 3px #fff;*/
|
/*box-shadow: 3px 3px 3px #b1b1b1, -3px -3px 3px #fff;*/
|
||||||
overflow: hidden;
|
|
||||||
background: rgba( 255, 255, 255, 0.55 );
|
background: rgba( 255, 255, 255, 0.25 );
|
||||||
box-shadow: 0 8px 32px 0 rgba( 31, 38, 135, 0.57 );
|
|
||||||
backdrop-filter: blur( 8px );
|
backdrop-filter: blur( 8px );
|
||||||
-webkit-backdrop-filter: blur( 8px );
|
-webkit-backdrop-filter: blur( 8px );
|
||||||
border-radius: 10px;
|
|
||||||
border: 1px solid rgba( 255, 255, 255, 0.18 );
|
|
||||||
/*color: #58457b;*/
|
/*color: #58457b;*/
|
||||||
font-size: small;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.card .card-body {
|
.card .card-body {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
|
|
||||||
}
|
border: 1px solid rgba( 255, 255, 255, 0.18 );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
.inputwizardwrapper {
|
.inputwizardwrapper {
|
||||||
/*max-width: 450px;*/
|
/*max-width: 450px;*/
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -28,7 +28,9 @@ builder.Services.AddBlazoredLocalStorage();
|
||||||
builder.Services.AddSingleton<ISessionService, SessionServiceWeb>();
|
builder.Services.AddSingleton<ISessionService, SessionServiceWeb>();
|
||||||
builder.Services.AddSingleton<IComponentUpdateService, ComponentUpdateServiceWeb>();
|
builder.Services.AddSingleton<IComponentUpdateService, ComponentUpdateServiceWeb>();
|
||||||
builder.Services.AddScoped<IServiceProviderDataService, ServiceProviderDataService>();
|
builder.Services.AddScoped<IServiceProviderDataService, ServiceProviderDataService>();
|
||||||
|
builder.Services.AddScoped<IClientNoticeSenderService, ClientNoticeSenderService>();
|
||||||
builder.Services.AddScoped<IWizardProcessor, WizardProcessor>();
|
builder.Services.AddScoped<IWizardProcessor, WizardProcessor>();
|
||||||
|
builder.Services.AddScoped<IImageDataService, ImageDataService>();
|
||||||
//WebSpecific
|
//WebSpecific
|
||||||
builder.Services.AddScoped<SessionStorageAccessor>();
|
builder.Services.AddScoped<SessionStorageAccessor>();
|
||||||
builder.Services.AddSingleton(x => new ResourceManager("TIAMWebApp.Client.Resources.MyResources", typeof(Program).Assembly));
|
builder.Services.AddSingleton(x => new ResourceManager("TIAMWebApp.Client.Resources.MyResources", typeof(Program).Assembly));
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,26 @@
|
||||||
using TIAM.Entities.TransferDestinations;
|
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.Interfaces;
|
||||||
using TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels;
|
using TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels;
|
||||||
|
using static AyCode.Interfaces.Enums.IMessageTypes;
|
||||||
|
|
||||||
namespace TIAMWebApp.Client.Services
|
namespace TIAMWebApp.Client.Services
|
||||||
{
|
{
|
||||||
public class WizardProcessor : IWizardProcessor
|
public class WizardProcessor : IWizardProcessor
|
||||||
{
|
{
|
||||||
|
|
||||||
public ITransferDataService transferDataService { get; set; }
|
public ITransferDataService TransferDataService { get; set; }
|
||||||
public IUserDataService userDataService { 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.TransferDataService = transferDataService;
|
||||||
this.userDataService = userDataService;
|
this.UserDataService = userDataService;
|
||||||
|
this.MessageSenderService = messageSenderService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<TModelType?> ProcessWizardAsync<TModelType>(Type type, object data) where TModelType: class
|
public async Task<TModelType?> ProcessWizardAsync<TModelType>(Type type, object data) where TModelType: class
|
||||||
|
|
@ -21,13 +28,17 @@ namespace TIAMWebApp.Client.Services
|
||||||
switch (type.Name)
|
switch (type.Name)
|
||||||
{
|
{
|
||||||
case "TransferDestinationWizardModel":
|
case "TransferDestinationWizardModel":
|
||||||
var result = await transferDataService.CreateTransferDestination((TransferDestination)data);
|
var result = await TransferDataService.CreateTransferDestination((TransferDestination)data);
|
||||||
return result as TModelType;
|
return result as TModelType;
|
||||||
|
|
||||||
case "TransferWizardModel":
|
case "TransferWizardModel":
|
||||||
var transferResult = await transferDataService.CreateTransfer((TransferWizardModel)data);
|
var transferResult = await TransferDataService.CreateTransfer((TransferWizardModel)data);
|
||||||
return transferResult as TModelType;
|
return transferResult as TModelType;
|
||||||
|
|
||||||
|
case "MessageWizardModel":
|
||||||
|
var messageResult = await MessageSenderService.SendNoticeAsync((EmailMessage)data, 1);
|
||||||
|
return messageResult as TModelType;
|
||||||
|
|
||||||
case "ServiceProvider":
|
case "ServiceProvider":
|
||||||
return null;
|
return null;
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,9 @@
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<WasmEnableSIMD>false</WasmEnableSIMD>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Blazored.LocalStorage" Version="4.4.0" />
|
<PackageReference Include="Blazored.LocalStorage" Version="4.4.0" />
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ using AyCode.Entities.Messages;
|
||||||
using TIAMWebApp.Shared.Application.Models.ClientSide.Messages;
|
using TIAMWebApp.Shared.Application.Models.ClientSide.Messages;
|
||||||
using AyCode.Models.Messages;
|
using AyCode.Models.Messages;
|
||||||
using AyCode.Models.Enums;
|
using AyCode.Models.Enums;
|
||||||
|
using TIAM.Database.DataLayers.Admins;
|
||||||
|
|
||||||
namespace TIAMWebApp.Server.Controllers
|
namespace TIAMWebApp.Server.Controllers
|
||||||
{
|
{
|
||||||
|
|
@ -35,6 +36,7 @@ namespace TIAMWebApp.Server.Controllers
|
||||||
[Route("api/v1/[controller]")]
|
[Route("api/v1/[controller]")]
|
||||||
public class MessageAPIController : ControllerBase
|
public class MessageAPIController : ControllerBase
|
||||||
{
|
{
|
||||||
|
private AdminDal _adminDal;
|
||||||
private readonly IConfiguration _configuration;
|
private readonly IConfiguration _configuration;
|
||||||
private readonly IWebHostEnvironment _webHostEnvironment;
|
private readonly IWebHostEnvironment _webHostEnvironment;
|
||||||
private IMessageSenderService _messageSenderService;
|
private IMessageSenderService _messageSenderService;
|
||||||
|
|
@ -42,8 +44,9 @@ namespace TIAMWebApp.Server.Controllers
|
||||||
|
|
||||||
private readonly ILogger<MessageAPIController> _logger;
|
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;
|
_logger = logger;
|
||||||
_configuration = configuration;
|
_configuration = configuration;
|
||||||
_webHostEnvironment = webHostEnvironment;
|
_webHostEnvironment = webHostEnvironment;
|
||||||
|
|
@ -66,6 +69,7 @@ namespace TIAMWebApp.Server.Controllers
|
||||||
Console.WriteLine($"EmailMessage!!!");
|
Console.WriteLine($"EmailMessage!!!");
|
||||||
|
|
||||||
var result = await _messageSenderService.SendMessageAsync(SerializedMessageSenderModel.Message, (int)SerializedMessageSenderModel.MessageType);
|
var result = await _messageSenderService.SendMessageAsync(SerializedMessageSenderModel.Message, (int)SerializedMessageSenderModel.MessageType);
|
||||||
|
//_adminDal.AddEmailMessageAsync((TIAM.Entities.Emails.EmailMessage)SerializedMessageSenderModel.Message);
|
||||||
Console.WriteLine("SendEmail result: " + result);
|
Console.WriteLine("SendEmail result: " + result);
|
||||||
return Ok(result);
|
return Ok(result);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -57,7 +57,7 @@ namespace TIAMWebApp.Server.Controllers
|
||||||
|
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[Route("AuthenticateUser")]
|
[Route(APIUrls.AuthenticateUserRouteName)]
|
||||||
public async Task<IActionResult> AuthenticateUser([FromBody] JsonElement SerializedLoginModel)
|
public async Task<IActionResult> AuthenticateUser([FromBody] JsonElement SerializedLoginModel)
|
||||||
{
|
{
|
||||||
Console.WriteLine("AuthenticateUser called");
|
Console.WriteLine("AuthenticateUser called");
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using AyCode.Interfaces.Messages;
|
using AyCode.Interfaces.Messages;
|
||||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||||
|
using Microsoft.AspNetCore.Http.Features;
|
||||||
using Microsoft.IdentityModel.Tokens;
|
using Microsoft.IdentityModel.Tokens;
|
||||||
using Microsoft.OpenApi.Models;
|
using Microsoft.OpenApi.Models;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
@ -12,6 +13,8 @@ using TIAMWebApp.Server.Services;
|
||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
|
||||||
|
string MyAllowSpecificOrigins = "_myAllowSpecificOrigins";
|
||||||
|
|
||||||
// Add services to the container.
|
// Add services to the container.
|
||||||
|
|
||||||
builder.Services.AddControllersWithViews();
|
builder.Services.AddControllersWithViews();
|
||||||
|
|
@ -20,9 +23,15 @@ builder.Services.AddRazorPages();
|
||||||
builder.Services.AddScoped<UserDal>();
|
builder.Services.AddScoped<UserDal>();
|
||||||
builder.Services.AddScoped<AdminDal>();
|
builder.Services.AddScoped<AdminDal>();
|
||||||
builder.Services.AddScoped<AuctionDal>();
|
builder.Services.AddScoped<AuctionDal>();
|
||||||
//builder.Services.AddScoped<ServiceProviderDal>();
|
|
||||||
builder.Services.AddScoped<TransferDestinationDal>();
|
builder.Services.AddScoped<TransferDestinationDal>();
|
||||||
|
|
||||||
|
builder.Services.AddCors(options => {
|
||||||
|
options.AddPolicy(MyAllowSpecificOrigins,
|
||||||
|
builder => {
|
||||||
|
builder.AllowAnyOrigin();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
builder.Services.AddSwaggerGen(swagger =>
|
builder.Services.AddSwaggerGen(swagger =>
|
||||||
{
|
{
|
||||||
swagger.SwaggerDoc("v1",
|
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.AddScoped<IMessageSenderService, NoticeSenderService>();
|
||||||
builder.Services.AddEndpointsApiExplorer();
|
builder.Services.AddEndpointsApiExplorer();
|
||||||
|
|
@ -90,6 +102,8 @@ builder.Services.ConfigureApplicationCookie(options =>
|
||||||
|
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Configure the HTTP request pipeline.
|
// Configure the HTTP request pipeline.
|
||||||
if (app.Environment.IsDevelopment())
|
if (app.Environment.IsDevelopment())
|
||||||
{
|
{
|
||||||
|
|
@ -116,6 +130,8 @@ app.UseStaticFiles();
|
||||||
|
|
||||||
app.UseAuthentication();
|
app.UseAuthentication();
|
||||||
app.UseRouting();
|
app.UseRouting();
|
||||||
|
//cors
|
||||||
|
app.UseCors(MyAllowSpecificOrigins);
|
||||||
app.UseAuthorization();
|
app.UseAuthorization();
|
||||||
app.UsePathBase("/");
|
app.UsePathBase("/");
|
||||||
app.MapRazorPages();
|
app.MapRazorPages();
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,9 @@
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<WasmEnableSIMD>false</WasmEnableSIMD>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="GoogleApi" Version="5.3.1" />
|
<PackageReference Include="GoogleApi" Version="5.3.1" />
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -13,6 +13,7 @@ namespace TIAMWebApp.Shared.Application.Models
|
||||||
public const string TransferDataAPI = BaseUrlWithSlashAndVersion + "TransferDataAPI/";
|
public const string TransferDataAPI = BaseUrlWithSlashAndVersion + "TransferDataAPI/";
|
||||||
public const string ServiceProviderAPI = BaseUrlWithSlashAndVersion + "ServiceProviderAPI/";
|
public const string ServiceProviderAPI = BaseUrlWithSlashAndVersion + "ServiceProviderAPI/";
|
||||||
public const string UserPermissionAPI = BaseUrlWithSlashAndVersion + "UserPermissionAPI/";
|
public const string UserPermissionAPI = BaseUrlWithSlashAndVersion + "UserPermissionAPI/";
|
||||||
|
public const string FileAPI = BaseUrlWithSlashAndVersion + "FileAPI/";
|
||||||
|
|
||||||
//userdata
|
//userdata
|
||||||
public const string UserTestRouteName = "test1";
|
public const string UserTestRouteName = "test1";
|
||||||
|
|
@ -108,5 +109,16 @@ namespace TIAMWebApp.Shared.Application.Models
|
||||||
//12
|
//12
|
||||||
public const string GetPermissionGroupsForContextByContextIdRouteName = "GetPermissionGroupsForContextByContextId";
|
public const string GetPermissionGroupsForContextByContextIdRouteName = "GetPermissionGroupsForContextByContextId";
|
||||||
public const string GetPermissionGroupsForContextByContextId = ServiceProviderAPI+GetPermissionGroupsForContextByContextIdRouteName;
|
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;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,12 @@
|
||||||
using System;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using TIAM.Entities.Emails;
|
||||||
using TIAM.Resources;
|
using TIAM.Resources;
|
||||||
|
|
||||||
namespace TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
namespace TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
||||||
|
|
@ -12,9 +14,11 @@ namespace TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
||||||
public class MessageWizardModel
|
public class MessageWizardModel
|
||||||
{
|
{
|
||||||
|
|
||||||
[DataType(DataType.Text)]
|
public string ReceiverEmailAddress { get; set; }
|
||||||
[Display(Name = "ReceiverId", ResourceType = typeof(TIAMResources))]
|
public Guid ReceiverId { get; set; }
|
||||||
public string 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.")]
|
[Required(ErrorMessage = "The subject value should be specified.")]
|
||||||
[DataType(DataType.Text)]
|
[DataType(DataType.Text)]
|
||||||
[Display(Name = "Subject", ResourceType = typeof(TIAMResources))]
|
[Display(Name = "Subject", ResourceType = typeof(TIAMResources))]
|
||||||
|
|
@ -25,11 +29,32 @@ namespace TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
||||||
public string Content { get; set; }
|
public string Content { get; set; }
|
||||||
|
|
||||||
public MessageWizardModel() { }
|
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;
|
ReceiverId = receiverId;
|
||||||
|
SenderEmailAddress = senderEmailAddress;
|
||||||
|
SenderId = senderId;
|
||||||
Subject = subject;
|
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) }
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -18,6 +18,7 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="8.0.1" />
|
<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="Microsoft.JSInterop" Version="8.0.1" />
|
||||||
<PackageReference Include="SkiaSharp" Version="2.88.7" />
|
<PackageReference Include="SkiaSharp" Version="2.88.7" />
|
||||||
<PackageReference Include="SkiaSharp.Views.Desktop.Common" Version="2.88.7" />
|
<PackageReference Include="SkiaSharp.Views.Desktop.Common" Version="2.88.7" />
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue