Skip to content

Commit

Permalink
#1050 fix bugs by add or remove attributes.
Browse files Browse the repository at this point in the history
parameter values are not stored in the stepmodel helper
  • Loading branch information
DavidBlaa committed Feb 22, 2023
1 parent 115e1b6 commit d5eeccf
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 14 deletions.
16 changes: 16 additions & 0 deletions Console/BExIS.Web.Shell/Areas/DCM/Controllers/FormController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3076,6 +3076,22 @@ public ActionResult ValidateMetadataParameterUsage(string value, int id, long at

ViewData["Xpath"] = stepModelHelper.XPath; // set Xpath for idbyxapth

// store in stephelper
if (stepModelHelper.Model.MetadataAttributeModels.Any()) // check if metadata Attribute models exist
{
var metadataAttributeModel = stepModelHelper.Model.MetadataAttributeModels.Where(m=>m.Source.Id.Equals(attrUsageId) && m.Number.Equals((long)number)).FirstOrDefault();// get metadata attribute model for this parameter
if (metadataAttributeModel != null)
{
if(metadataAttributeModel.Parameters.Any())
{
// get stored parameter model and replace it
var storedParameterModel = metadataAttributeModel.Parameters.Where(p => p.Id.Equals(model.Id)).FirstOrDefault();
storedParameterModel.Value = model.Value;
storedParameterModel.Errors = validateParameter(model);
}
}
}

return PartialView("_metadataParameterView", model);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,6 @@ private void createDOIMappingConcept()
var creator = conceptManager.CreateMappingKey("Creator", "", "www.google.de",false,true,concept);
var firstname = conceptManager.CreateMappingKey("Firstname", "", "", false, false, concept,creator);
var lastname = conceptManager.CreateMappingKey("Lastname", "", "", false, false, concept, creator);


}
}

Expand Down
24 changes: 12 additions & 12 deletions Console/BExIS.Web.Shell/Areas/DIM/Helpers/MappingHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@ public static List<LinkElementRootListItem> LoadSelectionList()
tmp.Add(li);

//load Metadata Strutcure
IEnumerable<MetadataStructure> metadataStructures = metadataStructureManager.Repo.Get();

foreach (var metadataStructure in metadataStructures)
{
li = new LinkElementRootListItem(
metadataStructure.Id,
metadataStructure.Name,
LinkElementType.MetadataStructure
);

tmp.Add(li);
}
//IEnumerable<MetadataStructure> metadataStructures = metadataStructureManager.Repo.Get();

//foreach (var metadataStructure in metadataStructures)
//{
// li = new LinkElementRootListItem(
// metadataStructure.Id,
// metadataStructure.Name,
// LinkElementType.MetadataStructure
// );

// tmp.Add(li);
//}

// add concepts
using (var conceptManager = new ConceptManager())
Expand Down

0 comments on commit d5eeccf

Please sign in to comment.