* Further improvements of Warehouse view

* Fixed issue with not saving Products updates
This commit is contained in:
2025-05-24 21:47:32 +02:00
parent 71dd78cbd7
commit f58d2ab04c
8 changed files with 173 additions and 44 deletions

View File

@@ -5,6 +5,7 @@ namespace SytelineSaAppEfDataModel.Services;
public interface IWzHeaderService
{
Task<IEnumerable<WzHeaderDto>> GetAll();
Task<IEnumerable<WzHeaderDto>> GetByCustomerNumber(string customerNumber, int customerSequence);
Task CreateHeader(WzHeaderDto wzHeader);
Task<WzHeaderDto> GetById(Guid id);
}

View File

@@ -12,6 +12,13 @@ public class WzHeaderService(SytelineSaAppDbContext context, IMapper mapper) : I
return await context.WzHeaders.Select(x => mapper.Map<WzHeaderDto>(x)).ToListAsync();
}
public async Task<IEnumerable<WzHeaderDto>> GetByCustomerNumber(string customerNumber, int customerSequence)
{
return await context.WzHeaders.Include(x => x.Client)
.Where(x => x.Client.CustomerNumber == customerNumber && x.Client.CustomerSequence == customerSequence)
.Select(x => mapper.Map<WzHeaderDto>(x)).ToListAsync();
}
public async Task CreateHeader(WzHeaderDto wzHeader)
{
var entity = mapper.Map<WzHeader>(wzHeader);

View File

@@ -899,7 +899,7 @@ namespace SytelineSaAppEfDataModel
entity.Property(e => e.CreatedDate)
.HasColumnName("CreatedDate")
.HasColumnType("timestamp")
.HasColumnType("DateTime")
.IsRowVersion();
// Relationship
@@ -931,7 +931,7 @@ namespace SytelineSaAppEfDataModel
entity.Property(e => e.CreatedDate)
.HasColumnName("CreatedDate")
.HasColumnType("timestamp")
.HasColumnType("DateTime")
.IsRowVersion();
entity.Property(e => e.Name)