ok avanzamento stati

This commit is contained in:
zaccaria.majid
2023-06-27 10:06:47 +02:00
parent fa747a144d
commit 2bcd575d00
7 changed files with 125 additions and 51 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>WebDoorCreator - Egalware</i>
<h4>Version: 0.9.2306.2609</h4>
<h4>Version: 0.9.2306.2710</h4>
<br /> Release note:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
0.9.2306.2609
0.9.2306.2710
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>0.9.2306.2609</version>
<version>0.9.2306.2710</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>
@@ -35,56 +35,71 @@
<div class=" py-1">
<HwSvgObj LineColor="#CFD8DC" LineWidth="8" ObjH="200" ObjW="700" EC_ExeFunct="()=> RecalcSVGs()" ObjId="Svg" ItemName="Recalc all the SVGs" ItemCount="0" ShowPlus="true" ImagePath="images/icons/arrows-rotate-solid.svg"></HwSvgObj>
</div>
@if ((orderStatus == 10 || orderStatus >= 10000) && WDCUService.userRole == "CompAdmin")
</div>@*
@if ((orderStatus != 30 || orderStatus >= 10000) && WDCUService.userRole == "CompAdmin")
{*@
@if (isAddNew)
{
@if (isAddNew)
{
<div class=" py-1">
<HwSvgObj LineColor="#CFD8DC" LineWidth="8" ObjH="200" ObjW="700" EC_ExeFunct="@(()=> ToggleAddNew())" ObjId="ToggleHide" ItemName="Close Add New" ItemCount="0" ShowPlus="true" ImagePath="images/icons/angles-left-solid.svg"></HwSvgObj>
</div>
<div class=" py-1">
<HwSvgObj LineColor="#CFD8DC" LineWidth="8" ObjH="200" ObjW="700" EC_ExeFunct="@(()=> createDoor())" ObjId="NewEmpty" ItemName="New Empty" ItemCount="0" ShowPlus="true" ImagePath="images/icons/file.svg"></HwSvgObj>
</div>
<div class=" py-1">
<HwSvgObj LineColor="#CFD8DC" LineWidth="8" ObjH="200" ObjW="700" EC_ExeFunct="@(()=> showModalTpl())" ObjId="Template" ItemName="Clone from Template" ItemCount="0" ShowPlus="true" ImagePath="images/icons/clone.svg"></HwSvgObj>
</div>
<div class=" py-1 w-50">
</div>
}
else
<div class=" py-1">
<HwSvgObj LineColor="#CFD8DC" LineWidth="8" ObjH="200" ObjW="700" EC_ExeFunct="@(()=> ToggleAddNew())" ObjId="ToggleHide" ItemName="Close Add New" ItemCount="0" ShowPlus="true" ImagePath="images/icons/angles-left-solid.svg"></HwSvgObj>
</div>
<div class=" py-1">
<HwSvgObj LineColor="#CFD8DC" LineWidth="8" ObjH="200" ObjW="700" EC_ExeFunct="@(()=> createDoor())" ObjId="NewEmpty" ItemName="New Empty" ItemCount="0" ShowPlus="true" ImagePath="images/icons/file.svg"></HwSvgObj>
</div>
<div class=" py-1">
<HwSvgObj LineColor="#CFD8DC" LineWidth="8" ObjH="200" ObjW="700" EC_ExeFunct="@(()=> showModalTpl())" ObjId="Template" ItemName="Clone from Template" ItemCount="0" ShowPlus="true" ImagePath="images/icons/clone.svg"></HwSvgObj>
</div>
<div class=" py-1 w-50">
</div>
}
else
{
@if (orderStatus == 10 && (WDCUService.userRole == "CompAdmin" || WDCUService.userRole == "SuperAdmin"))
{
<div class=" py-1">
<HwSvgObj LineColor="#CFD8DC" LineWidth="8" ObjH="200" ObjW="700" EC_ExeFunct="()=> ToggleAddNew()" ObjId="ToggleShow" ItemName="Add new door" ItemCount="0" ShowPlus="true" ImagePath="images/icons/PlusWhite.svg"></HwSvgObj>
</div>
}
else if (orderStatus != 30 && (WDCUService.userRole == "CompAdmin" || WDCUService.userRole == "SuperAdmin"))
{
<div class=" py-1">
<HwSvgObj LineColor="#CFD8DC" LineWidth="8" ObjH="200" ObjW="700" EC_ExeFunct="()=> reportUrl(currOrderId)" ObjId="Report" ItemName="Order PDF Report" ItemCount="0" ShowPlus="true" ImagePath="images/icons/file-pdf-regular.svg"></HwSvgObj>
</div>
<div class=" py-1">
<HwSvgObj LineColor="#CFD8DC" LineWidth="8" ObjH="200" ObjW="700" ObjId="Calc" EC_ExeFunct="()=>RefreshCosts()" ItemName="Update costs" ItemCount="0" ShowPlus="true" ImagePath="images/icons/calculator-solid.svg"></HwSvgObj>
</div>
<div class=" py-1">
@if (isTplPage)
{
<HwSvgObj LineColor="#7F8C8D" LineWidth="8" ObjH="200" ObjW="700" ObjId="-5" ItemName="Send to DCA" ItemCount="0" ImagePath="images/icons/angles-right-solid.svg"></HwSvgObj>
}
else
{
<HwSvgObj LineColor="#CFD8DC" LineWidth="8" ObjH="200" ObjW="700" EC_ExeFunct="@(()=> changeOrderStatus(currOrderId))" ObjId="-5" ItemName="Send to DCA" ItemCount="0" ShowPlus="true" ImagePath="images/icons/angles-right-solid.svg"></HwSvgObj>
}
<HwSvgObj TextStyle="font-size: 2.5em; color: #95A5A6;" LineColor="#7F8C8D" LineWidth="8" ObjH="200" ObjW="700" ObjId="ToggleShow" ItemName="Add new door" ItemCount="0" ImagePath="images/icons/PlusWhite.svg"></HwSvgObj>
</div>
}
}
else if (orderStatus == 30 && WDCUService.userRole == "CompAdmin")
{
<div class=" py-1">
<HwSvgObj LineColor="#CFD8DC" LineWidth="8" ObjH="200" ObjW="700" EC_ExeFunct="@(()=> back2Draft(currOrderId))" ObjId="-5" ItemName="Back to door draft" ItemCount="0" ShowPlus="true" ImagePath="images/icons/angles-left-solid.svg"></HwSvgObj>
</div>
<div class=" py-1">
<HwSvgObj LineColor="#CFD8DC" LineWidth="8" ObjH="200" ObjW="700" EC_ExeFunct="@(()=> changeOrderStatus(currOrderId))" ObjId="-6" ItemName="Accept Proposal" ItemCount="0" ShowPlus="true" ImagePath="images/icons/angles-right-solid.svg"></HwSvgObj>
</div>
else
{
}
<div class=" py-1">
<HwSvgObj LineColor="#CFD8DC" LineWidth="8" ObjH="200" ObjW="700" EC_ExeFunct="()=> reportUrl(currOrderId)" ObjId="Report" ItemName="Order PDF Report" ItemCount="0" ShowPlus="true" ImagePath="images/icons/file-pdf-regular.svg"></HwSvgObj>
</div>
<div class=" py-1">
<HwSvgObj LineColor="#CFD8DC" LineWidth="8" ObjH="200" ObjW="700" ObjId="Calc" EC_ExeFunct="()=>RefreshCosts()" ItemName="Update costs" ItemCount="0" ShowPlus="true" ImagePath="images/icons/calculator-solid.svg"></HwSvgObj>
</div>
@if (isTplPage)
{
<div class=" py-1">
<HwSvgObj LineColor="#7F8C8D" LineWidth="8" ObjH="200" ObjW="700" ObjId="-5" ItemName="Send to DCA" ItemCount="0" ImagePath="images/icons/angles-right-solid.svg"></HwSvgObj>
</div>
}
else
{
@if (orderStatus == 30 && (WDCUService.userRole == "CompAdmin" || WDCUService.userRole == "SuperAdmin"))
{
<div class=" py-1">
<HwSvgObj LineColor="#CFD8DC" LineWidth="8" ObjH="200" ObjW="700" EC_ExeFunct="@(()=> back2Draft(currOrderId))" ObjId="-5" ItemName="Back to door draft" ItemCount="0" ShowPlus="true" PlusColor="#EF6C00" ImagePath="images/icons/angles-left-solid.svg"></HwSvgObj>
</div>
}
<div class=" py-1">
<HwSvgObj LineColor="#CFD8DC" LineWidth="8" ObjH="200" ObjW="700" EC_ExeFunct="@(()=> changeOrderStatus(currOrderId))" ObjId="-8" ItemName="@nextStepLabel" ItemCount="0" ShowPlus="true" PlusColor="@nextStepColor" ImagePath="images/icons/angles-right-solid.svg"></HwSvgObj>
</div>
}
}
@*}
else*@
</div>
<div class="row">
@@ -61,6 +61,8 @@ namespace WebDoorCreator.UI.Components.DoorMan
protected List<DoorModel>? DoorsList { get; set; } = null;
protected List<ListValuesModel>? OrderSteps { get; set; } = null;
protected bool isAddNew { get; set; } = false;
protected string nextStepLabel { get; set; } = "Send to DCA";
protected string nextStepColor { get; set; } = "";
protected bool isAddRemMode { get; set; }
protected bool IsChanged { get; set; } = false;
@@ -278,7 +280,23 @@ namespace WebDoorCreator.UI.Components.DoorMan
.Skip(numRecord * (currPage - 1))
.Take(numRecord)
.ToList();
if (OrderSteps != null)
{
var stepsArray = OrderSteps.ToArray();
var currStepInList = OrderSteps.Where(x => x.Value == orderStatus.ToString()).FirstOrDefault();
var stepIndex = Array.IndexOf(stepsArray, currStepInList);
if (stepIndex != -1)
{
if (currStepInList?.Value != "70")
{
var nextStep = stepsArray[stepIndex + 1];
nextStepColor = nextStep.DefaultVal;
nextStepLabel = nextStep.Label;
}
}
}
#if false
if (DoorsList != null)
{
var currDoor = DoorsList.FirstOrDefault();
@@ -286,7 +304,8 @@ namespace WebDoorCreator.UI.Components.DoorMan
{
//orderStatus = currDoor.OrderNav.Status;
}
}
}
#endif
}
}
}
@@ -304,6 +323,43 @@ namespace WebDoorCreator.UI.Components.DoorMan
await JSRuntime.InvokeAsync<object>("open", url, "_blank");
}
protected string getStepColor()
{
string answ = "";
if (OrderSteps != null)
{
var stepsArray = OrderSteps.ToArray();
var currStepInList = OrderSteps.Where(x => x.Value == orderStatus.ToString()).FirstOrDefault();
var stepIndex = Array.IndexOf(stepsArray, currStepInList);
if (stepIndex != -1)
{
var nextStep = stepsArray[stepIndex + 1];
answ = nextStep.DefaultVal;
}
}
return answ;
}
protected string getStepLabel()
{
string answ = "";
if (OrderSteps != null)
{
var stepsArray = OrderSteps.ToArray();
var currStepInList = OrderSteps.Where(x => x.Value == orderStatus.ToString()).FirstOrDefault();
var stepIndex = Array.IndexOf(stepsArray, currStepInList);
if (stepIndex != -1)
{
if (currStepInList?.Value != "70")
{
var nextStep = stepsArray[stepIndex + 1];
answ = nextStep.Label;
}
}
}
return answ;
}
protected async void changeOrderStatus(int ordId)
{
if (OrderSteps != null)
@@ -313,12 +369,15 @@ namespace WebDoorCreator.UI.Components.DoorMan
var stepIndex = Array.IndexOf(stepsArray, currStepInList);
if (stepIndex != -1)
{
var nextStep = stepsArray[stepIndex + 1];
bool done = await WDService.OrderUpdateStatus(ordId, int.Parse(nextStep.Value));
if (done)
if (currStepInList?.Value != "70")
{
await ReloadData();
await InvokeAsync(StateHasChanged);
var nextStep = stepsArray[stepIndex + 1];
bool done = await WDService.OrderUpdateStatus(ordId, int.Parse(nextStep.Value));
if (done)
{
await ReloadData();
await InvokeAsync(StateHasChanged);
}
}
}
}
@@ -65,7 +65,7 @@ namespace WebDoorCreator.UI.Components.SvgComp
protected string cardClass
{
get => ItemCount > 0 ? "bg-primary text-light" : "bg-inactive text-dark";
get => ItemCount > 0 ? "bg-primary text-light" : "bg-inactive";
}
protected CircleData CircleImg { get; set; } = null!;
+1 -1
View File
@@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<Version>0.9.2306.2609</Version>
<Version>0.9.2306.2710</Version>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>aspnet-WebDoorCreator.UI-dfe95fed-1398-4144-bd43-8b3a765d6608</UserSecretsId>
</PropertyGroup>