Compare commits
No commits in common. "68a83ff8a3c3d42f308b9dd44e696356032d34bc" and "3566aaca631695b27f6d5adb82ef6767040f5bfc" have entirely different histories.
68a83ff8a3
...
3566aaca63
|
|
@ -1,49 +0,0 @@
|
|||
@using System.Text
|
||||
@using TIAM.Entities.Transfers
|
||||
@using TIAM.Services
|
||||
@using TIAMWebApp.Shared.Application.Services
|
||||
@inject AdminSignalRClient _adminSignalRClient;
|
||||
|
||||
<p>@DriverName</p>
|
||||
|
||||
@code {
|
||||
[Parameter] public Guid TransferId { get; set; }
|
||||
private string DriverName = "";
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
|
||||
var keyItemTransferToDriver = await _adminSignalRClient.GetByIdAsync<List<TransferToDriver>>(SignalRTags.GetTransferDriversByTransferId, TransferId);
|
||||
if(keyItemTransferToDriver != null && keyItemTransferToDriver.Count > 0)
|
||||
{
|
||||
foreach (var driver in keyItemTransferToDriver)
|
||||
{
|
||||
if (driver.UserProductMapping != null)
|
||||
{
|
||||
|
||||
if(driver.UserProductMapping.User != null)
|
||||
{
|
||||
|
||||
if (driver.UserProductMapping.User.Profile != null)
|
||||
{
|
||||
if(!string.IsNullOrEmpty(driver.UserProductMapping.User.Profile.Name))
|
||||
{
|
||||
DriverName = driver.UserProductMapping.User.Profile.Name;
|
||||
}
|
||||
else
|
||||
{
|
||||
DriverName = driver.LicencePlate;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
DriverName = "No driver assigned yet";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -155,7 +155,7 @@ else
|
|||
|
||||
<hr />
|
||||
<p class="text-muted">Status on: <span class="text-body">@DateTime.Now.ToString("hh:mm tt"), @DateTime.Today.ToString("MMMM dd, yyyy")</span></p>
|
||||
<h5 class="text-muted">@TransferStatusModel.GetStatusModel(_transfer.TransferStatusType).StatusName;</h5>
|
||||
<h5 class="text-muted">@TransferStatusModel.GetStatusModel(_transfer.TransferStatusType);</h5>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -524,9 +524,8 @@ else
|
|||
private async Task UpdateTransferEventHandler(MouseEventArgs e, bool shouldRedirect = false)
|
||||
{
|
||||
var result = await UpdateTransfer(shouldRedirect);
|
||||
_editMode = false;
|
||||
if (result != null && shouldRedirect)
|
||||
navManager.NavigateTo($"/mytransfers/{_transfer.Id}"); // Redirect to a list or another page after successful update
|
||||
navManager.NavigateTo("/mytransfers"); // Redirect to a list or another page after successful update
|
||||
}
|
||||
|
||||
private async Task CancelTransferEventHandler(MouseEventArgs e, bool shouldRedirect = false)
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
@using TIAM.Core.Enums
|
||||
@using TIAM.Entities.Emails
|
||||
@using TIAM.Entities.Transfers
|
||||
@using TIAM.Entities.Users
|
||||
@using TIAM.Resources
|
||||
@using TIAMSharedUI.Pages.Components
|
||||
@using TIAMSharedUI.Shared
|
||||
|
|
@ -23,7 +22,6 @@
|
|||
@using DevExpress.Data.Filtering
|
||||
@using TIAM.Entities.Emails
|
||||
@using TIAMSharedUI.Shared.Components.BaseComponents
|
||||
@using TIAM.Services
|
||||
@inherits UserBasePageComponent
|
||||
@layout AdminLayout
|
||||
@inject IWizardProcessor wizardProcessor
|
||||
|
|
@ -38,21 +36,21 @@
|
|||
|
||||
|
||||
<DxPopup CssClass="popup-demo-events"
|
||||
@bind-Visible="@_popupVisible"
|
||||
ShowFooter="true"
|
||||
CloseOnEscape="true"
|
||||
CloseOnOutsideClick="false"
|
||||
ShowCloseButton="false"
|
||||
HeaderText="MessageBox"
|
||||
Closing="EulaPopupClosing"
|
||||
Closed="EulaPopupClosed">
|
||||
@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="@_localizer.GetString("ButtonSend")"></InputWizard>
|
||||
OnSubmit="SubmitForm"
|
||||
IgnoreReflection=@IgnoreList
|
||||
TitleResourceString="NewMessage"
|
||||
SubtitleResourceString="NewMessageSubtitle"
|
||||
SubmitButtonText="@_localizer.GetString("ButtonSend")"></InputWizard>
|
||||
</BodyContentTemplate>
|
||||
<FooterContentTemplate Context="Context">
|
||||
<div class="popup-demo-events-footer">
|
||||
|
|
@ -75,26 +73,26 @@ Closed="EulaPopupClosed">
|
|||
<div class="d-flex flex-column mb-4 pb-2">
|
||||
<div class="align-self-end pl-2 pb-2">
|
||||
<DxButton Text="Column Chooser"
|
||||
RenderStyle="ButtonRenderStyle.Secondary"
|
||||
IconCssClass="btn-column-chooser"
|
||||
Click="ColumnChooserButton_Click" />
|
||||
RenderStyle="ButtonRenderStyle.Secondary"
|
||||
IconCssClass="btn-column-chooser"
|
||||
Click="ColumnChooserButton_Click" />
|
||||
</div>
|
||||
|
||||
<TransferGrid @ref="_gridTransfer"
|
||||
Logger="_logger"
|
||||
SignalRClient="AdminSignalRClient"
|
||||
FilterText="@_filterText"
|
||||
OnDataSourceChanged="DataSourceChanged"
|
||||
OnGridItemChanging="DataSourceItemChanging"
|
||||
OnGridItemChanged="DataSourceItemChanged"
|
||||
OnGridItemDeleting="DataItemDeleting"
|
||||
OnGridEditModelSaving="DataItemSaving"
|
||||
CustomizeElement="Grid_CustomizeElement"
|
||||
CustomizeEditModel="Grid_CustomizeEditModel"
|
||||
EditMode="GridEditMode.EditForm"
|
||||
ColumnResizeMode="GridColumnResizeMode.NextColumn"
|
||||
PageSize="13"
|
||||
ShowFilterRow="true">
|
||||
Logger="_logger"
|
||||
SignalRClient="AdminSignalRClient"
|
||||
FilterText="@_filterText"
|
||||
OnDataSourceChanged="DataSourceChanged"
|
||||
OnGridItemChanging="DataSourceItemChanging"
|
||||
OnGridItemChanged="DataSourceItemChanged"
|
||||
OnGridItemDeleting="DataItemDeleting"
|
||||
OnGridEditModelSaving="DataItemSaving"
|
||||
CustomizeElement="Grid_CustomizeElement"
|
||||
CustomizeEditModel="Grid_CustomizeEditModel"
|
||||
EditMode="GridEditMode.EditForm"
|
||||
ColumnResizeMode="GridColumnResizeMode.NextColumn"
|
||||
PageSize="13"
|
||||
ShowFilterRow="true">
|
||||
|
||||
<Columns>
|
||||
<DxGridCommandColumn NewButtonVisible="false" DeleteButtonVisible="AcDomain.IsDeveloperVersion" Width="80" MinWidth="80" FixedPosition="GridColumnFixedPosition.Left" />
|
||||
|
|
@ -119,19 +117,8 @@ Closed="EulaPopupClosed">
|
|||
<DxGridDataColumn FieldName="Price" Caption="Price" Width="70" CaptionAlignment="GridTextAlignment.Center" />
|
||||
<DxGridDataColumn FieldName="Revenue" Caption="Revenue" Width="70" CaptionAlignment="GridTextAlignment.Center" />
|
||||
<DxGridDataColumn FieldName="FullName" />
|
||||
<DxGridDataColumn Caption="Driver" Width="120">
|
||||
<CellDisplayTemplate>
|
||||
@{
|
||||
var keyField = context.Value;
|
||||
var keyItem = (Transfer)context.DataItem;
|
||||
<DriverDisplayNameComponent TransferId="@keyItem.Id"></DriverDisplayNameComponent>
|
||||
}
|
||||
</CellDisplayTemplate>
|
||||
|
||||
</DxGridDataColumn>
|
||||
<DxGridDataColumn FieldName="ContactPhone" Width="120" />
|
||||
<DxGridDataColumn FieldName="ContactEmail" Width="120" />
|
||||
|
||||
<DxGridDataColumn FieldName="ContactEmail" Width="120">
|
||||
<CellDisplayTemplate>
|
||||
@{
|
||||
|
|
@ -191,8 +178,8 @@ Closed="EulaPopupClosed">
|
|||
<DxFormLayoutItem Caption="Trip date:" ColSpanMd="3">
|
||||
|
||||
<DxDateEdit @bind-Date="@transfer2.Appointment"
|
||||
TimeSectionVisible="true"
|
||||
TimeSectionScrollPickerFormat="tt h m">
|
||||
TimeSectionVisible="true"
|
||||
TimeSectionScrollPickerFormat="tt h m">
|
||||
</DxDateEdit>
|
||||
|
||||
</DxFormLayoutItem>
|
||||
|
|
@ -211,9 +198,6 @@ Closed="EulaPopupClosed">
|
|||
<DxFormLayoutItem Caption="Price:" ColSpanMd="3">
|
||||
@editFormContext.GetEditor("Price")
|
||||
</DxFormLayoutItem>
|
||||
<DxFormLayoutItem Caption="Revenue:" ColSpanMd="3">
|
||||
@editFormContext.GetEditor("Revenue")
|
||||
</DxFormLayoutItem>
|
||||
|
||||
</DxFormLayout>
|
||||
</EditFormTemplate>
|
||||
|
|
@ -221,9 +205,9 @@ Closed="EulaPopupClosed">
|
|||
<ToolbarTemplate>
|
||||
<div>
|
||||
<DxTagBox Data="@TransferStatusModel.AllStatuses.Values" Values="@_selectedCategories" @ref="_filterTag"
|
||||
ValuesChanged="(IEnumerable<TransferStatusModel> values) => TagBox_ValuesChanged(values)"
|
||||
ValueFieldName="StatusValue" TextFieldName="StatusName" NullText="Select status type..."
|
||||
ClearButtonDisplayMode="DataEditorClearButtonDisplayMode.Auto" aria-label="Select status type" />
|
||||
ValuesChanged="(IEnumerable<TransferStatusModel> values) => TagBox_ValuesChanged(values)"
|
||||
ValueFieldName="StatusValue" TextFieldName="StatusName" NullText="Select status type..."
|
||||
ClearButtonDisplayMode="DataEditorClearButtonDisplayMode.Auto" aria-label="Select status type" />
|
||||
</div>
|
||||
</ToolbarTemplate>
|
||||
</TransferGrid>
|
||||
|
|
@ -233,8 +217,8 @@ Closed="EulaPopupClosed">
|
|||
<DxTabPage Text="Calendar">
|
||||
<div class="d-flex flex-column mb-4 pb-2">
|
||||
<DxScheduler @bind-StartDate="@StartDate"
|
||||
DataStorage="@_dataStorage"
|
||||
CssClass="w-100">
|
||||
DataStorage="@_dataStorage"
|
||||
CssClass="w-100">
|
||||
<DxSchedulerTimelineView Duration="@TimeSpan.FromHours(48)" CellMinWidth="80">
|
||||
<Scales>
|
||||
<DxSchedulerTimeScale Unit="@SchedulerTimeScaleUnit.Day" UnitCount="1"></DxSchedulerTimeScale>
|
||||
|
|
@ -289,7 +273,6 @@ Closed="EulaPopupClosed">
|
|||
DxSchedulerDataStorage _dataStorage = new();
|
||||
|
||||
|
||||
|
||||
void SendMail(Transfer item)
|
||||
{
|
||||
_logger.Info($"Preparing mail to {item.ContactEmail}, {item.Id}");
|
||||
|
|
@ -334,7 +317,7 @@ Closed="EulaPopupClosed">
|
|||
CancelCreateClick();
|
||||
}
|
||||
|
||||
async void Grid_CustomizeElement(GridCustomizeElementEventArgs e)
|
||||
void Grid_CustomizeElement(GridCustomizeElementEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
@ -344,8 +327,6 @@ Closed="EulaPopupClosed">
|
|||
e.CssClass = "header-bold";
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (e.ElementType != GridElementType.DataRow) return;
|
||||
|
||||
var transferStatus = e.Grid?.GetRowValue(e.VisibleIndex, "TransferStatusType");
|
||||
|
|
@ -368,16 +349,11 @@ Closed="EulaPopupClosed">
|
|||
e.CssClass = "bg-cancel";
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error($"Grid_CustomizeElement; {ex.Message}", ex);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Grid_CustomizeEditModel(GridCustomizeEditModelEventArgs e)
|
||||
|
|
|
|||
|
|
@ -766,11 +766,7 @@ namespace TIAMWebApp.Server.Controllers
|
|||
_logger.Debug($"GetTransferDrivers called; transferId: {transferId}");
|
||||
|
||||
var result = await _adminDal.GetTransferToDriversByTransferIdAsync(transferId);
|
||||
if(result == null)
|
||||
{
|
||||
_logger.Warning("Null result", "GetTransferDrivers");
|
||||
}
|
||||
return result;
|
||||
return result;
|
||||
}
|
||||
|
||||
//[Authorize]
|
||||
|
|
|
|||
Loading…
Reference in New Issue