-
Righe Ricetta
+
+
+
Righe Ricetta
+
+
+
+
+
+
@if (CurrRecipe?.RowsVal != null)
{
@foreach (var riga in CurrRecipe.RowsVal)
diff --git a/MP.SPEC/Components/RecipeMan.razor.cs b/MP.SPEC/Components/RecipeMan.razor.cs
index ee4825bb..e9b40f1f 100644
--- a/MP.SPEC/Components/RecipeMan.razor.cs
+++ b/MP.SPEC/Components/RecipeMan.razor.cs
@@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Components;
using MP.Data;
using MP.Data.MgModels;
using MP.SPEC.Data;
+using MP.SPEC.Pages;
using Newtonsoft.Json;
namespace MP.SPEC.Components
@@ -80,6 +81,7 @@ namespace MP.SPEC.Components
#region Private Fields
private bool showHead = true;
+ private bool showAllRows = false;
private Dictionary
showRows = new Dictionary();
#endregion Private Fields
@@ -95,12 +97,27 @@ namespace MP.SPEC.Components
CurrRecipe = new RecipeModel();
// effettua ricerca ricetta su MongoDb
CurrRecipe = await MDService.RecipeGetByPODL(IdxPODL);
- OrigRecipe = await MDService.RecipeGetByPODL(IdxPODL);
// se non trova crea nuova...
if (CurrRecipe == null)
{
- CurrRecipe = MDService.InitRecipe(IdxPODL, RecipePath);
+ // preparo dizionario valori calcolati
+ Dictionary CalcArgs = new Dictionary();
+ // aggiungo dati PODL
+ CalcArgs.Add("IdxPODL", $"{IdxPODL}");
+ CalcArgs.Add("CodePODL", $"PODL{IdxPODL:00000000}");
+ // recupero altri dati da PODL
+ var rowPodl = await MDService.PODL_getByKey(IdxPODL);
+ if (rowPodl != null)
+ {
+ CalcArgs.Add("CodArticolo", rowPodl.CodArticolo);
+ CalcArgs.Add("DescArticolo", rowPodl.ArticoloNav.DescArticolo);
+ }
+ CurrRecipe = MDService.InitRecipe(RecipePath, IdxPODL, CalcArgs);
+ // la salvo...
+ await MDService.RecipeSetByPODL(CurrRecipe);
}
+ // rileggo la default
+ OrigRecipe = await MDService.RecipeGetByPODL(IdxPODL);
// sistemo lista bool x righe
showRows = new Dictionary();
for (int i = 1; i <= CurrRecipe.RowsVal.Count; i++)
@@ -136,6 +153,10 @@ namespace MP.SPEC.Components
}
}
+ private async Task addRow()
+ {
+ await Task.Delay(1);
+ }
private void toggleHead()
@@ -143,6 +164,17 @@ namespace MP.SPEC.Components
showHead = !showHead;
}
+ private async Task toggleRows()
+ {
+ showAllRows = !showAllRows;
+ foreach (var item in showRows)
+ {
+ showRows[item.Key] = showAllRows;
+ }
+ await Task.Delay(1);
+ }
+
+
private async Task toggleRow(string rowNum)
{
showRows[rowNum] = !showRows[rowNum];
diff --git a/MP.SPEC/Data/MpDataService.cs b/MP.SPEC/Data/MpDataService.cs
index a4b81b96..7554bd33 100644
--- a/MP.SPEC/Data/MpDataService.cs
+++ b/MP.SPEC/Data/MpDataService.cs
@@ -74,12 +74,13 @@ namespace MP.SPEC.Data
///
/// Init ricetta
///
- ///
///
+ ///
+ ///
///
- public RecipeModel InitRecipe(int idxPODL, string confPath)
+ public RecipeModel InitRecipe(string confPath, int idxPODL, Dictionary CalcArgs)
{
- return mongoController.InitRecipe(idxPODL, confPath);
+ return mongoController.InitRecipe(confPath, idxPODL, CalcArgs);
}
///
/// Salva ricetta su MongoDB
diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj
index af7d0f76..807f72ec 100644
--- a/MP.SPEC/MP.SPEC.csproj
+++ b/MP.SPEC/MP.SPEC.csproj
@@ -5,7 +5,7 @@
enable
enable
MP.SPEC
- 6.16.2302.911
+ 6.16.2302.915
diff --git a/MP.SPEC/Recipe/README.md b/MP.SPEC/Recipe/README.md
new file mode 100644
index 00000000..9925615a
--- /dev/null
+++ b/MP.SPEC/Recipe/README.md
@@ -0,0 +1,23 @@
+# Ricette
+- [Ricette](#ricette)
+- [Gestione formati e tag x ricette](#gestione-formati-e-tag-x-ricette)
+ - [Campi Calcolati](#campi-calcolati)
+
+
+# Gestione formati e tag x ricette
+
+Nelle ricette ci possono essere campi liberi, campi da enum (da configurare nel json) e campi calcolati
+
+
+## Campi Calcolati
+
+I tag noti x decodifica riguardano i campi calcolati; hard coded, e riconosciuti, sono i seguenti:
+
+| ID | Note | Format | Esempio |
+|--------------|-----------------------------------------|------------------|-----------------|
+| IdxPODL | IdxODL numerico | - | 123 |
+| CodePODL | Codice alfanumerico partendo da IdxPODL | PODL{0:00000000} | PODL00000123 |
+| CodArticolo | Campo CodArticolo | - | Art000123 |
+| DescArticolo | Campo DescArticolo | - | Articol 123 blu |
+| RowNum | Numero riga | - | 1 |
+| RowTot | Totale righe | - | 10 |
diff --git a/MP.SPEC/Recipe/README.pdf b/MP.SPEC/Recipe/README.pdf
new file mode 100644
index 00000000..3f36eaff
Binary files /dev/null and b/MP.SPEC/Recipe/README.pdf differ
diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html
index e93ffe87..f0ae4d97 100644
--- a/MP.SPEC/Resources/ChangeLog.html
+++ b/MP.SPEC/Resources/ChangeLog.html
@@ -1,6 +1,6 @@
Modulo MAPOSPEC
- Versione: 6.16.2302.911
+ Versione: 6.16.2302.915
Note di rilascio:
-
diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt
index 37ed7d71..c653806e 100644
--- a/MP.SPEC/Resources/VersNum.txt
+++ b/MP.SPEC/Resources/VersNum.txt
@@ -1 +1 @@
-6.16.2302.911
+6.16.2302.915
diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml
index d07e8bc4..69e5e3f5 100644
--- a/MP.SPEC/Resources/manifest.xml
+++ b/MP.SPEC/Resources/manifest.xml
@@ -1,6 +1,6 @@
-
- 6.16.2302.911
+ 6.16.2302.915
https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/MP.SPEC.zip
https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/ChangeLog.html
false