DoorModal (and template):

- Fix clone con extCode + description
This commit is contained in:
Samuele Locatelli
2023-06-01 16:36:30 +02:00
parent a4175a5681
commit aac9ef28c6
7 changed files with 16 additions and 12 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>WebDoorCreator - Egalware</i>
<h4>Version: 0.9.2306.0115</h4>
<h4>Version: 0.9.2306.0116</h4>
<br /> Release note:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
0.9.2306.0115
0.9.2306.0116
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>0.9.2306.0115</version>
<version>0.9.2306.0116</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>
@@ -967,11 +967,13 @@ namespace WebDoorCreator.Data.Services
/// Clone a copy of the door in the specified order
/// </summary>
/// <param name="doorId">Record id to edit or add</param>
/// <param name="doorCode">Code associated to door</param>
/// <param name="doorDescr">Description for the door</param>
/// <param name="orderId">Destination order where door must be placed</param>
/// <param name="userName">userName for cloning</param>
/// <param name="isClone">true = cloning a door and save TypeId from orig, false = save to template order</param>
/// <returns></returns>
public async Task<int> DoorCloneToOrder(int doorId, int orderId, string userName, bool isClone)
public async Task<int> DoorCloneToOrder(int doorId, string doorCode, string doorDescr, int orderId, string userName, bool isClone)
{
int newDoorId = 0;
var doorOps2Add = new List<DoorOpModel>();
@@ -984,10 +986,12 @@ namespace WebDoorCreator.Data.Services
if (CurrDoor != null)
{
var doorToAdd = CurrDoor.ObjClone(userName);
// imposto ordine per la porta...
// imposto dati per la porta...
doorToAdd.OrderId = orderId;
doorToAdd.TypeId = isClone ? CurrDoor.DoorId : 1;
doorToAdd.Quantity = 1;
doorToAdd.DoorExtCode = doorCode;
doorToAdd.DoorDescript = doorDescr;
// salvo!
newDoorId = await DoorInsert(doorToAdd);
if (newDoorId != 0 && doorOps2Clone != null)
@@ -116,7 +116,7 @@ namespace WebDoorCreator.UI.Components.DoorMan
/// <returns></returns>
protected async Task CloneDoor()
{
var newDoorId = await WDService.DoorCloneToOrder(CurrDoor.DoorId, CurrDoor.OrderId, UserName, true);
var newDoorId = await WDService.DoorCloneToOrder(CurrDoor.DoorId, CurrDoor.DoorExtCode, CurrDoor.DoorDescript, CurrDoor.OrderId, UserName, true);
if (newDoorId > 0)
{
await RequestRefreshSvg(newDoorId);
@@ -264,7 +264,7 @@ namespace WebDoorCreator.UI.Components.DoorMan
{
if (!await JSRuntime.InvokeAsync<bool>("confirm", $"Are you sure? this operation will copy current door to selected template order?"))
return;
#if false
// prendo ord templ dest...
DoorTypeModel newDoorType = new DoorTypeModel()
@@ -272,9 +272,9 @@ namespace WebDoorCreator.UI.Components.DoorMan
TypeId = CurrDoor.DoorId,
TypeCode = $"TPLFROM-{CurrDoor.DoorId}",
Description = $"TEMPLATED DOOR: {CurrDoor.DoorId} ({CurrDoor.DoorDescript})"
};
var newDoorId = await WDService.DoorCloneToOrder(CurrDoor.DoorId, OrderIdTplSel, UserName, false);
};
#endif
var newDoorId = await WDService.DoorCloneToOrder(CurrDoor.DoorId, CurrDoor.DoorExtCode, CurrDoor.DoorDescript, OrderIdTplSel, UserName, false);
if (newDoorId > 0)
{
await RequestRefreshSvg(newDoorId);
@@ -87,7 +87,7 @@ namespace WebDoorCreator.UI.Components.TemplateMan
/// <returns></returns>
protected async Task doClone(DoorModel CurrDoor)
{
var newDoorId = await WDService.DoorCloneToOrder(CurrDoor.DoorId, OrderId, UserName, true);
var newDoorId = await WDService.DoorCloneToOrder(CurrDoor.DoorId, CurrDoor.DoorExtCode, CurrDoor.DoorDescript, OrderId, UserName, true);
if (newDoorId > 0)
{
await RequestRefreshSvg(newDoorId);
+1 -1
View File
@@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<Version>0.9.2306.0115</Version>
<Version>0.9.2306.0116</Version>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>aspnet-WebDoorCreator.UI-dfe95fed-1398-4144-bd43-8b3a765d6608</UserSecretsId>
</PropertyGroup>