Fix fileManager

Added filePath config
This commit is contained in:
Lucio Maranta
2018-09-04 17:06:54 +02:00
parent 757884ebb7
commit 3a0e1bc2a4
12 changed files with 85 additions and 31 deletions
@@ -144,23 +144,24 @@ namespace Step.Controllers.WebApi
return BadRequest(API_ERROR_KEYS.INCORRECT_PARAMETERS);
}
// If option is active
if (!ToolManagerConfig.FamilyOpt)
{
// Copy only family
DTONewNcFamilyModel newFamily = new DTONewNcFamilyModel();
SupportFunctions.CopyProperties(dtoToolWithFamily, newFamily);
// Update only family data
DbNcFamilyModel dbFam = toolsManager.UpdateFamily(dtoToolWithFamily.FamilyId, newFamily);
if (dbFam == null)
return BadRequest(API_ERROR_KEYS.INCORRECT_PARAMETERS);
}
using (NcHandler ncHandler = new NcHandler())
{
CmsError cmsError;
// If option is active
if (!ToolManagerConfig.FamilyOpt)
{
// Copy only family
DTONewNcFamilyModel newFamily = new DTONewNcFamilyModel();
SupportFunctions.CopyProperties(dtoToolWithFamily, newFamily);
// Update only family data
cmsError = ncHandler.UpdateFamily(dtoToolWithFamily.FamilyId, newFamily, out DTONcFamilyModel newFam);
if (cmsError.IsError())
return BadRequest(cmsError.localizationKey);
}
ncHandler.Connect();
// Update
CmsError cmsError = ncHandler.UpdateTool(toolId, dtoToolWithFamily, out DTONcToolModel newTool);
cmsError = ncHandler.UpdateTool(toolId, dtoToolWithFamily, out DTONcToolModel newTool);
if (cmsError.IsError())
return BadRequest(cmsError.localizationKey);