MesEntity Placeholder
This commit is contained in:
parent
f9296dc252
commit
2ff1342f5a
@ -266,13 +266,14 @@ public class FileRead : Properties.IFileRead
|
|||||||
string rds;
|
string rds;
|
||||||
string dateValue;
|
string dateValue;
|
||||||
string rdsPlaceholder = "%RDS%";
|
string rdsPlaceholder = "%RDS%";
|
||||||
|
string mesEntityPlaceholder = "%MesEntity%";
|
||||||
if (!descriptions.Any() || string.IsNullOrEmpty(descriptions[0].RDS))
|
if (!descriptions.Any() || string.IsNullOrEmpty(descriptions[0].RDS))
|
||||||
rds = logistics.MID;
|
rds = logistics.MID;
|
||||||
else
|
else
|
||||||
rds = descriptions[0].RDS;
|
rds = descriptions[0].RDS;
|
||||||
string[] segments = scopeInfo.FileName.Split(new string[] { "DateTime:" }, StringSplitOptions.RemoveEmptyEntries);
|
string[] segments = scopeInfo.FileName.Split(new string[] { "DateTime:" }, StringSplitOptions.RemoveEmptyEntries);
|
||||||
if (segments.Length == 0)
|
if (segments.Length == 0)
|
||||||
result = string.Concat(duplicateDirectory, @"\", scopeInfo.FileNameWithoutExtension.Replace(rdsPlaceholder, rds));
|
result = string.Concat(duplicateDirectory, @"\", scopeInfo.FileNameWithoutExtension.Replace(rdsPlaceholder, rds).Replace(mesEntityPlaceholder, logistics.MesEntity));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
segments = segments[1].Split('%');
|
segments = segments[1].Split('%');
|
||||||
@ -284,7 +285,7 @@ public class FileRead : Properties.IFileRead
|
|||||||
continue;
|
continue;
|
||||||
datePlaceholder = string.Concat('%', segment, '%');
|
datePlaceholder = string.Concat('%', segment, '%');
|
||||||
}
|
}
|
||||||
result = string.Concat(duplicateDirectory, @"\", scopeInfo.FileName.Replace(rdsPlaceholder, rds).Replace(datePlaceholder, dateValue));
|
result = string.Concat(duplicateDirectory, @"\", scopeInfo.FileName.Replace(rdsPlaceholder, rds).Replace(mesEntityPlaceholder, logistics.MesEntity).Replace(datePlaceholder, dateValue));
|
||||||
}
|
}
|
||||||
if (result.Contains('%'))
|
if (result.Contains('%'))
|
||||||
throw new Exception("Placeholder exists!");
|
throw new Exception("Placeholder exists!");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user