added notes in recipe
This commit is contained in:
@@ -31,6 +31,10 @@ namespace Thermo.Active.Model.DTOModels.ThRecipe
|
||||
/// Last TC observed (stats) in sec
|
||||
/// </summary>
|
||||
public double TC_last = 3600;
|
||||
/// <summary>
|
||||
/// Note ricetta
|
||||
/// </summary>
|
||||
public string recipeNotes = "";
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -474,10 +474,23 @@ namespace Thermo.Active.Controllers.WebApi
|
||||
return Ok();
|
||||
}
|
||||
|
||||
[Route("updateNote"), HttpPost]
|
||||
[WebApiAuthorize(FunctionAccess = FUNCTIONALITY_NAMES.RECIPE_MANAGER, Action = ACTIONS.READ)]
|
||||
public IHttpActionResult UpdateNote(string recipeNotes)
|
||||
{
|
||||
// salvo note...
|
||||
if (!string.IsNullOrEmpty(recipeNotes))
|
||||
{
|
||||
NcFileAdapter.RecipeLiveData.recipeNotes = recipeNotes.Trim();
|
||||
}
|
||||
// e salvo su disco
|
||||
NcFileAdapter.SaveRecipe(NcFileAdapter.RecipeLiveData.RecipeName, NcFileAdapter.RecipeLiveData);
|
||||
return Ok();
|
||||
}
|
||||
|
||||
[Route("saveAll"), HttpPost]
|
||||
[WebApiAuthorize(FunctionAccess = FUNCTIONALITY_NAMES.RECIPE_MANAGER, Action = ACTIONS.READ)]
|
||||
public async Task<IHttpActionResult> SaveAll(string newName, double estimTimeSec)
|
||||
public async Task<IHttpActionResult> SaveAll(string newName, string recipeNotes, double estimTimeSec)
|
||||
{
|
||||
// recupero dati utente loggato
|
||||
var identity = User.Identity as ClaimsIdentity;
|
||||
@@ -492,6 +505,12 @@ namespace Thermo.Active.Controllers.WebApi
|
||||
NcFileAdapter.RecipeLiveData.UserSave = userData.Id.ToString();
|
||||
}
|
||||
|
||||
// salvo note...
|
||||
if(!string.IsNullOrEmpty(recipeNotes))
|
||||
{
|
||||
NcFileAdapter.RecipeLiveData.recipeNotes = recipeNotes.Trim();
|
||||
}
|
||||
|
||||
bool imageUploaded = false;
|
||||
|
||||
if (!Request.Content.IsMimeMultipartContent())
|
||||
@@ -538,7 +557,6 @@ namespace Thermo.Active.Controllers.WebApi
|
||||
// e salvo su disco
|
||||
NcFileAdapter.SaveRecipe(newName, NcFileAdapter.RecipeLiveData);
|
||||
}
|
||||
|
||||
return Ok();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user