Ejemplo n.º 1
0
        public bool CheckRequiredParametersForIntegration(Entity target, out JsonMetadataMapping jsonMapping, out Entity fetchResult)
        {
            dot_documents document = new dot_documents();

            jsonMapping = new JsonMetadataMapping();
            fetchResult = null;
            bool isExistMetadada = false;

            if (target.LogicalName == "annotation")
            {
                document        = _documentRepository.GetCrmEntityById(target.GetAttributeValue <EntityReference>("objectid").Id);
                isExistMetadada = CheckIsDocumentHaveMetadata(document.Id, out jsonMapping, out fetchResult);
            }
            else if (target.LogicalName == "dot_documents")
            {
                annotations     = _annotationRepository.GetEntitiesByField("objectid", target.Id, new ColumnSet(true)).ToList();
                isExistMetadada = CheckIsDocumentHaveMetadata(target.Id, out jsonMapping, out fetchResult);
            }
            if (authorization && isExistMetadada && ((document != null && document.dot_Validated != null && document.dot_Validated.Value == true) || (annotations != null && annotations.Count > 0)))
            {
                return(true);
            }

            return(false);
        }