Update gestioen ricetta

This commit is contained in:
Samuele Locatelli
2023-02-09 15:33:11 +01:00
parent e3363d88f1
commit 57c61eac3b
13 changed files with 152 additions and 121 deletions
+8 -32
View File
@@ -92,11 +92,15 @@ namespace MP.Data.Controllers
/// <summary>
/// Init ricetta dato PODL + conf
/// </summary>
/// <param name=""></param>
/// <param name="confPath"></param>
/// <param name="idxPODL"></param>
/// <param name="CalcArgs"></param>
/// <returns></returns>
public RecipeModel InitRecipe(int idxPODL, string confPath)
public RecipeModel InitRecipe(string confPath, int idxPODL, Dictionary<string, string> CalcArgs)
{
RecipeModel answ = new RecipeModel();
// recupero dati da PODL...
// per prima cosa leggo file di conf x inizializzare ricetta...
string fullPath = RecipePath(confPath);
bool fileOk = File.Exists(fullPath);
@@ -104,36 +108,8 @@ namespace MP.Data.Controllers
{
string rawData = File.ReadAllText(fullPath);
var currRecipe = JsonConvert.DeserializeObject<RecipeConfig>(rawData);
// copio la mia ricetta come conf...
answ = new RecipeModel(idxPODL, currRecipe);
//answ = new RecipeModel()
//{
// IdxPODL = idxPODL,
// TemplateFile = currRecipe.TemplateFile,
// HeadConf = currRecipe.HeadConf,
// RowsConf = currRecipe.RowsConf,
// //HeadVal = currRecipe.HeadConf.ListKeys,
// HeadVal = RecipeModel.ConvertToValues(currRecipe.HeadConf.ListKeys),
// // aggiungo 1 riga...
// RowsVal = new Dictionary<string, Dictionary<string, string>>()
// {
// { "1", currRecipe.RowsConf.ListKeys}
// }
// //IdxPODL = idxPODL,
// //TemplateFile = currRecipe.TemplateFile,
// //HeadConf = currRecipe.HeadConf,
// //RowsConf = currRecipe.RowsConf,
// ////HeadVal = currRecipe.HeadConf.ListKeys,
// //HeadVal = RecipeModel.ConvertToObj(currRecipe.HeadConf.ListKeys),
// //// aggiungo 1 riga...
// //RowsVal = new Dictionary<string, Dictionary<string, Element>>()
// //{
// // //{ "1", rigaBase }
// // { "1", RecipeModel.ConvertToObj(currRecipe.RowsConf.ListKeys)}
// //}
//};
// inizializzo dalla conf...
answ = new RecipeModel(idxPODL, currRecipe, CalcArgs);
}
return answ;