Exemple #1
0
        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
                        });
                    }
                }
            }
        }
Exemple #2
0
 public ActionResult ValueListControl(int id)
 {
     return(View("ValueListControl", new MetaDataValueListModel
     {
         AnalysisResultID = id,
         MetaDataValues = MetaDAC.GetMetaDataValues(id)
     }));
 }
Exemple #3
0
        public ActionResult DeleteKey(int id)
        {
            Nullable <Int32> informationTypeID = InformationTypeDAC.GetInformationTypeIDByMetaDataKeyID(id);

            MetaDAC.DeleteKey(id);

            MetaDataKeyListModel metaDataKeyListModel = GetMetaDataKeyListModelWithEmptyRow(informationTypeID.Value);

            return(View("KeyList", metaDataKeyListModel));
        }
Exemple #4
0
        public ActionResult SaveKeyList(IList <MetaDataKeyDTO> MetaDataKeyList, Int32 informationTypeID)
        {
            foreach (MetaDataKeyDTO metaDataKey in MetaDataKeyList)
            {
                MetaDAC.StoreKey(metaDataKey);
            }

            MetaDataKeyListModel metaDataKeyListModel = GetMetaDataKeyListModelWithEmptyRow(informationTypeID);

            return(View("KeyListControl", metaDataKeyListModel));
        }
Exemple #5
0
        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);
        }