gestione creazione cartelle in caso di salvataggio

This commit is contained in:
zaccaria.majid
2023-06-09 16:03:49 +02:00
parent dc80de7238
commit 2ca7a79101
6 changed files with 40 additions and 16 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>WebDoorCreator - Egalware</i>
<h4>Version: 0.9.2306.0913</h4>
<h4>Version: 0.9.2306.0915</h4>
<br /> Release note:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
0.9.2306.0913
0.9.2306.0915
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>0.9.2306.0913</version>
<version>0.9.2306.0915</version>
<url>http://nexus.steamware.net/repository/SWS/WDC/stable/WDC.UI.zip</url>
<changelog>http://nexus.steamware.net/repository/SWS/WDC/stable/ChangeLog.html</changelog>
<mandatory>false</mandatory>
@@ -1625,18 +1625,7 @@ namespace WebDoorCreator.Data.Services
answ = answ && await OrdersFlushCache();
return dbResult;
}
/// <summary>
/// Update or add door
/// </summary>
/// <param name="currRec"></param>
/// <returns></returns>
public async Task<bool> DoorOpTypeAddRange(List<DoorOpTypeModel> currRec)
{
var dbResult = await dbController.DoorOpTypeAddRange(currRec);
// elimino cache redis dati porta...
bool answ = await ExecFlushRedisPattern(Constants.rKeyDoorOpType);
return dbResult;
}
public string EncriptData(string rawData)
{
@@ -2292,7 +2281,41 @@ namespace WebDoorCreator.Data.Services
return doorOpTypesList;
}
/// <summary>
/// Bulk add door op types
/// </summary>
/// <param name="currRecList"></param>
/// <returns></returns>
public async Task<bool> DoorOpTypeAddRange(List<DoorOpTypeModel> currRecList)
{
string rootPathNew = _configuration.GetValue<string>("CompoBaseDirs:NewCompoDir");
string rootPathOld = _configuration.GetValue<string>("CompoBaseDirs:CurrCompoDir");
var dbResult = await dbController.DoorOpTypeAddRange(currRecList);
foreach (var item in currRecList)
{
var pathSplit = item.OpCode.Split("\\");
var allDirectories = Directory.GetDirectories(rootPathNew, $"{pathSplit[pathSplit.Length - 3]}\\{pathSplit[pathSplit.Length - 2]}", SearchOption.AllDirectories);
foreach (string dir in allDirectories)
{
string dirToCreate = dir.Replace(rootPathNew, rootPathOld);
Directory.CreateDirectory(dirToCreate);
}
var allFiles = Directory.GetFiles(Path.Combine(rootPathNew, pathSplit[pathSplit.Length - 3], pathSplit[pathSplit.Length - 2]), pathSplit.Last(), SearchOption.AllDirectories);
foreach (string newPath in allFiles)
{
File.Copy(newPath, newPath.Replace(rootPathNew, rootPathOld), true);
}
}
//$"{pathSplit[pathSplit.Length - 3]}\\{pathSplit[pathSplit.Length - 2]}"
// elimino cache redis dati porta...
bool answ = await ExecFlushRedisPattern(Constants.rKeyDoorOpType);
return dbResult;
}
public async Task<List<DoorOpTypeModel>> ListValuesLuaNgeInsert(DoorOpTypeModel HwTpl)
{
List<ListValuesTempModel> values = new List<ListValuesTempModel>();
+1
View File
@@ -139,6 +139,7 @@
}
protected async Task scanB()
{
tempDOT.Clear();
tempDOT = await WDCService.scanAndCompare();
}
+1 -1
View File
@@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<Version>0.9.2306.0913</Version>
<Version>0.9.2306.0915</Version>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>aspnet-WebDoorCreator.UI-dfe95fed-1398-4144-bd43-8b3a765d6608</UserSecretsId>
</PropertyGroup>