From 253f3aefac0fc91e6821fea7116bee6af49949aa Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Thu, 1 Jun 2023 12:35:40 +0200 Subject: [PATCH] fix naming x refresh --- .../Components/DoorMan/DoorModal.razor.cs | 138 +++++++++--------- 1 file changed, 69 insertions(+), 69 deletions(-) diff --git a/WebDoorCreator.UI/Components/DoorMan/DoorModal.razor.cs b/WebDoorCreator.UI/Components/DoorMan/DoorModal.razor.cs index fe5adf1..6c03711 100644 --- a/WebDoorCreator.UI/Components/DoorMan/DoorModal.razor.cs +++ b/WebDoorCreator.UI/Components/DoorMan/DoorModal.razor.cs @@ -110,6 +110,20 @@ namespace WebDoorCreator.UI.Components.DoorMan } } + /// + /// Clona la porta selezionata con annesse door operations + /// + /// + protected async Task CloneDoor() + { + var newDoorId = await WDService.DoorCloneToOrder(CurrDoor.DoorId, CurrDoor.OrderId, UserName, true); + if (newDoorId > 0) + { + await RequestRefreshSvg(newDoorId); + await closeModal(); + } + } + protected async Task closeModal() { await Task.Delay(1); @@ -137,75 +151,6 @@ namespace WebDoorCreator.UI.Components.DoorMan } } - /// - /// Clona la porta selezionata con annesse door operations - /// - /// - protected async Task CloneDoor() - { - var newDoorId = await WDService.DoorCloneToOrder(CurrDoor.DoorId, CurrDoor.OrderId, UserName, true); - if (newDoorId > 0) - { - await doSave(newDoorId); - await closeModal(); - } - } - - /// - /// Effettua salvataggio record e generazione DDF - /// - /// - protected async Task doSave(int newDoorId) - { - List? listOpAll = await WDService.DoorOpGetByDoorId(newDoorId); - if (listOpAll != null) - { - List listOp = listOpAll.Where(x => x.userConfirm != "" && x.DtConfirm != null).ToList(); - if (listOp != null) - { - // chiamo metodo x avewre DDF serializzato - var CurrentCompoOrder = await WDService.ListValuesGetAll("*", "Hardware"); - if (CurrentCompoOrder != null) - { - foreach (var item in CurrentCompoOrder.OrderBy(x => x.Ordinal).ToList()) - { - ordListVal.Add(item.TableName); - } - } - - listOp = listOp.OrderBy(d => ordListVal.IndexOf(d.ObjectId)).ToList(); - - string currDdf = currDdfConv.GetSerialized(listOp); - // FIXME TODO: si potrebbe eliminare in futuro che va su REDIS versione corrente - // del DDF generato - int currVers = await QDataServ.SendCalcReq(newDoorId, currDdf); - - if (currVers > 0) - { - IsErr = false; - } - } - } - } - - /// - /// Clona la porta selezionata con annesse door operations nel template selezionato... - /// - /// - protected async Task SaveToTemplate() - { - if (!await JSRuntime.InvokeAsync("confirm", $"Are you sure? this operation will copy current door to selected template order?")) - return; - - // prendo ord templ dest... - var newDoorId = await WDService.DoorCloneToOrder(CurrDoor.DoorId, OrderIdTplSel, UserName, false); - if (newDoorId > 0) - { - await doSave(newDoorId); - await closeModal(); - } - } - protected override async Task OnInitializedAsync() { await Task.Delay(1); @@ -274,6 +219,61 @@ namespace WebDoorCreator.UI.Components.DoorMan } } + /// + /// Effettua salvataggio record e generazione DDF + /// + /// + protected async Task RequestRefreshSvg(int newDoorId) + { + List? listOpAll = await WDService.DoorOpGetByDoorId(newDoorId); + if (listOpAll != null) + { + List listOp = listOpAll.Where(x => x.userConfirm != "" && x.DtConfirm != null).ToList(); + if (listOp != null) + { + // chiamo metodo x avewre DDF serializzato + var CurrentCompoOrder = await WDService.ListValuesGetAll("*", "Hardware"); + if (CurrentCompoOrder != null) + { + foreach (var item in CurrentCompoOrder.OrderBy(x => x.Ordinal).ToList()) + { + ordListVal.Add(item.TableName); + } + } + + listOp = listOp.OrderBy(d => ordListVal.IndexOf(d.ObjectId)).ToList(); + + string currDdf = currDdfConv.GetSerialized(listOp); + // FIXME TODO: si potrebbe eliminare in futuro che va su REDIS versione corrente + // del DDF generato + int currVers = await QDataServ.SendCalcReq(newDoorId, currDdf); + + if (currVers > 0) + { + IsErr = false; + } + } + } + } + + /// + /// Clona la porta selezionata con annesse door operations nel template selezionato... + /// + /// + protected async Task SaveToTemplate() + { + if (!await JSRuntime.InvokeAsync("confirm", $"Are you sure? this operation will copy current door to selected template order?")) + return; + + // prendo ord templ dest... + var newDoorId = await WDService.DoorCloneToOrder(CurrDoor.DoorId, OrderIdTplSel, UserName, false); + if (newDoorId > 0) + { + await RequestRefreshSvg(newDoorId); + await closeModal(); + } + } + #endregion Protected Methods } } \ No newline at end of file