Merge branch 'master' of http://git2.aycode.com/Adam/TourIAm
This commit is contained in:
commit
ddb1ce58a4
|
|
@ -0,0 +1,44 @@
|
|||
@using TIAM.Entities.Addresses
|
||||
@* @typeparam TModel *@
|
||||
<EditForm Context="EditFormContext" Model="@Model" OnValidSubmit="OnValidSubmit">
|
||||
<DxFormLayout>
|
||||
<DxFormLayoutGroup ColSpanXs="12">
|
||||
<DxFormLayoutItem Caption="Address Text">
|
||||
<DxTextBox @bind-Text="Model.AddressText" />
|
||||
</DxFormLayoutItem>
|
||||
<DxFormLayoutItem Caption="Is Helper">
|
||||
<DxCheckBox @bind-Checked="Model.IsHelper" />
|
||||
</DxFormLayoutItem>
|
||||
<DxFormLayoutItem Caption="Is Valid">
|
||||
<DxCheckBox @bind-Checked="Model.IsValid" />
|
||||
</DxFormLayoutItem>
|
||||
<DxFormLayoutItem Caption="Latitude">
|
||||
<DxSpinEdit @bind-Value="Model.Latitude" />
|
||||
</DxFormLayoutItem>
|
||||
<DxFormLayoutItem Caption="Longitude">
|
||||
<DxSpinEdit @bind-Value="Model.Longitude" />
|
||||
</DxFormLayoutItem>
|
||||
<DxFormLayoutItem Caption="Created">
|
||||
<DxDateEdit @bind-Date="Model.Created" ReadOnly="true" />
|
||||
</DxFormLayoutItem>
|
||||
<DxFormLayoutItem Caption="Modified">
|
||||
<DxDateEdit @bind-Date="Model.Modified" ReadOnly="true" />
|
||||
</DxFormLayoutItem>
|
||||
@* <DxButton Context="ButtonContext" RenderStyle="ButtonRenderStyle.Primary" ButtonType="ButtonType.Submit">Save Changes</DxButton> *@
|
||||
</DxFormLayoutGroup>
|
||||
</DxFormLayout>
|
||||
</EditForm>
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public Address Model { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<Address> OnAddressChanged { get; set; }
|
||||
|
||||
|
||||
private async Task OnValidSubmit()
|
||||
{
|
||||
await OnAddressChanged.InvokeAsync(Model);
|
||||
}
|
||||
}
|
||||
|
|
@ -8,15 +8,22 @@
|
|||
|
||||
<button @onclick="CreatePaymentLink">Create Payment Link</button>
|
||||
|
||||
<NavLink href="@checkoutUrl">Pay Now</NavLink>
|
||||
|
||||
@code {
|
||||
private string checkoutId;
|
||||
private string checkoutUrl = "sumuppayment/3a278990-9eee-4310-9d02-da5c769847fe";
|
||||
|
||||
private async Task CreatePaymentLink()
|
||||
{
|
||||
Transfer subject = new Transfer();
|
||||
subject.Id = Guid.NewGuid();
|
||||
subject.Price = 17000;
|
||||
subject.ContactEmail = "fyloruta@citmo.net";
|
||||
subject.OrderId = 1232131;
|
||||
subject.OrderId = 1232132;
|
||||
var paymentLink = await SumUpService.CreatePaymentLinkAsync(subject);
|
||||
checkoutId = paymentLink;
|
||||
checkoutUrl = "sumuppayment/" + checkoutId;
|
||||
Console.WriteLine($"Payment Link: {paymentLink}");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
@page "/sumuppayment/{checkoutId}"
|
||||
|
||||
@inject IJSRuntime JSRuntime
|
||||
@code {
|
||||
[Parameter]
|
||||
public string checkoutId { get; set; } = "";
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (firstRender)
|
||||
{
|
||||
await JSRuntime.InvokeVoidAsync("loadSumUpPaymentWidget", checkoutId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
<div id="sumup-card"></div>
|
||||
<script>
|
||||
window.loadSumUpPaymentWidget = function (checkoutId) {
|
||||
const script = document.createElement('script');
|
||||
script.src = 'https://gateway.sumup.com/gateway/ecom/card/v2/sdk.js';
|
||||
script.onload = () => {
|
||||
SumUpCard.mount({
|
||||
id: 'sumup-card',
|
||||
checkoutId: checkoutId,
|
||||
onResponse: function (type, body) {
|
||||
console.log('Type', type);
|
||||
console.log('Body', body);
|
||||
}
|
||||
});
|
||||
};
|
||||
document.head.appendChild(script);
|
||||
};
|
||||
</script>
|
||||
|
|
@ -0,0 +1,162 @@
|
|||
@using TIAM.Entities.Products
|
||||
@using TIAM.Entities.ServiceProviders
|
||||
@using TIAM.Entities.Transfers
|
||||
@using TIAM.Entities.Drivers
|
||||
@using TIAM.Entities.Users
|
||||
@using TIAM.Models.Dtos.Users
|
||||
@using TIAMWebApp.Shared.Application.Interfaces
|
||||
@using TIAMWebApp.Shared.Application.Utility
|
||||
@using AyCode.Services.Loggers
|
||||
@using TIAM.Core.Loggers
|
||||
@using TIAM.Entities.Addresses
|
||||
@using TIAMSharedUI.Pages.Components.EditComponents
|
||||
@inject IServiceProviderDataService serviceProviderDataService
|
||||
@inject IUserDataService userDataService
|
||||
@inject ITransferDataService transferDataService
|
||||
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
||||
|
||||
<div class="mb-2">
|
||||
Profile
|
||||
</div>
|
||||
<DxGrid @ref="Grid" 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>
|
||||
<DxGridCommandColumn NewButtonVisible="true" Width="8%" FixedPosition="GridColumnFixedPosition.Left" />
|
||||
<DxGridDataColumn FieldName="Id" GroupIndex="0" />
|
||||
<DxGridDataColumn FieldName="AddressText" />
|
||||
<DxGridDataColumn FieldName="IsValid" Width="40" />
|
||||
<DxGridDataColumn FieldName="IsHelper" Width="40"/>
|
||||
<DxGridDataColumn FieldName="Latitude" Width="40"/>
|
||||
<DxGridDataColumn FieldName="Longitude" Width="40"/>
|
||||
<DxGridDataColumn FieldName="Created" Width="40"/>
|
||||
<DxGridDataColumn FieldName="Modified" Width="40"/>
|
||||
</Columns>
|
||||
<EditFormTemplate>
|
||||
@{
|
||||
Address bleh = (Address)context.EditModel;
|
||||
}
|
||||
@* <EditAddressComponent TModel="Address" Model="@bleh" OnAddressChanged="@((Address model) => SaveAddress(model))" /> *@
|
||||
<EditAddressComponent Model="@((Address)context.EditModel)" OnAddressChanged="@((Address model) => SaveAddress(model))" />
|
||||
</EditFormTemplate>
|
||||
|
||||
</DxGrid>
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public bool KeyboardNavigationEnabled { get; set; }
|
||||
[Parameter]
|
||||
public object AddressContext { get; set; }
|
||||
[Parameter]
|
||||
public string ContextIdType { get; set; }
|
||||
IGrid Grid { get; set; }
|
||||
|
||||
List<TIAM.Entities.Addresses.Address> _detailGridData = new List<Address>();
|
||||
|
||||
List<TIAM.Entities.Addresses.Address> _availableProfiles;
|
||||
|
||||
ILogger _logger;
|
||||
|
||||
public void SaveAddress(Address addressToSave)
|
||||
{
|
||||
|
||||
Grid.SaveChangesAsync();
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
Address myAddress = new Address();
|
||||
|
||||
|
||||
_logger = new LoggerClient<AddressGridComponent>(LogWriters.ToArray());
|
||||
if(ContextIdType == null)
|
||||
{
|
||||
//get all profiles from DB
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (ContextIdType)
|
||||
{
|
||||
case ("userprofile"):
|
||||
//get profile for user
|
||||
UserModelDto resultData = (UserModelDto)AddressContext;
|
||||
if (resultData.ProfileDto.Address != null)
|
||||
_detailGridData.Add(resultData.ProfileDto.Address);
|
||||
break;
|
||||
case ("userdetailprofile"):
|
||||
//get profile for user
|
||||
UserModelDtoDetail resultData2 = (UserModelDtoDetail)AddressContext;
|
||||
if (resultData2.ProfileDto.Address != null)
|
||||
_detailGridData.Add(resultData2.ProfileDto.Address);
|
||||
break;
|
||||
case ("productprofile"):
|
||||
//get profile for user
|
||||
Product resultData3 = (Product)AddressContext;
|
||||
if (resultData3.Profile.Address != null)
|
||||
_detailGridData.Add(resultData3.Profile.Address);
|
||||
break;
|
||||
case ("companyprofile"):
|
||||
//get profile for user
|
||||
var resultData4 = (Company)AddressContext;
|
||||
if (resultData4.Profile.Address != null)
|
||||
_detailGridData.Add(resultData4.Profile.Address);
|
||||
break;
|
||||
case ("transferdestination"):
|
||||
//get address for transferDestination
|
||||
TransferDestination resultData5 = (TransferDestination)AddressContext;
|
||||
if (resultData5.Address != null)
|
||||
_detailGridData.Add(resultData5.Address);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
_logger.Info($"DetailGridData: {_detailGridData.Count}");
|
||||
}
|
||||
|
||||
|
||||
|
||||
void CustomizeEditModel(GridCustomizeEditModelEventArgs e)
|
||||
{
|
||||
if (!e.IsNew) return;
|
||||
|
||||
//editmodel customize
|
||||
|
||||
|
||||
}
|
||||
|
||||
async Task EditModelSaving(GridEditModelSavingEventArgs e)
|
||||
{
|
||||
if (e.IsNew)
|
||||
//add new orderData to orderData array
|
||||
_logger.Info("Data added");
|
||||
else
|
||||
_logger.Info("Data updated: " + ((Address)e.EditModel).IsValid);
|
||||
|
||||
await UpdateDataAsync();
|
||||
}
|
||||
|
||||
async Task DataItemDeleting(GridDataItemDeletingEventArgs e)
|
||||
{
|
||||
|
||||
_logger.Info("orderData deleted");
|
||||
|
||||
}
|
||||
|
||||
async Task UpdateDataAsync()
|
||||
{
|
||||
//refresh grid
|
||||
_logger.Info("orderData grid refreshed");
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -38,12 +38,18 @@
|
|||
<DxPopup
|
||||
@bind-Visible="@SetOwnerPopupVisible"
|
||||
ShowFooter="true"
|
||||
HeaderText="Set owner"
|
||||
HeaderText="Set owner by adding E-mail address"
|
||||
>
|
||||
<BodyContentTemplate>
|
||||
<DxTextBox CssClass="form-field" @Bind-Text="@UpdateOwnerIdText">
|
||||
|
||||
</DxTextBox>
|
||||
<label for="emailID" class="demo-text mt-4 mb-1">
|
||||
Put user email here
|
||||
</label>
|
||||
<DxMaskedInput @bind-Value="@Email"
|
||||
CssClass="cw-320"
|
||||
Mask="@EmailMask"
|
||||
InputId="emailID"
|
||||
MaskMode="MaskMode.RegEx" />
|
||||
|
||||
</BodyContentTemplate>
|
||||
<FooterContentTemplate>
|
||||
<DxButton CssClass="popup-button my-1 ms-2" RenderStyle="ButtonRenderStyle.Primary" Text="OK" Click="@(() => SetOwnerPopupVisible = false)" />
|
||||
|
|
@ -125,8 +131,11 @@
|
|||
</DxGridDataColumn> *@
|
||||
|
||||
</Columns>
|
||||
<DetailRowTemplate>
|
||||
@* <DetailRowTemplate>
|
||||
<CompaniesNestedUserProductMapping CurrentCompany="(TIAM.Entities.ServiceProviders.Company)context.DataItem" KeyboardNavigationEnabled="true" />
|
||||
</DetailRowTemplate> *@
|
||||
<DetailRowTemplate>
|
||||
<AddressGridComponent AddressContext="(TIAM.Entities.ServiceProviders.Company)context.DataItem" ContextIdType="companyprofile" KeyboardNavigationEnabled="true" />
|
||||
</DetailRowTemplate>
|
||||
<EditFormTemplate Context="EditFormContext">
|
||||
@{
|
||||
|
|
@ -181,7 +190,8 @@
|
|||
];
|
||||
|
||||
private MessageWizardModel _messageWizardModel = new();
|
||||
private string UpdateOwnerIdText;
|
||||
private string Email { get; set; } = "email@email.com";
|
||||
string EmailMask { get; set; } = @"(\w|[.-])+@(\w|-)+\.(\w|-){2,4}";
|
||||
DateTime StartDate { get; set; } = DateTime.Today;
|
||||
DxSchedulerDataStorage _dataStorage = new();
|
||||
|
||||
|
|
@ -207,7 +217,7 @@
|
|||
async Task<Company> SetOwner(Guid CompanyId)
|
||||
{
|
||||
//get user id from DB
|
||||
var userModelDto = await userDataService.GetUserByEmailAsync(UpdateOwnerIdText);
|
||||
var userModelDto = await userDataService.GetUserByEmailAsync(Email);
|
||||
|
||||
//overwrite ServiceProvider ownerid
|
||||
var target = await serviceProviderDataService.GetServiceProviderByIdAsync(CompanyId);
|
||||
|
|
|
|||
|
|
@ -211,6 +211,12 @@
|
|||
public List<Transfer> TransferDataList { get; set; }
|
||||
|
||||
bool PopupVisible { get; set; }
|
||||
|
||||
|
||||
IGrid Grid2 { get; set; }
|
||||
object MasterGridData { get; set; }
|
||||
bool AutoCollapseDetailRow { get; set; }
|
||||
|
||||
public List<string> IgnoreList =
|
||||
[
|
||||
"ReceiverEmailAddress",
|
||||
|
|
@ -483,9 +489,6 @@
|
|||
Grid2.ShowColumnChooser();
|
||||
}
|
||||
|
||||
IGrid Grid2 { get; set; }
|
||||
object MasterGridData { get; set; }
|
||||
bool AutoCollapseDetailRow { get; set; }
|
||||
|
||||
protected override void OnAfterRender(bool firstRender)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@
|
|||
<Columns>
|
||||
<DxGridCommandColumn NewButtonVisible="false" Width="8%" FixedPosition="GridColumnFixedPosition.Left" />
|
||||
<DxGridDataColumn FieldName="Id" ShowInColumnChooser="false" SortIndex="0" Visible="false" />
|
||||
<DxGridDataColumn FieldName="Profile.FullName" />
|
||||
<DxGridDataColumn FieldName="ProfileDto.FullName" />
|
||||
<DxGridDataColumn FieldName="UserDto.PhoneNumber" />
|
||||
<DxGridDataColumn FieldName="UserDto.Created" />
|
||||
<DxGridDataColumn FieldName="UserDto.EmailConfirmed" />
|
||||
|
|
@ -109,6 +109,9 @@
|
|||
<DetailRowTemplate>
|
||||
<UserGrid_MasterDetail_NestedGrid_UserProductMapping UserModelDtoDetail="(UserModelDtoDetail)context.DataItem" KeyboardNavigationEnabled="true" />
|
||||
</DetailRowTemplate>
|
||||
<DetailRowTemplate>
|
||||
<AddressGridComponent AddressContext="(UserModelDtoDetail)context.DataItem" ContextIdType="userdetailprofile" KeyboardNavigationEnabled="true" />
|
||||
</DetailRowTemplate>
|
||||
<EditFormTemplate Context="EditFormContext">
|
||||
@{
|
||||
var transfer2 = (UserModelDtoDetail)EditFormContext.EditModel;
|
||||
|
|
@ -116,10 +119,7 @@
|
|||
<DxFormLayout CssClass="w-100">
|
||||
<DxFormLayoutItem Caption=@Localizer.GetString(ResourceKeys.EmailAddress) ColSpanMd="4">
|
||||
@EditFormContext.GetEditor("UserDto.EmailAddress")
|
||||
</DxFormLayoutItem>
|
||||
<DxFormLayoutItem Caption=@Localizer.GetString(ResourceKeys.EmailAddress) ColSpanMd="4">
|
||||
@EditFormContext.GetEditor("UserDto.EmailAddress")
|
||||
</DxFormLayoutItem>
|
||||
</DxFormLayoutItem>
|
||||
<DxFormLayoutItem Caption=@Localizer.GetString(ResourceKeys.ConfirmEmail) ColSpanMd="4">
|
||||
@EditFormContext.GetEditor("UserDto.EmailConfirmed")
|
||||
</DxFormLayoutItem>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,124 @@
|
|||
@using TIAM.Entities.Products
|
||||
@using TIAM.Entities.ServiceProviders
|
||||
@using TIAM.Entities.Transfers
|
||||
@using TIAM.Entities.Drivers
|
||||
@using TIAM.Entities.Users
|
||||
@using TIAM.Models.Dtos.Users
|
||||
@using TIAMWebApp.Shared.Application.Interfaces
|
||||
@using TIAMWebApp.Shared.Application.Utility
|
||||
@using AyCode.Services.Loggers
|
||||
@using TIAM.Core.Loggers
|
||||
@inject IServiceProviderDataService serviceProviderDataService
|
||||
@inject IUserDataService userDataService
|
||||
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
||||
|
||||
<div class="mb-2">
|
||||
Profile
|
||||
</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>
|
||||
<DxGridCommandColumn NewButtonVisible="true" Width="8%" FixedPosition="GridColumnFixedPosition.Left" />
|
||||
<DxGridDataColumn FieldName="Id" GroupIndex="0" />
|
||||
<DxGridDataColumn FieldName="UserId" />
|
||||
<DxGridDataColumn FieldName="ProductId" Width="40%" />
|
||||
<DxGridDataColumn FieldName="Permissions" />
|
||||
</Columns>
|
||||
|
||||
|
||||
</DxGrid>
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public bool KeyboardNavigationEnabled { get; set; }
|
||||
[Parameter]
|
||||
public object ProfileContext { get; set; }
|
||||
[Parameter]
|
||||
public string ContextIdType { get; set; }
|
||||
|
||||
List<TIAM.Entities.Profiles.Profile> _detailGridData;
|
||||
|
||||
List<TIAM.Entities.Profiles.Profile> _availableProfiles;
|
||||
|
||||
ILogger _logger;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
_logger = new LoggerClient<UserGrid_MasterDetail_NestedGrid_ServiceProviders>(LogWriters.ToArray());
|
||||
if(ContextIdType == null)
|
||||
{
|
||||
//get all profiles from DB
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (ContextIdType)
|
||||
{
|
||||
case ("user"):
|
||||
//get profile for user
|
||||
UserModelDto resultData = (UserModelDto)ProfileContext;
|
||||
_detailGridData.Add(resultData.UserDto.Profile);
|
||||
break;
|
||||
case ("product"):
|
||||
//get profile for product
|
||||
//var resultData2 = await serviceProviderDataService.GetProductById(ContextId); //todo
|
||||
Product resultData2 = (Product)ProfileContext;
|
||||
_detailGridData.Add(resultData2.Profile);
|
||||
break;
|
||||
case ("company"):
|
||||
//get profile for company
|
||||
Company resultData3 = (Company)ProfileContext;
|
||||
_detailGridData.Add(resultData3.Profile);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
_logger.Info($"DetailGridData: {_detailGridData.Count}");
|
||||
}
|
||||
|
||||
|
||||
|
||||
void CustomizeEditModel(GridCustomizeEditModelEventArgs e)
|
||||
{
|
||||
if (!e.IsNew) return;
|
||||
|
||||
//editmodel customize
|
||||
|
||||
|
||||
}
|
||||
|
||||
async Task EditModelSaving(GridEditModelSavingEventArgs e)
|
||||
{
|
||||
if (e.IsNew)
|
||||
//add new orderData to orderData array
|
||||
_logger.Info("Data added");
|
||||
else
|
||||
_logger.Info("Data updated");
|
||||
|
||||
await UpdateDataAsync();
|
||||
}
|
||||
|
||||
async Task DataItemDeleting(GridDataItemDeletingEventArgs e)
|
||||
{
|
||||
|
||||
_logger.Info("orderData deleted");
|
||||
|
||||
}
|
||||
|
||||
async Task UpdateDataAsync()
|
||||
{
|
||||
//refresh grid
|
||||
_logger.Info("orderData grid refreshed");
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue