refactor: migrate project structure by reorganizing realization code snippets into documentation and analysis categories.

This commit is contained in:
2026-05-27 10:48:45 +02:00
parent eb82e4e0b2
commit 24c0593f15
116 changed files with 3309 additions and 236 deletions

View File

@@ -0,0 +1,35 @@
public void SetLeRequestDeparture(string leNo, string placeName)
{
using var db = _dbContextFactory.GetDbContext();
var entry = db.Destination.GetByName(placeName);
NullCheck(entry, typeof(Destination), placeName);
if (!db.Le.Any(l => l.LeNo == leNo))
{
throw new InvalidOperationException($"LE {leNo} does not exist.");
}
// only check for regular LE; NoRead can be set in any entry
if (leNo != ConstantsCommon.ConstantsLE.NoRead)
{
db.Destination.GetByLeNo(leNo).ForEach(d =>
{
if (d.Name == placeName)
{
if (d.Status != DestinationStatus.LeArrived)
{
Log.Write(LogLevel.Error,
$"{nameof(Le)} {leNo} is set for {nameof(Destination)} {placeName}. But {nameof(Destination.Status)} is {d.Status}.");
}
}
else
{
Log.Write(LogLevel.Error,
$"{nameof(Le)} {leNo} is already set for {nameof(Destination)} {placeName}. {nameof(Destination.Status)} is {d.Status}. Will be deleted from {nameof(Destination)} entry");
d.SetLeDeparted();
}
});
}
db.Destination.GetByName(placeName)?.SetLeRequestDeparture(leNo);
db.SaveChanges();
}