Whatta fuck? Nem is volt kimenőm.
This commit is contained in:
parent
1005c4d39f
commit
c0ec3b624f
|
|
@ -14,13 +14,12 @@
|
||||||
@inject ISecureStorageHandler SecureStorageHandler
|
@inject ISecureStorageHandler SecureStorageHandler
|
||||||
@inject ISessionService sessionService;
|
@inject ISessionService sessionService;
|
||||||
@inject HttpClient http;
|
@inject HttpClient http;
|
||||||
<h3>AppLaunch</h3>
|
|
||||||
|
|
||||||
@{
|
@{
|
||||||
if (string.IsNullOrWhiteSpace(TrackingId))
|
if (string.IsNullOrWhiteSpace(TrackingId))
|
||||||
{
|
{
|
||||||
TrackingId = "";
|
TrackingId = "";
|
||||||
<p>Loading...</p>
|
// <p>Loading...</p>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -28,7 +27,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Loading....
|
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
|
|
@ -57,7 +55,7 @@ Loading....
|
||||||
|
|
||||||
logToBrowserConsole = new LogToBrowserConsole(JSRuntime);
|
logToBrowserConsole = new LogToBrowserConsole(JSRuntime);
|
||||||
//wait for 5 seconds
|
//wait for 5 seconds
|
||||||
await Task.Delay(1000);
|
//await Task.Delay(1000);
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(userDetailsStr))
|
if (!string.IsNullOrWhiteSpace(userDetailsStr))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -20,13 +20,13 @@ namespace TIAMSharedUI.Pages.Components
|
||||||
[CascadingParameter]
|
[CascadingParameter]
|
||||||
private PopupMessageBox PopupMessageBox { get; set; } = default!;
|
private PopupMessageBox PopupMessageBox { get; set; } = default!;
|
||||||
|
|
||||||
public bool IsVisible = true;
|
public bool IsVisible = false;
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
await base.OnInitializedAsync();
|
await base.OnInitializedAsync();
|
||||||
IsLoggedIn = sessionService.IsAuthenticated;
|
IsLoggedIn = sessionService.IsAuthenticated;
|
||||||
await PopupMessageBox.ShowAsync("AuthComponent", "Initialized", null, null, null, PopupMessageBox.ButtonOk);
|
//await PopupMessageBox.ShowAsync("AuthComponent", "Initialized", null, null, null, PopupMessageBox.ButtonOk);
|
||||||
|
|
||||||
//if (await PopupMessageBox.Show("Cancel", "Cancel this stuff",
|
//if (await PopupMessageBox.Show("Cancel", "Cancel this stuff",
|
||||||
//PopupMessageBox.ButtonNo, PopupMessageBox.ButtonYes) == PopupMessageBox.ButtonNo)
|
//PopupMessageBox.ButtonNo, PopupMessageBox.ButtonYes) == PopupMessageBox.ButtonNo)
|
||||||
|
|
|
||||||
|
|
@ -117,6 +117,8 @@
|
||||||
|
|
||||||
public async Task SubmitForm(object Result)
|
public async Task SubmitForm(object Result)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
var transfer = await WizardProcessor.ProcessWizardAsync<TransferWizardModel>(Result.GetType(), Result);
|
var transfer = await WizardProcessor.ProcessWizardAsync<TransferWizardModel>(Result.GetType(), Result);
|
||||||
logToBrowserConsole.LogToBC($"Submitted nested form: {Result.GetType().FullName}");
|
logToBrowserConsole.LogToBC($"Submitted nested form: {Result.GetType().FullName}");
|
||||||
navManager.NavigateTo("/transfer2/" + transfer.Id);
|
navManager.NavigateTo("/transfer2/" + transfer.Id);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,45 @@
|
||||||
|
@page "/user/createAndManageTransfer"
|
||||||
|
@using TIAMSharedUI.Shared
|
||||||
|
@using TIAMWebApp.Shared.Application.Models;
|
||||||
|
@using TIAMWebApp.Shared.Application.Interfaces;
|
||||||
|
@layout AdminLayout
|
||||||
|
@inject IPopulationStructureDataProvider DataProvider
|
||||||
|
@inject ISupplierService SupplierService
|
||||||
|
@inject IUserDataService UserDataService
|
||||||
|
<PageTitle>Transfer</PageTitle>
|
||||||
|
|
||||||
|
|
||||||
|
<!--We need to check if the user is owner of a swerviceprovider-->
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Stats admin-->
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<div class="row py-3">
|
||||||
|
<div class=" col-12 col-xl-3">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
@code {
|
||||||
|
string Id = "2312-32132121-32123";
|
||||||
|
bool isUserLoggedIn;
|
||||||
|
int userType = 0;
|
||||||
|
|
||||||
|
protected override void OnInitialized()
|
||||||
|
{
|
||||||
|
base.OnInitialized();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -56,7 +56,24 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="item" id="1" style="background-image: url(https://images.unsplash.com/photo-1551867633-194f125bddfa?auto=format&fit=crop&q=80&w=2070&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D); background-position: center;">
|
@{
|
||||||
|
|
||||||
|
for (int i = 0; i < Destinations.Count; i++)
|
||||||
|
{
|
||||||
|
var destination = Destinations[i];
|
||||||
|
var j = i + 1;
|
||||||
|
<div class="item" id="@j" style="background-image: url('_content/TIAMSharedUI/images/mapbg.jpg'); background-position: center;">
|
||||||
|
<div class="item-desc text-center pt-3">
|
||||||
|
<h3>@destination.Name</h3>
|
||||||
|
<p>@destination.AddressString</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@* <div class="item" id="1" style="background-image: url(https://images.unsplash.com/photo-1551867633-194f125bddfa?auto=format&fit=crop&q=80&w=2070&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D); background-position: center;">
|
||||||
<div class="item-desc text-center pt-3">
|
<div class="item-desc text-center pt-3">
|
||||||
<h3>Liszt Ferenc Airport</h3>
|
<h3>Liszt Ferenc Airport</h3>
|
||||||
|
|
||||||
|
|
@ -73,7 +90,7 @@
|
||||||
<h3>Chain Bridge</h3>
|
<h3>Chain Bridge</h3>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> *@
|
||||||
</div>
|
</div>
|
||||||
<p>Please type an address or swipe to select from preset destinations!</p>
|
<p>Please type an address or swipe to select from preset destinations!</p>
|
||||||
|
|
||||||
|
|
@ -222,10 +239,10 @@
|
||||||
{
|
{
|
||||||
if(firstRender)
|
if(firstRender)
|
||||||
{
|
{
|
||||||
var dotNetObjRef = DotNetObjectReference.Create(this);
|
// var dotNetObjRef = DotNetObjectReference.Create(this);
|
||||||
JSRuntime.InvokeVoidAsync("setOwlId", OwlId);
|
// JSRuntime.InvokeVoidAsync("setOwlId", OwlId);
|
||||||
JSRuntime.InvokeVoidAsync("InitOwl", OwlId);
|
// JSRuntime.InvokeVoidAsync("InitOwl", OwlId);
|
||||||
JSRuntime.InvokeVoidAsync("CStoJSCall", dotNetObjRef);
|
// JSRuntime.InvokeVoidAsync("CStoJSCall", dotNetObjRef);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -277,7 +294,15 @@
|
||||||
{
|
{
|
||||||
Destinations = await TransferDataService.GetDestinationsAsync();
|
Destinations = await TransferDataService.GetDestinationsAsync();
|
||||||
Content = TextValue;
|
Content = TextValue;
|
||||||
|
InitOwl();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void InitOwl()
|
||||||
|
{
|
||||||
|
var dotNetObjRef = DotNetObjectReference.Create(this);
|
||||||
|
JSRuntime.InvokeVoidAsync("setOwlId", OwlId);
|
||||||
|
JSRuntime.InvokeVoidAsync("InitOwl", OwlId);
|
||||||
|
JSRuntime.InvokeVoidAsync("CStoJSCall", dotNetObjRef);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,12 +48,6 @@
|
||||||
</NavLink>
|
</NavLink>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="nav-item px-3">
|
|
||||||
<NavLink class="nav-link" href="user/cards">
|
|
||||||
Cards
|
|
||||||
</NavLink>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="nav-item px-3">
|
<div class="nav-item px-3">
|
||||||
<NavLink class="nav-link" @onclick="()=>expandSysAdminNav = !expandSysAdminNav">
|
<NavLink class="nav-link" @onclick="()=>expandSysAdminNav = !expandSysAdminNav">
|
||||||
<span class="oi oi-list-rich" aria-hidden="true"></span> System Admin
|
<span class="oi oi-list-rich" aria-hidden="true"></span> System Admin
|
||||||
|
|
@ -94,6 +88,11 @@
|
||||||
Hotel Dashboard
|
Hotel Dashboard
|
||||||
</NavLink>
|
</NavLink>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="nav-item px-3">
|
||||||
|
<NavLink class="nav-link" href="user/createAndManageTransfer">
|
||||||
|
Transfer
|
||||||
|
</NavLink>
|
||||||
|
</div>
|
||||||
<div class="nav-item px-3">
|
<div class="nav-item px-3">
|
||||||
<NavLink class="nav-link" href="user/serviceprovider/5453-a87f77787d-khj899">
|
<NavLink class="nav-link" href="user/serviceprovider/5453-a87f77787d-khj899">
|
||||||
Manage
|
Manage
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ namespace TIAMWebApp.Client.Services
|
||||||
|
|
||||||
Task<Supplier[]?> ISupplierService.GetSuppliersAsync()
|
Task<Supplier[]?> ISupplierService.GetSuppliersAsync()
|
||||||
{
|
{
|
||||||
return http.GetFromJsonAsync<Supplier[]>("SupplierAPI");
|
return http.GetFromJsonAsync<Supplier[]>("api/v1/SupplierAPI");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ namespace TIAMWebApp.Client.Services
|
||||||
logToBrowserConsole.LogToBC($"{hasProperties.Count} properties found");
|
logToBrowserConsole.LogToBC($"{hasProperties.Count} properties found");
|
||||||
|
|
||||||
//create user session model
|
//create user session model
|
||||||
var user = new UserSessionModel(userModelDto.Id, UserType.User, userModelDto.Profile?.Name, hasProperties, 1);
|
var user = new UserSessionModel(userModelDto.Id, UserType.User, userModelDto, hasProperties, 1);
|
||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -64,7 +64,7 @@ namespace TIAMWebApp.Client.Services
|
||||||
|
|
||||||
public async Task<string> TestUserApi(int Param)
|
public async Task<string> TestUserApi(int Param)
|
||||||
{
|
{
|
||||||
var url = $"{Setting.BaseUrl}/{APIUrls.UserTest}";
|
var url = $"{Setting.ApiBaseUrl}/{APIUrls.UserTest}";
|
||||||
|
|
||||||
|
|
||||||
var response = await http.PostAsJsonAsync(url, Param);
|
var response = await http.PostAsJsonAsync(url, Param);
|
||||||
|
|
@ -75,7 +75,7 @@ namespace TIAMWebApp.Client.Services
|
||||||
public async Task<string> AuthenticateUser(LoginModel loginModel)
|
public async Task<string> AuthenticateUser(LoginModel loginModel)
|
||||||
{
|
{
|
||||||
string result = string.Empty;
|
string result = string.Empty;
|
||||||
var url = $"{Setting.BaseUrl}/{APIUrls.AuthenticateUser}";
|
var url = $"{Setting.ApiBaseUrl}/{APIUrls.AuthenticateUser}";
|
||||||
|
|
||||||
var response = await http.PostAsJsonAsync(url, loginModel);
|
var response = await http.PostAsJsonAsync(url, loginModel);
|
||||||
|
|
||||||
|
|
@ -107,7 +107,7 @@ namespace TIAMWebApp.Client.Services
|
||||||
|
|
||||||
bool isSuccess = true;
|
bool isSuccess = true;
|
||||||
string result = string.Empty;
|
string result = string.Empty;
|
||||||
var url = $"{Setting.BaseUrl}/{APIUrls.CreateUser}";
|
var url = $"{Setting.ApiBaseUrl}/{APIUrls.CreateUser}";
|
||||||
logToBrowserConsole.LogToBC("CreateUser url: " + url);
|
logToBrowserConsole.LogToBC("CreateUser url: " + url);
|
||||||
var response = await http.PostAsJsonAsync(url, regModel);
|
var response = await http.PostAsJsonAsync(url, regModel);
|
||||||
result = await response.Content.ReadAsStringAsync();
|
result = await response.Content.ReadAsStringAsync();
|
||||||
|
|
@ -133,13 +133,13 @@ namespace TIAMWebApp.Client.Services
|
||||||
|
|
||||||
public async Task<UserModelDto?> GetUserByEmailAsync(string email)
|
public async Task<UserModelDto?> GetUserByEmailAsync(string email)
|
||||||
{
|
{
|
||||||
var url = $"{Setting.BaseUrl}/{APIUrls.GetUserByEmail}";
|
var url = $"{Setting.ApiBaseUrl}/{APIUrls.GetUserByEmail}";
|
||||||
return await http.GetFromJsonAsync<UserModelDto?>(url);
|
return await http.GetFromJsonAsync<UserModelDto?>(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<UserModelDto?> GetUserByIdAsync(Guid id)
|
public async Task<UserModelDto?> GetUserByIdAsync(Guid id)
|
||||||
{
|
{
|
||||||
var url = $"{Setting.BaseUrl}/{APIUrls.GetUserById}";
|
var url = $"{Setting.ApiBaseUrl}/{APIUrls.GetUserById}";
|
||||||
logToBrowserConsole.LogToBC("GetUserByIdAsync url: " + url + ", " + id.ToString());
|
logToBrowserConsole.LogToBC("GetUserByIdAsync url: " + url + ", " + id.ToString());
|
||||||
|
|
||||||
var response = await http.PostAsJsonAsync(url, id);
|
var response = await http.PostAsJsonAsync(url, id);
|
||||||
|
|
@ -154,7 +154,7 @@ namespace TIAMWebApp.Client.Services
|
||||||
logToBrowserConsole.LogToBC("RefreshToken() called");
|
logToBrowserConsole.LogToBC("RefreshToken() called");
|
||||||
bool isTokenRefreshed = false;
|
bool isTokenRefreshed = false;
|
||||||
|
|
||||||
var url = $"{Setting.BaseUrl}/{APIUrls.RefreshToken}";
|
var url = $"{Setting.ApiBaseUrl}/{APIUrls.RefreshToken}";
|
||||||
//var url = APIUrls.RefreshToken;
|
//var url = APIUrls.RefreshToken;
|
||||||
|
|
||||||
var serializedStr = JsonConvert.SerializeObject(new AuthenticateRequestAndResponse
|
var serializedStr = JsonConvert.SerializeObject(new AuthenticateRequestAndResponse
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,12 @@
|
||||||
using AyCode.Interfaces.Enums;
|
using AyCode.Interfaces.Enums;
|
||||||
using AyCode.Interfaces.Messages;
|
using AyCode.Interfaces.Messages;
|
||||||
using AyCode.Models.Messages;
|
using AyCode.Models.Messages;
|
||||||
|
using System.Diagnostics;
|
||||||
using TIAM.Entities.Transfers;
|
using TIAM.Entities.Transfers;
|
||||||
//using TIAM.Entities.TransferDestinations;
|
//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 TIAMWebApp.Shared.Application.Utility;
|
||||||
using static AyCode.Interfaces.Enums.IMessageTypes;
|
using static AyCode.Interfaces.Enums.IMessageTypes;
|
||||||
|
|
||||||
namespace TIAMWebApp.Client.Services
|
namespace TIAMWebApp.Client.Services
|
||||||
|
|
@ -33,6 +35,7 @@ namespace TIAMWebApp.Client.Services
|
||||||
return result as TModelType;
|
return result as TModelType;
|
||||||
|
|
||||||
case "TransferWizardModel":
|
case "TransferWizardModel":
|
||||||
|
Console.WriteLine("TransferWizardModel");
|
||||||
var transferResult = await TransferDataService.CreateTransfer((TransferWizardModel)data);
|
var transferResult = await TransferDataService.CreateTransfer((TransferWizardModel)data);
|
||||||
return transferResult as TModelType;
|
return transferResult as TModelType;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
"version": 1,
|
||||||
|
"isRoot": true,
|
||||||
|
"tools": {
|
||||||
|
"dotnet-ef": {
|
||||||
|
"version": "8.0.3",
|
||||||
|
"commands": [
|
||||||
|
"dotnet-ef"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -71,6 +71,60 @@ namespace TIAMWebApp.Server.Controllers
|
||||||
return null;//await _transferDestinationDal.Context.TransferDestinations.FirstOrDefaultAsync(x => x.Address == address);
|
return null;//await _transferDestinationDal.Context.TransferDestinations.FirstOrDefaultAsync(x => x.Address == address);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[AllowAnonymous]
|
||||||
|
[HttpPost]
|
||||||
|
[Route(APIUrls.CreateTransferRouteName)]
|
||||||
|
public async Task<IActionResult> CreateTransfer([FromBody] JsonElement serializedTransferModel)
|
||||||
|
{
|
||||||
|
Console.WriteLine("CreateTransfer called!");
|
||||||
|
if (string.IsNullOrEmpty(serializedTransferModel.GetRawText()))
|
||||||
|
{
|
||||||
|
return BadRequest("SerializedTramsferDestinationWizardModel is required");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TransferWizardModel? transfer = JObject.Parse(serializedTransferModel.GetRawText()).ToObject<TransferWizardModel>();
|
||||||
|
|
||||||
|
if (transfer != null)
|
||||||
|
{
|
||||||
|
|
||||||
|
var id = Guid.NewGuid();
|
||||||
|
//TransferDestination transferDestination = new TransferDestination(id, transferDestinationModel.Name, transferDestinationModel.Description, transferDestinationModel.AddressString);
|
||||||
|
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(transfer.PhoneNumber) || string.IsNullOrEmpty(transfer.EmailAddress))
|
||||||
|
{
|
||||||
|
return BadRequest("Invalid request");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Console.WriteLine($"Transfer to be created: {id}");
|
||||||
|
Console.WriteLine($"Transfer to be created: {transfer.Id}");
|
||||||
|
Console.WriteLine($"Transfer to be created: {transfer.Destination}");
|
||||||
|
Console.WriteLine($"Transfer to be created: {transfer.PickupAddress}");
|
||||||
|
Console.WriteLine($"Transfer to be created: {transfer.TripDate}");
|
||||||
|
Console.WriteLine($"Transfer to be created: {transfer.NumberOfPassengers}");
|
||||||
|
Console.WriteLine($"Transfer to be created: {transfer.FullName}");
|
||||||
|
Console.WriteLine($"Transfer to be created: {transfer.PhoneNumber}");
|
||||||
|
Console.WriteLine($"Transfer to be created: {transfer.EmailAddress}");
|
||||||
|
|
||||||
|
|
||||||
|
//await _transferDestinationDal.Context.TransferDestinations.AddAsync(transferDestination);
|
||||||
|
await _adminDal.AddTransferAsync(transfer.CopyToTransfer());
|
||||||
|
return Ok(transfer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return BadRequest("Invalid request");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[Route(APIUrls.CreateTransferDestinationRouteName)]
|
[Route(APIUrls.CreateTransferDestinationRouteName)]
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||||
-->
|
-->
|
||||||
<Project>
|
<Project>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<DeleteExistingFiles>false</DeleteExistingFiles>
|
<DeleteExistingFiles>true</DeleteExistingFiles>
|
||||||
<ExcludeApp_Data>false</ExcludeApp_Data>
|
<ExcludeApp_Data>false</ExcludeApp_Data>
|
||||||
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
|
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
|
||||||
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
||||||
|
|
@ -13,5 +13,9 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||||
<PublishUrl>C:\REPOS\AYCODE\Publish\Server</PublishUrl>
|
<PublishUrl>C:\REPOS\AYCODE\Publish\Server</PublishUrl>
|
||||||
<WebPublishMethod>FileSystem</WebPublishMethod>
|
<WebPublishMethod>FileSystem</WebPublishMethod>
|
||||||
<_TargetId>Folder</_TargetId>
|
<_TargetId>Folder</_TargetId>
|
||||||
|
<SiteUrlToLaunchAfterPublish />
|
||||||
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
|
<ProjectGuid>9d0f60cb-0462-4bdb-91bd-cadb574ab5a5</ProjectGuid>
|
||||||
|
<SelfContained>false</SelfContained>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
@ -9,7 +9,9 @@ namespace TIAMWebApp.Shared.Application.Models.ClientSide
|
||||||
public class Setting
|
public class Setting
|
||||||
{
|
{
|
||||||
public static UserBasicDetails UserBasicDetails { get; set; }
|
public static UserBasicDetails UserBasicDetails { get; set; }
|
||||||
public const string BaseUrl = "https://localhost:7116";
|
//public const string BaseUrl = "https://localhost:7116";
|
||||||
|
public const string BaseUrl = "https://touriam.mangoweb.hu";
|
||||||
|
public const string ApiBaseUrl = "https://touriam.mangoweb.hu";
|
||||||
public const bool DarkMode = false;
|
public const bool DarkMode = false;
|
||||||
public static string Locale { get; set; }
|
public static string Locale { get; set; }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,12 +46,12 @@ namespace TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
||||||
[Required(ErrorMessage = "The price should be specified.")]
|
[Required(ErrorMessage = "The price should be specified.")]
|
||||||
[DataType("Price")]
|
[DataType("Price")]
|
||||||
[Display(Name = ResourceKeys.Price, ResourceType = typeof(TIAMResources))]
|
[Display(Name = ResourceKeys.Price, ResourceType = typeof(TIAMResources))]
|
||||||
public double Price2 { get; set; }
|
public double? Price2 { get; set; }
|
||||||
|
|
||||||
[Required(ErrorMessage = "The price should be specified.")]
|
[Required(ErrorMessage = "The price should be specified.")]
|
||||||
[DataType("Price")]
|
[DataType("Price")]
|
||||||
[Display(Name = ResourceKeys.Price, ResourceType = typeof(TIAMResources))]
|
[Display(Name = ResourceKeys.Price, ResourceType = typeof(TIAMResources))]
|
||||||
public double Price3 { get; set; }
|
public double? Price3 { get; set; }
|
||||||
public PriceType PriceType { get; set; }
|
public PriceType PriceType { get; set; }
|
||||||
|
|
||||||
public Address Address { get; set; }
|
public Address Address { get; set; }
|
||||||
|
|
@ -66,9 +66,9 @@ namespace TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
||||||
|
|
||||||
public TransferDestinationWizardModel() { }
|
public TransferDestinationWizardModel() { }
|
||||||
|
|
||||||
public TransferDestinationWizardModel(string name, string description, string addressString, double price, double price2, double price3, Address address) :this(Guid.NewGuid(), name, description, addressString, price, price2, price3, address)
|
public TransferDestinationWizardModel(string name, string description, string addressString, double price, double? price2, double? price3, Address address) :this(Guid.NewGuid(), name, description, addressString, price, price2, price3, address)
|
||||||
{ }
|
{ }
|
||||||
public TransferDestinationWizardModel(Guid id, string name, string description, string addressString, double price, double price2, double price3, Address address)
|
public TransferDestinationWizardModel(Guid id, string name, string description, string addressString, double price, double? price2, double? price3, Address address)
|
||||||
{
|
{
|
||||||
|
|
||||||
Id = id.ToString();
|
Id = id.ToString();
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ 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.Transfers;
|
||||||
using TIAM.Resources;
|
using TIAM.Resources;
|
||||||
|
|
||||||
namespace TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
namespace TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
||||||
|
|
@ -15,15 +16,13 @@ namespace TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
||||||
{
|
{
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
|
|
||||||
//[Required(ErrorMessage = "The Username value should be specified.")]
|
|
||||||
//[Required(ErrorMessage = "The destination address should be specified.")]
|
|
||||||
[Destination(ErrorMessage = "The destination value is invalid.")]
|
[Destination(ErrorMessage = "The destination value is invalid.")]
|
||||||
[DataType("TransferDestination")]
|
[DataType("TransferDestination")]
|
||||||
[Display(Name = ResourceKeys.Destination, ResourceType = typeof(TIAMResources))]
|
[Display(Name = ResourceKeys.Destination, ResourceType = typeof(TIAMResources))]
|
||||||
public string? Destination { get; set; }
|
public string? Destination { get; set; }
|
||||||
|
|
||||||
//[Required(ErrorMessage = "The Username value should be specified.")]
|
|
||||||
//[Required(ErrorMessage = "The pickup address should be specified.")]
|
|
||||||
[DataType("TransferDestination")]
|
[DataType("TransferDestination")]
|
||||||
[Display(Name = ResourceKeys.PickupAddress, ResourceType = typeof(TIAMResources))]
|
[Display(Name = ResourceKeys.PickupAddress, ResourceType = typeof(TIAMResources))]
|
||||||
public string? PickupAddress { get; set; }
|
public string? PickupAddress { get; set; }
|
||||||
|
|
@ -106,6 +105,29 @@ namespace TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
||||||
Driver = driver;
|
Driver = driver;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Transfer CopyToTransfer()
|
||||||
|
{
|
||||||
|
var transfer = new Transfer
|
||||||
|
{
|
||||||
|
Id = this.Id,
|
||||||
|
|
||||||
|
ToAddress = this.Destination,
|
||||||
|
FromAddress = this.PickupAddress,
|
||||||
|
Appointment = this.TripDate,
|
||||||
|
PassengerCount = Convert.ToByte(this.NumberOfPassengers),
|
||||||
|
//FullName = model.FullName,
|
||||||
|
//PhoneNumber = model.PhoneNumber,
|
||||||
|
//EmailAddress = model.EmailAddress,
|
||||||
|
Price = this.Price,
|
||||||
|
UserProductMappingId = Guid.NewGuid(),
|
||||||
|
TransferStatusType = TIAM.Core.Enums.TransferStatusType.OrderSubmitted,
|
||||||
|
Comment = "Transfer order",
|
||||||
|
ReferralProductId = Guid.NewGuid(),
|
||||||
|
};
|
||||||
|
|
||||||
|
return transfer;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false)]
|
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false)]
|
||||||
|
|
|
||||||
|
|
@ -1,28 +1,33 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Microsoft.IdentityModel.Tokens;
|
using Microsoft.IdentityModel.Tokens;
|
||||||
using TIAM.Entities.Users;
|
using TIAM.Entities.Users;
|
||||||
|
using TIAM.Models.Dtos.Users;
|
||||||
|
|
||||||
namespace TIAMWebApp.Shared.Application.Models
|
namespace TIAMWebApp.Shared.Application.Models
|
||||||
{
|
{
|
||||||
public class UserSessionModel
|
public class UserSessionModel
|
||||||
{
|
{
|
||||||
|
//TODO: add user class
|
||||||
|
public UserModelDto UserModelDto { get; set; }
|
||||||
public Guid UserId { get; set; }
|
public Guid UserId { get; set; }
|
||||||
public UserType UserType { get; set; }
|
public UserType UserType { get; set; }
|
||||||
public string? UserName { get; set; }
|
public string? UserName => UserModelDto?.Profile?.Name;
|
||||||
public string DisplayName => string.IsNullOrWhiteSpace(UserName) ? UserId.ToString() : UserName;
|
public string DisplayName => string.IsNullOrWhiteSpace(UserName) ? UserId.ToString() : UserName;
|
||||||
|
|
||||||
public Dictionary<Guid, string>? HasProperties { get; set; }
|
public Dictionary<Guid, string>? HasProperties { get; set; }
|
||||||
public int UserRoles { get; set; }
|
public int UserRoles { get; set; }
|
||||||
public Dictionary<int, string> UserRolesDictionary { get; set; }
|
public Dictionary<int, string> UserRolesDictionary { get; set; }
|
||||||
|
|
||||||
public UserSessionModel(Guid userId, UserType userType, string? userName, Dictionary<Guid, string>? hasProperties, int userRoles)
|
public UserSessionModel(Guid userId, UserType userType, UserModelDto userModelDto, Dictionary<Guid, string>? hasProperties, int userRoles)
|
||||||
{
|
{
|
||||||
UserId = userId;
|
UserId = userId;
|
||||||
UserType = userType;
|
UserType = userType;
|
||||||
UserName = userName;
|
UserModelDto = userModelDto;
|
||||||
HasProperties = hasProperties;
|
HasProperties = hasProperties;
|
||||||
//UserRoles = userRoles;
|
//UserRoles = userRoles;
|
||||||
//UserRolesDictionary = new Dictionary<int, string>();
|
//UserRolesDictionary = new Dictionary<int, string>();
|
||||||
|
|
||||||
|
//UserModelDto.ServiceProviders[0].
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ namespace TIAMWebApp.Shared.Application.Services
|
||||||
|
|
||||||
public async Task<string> UploadImageAsync(MultipartContent image)
|
public async Task<string> UploadImageAsync(MultipartContent image)
|
||||||
{
|
{
|
||||||
var url = $"{Setting.BaseUrl}/{APIUrls.UploadImage}";
|
var url = $"{Setting.ApiBaseUrl}/{APIUrls.UploadImage}";
|
||||||
var response = await _http.PostAsync(url, image);
|
var response = await _http.PostAsync(url, image);
|
||||||
|
|
||||||
//var result = new WizardProcessorResult();
|
//var result = new WizardProcessorResult();
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,8 @@ namespace TIAMWebApp.Shared.Application.Services
|
||||||
public async Task<List<TransferDestination>> GetDestinationsAsync()
|
public async Task<List<TransferDestination>> GetDestinationsAsync()
|
||||||
{
|
{
|
||||||
|
|
||||||
var url = $"{Setting.BaseUrl}/{APIUrls.GetTransferDestinations}";
|
var url = $"{Setting.ApiBaseUrl}/{APIUrls.GetTransferDestinations}";
|
||||||
|
//var url = $"{APIUrls.GetTransferDestinations}";
|
||||||
logToBrowserConsole.LogToBC(url);
|
logToBrowserConsole.LogToBC(url);
|
||||||
List<TransferDestination>? response = await http.GetFromJsonAsync<List<TransferDestination>>(url);
|
List<TransferDestination>? response = await http.GetFromJsonAsync<List<TransferDestination>>(url);
|
||||||
if(response == null)
|
if(response == null)
|
||||||
|
|
@ -32,19 +33,19 @@ namespace TIAMWebApp.Shared.Application.Services
|
||||||
|
|
||||||
public async Task<TransferDestination?> GetTransferDestinationbyCoordinatesAsync(string destinationId)
|
public async Task<TransferDestination?> GetTransferDestinationbyCoordinatesAsync(string destinationId)
|
||||||
{
|
{
|
||||||
var url = $"{Setting.BaseUrl}/{APIUrls.GetTransferDestinationByCoordinates}";
|
var url = $"{Setting.ApiBaseUrl}/{APIUrls.GetTransferDestinationByCoordinates}";
|
||||||
return await http.GetFromJsonAsync<TransferDestination>(url);
|
return await http.GetFromJsonAsync<TransferDestination>(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<TransferDestination?> GetTransferDestinationbyAddressAsync(string destinationId)
|
public async Task<TransferDestination?> GetTransferDestinationbyAddressAsync(string destinationId)
|
||||||
{
|
{
|
||||||
var url = $"{Setting.BaseUrl}/{APIUrls.GetTransferDestinationByAddress}";
|
var url = $"{Setting.ApiBaseUrl}/{APIUrls.GetTransferDestinationByAddress}";
|
||||||
return await http.GetFromJsonAsync<TransferDestination>(url);
|
return await http.GetFromJsonAsync<TransferDestination>(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<TransferDestination?> CreateTransferDestination(TransferDestination model)
|
public async Task<TransferDestination?> CreateTransferDestination(TransferDestination model)
|
||||||
{
|
{
|
||||||
var url = $"{Setting.BaseUrl}/{APIUrls.CreateTransferDestination}";
|
var url = $"{Setting.ApiBaseUrl}/{APIUrls.CreateTransferDestination}";
|
||||||
var response = await http.PostAsJsonAsync(url, model);
|
var response = await http.PostAsJsonAsync(url, model);
|
||||||
|
|
||||||
//var result = new WizardProcessorResult();
|
//var result = new WizardProcessorResult();
|
||||||
|
|
@ -65,9 +66,19 @@ namespace TIAMWebApp.Shared.Application.Services
|
||||||
|
|
||||||
public async Task<TransferWizardModel?> CreateTransfer(TransferWizardModel model)
|
public async Task<TransferWizardModel?> CreateTransfer(TransferWizardModel model)
|
||||||
{
|
{
|
||||||
var url = $"{Setting.BaseUrl}/{APIUrls.CreateTransferDestination}";
|
logToBrowserConsole.LogToBC("CreateTransfer called");
|
||||||
|
logToBrowserConsole.LogToBC(model.PickupAddress);
|
||||||
|
logToBrowserConsole.LogToBC(model.Destination);
|
||||||
|
logToBrowserConsole.LogToBC(model.EmailAddress);
|
||||||
|
logToBrowserConsole.LogToBC(model.PhoneNumber);
|
||||||
|
logToBrowserConsole.LogToBC(model.TripDate.ToString());
|
||||||
|
logToBrowserConsole.LogToBC(model.NumberOfPassengers.ToString());
|
||||||
|
model.Id = Guid.NewGuid();
|
||||||
|
|
||||||
|
var url = $"{Setting.ApiBaseUrl}/{APIUrls.CreateTransfer}";
|
||||||
var response = await http.PostAsJsonAsync(url, model);
|
var response = await http.PostAsJsonAsync(url, model);
|
||||||
|
|
||||||
|
|
||||||
//var result = new WizardProcessorResult();
|
//var result = new WizardProcessorResult();
|
||||||
|
|
||||||
//if (response.IsSuccessStatusCode)
|
//if (response.IsSuccessStatusCode)
|
||||||
|
|
@ -86,7 +97,7 @@ namespace TIAMWebApp.Shared.Application.Services
|
||||||
|
|
||||||
public async Task<TransferDestination?> UpdateTransferDestination(TransferDestination model)
|
public async Task<TransferDestination?> UpdateTransferDestination(TransferDestination model)
|
||||||
{
|
{
|
||||||
var url = $"{Setting.BaseUrl}/{APIUrls.UpdateTransferDestination}";
|
var url = $"{Setting.ApiBaseUrl}/{APIUrls.UpdateTransferDestination}";
|
||||||
var response = await http.PostAsJsonAsync(url, model);
|
var response = await http.PostAsJsonAsync(url, model);
|
||||||
|
|
||||||
//var result = new WizardProcessorResult();
|
//var result = new WizardProcessorResult();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue