示例#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);
        }
示例#2
0
        public void UpdateDocumentIntegrationStatus(Guid documentId)
        {
            var document          = _documentRepository.GetCrmEntityById(documentId);
            var documentForUpdate = new dot_documents()
            {
                Id = document.Id,
                dot_IntegrationStatus = error != string.Empty ? new OptionSetValue(180000002) : new OptionSetValue(180000001),
                dot_IntegrationError  = error,
            };

            _documentRepository.Update(documentForUpdate);
        }