Merge branch 'master' of http://git2.aycode.com/Adam/TourIAm
This commit is contained in:
commit
88535c9bb7
|
|
@ -35,6 +35,9 @@ namespace TIAM.Database.DataLayers.Admins
|
|||
#endregion Car
|
||||
|
||||
#region Transfer
|
||||
|
||||
public Task<List<Transfer>> GetTransfersAsync() => SessionAsync(ctx => ctx.GetTransfers().ToList());
|
||||
public Task<string> GetTransfersJsonAsync() => SessionAsync(ctx => ctx.GetTransfers().ToJson());
|
||||
public Transfer? GetTransferById(Guid transferId) => Session(ctx => ctx.GetTransferById(transferId));
|
||||
public string? GetTransferJsonById(Guid transferId) => Session(ctx => ctx.GetTransferById(transferId)?.ToJson());
|
||||
|
||||
|
|
@ -87,6 +90,10 @@ namespace TIAM.Database.DataLayers.Admins
|
|||
public User? GetUserById(Guid userId, bool autoInclude = false) => Session(ctx => ctx.GetUserById(userId, autoInclude));
|
||||
public User? GetUserByEmail(string email, bool autoInclude = false) => Session(ctx => ctx.GetUserByEmail(email, autoInclude));
|
||||
|
||||
public UserModelDtoDetail? GetUserModelDtoDetailById(Guid userId) => Session(ctx => ctx.GetUserModelDtoDetailById(userId));
|
||||
public Task<UserModelDtoDetail?> GetUserModelDtoDetailByIdAsync(Guid userId) => SessionAsync(ctx => ctx.GetUserModelDtoDetailById(userId));
|
||||
public UserModelDtoDetail? GetUserModelDtoDetailByEmail(string email) => Session(ctx => ctx.GetUserModelDtoDetailByEmail(email));
|
||||
|
||||
public UserModelDto? GetUserModelDtoById(Guid userId) => Session(ctx => ctx.GetUserModelDtoById(userId));
|
||||
public Task<UserModelDto?> GetUserModelDtoByIdAsync(Guid userId) => SessionAsync(ctx => ctx.GetUserModelDtoById(userId));
|
||||
public UserModelDto? GetUserModelDtoByEmail(string email) => Session(ctx => ctx.GetUserModelDtoByEmail(email));
|
||||
|
|
|
|||
|
|
@ -29,6 +29,10 @@ namespace TIAM.Database.DataLayers.Users
|
|||
{
|
||||
}
|
||||
|
||||
public UserModelDtoDetail? GetUserModelDtoDetailById(Guid userId) => Session(ctx => ctx.GetUserModelDtoDetailById(userId));
|
||||
public Task<UserModelDtoDetail?> GetUserModelDtoDetailByIdAsync(Guid userId) => SessionAsync(ctx => ctx.GetUserModelDtoDetailById(userId));
|
||||
public UserModelDtoDetail? GetUserModelDtoDetailByEmail(string email) => Session(ctx => ctx.GetUserModelDtoDetailByEmail(email));
|
||||
|
||||
public UserModelDto? GetUserModelDtoById(Guid userId) => Session(x => x.GetUserModelDtoById(userId));
|
||||
public Task<UserModelDto?> GetUserModelDtoByIdAsync(Guid userId) => SessionAsync(x => x.GetUserModelDtoById(userId));
|
||||
public Task<UserModelDto?> GetUserModelDtoByEmailAsync(string email) => SessionAsync(x => x.GetUserModelDtoByEmail(email));
|
||||
|
|
|
|||
|
|
@ -30,4 +30,13 @@ public static class UserDbSetExtensions
|
|||
public static IQueryable<UserModelDto> GetAllUsersModelDto(this IUserDbSet ctx)
|
||||
=> ctx.Users.Select(user => new UserModelDto(user));
|
||||
|
||||
public static UserModelDtoDetail? GetUserModelDtoDetailById(this IUserDbSet ctx, Guid userId)
|
||||
=> ctx.GetUsersById(userId).Select(user => new UserModelDtoDetail(user)).FirstOrDefault();
|
||||
|
||||
public static UserModelDtoDetail? GetUserModelDtoDetailByEmail(this IUserDbSet ctx, string email)
|
||||
=> ctx.GetUsersByEmail(email).Select(user => new UserModelDtoDetail(user)).FirstOrDefault();
|
||||
|
||||
public static IQueryable<UserModelDtoDetail> GetAllUsersModelDetailDto(this IUserDbSet ctx)
|
||||
=> ctx.Users.Select(user => new UserModelDtoDetail(user));
|
||||
|
||||
}
|
||||
|
|
@ -16,7 +16,7 @@ public class Transfer: IEntityGuid, ITimeStampInfo, IProductForeignKey, IUserFor
|
|||
public Guid Id { get; set; }
|
||||
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int OrderId { get; private set; }
|
||||
public int OrderId { get; set; }
|
||||
|
||||
public Guid UserId { get; set; }
|
||||
public Guid ProductId { get; set; }
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
using AyCode.Interfaces.Users.Dtos;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using TIAM.Entities.Addresses;
|
||||
using TIAM.Entities.Profiles;
|
||||
using TIAM.Entities.ServiceProviders;
|
||||
|
||||
namespace TIAM.Entities.Users
|
||||
{
|
||||
public interface IUserDtoDetail : IAcUserDtoDetailBase<Profile, TiamServiceProvider, UserToServiceProvider, Address>
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using TIAM.Entities.Users;
|
||||
|
||||
namespace TIAM.Models.Dtos.Users
|
||||
{
|
||||
public class UserDtoDetail : UserDto, IUserDtoDetail
|
||||
{
|
||||
public string PhoneNumber { get; set; }
|
||||
public string? RefreshToken { get; set; }
|
||||
public Guid? RefferalId { get; set; }
|
||||
public string EmailAddress { get; set; }
|
||||
public bool EmailConfirmed { get; set; }
|
||||
public string Password { get; set; }
|
||||
public DateTime Created { get; set; }
|
||||
public DateTime Modified { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
using AyCode.Models.Users;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using TIAM.Entities.Addresses;
|
||||
using TIAM.Entities.Products;
|
||||
using TIAM.Entities.Profiles;
|
||||
using TIAM.Entities.ServiceProviders;
|
||||
using TIAM.Entities.Users;
|
||||
using TIAM.Models.Dtos.Profiles;
|
||||
|
||||
namespace TIAM.Models.Dtos.Users
|
||||
{
|
||||
public class UserModelDtoDetail : AcUserModelDtoDetailBase<UserDtoDetail, Profile, ProfileDto, TiamServiceProvider, UserToServiceProvider, Address>, IProductsRelation
|
||||
{
|
||||
public List<UserProductMapping> UserProductMappings { get; set; }
|
||||
public List<Product> Products { get; set; }
|
||||
|
||||
public UserModelDtoDetail() { }
|
||||
public UserModelDtoDetail(User user) : base(user)
|
||||
{
|
||||
if (user.Products.Count == 0) return;
|
||||
|
||||
//így proxy error lesz... - J.
|
||||
//Products = new List<Product>(user.Products);
|
||||
//UserProductMappings = new List<UserProductMapping>(user.UserProductMappings);
|
||||
|
||||
Products = new List<Product>(user.Products.Count);
|
||||
UserProductMappings = new List<UserProductMapping>(user.UserProductMappings.Count);
|
||||
|
||||
foreach (var product in user.Products)
|
||||
{
|
||||
Products.Add(new Product(product.Id, product.ServiceProviderId, product.ProductType, product.Name, product.Description, product.Price, product.JsonDetails));
|
||||
}
|
||||
|
||||
foreach (var userProduct in user.UserProductMappings)
|
||||
{
|
||||
UserProductMappings.Add(new UserProductMapping(userProduct.Id, userProduct.UserId, userProduct.ProductId));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -8,6 +8,7 @@ using TIAMWebApp.Shared.Application.Interfaces;
|
|||
using TIAMWebApp.Shared.Application.Models;
|
||||
using TIAMWebApp.Shared.Application.Models.ClientSide;
|
||||
using TIAMWebApp.Shared.Application.Models.PageModels;
|
||||
using TIAMWebApp.Shared.Application.Utility;
|
||||
|
||||
namespace TIAMMobileApp.Services
|
||||
{
|
||||
|
|
@ -201,6 +202,18 @@ namespace TIAMMobileApp.Services
|
|||
return Task.FromResult(userRoleTypes);
|
||||
|
||||
}
|
||||
|
||||
public async Task<UserModelDtoDetail?> GetUserDetailByIdAsync(Guid id)
|
||||
{
|
||||
var url = $"{Setting.ApiBaseUrl}/{APIUrls.GetUserDetailById}";
|
||||
|
||||
|
||||
var response = await http.PostAsJsonAsync(url, id);
|
||||
var result = await response.Content.ReadAsStringAsync();
|
||||
var user = JsonConvert.DeserializeObject<UserModelDtoDetail>(result);
|
||||
|
||||
return user;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,11 +32,11 @@
|
|||
<a href="" class="reload">Reload</a>
|
||||
<a class="dismiss">🗙</a>
|
||||
</div>
|
||||
|
||||
<script src="_framework/blazor.webview.js" autostart="false"></script>
|
||||
<script src="https://kit.fontawesome.com/12c469cb8f.js" crossorigin="anonymous"></script>
|
||||
<script src="_content/TIAMSharedUI/blazorAnimationInterop.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.2/dist/umd/popper.min.js" integrity="sha384-IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.min.js" integrity="sha384-cVKIPhGWiC2Al4u+LWgxfKTRIcfu0JTxR+EQDz/bgldoEyl4H0zUF0QKbrJ0EcQF" crossorigin="anonymous"></script>
|
||||
<script src="_framework/blazor.webview.js" autostart="false"></script>
|
||||
|
||||
</body>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
@page "/";
|
||||
@* @page "/"; *@
|
||||
@using TIAMWebApp.Shared.Application.Interfaces
|
||||
@using TIAMWebApp.Shared.Application.Models
|
||||
@using TIAMWebApp.Shared.Application.Utility
|
||||
|
|
@ -14,6 +14,7 @@
|
|||
@inject ISecureStorageHandler SecureStorageHandler
|
||||
@inject ISessionService sessionService;
|
||||
@inject HttpClient http;
|
||||
@inject IComponentUpdateService ComponentUpdateService
|
||||
|
||||
@{
|
||||
if (string.IsNullOrWhiteSpace(TrackingId))
|
||||
|
|
@ -30,6 +31,8 @@
|
|||
|
||||
@code {
|
||||
|
||||
|
||||
|
||||
[Parameter]
|
||||
public string TrackingId { get; set; }
|
||||
|
||||
|
|
@ -56,7 +59,7 @@
|
|||
logToBrowserConsole = new LogToBrowserConsole(JSRuntime);
|
||||
//wait for 5 seconds
|
||||
//await Task.Delay(1000);
|
||||
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(userDetailsStr))
|
||||
{
|
||||
logToBrowserConsole.LogToBC(userDetailsStr);
|
||||
|
|
@ -76,17 +79,15 @@
|
|||
if (isTokenRefreshed)
|
||||
{
|
||||
logToBrowserConsole.LogToBC("Token refreshed");
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
logToBrowserConsole.LogToBC("Couldn't refresh token");
|
||||
SignOut();
|
||||
NavManager.NavigateTo("/index");
|
||||
//NavManager.NavigateTo("/");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -100,13 +101,14 @@
|
|||
sessionService.User = user;
|
||||
logToBrowserConsole.LogToBC($"Saved user in db is: {user.DisplayName}, setting autenthicated state");
|
||||
sessionService.IsAuthenticated = true;
|
||||
NavManager.NavigateTo("/index");
|
||||
//NavManager.NavigateTo("/");
|
||||
}
|
||||
else
|
||||
{
|
||||
logToBrowserConsole.LogToBC("No token stored yet");
|
||||
NavManager.NavigateTo("/index");
|
||||
NavManager.NavigateTo("/");
|
||||
}
|
||||
ComponentUpdateService.CallRequestRefresh();
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -24,9 +24,15 @@ namespace TIAMSharedUI.Pages.Components
|
|||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await base.OnInitializedAsync();
|
||||
|
||||
IsLoggedIn = sessionService.IsAuthenticated;
|
||||
//await PopupMessageBox.ShowAsync("AuthComponent", "Initialized", null, null, null, PopupMessageBox.ButtonOk);
|
||||
if(IsLoggedIn)
|
||||
{
|
||||
|
||||
string sessionMessage = sessionService.User.UserModelDto.Products.FirstOrDefault().Name;
|
||||
|
||||
await PopupMessageBox.ShowAsync("Session info", sessionMessage, null, null, null, PopupMessageBox.ButtonOk);
|
||||
}
|
||||
|
||||
//if (await PopupMessageBox.Show("Cancel", "Cancel this stuff",
|
||||
//PopupMessageBox.ButtonNo, PopupMessageBox.ButtonYes) == PopupMessageBox.ButtonNo)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
<div class="container-fluid bg-dark my-5" style="position: relative; z-index: 2;">
|
||||
<div class="row d-flex justify-content-center">
|
||||
<div class="col-12 col-md-4 justify-content-center">
|
||||
<div class="card m-5 p-5">
|
||||
<h2 class="py-5"> Your reliable partner in transfer</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
|
||||
}
|
||||
|
|
@ -29,6 +29,9 @@ namespace TIAMSharedUI.Pages.Components
|
|||
[Inject]
|
||||
IStringLocalizer<TIAMResources> localizer { get; set; }
|
||||
|
||||
[Inject]
|
||||
public ISessionService sessionService { get; set; }
|
||||
|
||||
public Dictionary<int, Guid> FormSteps { get; set; } = new Dictionary<int, Guid>();
|
||||
public int CurrentStep { get; set; } = 0;
|
||||
|
||||
|
|
@ -53,6 +56,9 @@ namespace TIAMSharedUI.Pages.Components
|
|||
[Parameter]
|
||||
public List<string> IgnoreReflection { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public string CssClass { get; set; } = "";
|
||||
|
||||
|
||||
|
||||
string _formSubmitResult = "";
|
||||
|
|
@ -146,7 +152,7 @@ namespace TIAMSharedUI.Pages.Components
|
|||
|
||||
layoutItemBuilder.OpenElement(i++, "div");//open div
|
||||
layoutItemBuilder.AddAttribute(i++, "id", _stepID.ToString());
|
||||
layoutItemBuilder.AddAttribute(i++, "class", "disply-flex align-items-center ");
|
||||
layoutItemBuilder.AddAttribute(i++, "class", "disply-flex align-items-center "+CssClass);
|
||||
layoutItemBuilder.AddAttribute(i++, "style", "width: 100%;");
|
||||
if (k != CurrentStep)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
@page "/events"
|
||||
@using TIAMSharedUI.Shared
|
||||
@using TIAMWebApp.Shared.Application.Models
|
||||
@using TIAMWebApp.Shared.Application.Models.ClientSide.UI
|
||||
|
||||
<HeroSlider></HeroSlider>
|
||||
<HeroSlider SliderItems="@SliderItems"></HeroSlider>
|
||||
|
||||
<div class="container">
|
||||
<section class="game-section" style="max-width: 100%; overflow-x:hidden">
|
||||
|
|
@ -67,6 +68,26 @@
|
|||
|
||||
|
||||
@code {
|
||||
|
||||
public List<HeroSliderItem> SliderItems = new List<HeroSliderItem>
|
||||
{
|
||||
new HeroSliderItem
|
||||
{
|
||||
Title = "Welcome to TIAM",
|
||||
ImageUrl = "https://images.unsplash.com/photo-1514525253161-7a46d19cd819?q=80&w=1974&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
|
||||
},
|
||||
new HeroSliderItem
|
||||
{
|
||||
Title = "Welcome to TIAM",
|
||||
ImageUrl = "https://images.unsplash.com/photo-1501527459-2d5409f8cf9f?q=80&w=2070&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
|
||||
},
|
||||
new HeroSliderItem
|
||||
{
|
||||
Title = "Welcome to TIAM",
|
||||
ImageUrl = "https://images.unsplash.com/photo-1526907858462-4b1c6b0a0dcc?q=80&w=1974&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
|
||||
}
|
||||
};
|
||||
|
||||
public List<Event> MockEvents = new List<Event>
|
||||
{
|
||||
new Event("HONEYBEAST", "A Honeybeast egyedisége abban rejlik, hogy a popzenét rengeteg különféle irányból közelítik meg - hol vidám, hol szomorú, hol pörgős, hogy lassú, koncertjükön az érzelmek széles skáláját élhetjük át együtt.", "2024.05.03", "Budapest Park", "https://tixa.hu/kepek/0027/320/27870-1_20231214141702.jpg"),
|
||||
|
|
|
|||
|
|
@ -0,0 +1,458 @@
|
|||
@page "/formulaone"
|
||||
@using AyCode.Interfaces.StorageHandlers;
|
||||
@using BlazorAnimation
|
||||
@using Newtonsoft.Json;
|
||||
@using TIAMSharedUI.Shared.Components
|
||||
@using TIAMWebApp.Shared.Application.Interfaces
|
||||
@using TIAMWebApp.Shared.Application.Models.ClientSide;
|
||||
@using AyCode.Blazor.Components;
|
||||
@using TIAMWebApp.Shared.Application.Models;
|
||||
@using TIAMWebApp.Shared.Application.Models.ClientSide.UI
|
||||
@using TIAMWebApp.Shared.Application.Utility;
|
||||
@using System.IdentityModel.Tokens.Jwt;
|
||||
@using TIAMSharedUI.Pages.Components;
|
||||
@using TIAMSharedUI.Shared
|
||||
@using TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
||||
@inject NavigationManager NavManager
|
||||
@inject IUserDataService UserDataService;
|
||||
@inject IJSRuntime jsRuntime;
|
||||
@inject ISecureStorageHandler SecureStorageHandler
|
||||
@inject ISessionService sessionService;
|
||||
@inject IStringLocalizer<MyResources> localizer;
|
||||
@inject NavigationManager navManager
|
||||
@inject LogToBrowserConsole logToBrowserConsole
|
||||
|
||||
@inject ITransferDataService transferDataService
|
||||
|
||||
<PageTitle>Index</PageTitle>
|
||||
|
||||
<AuthComponent />
|
||||
|
||||
<HeroSlider SliderItems="@sliders" PBottom="200px" Height="70vh"></HeroSlider>
|
||||
<div class="container" style="position: relative; z-index: 2;">
|
||||
<div class="row d-flex justify-content-center">
|
||||
<div class="col-12">
|
||||
|
||||
@{
|
||||
if (!showWizard)
|
||||
{
|
||||
|
||||
<DxTabs>
|
||||
|
||||
<DxTabPage CssClass="text-white" Text="From Budapest">
|
||||
<div class="row d-flex justify-content-center p-5 text-white">
|
||||
<h2>BUDAPEST - HUNGARORING</h2>
|
||||
|
||||
<div class="col-lg-3 col-12">
|
||||
<div class="card bg-gradient p-3 my-3">
|
||||
<div class="card-header">
|
||||
|
||||
<h5>Early bird sale</h5>
|
||||
|
||||
</div>
|
||||
<div class="card-body text-center">
|
||||
<h3>Friday</h3>
|
||||
<h4>round trip</h4>
|
||||
<img src="_content/TIAMSharedUI/images/f1_b.png" class="img-fluid py-3" />
|
||||
<span>Budapest </span> <i class="fa-solid fa-right-left"></i> <span>Hungaroring</span>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<p>07.19.2024</p>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<DxButton CssClass="float-end" Click="() => Book(new int[1] {19}, true, _location1)">Book now</DxButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-12">
|
||||
<div class="card bg-gradient p-3 my-3">
|
||||
<div class="card-header">
|
||||
|
||||
<h5>Early bird sale</h5>
|
||||
|
||||
</div>
|
||||
<div class="card-body text-center">
|
||||
<h3>Saturday</h3>
|
||||
<h4>round trip</h4>
|
||||
<img src="_content/TIAMSharedUI/images/f1_b.png" class="img-fluid py-3" />
|
||||
<span>Budapest </span> <i class="fa-solid fa-right-left"></i> <span>Hungaroring</span>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<p>07.20.2024</p>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<DxButton CssClass="float-end" Click="() => Book(new int[1] {20}, true, _location1)">Book now</DxButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-12">
|
||||
<div class="card bg-gradient p-3 my-3">
|
||||
<div class="card-header">
|
||||
|
||||
<h5>Early bird sale</h5>
|
||||
|
||||
</div>
|
||||
<div class="card-body text-center">
|
||||
<h3>Sunday</h3>
|
||||
<h4>round trip</h4>
|
||||
<img src="_content/TIAMSharedUI/images/f1_b.png" class="img-fluid py-3" />
|
||||
<span>Budapest </span> <i class="fa-solid fa-right-left"></i> <span>Hungaroring</span>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<p>07.21.2024</p>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<DxButton CssClass="float-end" Click="() => Book(new int[1] {21}, true, _location1)">Book now</DxButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-12">
|
||||
<div class="card bg-gradient p-3 my-3">
|
||||
<div class="card-header">
|
||||
|
||||
<h5>Early bird sale</h5>
|
||||
|
||||
</div>
|
||||
<div class="card-body text-center">
|
||||
<h3>3 days</h3>
|
||||
<h4>round trip</h4>
|
||||
<img src="_content/TIAMSharedUI/images/f1_b.png" class="img-fluid py-3" />
|
||||
<span>Budapest </span> <i class="fa-solid fa-right-left"></i> <span>Hungaroring</span>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<p>07.19-21.2024</p>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<DxButton CssClass="float-end" Click="() => Book(new int[3] {19,20,21}, true, _location1)">Book now</DxButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</DxTabPage>
|
||||
<DxTabPage CssClass="text-white" Text="Liszt Ferenc Airport">
|
||||
<div class="row d-flex justify-content-center p-5 text-white">
|
||||
<h2>AIRPORT - HUNGARORING</h2>
|
||||
|
||||
<div class="col-lg-3 col-12">
|
||||
<div class="card bg-white p-3 my-3">
|
||||
<div class="card-body">
|
||||
<h3>One way transfer</h3>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<div class="row">
|
||||
<div class="col-5">
|
||||
<p>07.19.2024</p>
|
||||
</div>
|
||||
<div class="col-7">
|
||||
<DxButton CssClass="float-end" Click="() => Book(new int[1] {19}, false, _location2)">Book now</DxButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-12">
|
||||
<div class="card bg-white p-3 my-3">
|
||||
<div class="card-body">
|
||||
<h3>One way transfer</h3>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<div class="row">
|
||||
<div class="col-5">
|
||||
<p>07.20.2024</p>
|
||||
</div>
|
||||
<div class="col-7">
|
||||
<DxButton CssClass="float-end" Click="() => Book(new int[1] {20}, false, _location2)">Book now</DxButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-12">
|
||||
<div class="card bg-white p-3 my-3">
|
||||
<div class="card-body">
|
||||
<h3>One way transfer</h3>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<div class="row">
|
||||
<div class="col-5">
|
||||
<p>07.21.2024</p>
|
||||
</div>
|
||||
<div class="col-7">
|
||||
<DxButton CssClass="float-end" Click="() => Book(new int[1] {21}, false, _location2)">Book now</DxButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</DxTabPage>
|
||||
<DxTabPage CssClass="text-white" Text="Other than Budapest">
|
||||
<div class="row d-flex justify-content-center p-5 text-white">
|
||||
<h2>FROM LOCATION OUTSIDE OF BUDAPEST</h2>
|
||||
|
||||
<div class="col-lg-3 col-12">
|
||||
<div class="card bg-white p-3 my-3">
|
||||
<div class="card-body">
|
||||
<h3>Friday round trip</h3>
|
||||
<i class="fa-solid fa-right-left"></i>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<div class="row">
|
||||
<div class="col-5">
|
||||
<p>07.19.2024</p>
|
||||
</div>
|
||||
<div class="col-7">
|
||||
<DxButton CssClass="float-end" Click="() => Book(new int[1] {19}, true, _location3)">Book now</DxButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-12">
|
||||
<div class="card bg-white p-3 my-3">
|
||||
<div class="card-body">
|
||||
<h3>Saturday round trip</h3>
|
||||
<i class="fa-solid fa-right-left"></i>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<div class="row">
|
||||
<div class="col-5">
|
||||
<p>07.20.2024</p>
|
||||
</div>
|
||||
<div class="col-7">
|
||||
<DxButton CssClass="float-end" Click="() => Book(new int[1] {20}, true, _location3)">Book now</DxButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-12">
|
||||
<div class="card bg-white p-3 my-3">
|
||||
<div class="card-body">
|
||||
<h3>Sunday round trip</h3>
|
||||
<i class="fa-solid fa-right-left"></i>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<div class="row">
|
||||
<div class="col-5">
|
||||
<p>07.21.2024</p>
|
||||
</div>
|
||||
<div class="col-7">
|
||||
<DxButton CssClass="float-end" Click="() => Book(new int[1] {21}, true, _location3)">Book now</DxButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-12">
|
||||
<div class="card bg-white p-3 my-3">
|
||||
<div class="card-body">
|
||||
<h3>3 days round trip bundle</h3>
|
||||
<i class="fa-solid fa-right-left"></i>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<div class="row">
|
||||
<div class="col-5">
|
||||
<p>07.19-21.2024</p>
|
||||
</div>
|
||||
<div class="col-7">
|
||||
<DxButton CssClass="float-end" Click="() => Book(new int[3] {19,20,21}, true, _location3)">Book now</DxButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</DxTabPage>
|
||||
|
||||
|
||||
</DxTabs>
|
||||
|
||||
//six cards for the six available services
|
||||
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col-sm-6 col-12">
|
||||
</div>
|
||||
<div class="col-sm-6 col-12">
|
||||
|
||||
<div class="card bg-white p-3">
|
||||
<div class="card-header">
|
||||
<div class="row">
|
||||
<div class="col-9">
|
||||
<h5>Early bird sale</h5>
|
||||
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<DxButton CssClass="float-end" Click="() => showWizard = false">
|
||||
<i class="fa-solid fa-times"></i>
|
||||
</DxButton>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<InputWizard Data=@myModel
|
||||
OnSubmit="SubmitForm"
|
||||
IgnoreReflection="@TransferIgnorList"
|
||||
SubmitButtonText="ButtonSend"
|
||||
TitleResourceString="TransferTitle"
|
||||
SubtitleResourceString="TransferSubtitle"
|
||||
CssClass="text-white"></InputWizard>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<CallToActionComponent />
|
||||
|
||||
@code {
|
||||
|
||||
[CascadingParameter]
|
||||
private PopupMessageBox PopupMessageBox { get; set; } = default!;
|
||||
|
||||
public bool showWizard = false;
|
||||
|
||||
public string _location1 = "Budapest";
|
||||
public string _location2 = "Airport";
|
||||
public string _location3 = "Other";
|
||||
|
||||
public int[] OrderDates;
|
||||
public bool OrderIsReturn;
|
||||
public string OrderLocation;
|
||||
|
||||
|
||||
public List<HeroSliderItem> sliders = new List<HeroSliderItem>
|
||||
{
|
||||
new HeroSliderItem
|
||||
{
|
||||
Title = "Welcome to TIAM",
|
||||
ImageUrl = "https://cdn.discordapp.com/attachments/1009417752978661446/1223738909545201734/adam_the_walking_dad_on_the_racetrack_in_epic_scene_with_sunset_949f618b-40f6-460c-80c8-b1acb1dd609e.png?ex=661af2ac&is=66087dac&hm=a65227652da3b9c165b197f58d031cbdbbea392290a1bca53fc8c768d732b53e&"
|
||||
},
|
||||
new HeroSliderItem
|
||||
{
|
||||
Title = "Welcome to TIAM",
|
||||
ImageUrl = "https://cdn.discordapp.com/attachments/1009417752978661446/1223720528544792687/adam_the_walking_dad_a_formula_1_race_track_with_a_formula_1_ra_f9ca52cb-6e1a-4458-929d-99d08bce7c1f.png?ex=661ae18d&is=66086c8d&hm=aa9ef7d602f1f9e42884469b0c556886540400c0a46131d9b06e855e85523140&"
|
||||
},
|
||||
new HeroSliderItem
|
||||
{
|
||||
Title = "Welcome to TIAM",
|
||||
ImageUrl = "https://cdn.discordapp.com/attachments/1009417752978661446/1223734873504616580/adam_the_walking_dad_a_formula_1_race_track_with_a_formula_1_ra_09b9f360-9660-41bc-840a-5b0b7a189ef7.png?ex=661aeee9&is=660879e9&hm=6e07a2da7d6de8767f56b4d62e5a268975b62d417e96cd5ed723dcb88f299d65&"
|
||||
},
|
||||
};
|
||||
|
||||
public TransferWizardModel myModel = new TransferWizardModel();
|
||||
|
||||
public List<string> TransferIgnorList = new List<string>
|
||||
{
|
||||
"Id",
|
||||
"UserId",
|
||||
"Destination",
|
||||
"PickupAddress",
|
||||
"ProductId",
|
||||
"TripDate",
|
||||
"UserProductMappingId",
|
||||
"UserProductToCarId",
|
||||
"ReferralId",
|
||||
"Price",
|
||||
"Driver",
|
||||
"Comment"
|
||||
};
|
||||
|
||||
/*protected override void OnAfterRender(bool isFirst)
|
||||
{
|
||||
message = " Target destination is " + slider.SliderElementId.ToString();
|
||||
}*/
|
||||
|
||||
public async Task SubmitForm(object result)
|
||||
{
|
||||
var orderModel = result as TransferWizardModel;
|
||||
List<TransferWizardModel> TransferList = new List<TransferWizardModel>();
|
||||
foreach (var date in OrderDates)
|
||||
{
|
||||
|
||||
TransferWizardModel transfer = orderModel.Clone();
|
||||
transfer.TripDate = new DateTime(2024, 07, date);
|
||||
//Basic settings
|
||||
if (sessionService.IsAuthenticated)
|
||||
{
|
||||
transfer.UserId = sessionService.User.UserModelDto.Id;
|
||||
transfer.ProductId = sessionService.User.UserModelDto.Products.FirstOrDefault().Id;
|
||||
}
|
||||
transfer.Price = null;
|
||||
|
||||
// Outbound trip
|
||||
transfer.PickupAddress = OrderLocation;
|
||||
transfer.Destination = "Hungaroring";
|
||||
TransferList.Add(transfer);
|
||||
|
||||
// Return trip
|
||||
transfer = orderModel.Clone();
|
||||
transfer.TripDate = new DateTime(2024, 07, date);
|
||||
transfer.PickupAddress = "Hungaroring";
|
||||
transfer.Destination = OrderLocation;
|
||||
TransferList.Add(transfer);
|
||||
}
|
||||
|
||||
var transferResult = await transferDataService.CreateTransfers(TransferList);
|
||||
logToBrowserConsole.LogToBC($"Submitted nested form: {transferResult.GetType().FullName}, {transferResult.Count}");
|
||||
}
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
bool IsLoggedIn = sessionService.IsAuthenticated;
|
||||
if (IsLoggedIn)
|
||||
{
|
||||
|
||||
logToBrowserConsole.LogToBC("logged in" + sessionService.User.UserModelDto.Products.FirstOrDefault().Id);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void Book(int[] dates, bool isReturn, string location)
|
||||
{
|
||||
myModel.TripDate = new DateTime(2024, 07, dates[0]);
|
||||
myModel.Destination = "Hungaroring";
|
||||
myModel.PickupAddress = location;
|
||||
OrderDates = dates;
|
||||
OrderIsReturn = isReturn;
|
||||
OrderLocation = location;
|
||||
showWizard = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
@page "/index"
|
||||
@page "/"
|
||||
@using AyCode.Interfaces.StorageHandlers;
|
||||
@using BlazorAnimation
|
||||
@using Newtonsoft.Json;
|
||||
|
|
@ -6,6 +6,7 @@
|
|||
@using TIAMWebApp.Shared.Application.Models.ClientSide;
|
||||
@using AyCode.Blazor.Components;
|
||||
@using TIAMWebApp.Shared.Application.Models;
|
||||
@using TIAMWebApp.Shared.Application.Models.ClientSide.UI
|
||||
@using TIAMWebApp.Shared.Application.Utility;
|
||||
@using System.IdentityModel.Tokens.Jwt;
|
||||
@using TIAMSharedUI.Pages.Components;
|
||||
|
|
@ -25,7 +26,7 @@
|
|||
|
||||
<AuthComponent />
|
||||
|
||||
<HeroSlider></HeroSlider>
|
||||
<HeroSlider SliderItems="@sliders" PBottom="50px" Height="50vh"></HeroSlider>
|
||||
<div class="container" style="position: relative; z-index: 2;">
|
||||
<div class="row d-flex justify-content-center">
|
||||
<div class="col-12 col-lg-6">
|
||||
|
|
@ -101,13 +102,38 @@
|
|||
|
||||
@code {
|
||||
|
||||
public List<HeroSliderItem> sliders = new List<HeroSliderItem>
|
||||
{
|
||||
new HeroSliderItem
|
||||
{
|
||||
Title = "Welcome to TIAM",
|
||||
ImageUrl = "https://images.unsplash.com/photo-1551867633-194f125bddfa?auto=format&fit=crop&q=80&w=2070&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
|
||||
},
|
||||
new HeroSliderItem
|
||||
{
|
||||
Title = "Welcome to TIAM",
|
||||
ImageUrl = "https://images.unsplash.com/photo-1549877452-9c387954fbc2?auto=format&fit=crop&q=80&w=2070&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
|
||||
},
|
||||
new HeroSliderItem
|
||||
{
|
||||
Title = "Welcome to TIAM",
|
||||
ImageUrl = "https://images.unsplash.com/photo-1507622560124-621e26755fb8?auto=format&fit=crop&q=80&w=2070&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
|
||||
}
|
||||
};
|
||||
|
||||
public TransferWizardModel myModel = new TransferWizardModel();
|
||||
|
||||
public List<string> TransferIgnorList = new List<string>
|
||||
{
|
||||
"Id",
|
||||
"UserId",
|
||||
"ProductId",
|
||||
"UserProductMappingId",
|
||||
"UserProductToCarId",
|
||||
"ReferralId",
|
||||
"Price",
|
||||
"Driver"
|
||||
"Driver",
|
||||
"Comment"
|
||||
};
|
||||
|
||||
/*protected override void OnAfterRender(bool isFirst)
|
||||
|
|
@ -117,9 +143,14 @@
|
|||
|
||||
public async Task SubmitForm(object Result)
|
||||
{
|
||||
|
||||
|
||||
var transfer = await WizardProcessor.ProcessWizardAsync<TransferWizardModel>(Result.GetType(), Result);
|
||||
TransferWizardModel transferWizardModel = Result as TransferWizardModel;
|
||||
if(sessionService.IsAuthenticated)
|
||||
{
|
||||
transferWizardModel.UserId = sessionService.User.UserModelDto.Id;
|
||||
transferWizardModel.ProductId = sessionService.User.UserModelDto.Products.FirstOrDefault().Id;
|
||||
}
|
||||
transferWizardModel.Price = null;
|
||||
var transfer = await WizardProcessor.ProcessWizardAsync<TransferWizardModel>(transferWizardModel.GetType(), transferWizardModel);
|
||||
logToBrowserConsole.LogToBC($"Submitted nested form: {Result.GetType().FullName}");
|
||||
navManager.NavigateTo("/transfer2/" + transfer.Id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,98 @@
|
|||
@using TIAM.Entities.Transfers
|
||||
@using TIAM.Entities.Drivers
|
||||
@using TIAM.Models.Dtos.Users
|
||||
@using TIAMWebApp.Shared.Application.Interfaces
|
||||
@using TIAMWebApp.Shared.Application.Utility
|
||||
@inject IUserDataService NwindDataService
|
||||
@inject LogToBrowserConsole logToBrowserConsole
|
||||
|
||||
<div class="mb-2">
|
||||
Contact Phone: @PhoneNumber
|
||||
</div>
|
||||
<div class="mb-2">
|
||||
Contact Phone: @EmailAddress
|
||||
</div>
|
||||
<DxGrid Data="DetailGridData"
|
||||
PageSize="5"
|
||||
AutoExpandAllGroupRows="true"
|
||||
KeyboardNavigationEnabled="KeyboardNavigationEnabled"
|
||||
KeyFieldName="Id"
|
||||
ValidationEnabled="false"
|
||||
CustomizeEditModel="CustomizeEditModel"
|
||||
EditModelSaving="EditModelSaving"
|
||||
DataItemDeleting="DataItemDeleting"
|
||||
EditMode="GridEditMode.EditForm"
|
||||
ColumnResizeMode="GridColumnResizeMode.NextColumn"
|
||||
ShowFilterRow="true">
|
||||
<Columns>
|
||||
<DxGridDataColumn FieldName="Id" GroupIndex="0" />
|
||||
<DxGridDataColumn FieldName="CarId" Width="40%" />
|
||||
<DxGridDataColumn FieldName="LicencePlate" />
|
||||
</Columns>
|
||||
</DxGrid>
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public bool KeyboardNavigationEnabled { get; set; }
|
||||
[Parameter]
|
||||
public TIAM.Entities.Transfers.Transfer Customer { get; set; }
|
||||
|
||||
List<TransferToDriver> DetailGridData { get; set; }
|
||||
|
||||
public UserModelDtoDetail UserInfo;
|
||||
public string PhoneNumber = "";
|
||||
public string EmailAddress = "";
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
UserInfo = await NwindDataService.GetUserDetailByIdAsync(Customer.UserId);
|
||||
PhoneNumber = UserInfo.UserDto.PhoneNumber;
|
||||
EmailAddress = UserInfo.UserDto.EmailAddress;
|
||||
DetailGridData = Customer.TransferToDrivers;
|
||||
logToBrowserConsole.LogToBC($"DetailGridData: {DetailGridData.Count}");
|
||||
}
|
||||
|
||||
void CustomizeEditModel(GridCustomizeEditModelEventArgs e)
|
||||
{
|
||||
if (e.IsNew)
|
||||
{
|
||||
var newDriver = (TransferToDriver)e.EditModel;
|
||||
newDriver.Id = Guid.NewGuid();
|
||||
newDriver.CarId = Guid.Empty;
|
||||
newDriver.LicencePlate = "";
|
||||
newDriver.Car = new Car();
|
||||
newDriver.Price = 0;
|
||||
newDriver.TransferId = Customer.Id;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
async Task EditModelSaving(GridEditModelSavingEventArgs e)
|
||||
{
|
||||
if (e.IsNew)
|
||||
//add new orderData to orderData array
|
||||
logToBrowserConsole.LogToBC("New orderData added");
|
||||
//await NwindDataService.InsertEmployeeAsync((EditableEmployee)e.EditModel);
|
||||
else
|
||||
logToBrowserConsole.LogToBC("orderData updated");
|
||||
|
||||
//await NwindDataService.UpdateEmployeeAsync((EditableEmployee)e.DataItem, (EditableEmployee)e.EditModel);
|
||||
|
||||
await UpdateDataAsync();
|
||||
}
|
||||
async Task DataItemDeleting(GridDataItemDeletingEventArgs e)
|
||||
{
|
||||
//await NwindDataService.RemoveEmployeeAsync((EditableEmployee)e.DataItem);
|
||||
//remove orderData from orderData array
|
||||
logToBrowserConsole.LogToBC("orderData deleted");
|
||||
//await UpdateDataAsync();
|
||||
}
|
||||
async Task UpdateDataAsync()
|
||||
{
|
||||
//DataSource = await NwindDataService.GetEmployeesEditableAsync();
|
||||
//refresh grid
|
||||
logToBrowserConsole.LogToBC("orderData grid refreshed");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,12 +1,16 @@
|
|||
@page "/user/transfers"
|
||||
@using AyCode.Models.Messages
|
||||
@using BlazorAnimation
|
||||
@using TIAM.Core.Enums
|
||||
@using TIAM.Entities.ServiceProviders
|
||||
@using TIAM.Entities.Transfers
|
||||
@using TIAM.Models.Dtos.Users
|
||||
@using TIAM.Resources
|
||||
@using TIAMSharedUI.Pages.Components
|
||||
@using TIAMSharedUI.Shared
|
||||
@using TIAMWebApp.Shared.Application.Interfaces
|
||||
@using TIAMWebApp.Shared.Application.Models
|
||||
@using TIAMWebApp.Shared.Application.Models.ClientSide.UI
|
||||
@using TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
||||
@using TIAMWebApp.Shared.Application.Models.ClientSide.Messages
|
||||
@using TIAMWebApp.Shared.Application.Utility
|
||||
|
|
@ -14,6 +18,7 @@
|
|||
@inject LogToBrowserConsole logToBrowserConsole
|
||||
@inject IStringLocalizer<TIAMResources> localizer
|
||||
@inject IWizardProcessor wizardProcessor
|
||||
@inject ITransferDataService transferDataService
|
||||
<PageTitle>Transfers</PageTitle>
|
||||
|
||||
<div class="text-center m-5">
|
||||
|
|
@ -26,32 +31,72 @@
|
|||
<div class=" col-12">
|
||||
<Animation Effect="@Effect.FadeInUp" Class="glass" Speed="@Speed.Fast" Delay="@TimeSpan.FromMilliseconds(250)">
|
||||
<div class="card">
|
||||
<div class="d-flex flex-column mb-4 pb-2">
|
||||
|
||||
<DxGrid @ref="Grid2"
|
||||
Data="TransferData"
|
||||
AutoCollapseDetailRow="AutoCollapseDetailRow"
|
||||
KeyboardNavigationEnabled="true"
|
||||
CustomizeEditModel="Grid_CustomizeEditModel"
|
||||
EditModelSaving="Grid_EditModelSaving"
|
||||
DataItemDeleting="Grid_DataItemDeleting"
|
||||
EditMode="GridEditMode.EditForm"
|
||||
ColumnResizeMode="GridColumnResizeMode.NextColumn"
|
||||
ShowFilterRow="true"
|
||||
KeyFieldName="Id">
|
||||
|
||||
<Columns>
|
||||
<DxGridCommandColumn Width="8%" FixedPosition="GridColumnFixedPosition.Left" />
|
||||
<DxGridDataColumn FieldName="Id" SortIndex="0" />
|
||||
<DxGridDataColumn FieldName="OrderId" />
|
||||
<DxGridDataColumn FieldName="FromAddress" />
|
||||
<DxGridDataColumn FieldName="ToAddress" />
|
||||
<DxGridDataColumn FieldName="Appointment" />
|
||||
<DxGridDataColumn FieldName="PassengerCount" />
|
||||
<DxGridDataColumn FieldName="TransferStatusType">
|
||||
<CellDisplayTemplate>
|
||||
@{
|
||||
|
||||
TransferStatusModel keyField = Statuses.FirstOrDefault(x => x.StatusValue == Convert.ToInt16(context.Value));
|
||||
string driverText = keyField.StatusName;
|
||||
<p>@driverText</p>
|
||||
}
|
||||
</CellDisplayTemplate>
|
||||
</DxGridDataColumn>
|
||||
</Columns>
|
||||
<DetailRowTemplate>
|
||||
<Grid_MasterDetail_NestedGrid_DetailContent Customer="(TIAM.Entities.Transfers.Transfer)context.DataItem" KeyboardNavigationEnabled="true" />
|
||||
</DetailRowTemplate>
|
||||
<EditFormTemplate Context="EditFormContext">
|
||||
@{
|
||||
var transfer2 = (Transfer)EditFormContext.EditModel;
|
||||
}
|
||||
<DxFormLayout CssClass="w-100">
|
||||
<DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.DestinationAddress) ColSpanMd="6">
|
||||
@EditFormContext.GetEditor("ToAddress")
|
||||
</DxFormLayoutItem>
|
||||
<DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.PickupAddress) ColSpanMd="6">
|
||||
@EditFormContext.GetEditor("FromAddress")
|
||||
</DxFormLayoutItem>
|
||||
<DxFormLayoutItem Caption="Trip date:" ColSpanMd="6">
|
||||
@EditFormContext.GetEditor("Appointment")
|
||||
</DxFormLayoutItem>
|
||||
<DxFormLayoutItem Caption="Passengers:" ColSpanMd="6">
|
||||
@EditFormContext.GetEditor("PassengerCount")
|
||||
</DxFormLayoutItem>
|
||||
|
||||
<DxFormLayoutItem Caption="Status:" ColSpanMd="6">
|
||||
@EditFormContext.GetEditor("TransferStatusType")
|
||||
</DxFormLayoutItem>
|
||||
|
||||
</DxFormLayout>
|
||||
</EditFormTemplate>
|
||||
|
||||
|
||||
</DxGrid>
|
||||
|
||||
</div>
|
||||
|
||||
<DxPopup CssClass="popup-demo-events"
|
||||
@bind-Visible="@PopupVisible"
|
||||
ShowFooter="true"
|
||||
CloseOnEscape="true"
|
||||
CloseOnOutsideClick="false"
|
||||
ShowCloseButton="false"
|
||||
HeaderText="MessageBox"
|
||||
Closing="EulaPopupClosing"
|
||||
Closed="EulaPopupClosed">
|
||||
<BodyContentTemplate>
|
||||
<InputWizard Data=@messageWizardModel
|
||||
OnSubmit="SubmitForm"
|
||||
IgnoreReflection=@ignoreList
|
||||
TitleResourceString="NewMessage"
|
||||
SubtitleResourceString="NewMessageSubtitle"
|
||||
SubmitButtonText="ButtonSend"></InputWizard>
|
||||
</BodyContentTemplate>
|
||||
<FooterContentTemplate Context="Context">
|
||||
<div class="popup-demo-events-footer">
|
||||
<!--DxCheckBox CssClass="popup-demo-events-checkbox" @bind-Checked="@EulaAccepted">I accept the terms of the EULA</!--DxCheckBox-->
|
||||
<!--DxButton CssClass="popup-demo-events-button ms-2" RenderStyle="ButtonRenderStyle.Primary" Text="OK" Click="Context.CloseCallback" /-->
|
||||
<DxButton CssClass="popup-demo-events-button ms-2" RenderStyle="ButtonRenderStyle.Secondary" Text="Cancel" Click="CancelCreateClick" />
|
||||
</div>
|
||||
</FooterContentTemplate>
|
||||
</DxPopup>
|
||||
|
||||
<div class="d-flex flex-column mb-4 pb-2">
|
||||
<div class="align-self-end pl-2 pb-2">
|
||||
|
|
@ -60,6 +105,10 @@
|
|||
IconCssClass="btn-column-chooser"
|
||||
Click="ColumnChooserButton_Click" />
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<DxGrid @ref="Grid"
|
||||
Data="TransferData"
|
||||
PageSize="8"
|
||||
|
|
@ -75,8 +124,8 @@
|
|||
<Columns>
|
||||
<DxGridCommandColumn Width="8%" FixedPosition="GridColumnFixedPosition.Left" />
|
||||
|
||||
<DxGridDataColumn FieldName="Id" MinWidth="80" Width="10%" Visible="false" />
|
||||
<DxGridDataColumn FieldName="Destination" FixedPosition="GridColumnFixedPosition.Left" MinWidth="80" Width="10%">
|
||||
<DxGridDataColumn FieldName="Id" MinWidth="80" Width="20%" Visible="false" />
|
||||
<DxGridDataColumn FieldName="ToAddress" FixedPosition="GridColumnFixedPosition.Left" MinWidth="80">
|
||||
<CellDisplayTemplate>
|
||||
@{
|
||||
var keyField = context.Value;
|
||||
|
|
@ -84,30 +133,30 @@
|
|||
}
|
||||
</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="FromAddress" FixedPosition="GridColumnFixedPosition.Left" MinWidth="80" />
|
||||
<DxGridDataColumn FieldName="Appointment" MinWidth="80" Width="20%" />
|
||||
<DxGridDataColumn FieldName="PassengerCount" MinWidth="40" Width="3%" />
|
||||
@* <DxGridDataColumn FieldName="Drivers" 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>
|
||||
<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>
|
||||
|
||||
|
|
@ -117,39 +166,39 @@
|
|||
}
|
||||
<DxFormLayout CssClass="w-100">
|
||||
<DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.DestinationAddress) ColSpanMd="6">
|
||||
@EditFormContext.GetEditor("Destination")
|
||||
@EditFormContext.GetEditor("ToAddress")
|
||||
</DxFormLayoutItem>
|
||||
<DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.PickupAddress) ColSpanMd="6">
|
||||
@EditFormContext.GetEditor("PickupAddress")
|
||||
@EditFormContext.GetEditor("FromAddress")
|
||||
</DxFormLayoutItem>
|
||||
<DxFormLayoutItem Caption="Trip date:" ColSpanMd="6">
|
||||
@EditFormContext.GetEditor("TripDate")
|
||||
@EditFormContext.GetEditor("Appointment")
|
||||
</DxFormLayoutItem>
|
||||
<DxFormLayoutItem Caption="Passengers:" ColSpanMd="6">
|
||||
@EditFormContext.GetEditor("NumberOfPassengers")
|
||||
@EditFormContext.GetEditor("PassengerCount")
|
||||
</DxFormLayoutItem>
|
||||
<DxFormLayoutItem Caption="Full name:" ColSpanMd="6">
|
||||
@EditFormContext.GetEditor("FullName")
|
||||
@* <DxFormLayoutItem Caption="Full name:" ColSpanMd="6">
|
||||
@EditFormContext.GetEditor("FullName")
|
||||
</DxFormLayoutItem>
|
||||
<DxFormLayoutItem Caption="Phone number:" ColSpanMd="6">
|
||||
@EditFormContext.GetEditor("PhoneNumber")
|
||||
@EditFormContext.GetEditor("PhoneNumber")
|
||||
</DxFormLayoutItem>
|
||||
<DxFormLayoutItem Caption="Email:" ColSpanMd="6">
|
||||
@EditFormContext.GetEditor("EmailAddress")
|
||||
</DxFormLayoutItem>
|
||||
<DxFormLayoutItem Caption="Driver:" ColSpanMd="6">
|
||||
<DxComboBox Data="@drivers"
|
||||
NullText="Select driver..."
|
||||
FilteringMode="DataGridFilteringMode.Contains"
|
||||
TextFieldName="Name"
|
||||
ValueFieldName="Name"
|
||||
Value="@transfer.Driver.Name"
|
||||
ValueChanged="(string newCellValue) => {
|
||||
transfer.Driver = drivers.FirstOrDefault(x => x.Name == newCellValue);
|
||||
logToBrowserConsole.LogToBC(newCellValue);
|
||||
}">
|
||||
</DxComboBox>
|
||||
</DxFormLayoutItem>
|
||||
@EditFormContext.GetEditor("EmailAddress")
|
||||
</DxFormLayoutItem> *@
|
||||
@*<DxFormLayoutItem Caption="Driver:" ColSpanMd="6">
|
||||
<DxComboBox Data="@drivers"
|
||||
NullText="Select driver..."
|
||||
FilteringMode="DataGridFilteringMode.Contains"
|
||||
TextFieldName="Name"
|
||||
ValueFieldName="Name"
|
||||
Value="@transfer.Driver.Name"
|
||||
ValueChanged="(string newCellValue) => {
|
||||
transfer.Driver = drivers.FirstOrDefault(x => x.Name == newCellValue);
|
||||
logToBrowserConsole.LogToBC(newCellValue);
|
||||
}">
|
||||
</DxComboBox>
|
||||
</DxFormLayoutItem> *@
|
||||
|
||||
</DxFormLayout>
|
||||
</EditFormTemplate>
|
||||
|
|
@ -180,6 +229,8 @@
|
|||
|
||||
public TransferWizardModel myModel = new TransferWizardModel();
|
||||
|
||||
public List<Transfer> TransferData { get; set; }
|
||||
|
||||
bool PopupVisible { get; set; }
|
||||
public List<string> ignoreList = new List<string>
|
||||
{
|
||||
|
|
@ -190,28 +241,12 @@
|
|||
"ContextId"
|
||||
};
|
||||
|
||||
public MessageWizardModel messageWizardModel = new MessageWizardModel();
|
||||
public List<TransferStatusModel> Statuses { get; set; }
|
||||
|
||||
public MessageWizardModel messageWizardModel = new MessageWizardModel();
|
||||
|
||||
//IEnumerable<DriverModel> drivers { get; set; }
|
||||
|
||||
IEnumerable<DriverModel> drivers { get; set; } = new DriverModel[] {
|
||||
new DriverModel(Guid.NewGuid(), Guid.NewGuid(), "John Doe"),
|
||||
new DriverModel(Guid.NewGuid(), Guid.NewGuid(), "Jane Doe"),
|
||||
new DriverModel(Guid.NewGuid(), Guid.NewGuid(), "James Doe")
|
||||
};
|
||||
|
||||
object? TransferData = new TransferWizardModel[]
|
||||
{
|
||||
new TransferWizardModel(Guid.NewGuid(), "1087, Budapest, Százados út 30/a", "Nyugati Pályaudvar", DateTime.UtcNow.AddDays(3), 3, "John Malkovich", "+13021234567", "john.malkovich@stars.com", new DriverModel(Guid.NewGuid(), Guid.NewGuid(), "John Doe")),
|
||||
new TransferWizardModel(Guid.NewGuid(), "1027, Budapest, Batthyányi tér 3", "Budapest, Koós Károly sétány 21", DateTime.UtcNow.AddDays(6), 3, "John Malkovich", "+13021234567", "john.malkovich@stars.com", new DriverModel(Guid.NewGuid(), Guid.NewGuid(), "Jane Doe")),
|
||||
new TransferWizardModel(Guid.NewGuid(), "1087, Budapest, Százados út 30/a", "Nyugati Pályaudvar", DateTime.UtcNow.AddDays(2), 3, "John Malkovich", "+13021234567", "john.malkovich@stars.com", new DriverModel(Guid.NewGuid(), Guid.NewGuid(), "James Doe")),
|
||||
new TransferWizardModel(Guid.NewGuid(), "1087, Budapest, Százados út 30/a", "Nyugati Pályaudvar", DateTime.UtcNow.AddDays(4).AddHours(-6), 3, "John Malkovich", "+13021234567", "john.malkovich@stars.com", new DriverModel(Guid.NewGuid(), Guid.NewGuid(), "James Doe")),
|
||||
new TransferWizardModel(Guid.NewGuid(), "1087, Budapest, Százados út 30/a", "Nyugati Pályaudvar", DateTime.UtcNow.AddDays(7), 3, "John Malkovich", "+13021234567", "john.malkovich@stars.com", new DriverModel(Guid.NewGuid(), Guid.NewGuid(), "Joan Doe")),
|
||||
new TransferWizardModel(Guid.NewGuid(), "1087, Budapest, Százados út 30/a", "Nyugati Pályaudvar", DateTime.UtcNow.AddDays(1), 3, "John Malkovich", "+13021234567", "john.malkovich@stars.com", new DriverModel(Guid.NewGuid(), Guid.NewGuid(), "James Doe")),
|
||||
new TransferWizardModel(Guid.NewGuid(), "1087, Budapest, Százados út 30/a", "Nyugati Pályaudvar", DateTime.UtcNow.AddDays(6).AddHours(3), 3, "John Malkovich", "+13021234567", "john.malkovich@stars.com", new DriverModel(Guid.NewGuid(), Guid.NewGuid(), "John Doe"))
|
||||
|
||||
};
|
||||
|
||||
void SendMail(TransferWizardModel Item)
|
||||
{
|
||||
|
|
@ -222,7 +257,6 @@
|
|||
void CancelCreateClick()
|
||||
{
|
||||
|
||||
|
||||
PopupVisible = false;
|
||||
}
|
||||
void EulaPopupClosed()
|
||||
|
|
@ -266,7 +300,6 @@
|
|||
newEmployee.FullName = "ghjgkg hkgh ghjkghgkjgh";
|
||||
newEmployee.PhoneNumber = "+13021234567";
|
||||
newEmployee.EmailAddress = "ghjgkg hkgh ghjkghgkjgh";
|
||||
newEmployee.Driver = drivers.FirstOrDefault();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -281,20 +314,17 @@
|
|||
//modify transferData where transferData.Id == e.EditModel.Id
|
||||
//get transfer from TransferData by Id
|
||||
|
||||
foreach (var transferToModify in (TransferWizardModel[])TransferData)
|
||||
foreach (var transferToModify in (List<Transfer>)TransferData)
|
||||
{
|
||||
myModel = (TransferWizardModel)e.EditModel;
|
||||
|
||||
if (transferToModify.Id == myModel.Id)
|
||||
{
|
||||
transferToModify.Driver = myModel.Driver;
|
||||
//transferToModify.Driver = myModel.Driver;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//await NwindDataService.UpdateEmployeeAsync((EditableEmployee)e.DataItem, (EditableEmployee)e.EditModel);
|
||||
|
||||
await UpdateDataAsync();
|
||||
}
|
||||
async Task Grid_DataItemDeleting(GridDataItemDeletingEventArgs e)
|
||||
|
|
@ -311,18 +341,53 @@
|
|||
logToBrowserConsole.LogToBC("orderData grid refreshed");
|
||||
}
|
||||
|
||||
protected override void OnInitialized()
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
Statuses = new List<TransferStatusModel>
|
||||
{
|
||||
new TransferStatusModel(Convert.ToInt16(TransferStatusType.OrderSubmitted), "Order submitted"),
|
||||
new TransferStatusModel(Convert.ToInt16(TransferStatusType.OrderConfirmed), "Order confirmed"),
|
||||
new TransferStatusModel(Convert.ToInt16(TransferStatusType.AssignedToDriver), "Assigned to driver"),
|
||||
new TransferStatusModel(Convert.ToInt16(TransferStatusType.DriverConfirmed), "Driver confirmed"),
|
||||
new TransferStatusModel(Convert.ToInt16(TransferStatusType.DriverEnRoute), "Driver enroute"),
|
||||
new TransferStatusModel(Convert.ToInt16(TransferStatusType.PassengerPickup), "Passenger in car"),
|
||||
new TransferStatusModel(Convert.ToInt16(TransferStatusType.Finished), "Finished"),
|
||||
new TransferStatusModel(Convert.ToInt16(TransferStatusType.UserCanceled), "User cancelled"),
|
||||
new TransferStatusModel(Convert.ToInt16(TransferStatusType.AdminDenied), "Admin cancelled")
|
||||
};
|
||||
TransferData = (await transferDataService.GetTransfersAsync()).OrderBy(x => x.TransferStatusType).ThenByDescending(x => x.OrderId).ToList();
|
||||
base.OnInitialized();
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
void ColumnChooserButton_Click()
|
||||
{
|
||||
Grid.ShowColumnChooser();
|
||||
Grid2.ShowColumnChooser();
|
||||
}
|
||||
|
||||
IGrid Grid2 { get; set; }
|
||||
object MasterGridData { get; set; }
|
||||
bool AutoCollapseDetailRow { get; set; }
|
||||
|
||||
protected override void OnAfterRender(bool firstRender)
|
||||
{
|
||||
if (firstRender)
|
||||
{
|
||||
Grid2.ExpandDetailRow(0);
|
||||
}
|
||||
}
|
||||
void AutoCollapseDetailRow_Changed(bool newValue)
|
||||
{
|
||||
AutoCollapseDetailRow = newValue;
|
||||
if (newValue)
|
||||
{
|
||||
Grid2.BeginUpdate();
|
||||
Grid2.CollapseAllDetailRows();
|
||||
Grid2.ExpandDetailRow(0);
|
||||
Grid2.EndUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -186,6 +186,15 @@ namespace TIAMSharedUI.Resources {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to FormulaOne.
|
||||
/// </summary>
|
||||
public static string NavMenu_FormulaOne {
|
||||
get {
|
||||
return ResourceManager.GetString("NavMenu.FormulaOne", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Home.
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -159,6 +159,9 @@
|
|||
<data name="NavMenu.Events" xml:space="preserve">
|
||||
<value>Események</value>
|
||||
</data>
|
||||
<data name="NavMenu.FormulaOne" xml:space="preserve">
|
||||
<value>Forma1</value>
|
||||
</data>
|
||||
<data name="NavMenu.Home" xml:space="preserve">
|
||||
<value>Főoldal</value>
|
||||
</data>
|
||||
|
|
|
|||
|
|
@ -159,6 +159,9 @@
|
|||
<data name="NavMenu.Events" xml:space="preserve">
|
||||
<value>Events</value>
|
||||
</data>
|
||||
<data name="NavMenu.FormulaOne" xml:space="preserve">
|
||||
<value>FormulaOne</value>
|
||||
</data>
|
||||
<data name="NavMenu.Home" xml:space="preserve">
|
||||
<value>Home</value>
|
||||
</data>
|
||||
|
|
|
|||
|
|
@ -5,8 +5,11 @@
|
|||
|
||||
|
||||
<nav class="navbar sticky-top navbar-expand-lg">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="#"><img height="25" src="_content/TIAMSharedUI/images/logo_wide.png" alt="TourIam Logo" title="TourIAm Logo" /></a>
|
||||
<div class="container-fluid">
|
||||
<NavLink class="navbar-brand" href="/">
|
||||
<img height="25" src="_content/TIAMSharedUI/images/logo_wide.png" alt="TourIam Logo" title="TourIAm Logo" />
|
||||
</NavLink>
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<img src="_content/TIAMSharedUI/images/navbar-toggler.png" width="40" />
|
||||
</button>
|
||||
|
|
@ -14,7 +17,7 @@
|
|||
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
||||
<li class="nav-item">
|
||||
<!--NavLink class="nav-link" href="" Match="NavLinkMatch.All"-->
|
||||
<NavLink class="nav-link" href="index">
|
||||
<NavLink class="nav-link" href="/">
|
||||
<!--span class="oi oi-home" aria-hidden="true"></span-->
|
||||
@localizer.GetString("NavMenu.Home")
|
||||
</NavLink>
|
||||
|
|
@ -24,6 +27,11 @@
|
|||
@localizer.GetString("NavMenu.Transfer")
|
||||
</NavLink>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<NavLink class="nav-link" href="formulaone">
|
||||
@localizer.GetString("NavMenu.FormulaOne")
|
||||
</NavLink>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<NavLink class="nav-link" href="events">
|
||||
@localizer.GetString("NavMenu.Events")
|
||||
|
|
|
|||
|
|
@ -1,51 +1,27 @@
|
|||
@using BlazorAnimation
|
||||
<header class="pb-5">
|
||||
@using TIAMWebApp.Shared.Application.Models.ClientSide.UI
|
||||
<header style="padding-bottom: @PBottom;">
|
||||
<Animation Effect="@Effect.FadeIn" Speed="@Speed.Fast" Delay="@TimeSpan.FromMilliseconds(250)">
|
||||
<div id="owl-demo" class="owl-carousel owl-theme" style="position:absolute; z-index: 1">
|
||||
<div id="owl-demo" class="owl-carousel owl-theme" style="position:absolute; z-index: 1;">
|
||||
|
||||
<div class="item d-flex align-items-center"><img src="https://images.unsplash.com/photo-1551867633-194f125bddfa?auto=format&fit=crop&q=80&w=2070&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D" class="my-auto" alt="The Last of us"></div>
|
||||
<div class="item d-flex align-items-center"><img src="https://images.unsplash.com/photo-1549877452-9c387954fbc2?auto=format&fit=crop&q=80&w=2070&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D" class="my-auto" alt="GTA V"></div>
|
||||
<div class="item d-flex align-items-center"><img src="https://images.unsplash.com/photo-1507622560124-621e26755fb8?auto=format&fit=crop&q=80&w=2070&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D" class="my-auto" alt="Mirror Edge"></div>
|
||||
|
||||
</div>
|
||||
@{
|
||||
foreach (var slider in SliderItems)
|
||||
{
|
||||
<div class="item d-flex align-items-center" style="height: @Height;">
|
||||
<img src="@slider.ImageUrl" class="my-auto" alt="@slider.Title">
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
</div>
|
||||
|
||||
</Animation>
|
||||
<!--div id="carouselExampleCaptions" class="carousel slide" data-bs-ride="carousel">
|
||||
<div class="carousel-indicators">
|
||||
<button type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide-to="0" class="active" aria-current="true" aria-label="Slide 1"></button>
|
||||
<button type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide-to="1" aria-label="Slide 2"></button>
|
||||
<button type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide-to="2" aria-label="Slide 3"></button>
|
||||
</div>
|
||||
<div class="carousel-inner">
|
||||
<div class="carousel-item active" 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')">
|
||||
<div class="carousel-caption">
|
||||
<h5>First slide label</h5>
|
||||
<p>Some representative placeholder content for the first slide.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="carousel-item" style="background-image: url('https://images.unsplash.com/photo-1518471152222-d42e38ce6873?auto=format&fit=crop&q=80&w=1974&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D')">
|
||||
<div class="carousel-caption">
|
||||
<h5>Second slide label</h5>
|
||||
<p>Some representative placeholder content for the second slide.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="carousel-item" style="background-image: url('https://images.unsplash.com/photo-1507622560124-621e26755fb8?auto=format&fit=crop&q=80&w=2070&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D')">
|
||||
<div class="carousel-caption">
|
||||
<h5>Third slide label</h5>
|
||||
<p>Some representative placeholder content for the third slide.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide="prev">
|
||||
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
|
||||
<span class="visually-hidden">Previous</span>
|
||||
</button>
|
||||
<button class="carousel-control-next" type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide="next">
|
||||
<span class="carousel-control-next-icon" aria-hidden="true"></span>
|
||||
<span class="visually-hidden">Next</span>
|
||||
</button>
|
||||
</div-->
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
|
||||
|
|
@ -53,7 +29,7 @@
|
|||
|
||||
navigation: true, // Show next and prev buttons
|
||||
autoplay: true,
|
||||
loop:true,
|
||||
loop: true,
|
||||
autoplayTimeout: 5000,
|
||||
slideSpeed: 100,
|
||||
paginationSpeed: 200,
|
||||
|
|
@ -83,5 +59,12 @@
|
|||
</script>
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public List<HeroSliderItem> SliderItems { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public string PBottom { get; set; } = "50px";
|
||||
|
||||
[Parameter]
|
||||
public string Height { get; set; } = "50vh";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
@inherits LayoutComponentBase
|
||||
@using AyCode.Interfaces.StorageHandlers;
|
||||
@using Newtonsoft.Json;
|
||||
@using TIAMSharedUI.Pages
|
||||
@using TIAMSharedUI.Shared.Components
|
||||
@using TIAMWebApp.Shared.Application.Interfaces
|
||||
@using TIAMWebApp.Shared.Application.Models.ClientSide;
|
||||
|
|
@ -14,8 +15,10 @@
|
|||
@inject ISessionService sessionService;
|
||||
|
||||
|
||||
|
||||
<!--div-- class="page"-->
|
||||
<div>
|
||||
<AppLaunchComponent />
|
||||
|
||||
<Navbar/>
|
||||
<!--div class="my-sidebar">
|
||||
|
|
|
|||
|
|
@ -34,8 +34,9 @@ body {
|
|||
}
|
||||
|
||||
.btn-primary {
|
||||
background-color: #475bd6;
|
||||
border-radius: 15px;
|
||||
background-color: #6F42C1;
|
||||
color: #fff;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.btn-success, .btn-warning, .btn-danger {
|
||||
|
|
@ -62,6 +63,7 @@ select {
|
|||
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;
|
||||
min-height: 300px;
|
||||
background-color: rgba( 255, 255, 255, 0.15 );
|
||||
/*color: #58457b;*/
|
||||
font-size: small;
|
||||
|
|
@ -69,11 +71,11 @@ select {
|
|||
|
||||
.glass {
|
||||
/*box-shadow: 3px 3px 3px #b1b1b1, -3px -3px 3px #fff;*/
|
||||
|
||||
background: rgba( 255, 255, 255, 0.25 );
|
||||
|
||||
|
||||
background: rgba( 255, 255, 255, 0.25 ) !important;
|
||||
backdrop-filter: blur( 8px );
|
||||
-webkit-backdrop-filter: blur( 8px );
|
||||
--dxbl-fl-caption-color: #fff !important;
|
||||
/*color: #58457b;*/
|
||||
}
|
||||
|
||||
|
|
@ -84,6 +86,45 @@ select {
|
|||
|
||||
}
|
||||
|
||||
.card .card-footer {
|
||||
padding: 0px;
|
||||
margin:0px;
|
||||
background-color:transparent;
|
||||
}
|
||||
|
||||
.card .card-header {
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.bg-red {
|
||||
background-color: #f7279f !important;
|
||||
}
|
||||
|
||||
.bg-gradient {
|
||||
|
||||
color: #fff !important;
|
||||
background: linear-gradient(111deg,deepskyblue,darkviolet,#502caf) !important;
|
||||
background-size: 180% 180% !important;
|
||||
animation: gradient-animation 3s ease infinite !important;
|
||||
}
|
||||
|
||||
@keyframes gradient-animation {
|
||||
0% {
|
||||
background-position: 0% 50%;
|
||||
}
|
||||
|
||||
50% {
|
||||
background-position: 100% 50%;
|
||||
}
|
||||
|
||||
100% {
|
||||
background-position: 0% 50%;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.inputwizardwrapper {
|
||||
/*max-width: 450px;*/
|
||||
}
|
||||
|
|
@ -109,10 +150,12 @@ select {
|
|||
}
|
||||
|
||||
.dxbl-tabs.dxbl-tabs-top {
|
||||
--dxbl-tabs-bg: #ffffff25;
|
||||
--dxbl-tabs-bg: #ffffff45;
|
||||
background-color: #ffffff45;
|
||||
box-shadow: 0 8px 32px 0 rgba( 31, 38, 135, 0.37 );
|
||||
backdrop-filter: blur( 6px );
|
||||
-webkit-backdrop-filter: blur( 6px );
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.dxbl-modal > .dxbl-modal-root > .dxbl-popup > .dxbl-modal-content {
|
||||
|
|
@ -519,7 +562,7 @@ select:focus-visible {
|
|||
}
|
||||
|
||||
.card-header {
|
||||
height: 65px;
|
||||
min-height: 65px;
|
||||
}
|
||||
|
||||
/*Admin end*/
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 99 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 65 KiB |
|
|
@ -36,7 +36,6 @@ namespace TIAMWebApp.Client.Services
|
|||
|
||||
|
||||
|
||||
|
||||
public async Task<UserSessionModel> IsLoggedInAsync(Guid id)
|
||||
{
|
||||
//api call to get user
|
||||
|
|
@ -149,6 +148,18 @@ namespace TIAMWebApp.Client.Services
|
|||
return user;
|
||||
}
|
||||
|
||||
public async Task<UserModelDtoDetail?> GetUserDetailByIdAsync(Guid id)
|
||||
{
|
||||
var url = $"{Setting.ApiBaseUrl}/{APIUrls.GetUserDetailById}";
|
||||
logToBrowserConsole.LogToBC("GetUserDetailByIdAsync url: " + url + ", " + id.ToString());
|
||||
|
||||
var response = await http.PostAsJsonAsync(url, id);
|
||||
var result = await response.Content.ReadAsStringAsync();
|
||||
var user = JsonConvert.DeserializeObject<UserModelDtoDetail>(result);
|
||||
|
||||
return user;
|
||||
}
|
||||
|
||||
public async Task<bool> RefreshToken()
|
||||
{
|
||||
logToBrowserConsole.LogToBC("RefreshToken() called");
|
||||
|
|
|
|||
|
|
@ -35,11 +35,11 @@
|
|||
<a href="" class="reload">Reload</a>
|
||||
<a class="dismiss">🗙</a>
|
||||
</div>
|
||||
<script src="_framework/blazor.webassembly.js"></script>
|
||||
<script src="https://kit.fontawesome.com/12c469cb8f.js" crossorigin="anonymous"></script>
|
||||
<script src="_content/TIAMSharedUI/blazorAnimationInterop.js"></script>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.2/dist/umd/popper.min.js" integrity="sha384-IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.min.js" integrity="sha384-cVKIPhGWiC2Al4u+LWgxfKTRIcfu0JTxR+EQDz/bgldoEyl4H0zUF0QKbrJ0EcQF" crossorigin="anonymous"></script>
|
||||
<script src="_framework/blazor.webassembly.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using System.Linq.Expressions;
|
||||
using System.Reflection.Metadata;
|
||||
using System.Text.Json;
|
||||
|
|
@ -11,9 +13,11 @@ using TIAM.Database.DataLayers.Admins;
|
|||
using TIAM.Database.DataLayers.TransferDestinations;
|
||||
using TIAM.Database.DataLayers.Users;
|
||||
using TIAM.Database.DbContexts;
|
||||
using TIAM.Database.DbSets.Transfers;
|
||||
using TIAM.Entities.Products;
|
||||
using TIAM.Entities.Transfers;
|
||||
using TIAM.Entities.Users;
|
||||
using TIAMWebApp.Server.Services;
|
||||
using TIAMWebApp.Shared.Application.Models;
|
||||
using TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels;
|
||||
using TIAMWebApp.Shared.Application.Models.PageModels;
|
||||
|
|
@ -40,12 +44,14 @@ namespace TIAMWebApp.Server.Controllers
|
|||
private readonly TransferDestinationDal _transferDestinationDal;
|
||||
private readonly AdminDal _adminDal;
|
||||
private readonly ILogger<TransferDataAPIController> _logger;
|
||||
private readonly TransferBackendService _transferBackendService;
|
||||
|
||||
public TransferDataAPIController(ILogger<TransferDataAPIController> logger, TransferDestinationDal transferDestinationDal, AdminDal adminDal)
|
||||
public TransferDataAPIController(ILogger<TransferDataAPIController> logger, TransferDestinationDal transferDestinationDal, AdminDal adminDal, TransferBackendService transferBackendService)
|
||||
{
|
||||
_logger = logger;
|
||||
_transferDestinationDal = transferDestinationDal;
|
||||
_adminDal = adminDal;
|
||||
_transferBackendService = transferBackendService;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -55,7 +61,7 @@ namespace TIAMWebApp.Server.Controllers
|
|||
[Route(APIUrls.GetTransferDestinationsRouteName)]
|
||||
public async Task<IEnumerable<TransferDestination>> GetTransferDestinations()
|
||||
{
|
||||
return await _transferDestinationDal.Context.TransferDestinations.ToListAsync();
|
||||
return await _adminDal.Context.TransferDestinations.ToListAsync();
|
||||
}
|
||||
|
||||
[AllowAnonymous]
|
||||
|
|
@ -204,5 +210,111 @@ namespace TIAMWebApp.Server.Controllers
|
|||
|
||||
}
|
||||
|
||||
[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
|
||||
{
|
||||
Transfer? transfer= JObject.Parse(serializedTransferModel.GetRawText()).ToObject<Transfer>();
|
||||
|
||||
if (transfer != null)
|
||||
{
|
||||
|
||||
var id = Guid.NewGuid();
|
||||
//TransferDestination transferDestination = new TransferDestination(id, transferDestinationModel.Name, transferDestinationModel.Description, transferDestinationModel.AddressString);
|
||||
|
||||
|
||||
if (string.IsNullOrEmpty(transfer.FromAddress) || string.IsNullOrEmpty(transfer.ToAddress))
|
||||
{
|
||||
return BadRequest("Invalid request");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine($"TransferDestination to be created: {id}");
|
||||
Console.WriteLine($"TransferDestination to be created: {transfer.FromAddress}");
|
||||
Console.WriteLine($"TransferDestination to be created: {transfer.ToAddress}");
|
||||
Console.WriteLine($"TransferDestination to be created: {transfer.ProductId}");
|
||||
Console.WriteLine($"TransferDestination to be created: {transfer.Price}");
|
||||
|
||||
var from = await _adminDal.Context.TransferDestinations.FirstOrDefaultAsync(x => x.AddressString == transfer.FromAddress);
|
||||
var to = await _adminDal.Context.TransferDestinations.FirstOrDefaultAsync(x => x.AddressString == transfer.ToAddress);
|
||||
transfer.Price = _transferBackendService.GetTransferPrice(transfer.ProductId, from, to, transfer.PassengerCount);
|
||||
transfer.TransferStatusType = TransferStatusType.OrderSubmitted;
|
||||
|
||||
await _adminDal.AddTransferAsync(transfer);
|
||||
return Ok(transfer);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return BadRequest("Invalid request");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
[AllowAnonymous]
|
||||
[HttpPost]
|
||||
[Route(APIUrls.CreateTransfersRouteName)]
|
||||
public async Task<IActionResult> CreateTransfers([FromBody] JsonElement serializedTransferModel)
|
||||
{
|
||||
Console.WriteLine("CreateTransfers called!");
|
||||
if (string.IsNullOrEmpty(serializedTransferModel.GetRawText()))
|
||||
{
|
||||
return BadRequest("SerializedTramsferDestinationWizardModel is required");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine($"Serialized model: {serializedTransferModel.GetRawText()}");
|
||||
|
||||
var settings = new JsonSerializerSettings
|
||||
{
|
||||
ContractResolver = new CamelCasePropertyNamesContractResolver()
|
||||
};
|
||||
|
||||
List<Transfer>? transfers = JsonConvert.DeserializeObject<List<Transfer>>(serializedTransferModel.GetRawText(), settings);
|
||||
|
||||
//List<Transfer>? transfers = JObject.Parse(serializedTransferModel.GetRawText()).ToObject<List<Transfer>>();
|
||||
List<Transfer> createdTransfers = new List<Transfer>();
|
||||
if (transfers != null)
|
||||
{
|
||||
foreach (var transfer in transfers)
|
||||
{
|
||||
var id = Guid.NewGuid();
|
||||
var result = await _adminDal.AddTransferAsync(transfer);
|
||||
if(result)
|
||||
{
|
||||
createdTransfers.Add(transfer);
|
||||
}
|
||||
}
|
||||
return Ok(createdTransfers);
|
||||
}
|
||||
else
|
||||
{
|
||||
return BadRequest("Invalid request");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[AllowAnonymous]
|
||||
[HttpGet]
|
||||
[Route(APIUrls.GetTransfersRouteName)]
|
||||
public async Task<string> GetTransfers()
|
||||
{
|
||||
var result = await _adminDal.GetTransfersJsonAsync();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -347,6 +347,15 @@ namespace TIAMWebApp.Server.Controllers
|
|||
return _userDal.GetUserModelDtoByIdAsync(id);
|
||||
}
|
||||
|
||||
[AllowAnonymous]
|
||||
[HttpPost]
|
||||
[Route("GetUserDetailById")]
|
||||
public Task<UserModelDtoDetail?> GetUserDetailById([FromBody] Guid id)
|
||||
{
|
||||
Logger.Info($"GetUserDetailById called with id: {id}");
|
||||
return _userDal.GetUserModelDtoDetailByIdAsync(id);
|
||||
}
|
||||
|
||||
private bool VerifyPassword(string password, string hashedPassword)
|
||||
{
|
||||
var isPasswordValid = _hasher.VerifyPassword(password, hashedPassword);
|
||||
|
|
|
|||
|
|
@ -89,6 +89,7 @@ builder.Services.Configure<FormOptions>(options =>
|
|||
});
|
||||
|
||||
builder.Services.AddScoped<IMessageSenderService, NoticeSenderService>();
|
||||
builder.Services.AddScoped<TransferBackendService, TransferBackendService>();
|
||||
builder.Services.AddEndpointsApiExplorer();
|
||||
builder.Services.AddSwaggerGen();
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,10 @@ namespace TIAMWebApp.Shared.Application.Interfaces
|
|||
|
||||
Task<TransferDestination?> UpdateTransferDestination(TransferDestination model);
|
||||
|
||||
Task<TransferWizardModel?> CreateTransfer(TransferWizardModel model);
|
||||
Task<Transfer?> CreateTransfer(TransferWizardModel model);
|
||||
Task<List<Transfer>?> CreateTransfers(List<TransferWizardModel> modelList);
|
||||
|
||||
Task<Transfer?> GetTransferByIdAsync(Guid id);
|
||||
Task<List<Transfer>> GetTransfersAsync();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,9 @@ namespace TIAMWebApp.Shared.Application.Interfaces
|
|||
//public Task<Dictionary<int, string>> GetUserRolesAsync(UserModel userModel);
|
||||
|
||||
public Task<IEnumerable<UserModelDto>?> GetUsersAsync();
|
||||
|
||||
public Task<UserModelDto?> GetUserByIdAsync(Guid id);
|
||||
public Task<UserModelDtoDetail?> GetUserDetailByIdAsync(Guid id);
|
||||
public Task<UserModelDto?> GetUserByEmailAsync(string email);
|
||||
Task<bool> RefreshToken();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,9 @@ namespace TIAMWebApp.Shared.Application.Models
|
|||
public const string GetUserByIdRouteName = "GetUserById";
|
||||
public const string GetUserById = UserAPI + GetUserByIdRouteName;
|
||||
|
||||
public const string GetUserDetailByIdRouteName = "GetUserDetailById";
|
||||
public const string GetUserDetailById = UserAPI + GetUserDetailByIdRouteName;
|
||||
|
||||
public const string GetUsersRouteName = "GetUsers";
|
||||
public const string GetUsers = UserAPI + GetUsersRouteName;
|
||||
|
||||
|
|
@ -57,10 +60,22 @@ namespace TIAMWebApp.Shared.Application.Models
|
|||
|
||||
public const string CreateTransferDestinationRouteName = "CreateTransferDestination";
|
||||
public const string CreateTransferDestination = TransferDataAPI+CreateTransferDestinationRouteName;
|
||||
|
||||
public const string GetTransfersRouteName = "GetTransfers";
|
||||
public const string GetTransfers = TransferDataAPI+GetTransfersRouteName;
|
||||
|
||||
public const string GetTransfersByUserIdRouteName = "GetTransfersByUserId";
|
||||
public const string GetTransfersByUserId = TransferDataAPI+GetTransfersByUserIdRouteName;
|
||||
|
||||
public const string GetTransferByIdRouteName = "GetTransferById";
|
||||
public const string GetTransferById = TransferDataAPI+GetTransferByIdRouteName;
|
||||
|
||||
public const string CreateTransferRouteName = "CreateTransfer";
|
||||
public const string CreateTransfer = TransferDataAPI+CreateTransferRouteName;
|
||||
|
||||
public const string CreateTransfersRouteName = "CreateTransfers";
|
||||
public const string CreateTransfers = TransferDataAPI+CreateTransfersRouteName;
|
||||
|
||||
public const string UpdateTransferDestinationRouteName = "UpdateTransfer";
|
||||
public const string UpdateTransferDestination = TransferDataAPI + UpdateTransferDestinationRouteName;
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TIAMWebApp.Shared.Application.Models.ClientSide.UI
|
||||
{
|
||||
public class HeroSliderItem
|
||||
{
|
||||
public string ImageUrl { get; set; }
|
||||
public string Title { get; set; }
|
||||
public string Subtitle { get; set; }
|
||||
public string ButtonText { get; set; }
|
||||
public string ButtonUrl { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TIAMWebApp.Shared.Application.Models.ClientSide.UI
|
||||
{
|
||||
public class TransferStatusModel
|
||||
{
|
||||
public int StatusValue { get; set; }
|
||||
public string StatusName { get; set; }
|
||||
|
||||
public TransferStatusModel(int statusValue, string statusName)
|
||||
{
|
||||
StatusValue = statusValue;
|
||||
StatusName = statusName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -15,8 +15,17 @@ namespace TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
|||
public class TransferWizardModel
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid UserId { get; set; }
|
||||
public Guid ProductId { get; set; }
|
||||
public Guid UserProductMappingId { get; set; }
|
||||
|
||||
|
||||
public Guid UserProductToCarId { get; set; }
|
||||
|
||||
public Guid ReferralId { get; set; }
|
||||
|
||||
public string ? Comment { get; set; }
|
||||
|
||||
#region wizard fields
|
||||
[Destination(ErrorMessage = "The destination value is invalid.")]
|
||||
[DataType("TransferDestination")]
|
||||
[Display(Name = ResourceKeys.Destination, ResourceType = typeof(TIAMResources))]
|
||||
|
|
@ -63,7 +72,7 @@ namespace TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
|||
[Display(Name = ResourceKeys.Driver, ResourceType = typeof(TIAMResources))]
|
||||
public DriverModel Driver { get; set; }
|
||||
|
||||
|
||||
#endregion wizard fields
|
||||
|
||||
|
||||
|
||||
|
|
@ -105,29 +114,8 @@ namespace TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
|||
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",
|
||||
|
||||
};
|
||||
|
||||
return transfer;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false)]
|
||||
|
|
|
|||
|
|
@ -0,0 +1,59 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using TIAM.Entities.Transfers;
|
||||
|
||||
namespace TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
||||
{
|
||||
public static class TransferWizardModelExtensions
|
||||
{
|
||||
public static TransferWizardModel Clone(this TransferWizardModel obj)
|
||||
{
|
||||
return new TransferWizardModel()
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
UserId = obj.UserId,
|
||||
ProductId = obj.ProductId,
|
||||
UserProductMappingId = obj.UserProductMappingId,
|
||||
UserProductToCarId = obj.UserProductToCarId,
|
||||
ReferralId = obj.ReferralId,
|
||||
Comment = obj.Comment,
|
||||
Destination = obj.Destination,
|
||||
PickupAddress = obj.PickupAddress,
|
||||
TripDate = obj.TripDate,
|
||||
NumberOfPassengers = obj.NumberOfPassengers,
|
||||
FullName = obj.FullName,
|
||||
PhoneNumber = obj.PhoneNumber,
|
||||
EmailAddress = obj.EmailAddress,
|
||||
Price = obj.Price,
|
||||
Driver = obj.Driver,
|
||||
};
|
||||
}
|
||||
|
||||
public static Transfer CopyToTransfer(this TransferWizardModel obj)
|
||||
{
|
||||
var transfer = new Transfer
|
||||
{
|
||||
Id = obj.Id,
|
||||
UserId = obj.UserId,
|
||||
ProductId = obj.ProductId,
|
||||
ToAddress = obj.Destination,
|
||||
FromAddress = obj.PickupAddress,
|
||||
Appointment = obj.TripDate,
|
||||
PassengerCount = Convert.ToByte(obj.NumberOfPassengers),
|
||||
//FullName = model.FullName,
|
||||
//PhoneNumber = model.PhoneNumber,
|
||||
//EmailAddress = model.EmailAddress,
|
||||
Price = obj.Price,
|
||||
//UserProductMappingId = Guid.NewGuid(),
|
||||
TransferStatusType = TIAM.Core.Enums.TransferStatusType.OrderSubmitted,
|
||||
Comment = "Transfer order",
|
||||
|
||||
};
|
||||
|
||||
return transfer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
using System.Net.Http.Json;
|
||||
using System.Text.Json;
|
||||
using TIAM.Entities.Transfers;
|
||||
using TIAMWebApp.Shared.Application.Interfaces;
|
||||
using TIAMWebApp.Shared.Application.Models;
|
||||
|
|
@ -65,7 +66,7 @@ namespace TIAMWebApp.Shared.Application.Services
|
|||
return result;
|
||||
}
|
||||
|
||||
public async Task<TransferWizardModel?> CreateTransfer(TransferWizardModel model)
|
||||
public async Task<Transfer?> CreateTransfer(TransferWizardModel model)
|
||||
{
|
||||
logToBrowserConsole.LogToBC("CreateTransfer called");
|
||||
logToBrowserConsole.LogToBC(model.PickupAddress);
|
||||
|
|
@ -76,8 +77,11 @@ namespace TIAMWebApp.Shared.Application.Services
|
|||
logToBrowserConsole.LogToBC(model.NumberOfPassengers.ToString());
|
||||
model.Id = Guid.NewGuid();
|
||||
|
||||
var transfer = model.CopyToTransfer();
|
||||
|
||||
|
||||
var url = $"{Setting.ApiBaseUrl}/{APIUrls.CreateTransfer}";
|
||||
var response = await http.PostAsJsonAsync(url, model);
|
||||
var response = await http.PostAsJsonAsync(url, transfer);
|
||||
|
||||
|
||||
//var result = new WizardProcessorResult();
|
||||
|
|
@ -91,7 +95,37 @@ namespace TIAMWebApp.Shared.Application.Services
|
|||
if (!response.IsSuccessStatusCode)
|
||||
return null;
|
||||
|
||||
var result = (TransferWizardModel)(await response.Content.ReadFromJsonAsync(typeof(TransferWizardModel)))!;
|
||||
var result = (Transfer)(await response.Content.ReadFromJsonAsync(typeof(Transfer)))!;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public async Task<List<Transfer>?> CreateTransfers(List<TransferWizardModel> modelList)
|
||||
{
|
||||
List<Transfer> transferList = new List<Transfer>();
|
||||
foreach (var model in modelList)
|
||||
{
|
||||
model.Id = Guid.NewGuid();
|
||||
var transfer = model.CopyToTransfer();
|
||||
transferList.Add(transfer);
|
||||
}
|
||||
|
||||
var url = $"{Setting.ApiBaseUrl}/{APIUrls.CreateTransfers}";
|
||||
var response = await http.PostAsJsonAsync(url, transferList);
|
||||
|
||||
|
||||
//var result = new WizardProcessorResult();
|
||||
|
||||
//if (response.IsSuccessStatusCode)
|
||||
//{
|
||||
// result.IsSucces = true;
|
||||
// result.ResultJson = await response.Content.ReadAsStringAsync();
|
||||
//}
|
||||
|
||||
if (!response.IsSuccessStatusCode)
|
||||
return null;
|
||||
|
||||
var result = (List<Transfer>)(await response.Content.ReadFromJsonAsync(typeof(List<Transfer>)))!;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
@ -116,5 +150,33 @@ namespace TIAMWebApp.Shared.Application.Services
|
|||
|
||||
return result;
|
||||
}
|
||||
|
||||
public async Task<Transfer?> GetTransferByIdAsync(Guid id)
|
||||
{
|
||||
var url = $"{Setting.ApiBaseUrl}/{APIUrls.GetTransferById}";
|
||||
//var url = $"{APIUrls.GetTransferDestinations}";
|
||||
logToBrowserConsole.LogToBC(url);
|
||||
Transfer? response = await http.GetFromJsonAsync<Transfer>(url);
|
||||
if (response == null)
|
||||
return new Transfer();
|
||||
return response;
|
||||
}
|
||||
|
||||
public async Task<List<Transfer>> GetTransfersAsync()
|
||||
{
|
||||
var url = $"{Setting.ApiBaseUrl}/{APIUrls.GetTransfers}";
|
||||
//var url = $"{APIUrls.GetTransferDestinations}";
|
||||
logToBrowserConsole.LogToBC(url);
|
||||
//add json settings ignore readonly properties
|
||||
JsonSerializerOptions options = new JsonSerializerOptions
|
||||
{
|
||||
IgnoreReadOnlyProperties = true
|
||||
};
|
||||
|
||||
List<Transfer>? response = await http.GetFromJsonAsync<List<Transfer>>(url, options);
|
||||
if (response == null)
|
||||
return new List<Transfer>();
|
||||
return response;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue