public static void IdentifyMetaDataValues(String text, Int32 informationTypeID, Int32 analysisResultID) { MetaDAC.DeleteValues(analysisResultID); List <MetaDataKeyDTO> metaDataKeys = MetaDAC.GetMetaDataKeys(informationTypeID); foreach (MetaDataKeyDTO metaDataKey in metaDataKeys) { //MatchCollection matches = new Regex(@"[0-9]{4}\s[0-9]{4}|[0-9]{8}|[0-9]{2}\s[0-9]{2}\s[0-9]{2}\s[0-9]{2}", RegexOptions.IgnoreCase).Matches(text); MatchCollection matches = new Regex(metaDataKey.RegEx).Matches(text); List <String> values = new List <string>(); foreach (Match match in matches) { if (match.Success) { values.Add(match.Value); MetaDAC.StoreValue(new MetaDataValueDTO { AnalysisResultID = analysisResultID, MetaDataKeyID = metaDataKey.ID.Value, MetaValue = match.Value }); } } } }
public ActionResult ValueListControl(int id) { return(View("ValueListControl", new MetaDataValueListModel { AnalysisResultID = id, MetaDataValues = MetaDAC.GetMetaDataValues(id) })); }
public ActionResult DeleteKey(int id) { Nullable <Int32> informationTypeID = InformationTypeDAC.GetInformationTypeIDByMetaDataKeyID(id); MetaDAC.DeleteKey(id); MetaDataKeyListModel metaDataKeyListModel = GetMetaDataKeyListModelWithEmptyRow(informationTypeID.Value); return(View("KeyList", metaDataKeyListModel)); }
public ActionResult SaveKeyList(IList <MetaDataKeyDTO> MetaDataKeyList, Int32 informationTypeID) { foreach (MetaDataKeyDTO metaDataKey in MetaDataKeyList) { MetaDAC.StoreKey(metaDataKey); } MetaDataKeyListModel metaDataKeyListModel = GetMetaDataKeyListModelWithEmptyRow(informationTypeID); return(View("KeyListControl", metaDataKeyListModel)); }
private MetaDataKeyListModel GetMetaDataKeyListModelWithEmptyRow(Int32 informationTypeID) { List <MetaDataKeyDTO> metaDataKeys = MetaDAC.GetMetaDataKeys(informationTypeID); MetaDataKeyDTO emptyMetaDataKey = new MetaDataKeyDTO(); emptyMetaDataKey.InformationTypeID = informationTypeID; emptyMetaDataKey.Title = ""; emptyMetaDataKey.RegEx = ""; metaDataKeys.Add(emptyMetaDataKey); MetaDataKeyListModel metaDataKeyListModel = new MetaDataKeyListModel { InformationType = InformationTypeDAC.GetInformationType(informationTypeID, ContextManager.Current.SelectedAreaID.Value), MetaDataKeys = metaDataKeys }; return(metaDataKeyListModel); }