TransferToDriver in progress...
This commit is contained in:
parent
0651a8c06a
commit
2064418cfc
|
|
@ -235,7 +235,7 @@ namespace TIAM.Database.Test
|
||||||
|
|
||||||
await Dal.RemoveProductAsync(productId); //kitöröljük a szemetet, ha korábbról bentmaradt - J.
|
await Dal.RemoveProductAsync(productId); //kitöröljük a szemetet, ha korábbról bentmaradt - J.
|
||||||
|
|
||||||
var company = new Company(companyId, "Test unit company...", null);
|
var company = new Company(companyId, "Test unit product...", null);
|
||||||
|
|
||||||
Assert.IsTrue(await Dal.AddCompanyAsync(company));
|
Assert.IsTrue(await Dal.AddCompanyAsync(company));
|
||||||
Assert.IsNotNull(company);
|
Assert.IsNotNull(company);
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,9 @@ namespace TIAM.Database.DataLayers.Admins
|
||||||
#endregion TransferDestination
|
#endregion TransferDestination
|
||||||
|
|
||||||
#region TransferToDriver
|
#region TransferToDriver
|
||||||
|
public Task<TransferToDriver?> GetTransferToDriverById(Guid transferToDriverId, bool autoInclude = false) => SessionAsync(ctx => ctx.TransferToDrivers.FirstOrDefault(x=>x.Id == transferToDriverId));
|
||||||
|
public Task<List<TransferToDriver>> GetTransferToDriversByTransferId(Guid transferId, bool autoInclude = false) => SessionAsync(ctx => ctx.TransferToDrivers.Where(x => x.TransferId == transferId).ToList());
|
||||||
|
|
||||||
public Task<bool> AddTransferToDriverAsync(TransferToDriver transferToDriver) => TransactionAsync(ctx => ctx.TransferToDrivers.Add(transferToDriver).State == EntityState.Added);
|
public Task<bool> AddTransferToDriverAsync(TransferToDriver transferToDriver) => TransactionAsync(ctx => ctx.TransferToDrivers.Add(transferToDriver).State == EntityState.Added);
|
||||||
public Task<bool> UpdateTransferToDriverAsync(TransferToDriver transferToDriver) => TransactionAsync(ctx => ctx.TransferToDrivers.Update(transferToDriver).State == EntityState.Modified);
|
public Task<bool> UpdateTransferToDriverAsync(TransferToDriver transferToDriver) => TransactionAsync(ctx => ctx.TransferToDrivers.Update(transferToDriver).State == EntityState.Modified);
|
||||||
public Task<bool> RemoveTransferToDriverAsync(TransferToDriver transferToDriver) => TransactionAsync(ctx => ctx.TransferToDrivers.Remove(transferToDriver).State == EntityState.Deleted);
|
public Task<bool> RemoveTransferToDriverAsync(TransferToDriver transferToDriver) => TransactionAsync(ctx => ctx.TransferToDrivers.Remove(transferToDriver).State == EntityState.Deleted);
|
||||||
|
|
|
||||||
|
|
@ -25,9 +25,9 @@ public class SignalRTags : AcSignalRTags
|
||||||
public const int AddCompany = 17;
|
public const int AddCompany = 17;
|
||||||
public const int RemoveCompany = 18;
|
public const int RemoveCompany = 18;
|
||||||
|
|
||||||
public const int GetTransferToDriver = 22;
|
public const int GetTransferDriver = 22;
|
||||||
//public const int GetTransferToDrivers = 23;
|
//public const int GetTransferToDrivers = 23;
|
||||||
public const int GetTransferToDriversByContextId = 24;
|
public const int GetTransferDriversByTransferId = 24;
|
||||||
public const int AddTransferToDriver = 25;
|
public const int AddTransferToDriver = 25;
|
||||||
public const int UpdateTransferToDriver = 26;
|
public const int UpdateTransferToDriver = 26;
|
||||||
public const int RemoveTransferToDriver = 27;
|
public const int RemoveTransferToDriver = 27;
|
||||||
|
|
|
||||||
|
|
@ -145,7 +145,7 @@
|
||||||
<MessageDetailGridComponent ContextId="((Transfer)context.DataItem).Id" KeyboardNavigationEnabled="true" />
|
<MessageDetailGridComponent ContextId="((Transfer)context.DataItem).Id" KeyboardNavigationEnabled="true" />
|
||||||
</DxTabPage>
|
</DxTabPage>
|
||||||
<DxTabPage Text="Driver">
|
<DxTabPage Text="Driver">
|
||||||
<TransferToDriverGridComponent ParentData="(Transfer)context.DataItem" KeyboardNavigationEnabled="true" />
|
<TransferToDriverGridComponent ContextId="((Transfer)context.DataItem).Id" ParentData="(Transfer)context.DataItem" KeyboardNavigationEnabled="true" />
|
||||||
</DxTabPage>
|
</DxTabPage>
|
||||||
</DxTabs>
|
</DxTabs>
|
||||||
</DetailRowTemplate>
|
</DetailRowTemplate>
|
||||||
|
|
|
||||||
|
|
@ -18,14 +18,13 @@
|
||||||
|
|
||||||
|
|
||||||
<TransferToDriversDetailGrid @ref="_transferToDriversGrid"
|
<TransferToDriversDetailGrid @ref="_transferToDriversGrid"
|
||||||
|
ContextIds="ContextId.IsNullOrEmpty() ? throw new InvalidDataException() : [ContextId.Value]"
|
||||||
DataSource="ParentData.TransferToDrivers"
|
DataSource="ParentData.TransferToDrivers"
|
||||||
Logger="_logger"
|
Logger="_logger"
|
||||||
SignalRClient="AdminSignalRClient"
|
SignalRClient="AdminSignalRClient"
|
||||||
OnGridEditModelSaving="DataItemSaving"
|
OnGridEditModelSaving="DataItemSaving"
|
||||||
OnGridItemDeleting="DataItemDeleting"
|
OnGridItemDeleting="DataItemDeleting"
|
||||||
OnGridItemChanged="DataItemChanged"
|
OnGridItemChanged="DataItemChanged"
|
||||||
PageSize="5"
|
|
||||||
AutoExpandAllGroupRows="true"
|
|
||||||
KeyboardNavigationEnabled="KeyboardNavigationEnabled"
|
KeyboardNavigationEnabled="KeyboardNavigationEnabled"
|
||||||
KeyFieldName="Id"
|
KeyFieldName="Id"
|
||||||
ValidationEnabled="false"
|
ValidationEnabled="false"
|
||||||
|
|
@ -34,8 +33,8 @@
|
||||||
ColumnResizeMode="GridColumnResizeMode.NextColumn"
|
ColumnResizeMode="GridColumnResizeMode.NextColumn"
|
||||||
ShowFilterRow="false">
|
ShowFilterRow="false">
|
||||||
<Columns>
|
<Columns>
|
||||||
<DxGridCommandColumn NewButtonVisible="true" Width="8%" FixedPosition="GridColumnFixedPosition.Left" />
|
<DxGridCommandColumn Width="135" MinWidth="135" FixedPosition="GridColumnFixedPosition.Left" />
|
||||||
<DxGridDataColumn FieldName="Id" GroupIndex="0" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" />
|
<DxGridDataColumn FieldName="Id" SortIndex="0" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N" />
|
||||||
<DxGridDataColumn FieldName="CarId" Width="40%" />
|
<DxGridDataColumn FieldName="CarId" Width="40%" />
|
||||||
<DxGridDataColumn FieldName="LicencePlate" />
|
<DxGridDataColumn FieldName="LicencePlate" />
|
||||||
</Columns>
|
</Columns>
|
||||||
|
|
@ -43,7 +42,7 @@
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
[Parameter] public bool KeyboardNavigationEnabled { get; set; }
|
[Parameter] public bool KeyboardNavigationEnabled { get; set; }
|
||||||
|
[Parameter] public Guid? ContextId { get; set; }
|
||||||
[Parameter] public ITransferToDriversRelation ParentData { get; set; } = null!;
|
[Parameter] public ITransferToDriversRelation ParentData { get; set; } = null!;
|
||||||
[Parameter] public EventCallback<TransferToDriver> OnTransferToDriverChanged { get; set; }
|
[Parameter] public EventCallback<TransferToDriver> OnTransferToDriverChanged { get; set; }
|
||||||
|
|
||||||
|
|
@ -59,8 +58,6 @@
|
||||||
|
|
||||||
private void DataItemChanged(GridDataItemChangedEventArgs<TransferToDriver> args)
|
private void DataItemChanged(GridDataItemChangedEventArgs<TransferToDriver> args)
|
||||||
{
|
{
|
||||||
ParentData.TransferToDrivers.UpdateCollection(args.DataItem, args.TrackingState == TrackingState.Remove);
|
|
||||||
|
|
||||||
OnTransferToDriverChanged.InvokeAsync(args.DataItem);
|
OnTransferToDriverChanged.InvokeAsync(args.DataItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ public class TransferToDriversGrid : TiamGrid<TransferToDriver>
|
||||||
{
|
{
|
||||||
public TransferToDriversGrid() : base()
|
public TransferToDriversGrid() : base()
|
||||||
{
|
{
|
||||||
GetAllMessageTag = SignalRTags.GetTransferToDriversByContextId;
|
GetAllMessageTag = SignalRTags.GetTransferDriversByTransferId;
|
||||||
AddMessageTag = SignalRTags.AddTransferToDriver;
|
AddMessageTag = SignalRTags.AddTransferToDriver;
|
||||||
UpdateMessageTag = SignalRTags.UpdateTransferToDriver;
|
UpdateMessageTag = SignalRTags.UpdateTransferToDriver;
|
||||||
RemoveMessageTag = SignalRTags.RemoveTransferToDriver;
|
RemoveMessageTag = SignalRTags.RemoveTransferToDriver;
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ using TIAMWebApp.Shared.Application.Models.ClientSide.Messages;
|
||||||
using TIAMWebApp.Server.Services;
|
using TIAMWebApp.Server.Services;
|
||||||
using TIAMWebApp.Shared.Application.Models.ClientSide;
|
using TIAMWebApp.Shared.Application.Models.ClientSide;
|
||||||
using AyCode.Core.Extensions;
|
using AyCode.Core.Extensions;
|
||||||
|
using TIAM.Entities.Users;
|
||||||
|
|
||||||
namespace TIAMWebApp.Server.Controllers
|
namespace TIAMWebApp.Server.Controllers
|
||||||
{
|
{
|
||||||
|
|
@ -403,17 +404,6 @@ namespace TIAMWebApp.Server.Controllers
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
[Authorize]
|
|
||||||
[HttpGet]
|
|
||||||
[Route(APIUrls.GetTransfersByDriverRouteName)]
|
|
||||||
[SignalR(SignalRTags.GetTransfersByDriverId)]
|
|
||||||
public Task<string> GetDriverTransfers(Guid transferId, Guid userProductMappingId)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
//var result = await _adminDal.GetTransfersByUserIdJsonAsync(userId);
|
|
||||||
//return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[Route(APIUrls.GetTransferByIdRouteName)]
|
[Route(APIUrls.GetTransferByIdRouteName)]
|
||||||
|
|
@ -437,5 +427,24 @@ namespace TIAMWebApp.Server.Controllers
|
||||||
return transferToModify;
|
return transferToModify;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Authorize]
|
||||||
|
[HttpGet]
|
||||||
|
[Route(APIUrls.GetTransferDriverRouteName)]
|
||||||
|
[SignalR(SignalRTags.GetTransferDriver)]
|
||||||
|
public async Task<TransferToDriver?> GetTransferDriver(Guid transferDriverId)
|
||||||
|
{
|
||||||
|
var result = await _adminDal.GetTransferToDriverById(transferDriverId);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
[Authorize]
|
||||||
|
[HttpGet]
|
||||||
|
[Route(APIUrls.GetTransferDriversByTransferIdRouteName)]
|
||||||
|
[SignalR(SignalRTags.GetTransferDriversByTransferId)]
|
||||||
|
public async Task<List<TransferToDriver>> GetTransferDrivers(Guid transferId)
|
||||||
|
{
|
||||||
|
var result = await _adminDal.GetTransferToDriversByTransferId(transferId);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -87,9 +87,6 @@ namespace TIAMWebApp.Shared.Application.Models
|
||||||
public const string GetTransfersByUserIdRouteName = "GetTransfersByUserId";
|
public const string GetTransfersByUserIdRouteName = "GetTransfersByUserId";
|
||||||
public const string GetTransfersByUserId = TransferDataAPI + GetTransfersByUserIdRouteName;
|
public const string GetTransfersByUserId = TransferDataAPI + GetTransfersByUserIdRouteName;
|
||||||
|
|
||||||
public const string GetTransfersByDriverRouteName = "GetTransfersByDriverId";
|
|
||||||
public const string GetTransfersByDriver = TransferDataAPI + GetTransfersByDriverRouteName;
|
|
||||||
|
|
||||||
public const string GetTransferByIdRouteName = "GetTransferById";
|
public const string GetTransferByIdRouteName = "GetTransferById";
|
||||||
public const string GetTransferById = TransferDataAPI + GetTransferByIdRouteName;
|
public const string GetTransferById = TransferDataAPI + GetTransferByIdRouteName;
|
||||||
|
|
||||||
|
|
@ -105,6 +102,12 @@ namespace TIAMWebApp.Shared.Application.Models
|
||||||
public const string UpdateTransferDestinationRouteName = "UpdateTransferDestintion";
|
public const string UpdateTransferDestinationRouteName = "UpdateTransferDestintion";
|
||||||
public const string UpdateTransferDestination = TransferDataAPI + UpdateTransferDestinationRouteName;
|
public const string UpdateTransferDestination = TransferDataAPI + UpdateTransferDestinationRouteName;
|
||||||
|
|
||||||
|
public const string GetTransferDriverRouteName = "GetTransfersByDriverId";
|
||||||
|
public const string GetTransferDriver = TransferDataAPI + GetTransferDriverRouteName;
|
||||||
|
|
||||||
|
public const string GetTransferDriversByTransferIdRouteName = "GetTransfersByDriverId";
|
||||||
|
public const string GetTransferDriversByTransferId = TransferDataAPI + GetTransferDriversByTransferIdRouteName;
|
||||||
|
|
||||||
//serviceprovider
|
//serviceprovider
|
||||||
public const string CreateServiceProviderRouteName = "CreateServiceProvider/";
|
public const string CreateServiceProviderRouteName = "CreateServiceProvider/";
|
||||||
public const string CreateServiceProvider = ServiceProviderAPI + CreateServiceProviderRouteName;
|
public const string CreateServiceProvider = ServiceProviderAPI + CreateServiceProviderRouteName;
|
||||||
|
|
|
||||||
|
|
@ -45,8 +45,8 @@ namespace TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
||||||
|
|
||||||
public Product SaveToProduct(Company company)
|
public Product SaveToProduct(Company company)
|
||||||
{
|
{
|
||||||
Product NewProduct = new(this.Id, company.Id, company, this.ProductType, this.Name, this.Description, this.Price, this.JsonDetails);
|
Product newProduct = new(this.Id, company.Id, company, this.ProductType, this.Name, this.Description, this.Price, this.JsonDetails);
|
||||||
return NewProduct;
|
return newProduct;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue