Ejemplo n.º 1
0
        /// <summary>
        /// This method helps to Log Info for which filler outs original documents from duplicate
        /// documents and collects there bates no. to be shown to user.This is called for Action Type-Delete
        /// </summary>
        private void OriginalDocumentsLogInfo(Guid collectionId, string documentReferenceId)
        {
            try
            {
                //  List<AffectedDocument> lsAffectedDocument1 = new List<AffectedDocument>();
                var document = _vault.GetDocumentMasterData(collectionId, documentReferenceId);
                if (document != null)
                {
                    var objAffectedDocuments = new AffectedDocument
                    {
                        CollectionId = document.CollectionId.ToString(),
                        DocId        = document.DocumentReferenceId
                    };
                    if (!String.IsNullOrEmpty(document.NativeFilePath))
                    {
                        var strFileInfo = document.NativeFilePath;
                        var strFile     = strFileInfo.Split(Convert.ToChar(@"\"));
                        objAffectedDocuments.Name = strFile[strFile.Length - 1];
                    }
                    else
                    {
                        objAffectedDocuments.Name = document.DocumentTitle;
                    }

                    if (document.DocumentTitle != null)
                    {
                        objAffectedDocuments.BatesNumber = document.DocumentTitle;
                    }

                    _lsAffectedDocument.Add(objAffectedDocuments);
                }
                _actionType = Constants.Action_Delete_Type;
            }
            catch (Exception ex)
            {
                EvLog.WriteEntry(_jobid + Constants.ErrorForOriginalDocumentForDelete, ex.Message,
                                 EventLogEntryType.Error); //Constants.EVENT_GENERATE_TASK_KEY,
                LogException(_jobid, ex, Constants.ErrorForOriginalDocument, LogCategory.Job, string.Empty,
                             ErrorCodes.ProblemInGenerateTasks);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// This method helps to Log Info which groups duplicates and there original document in turn docs whose hash values count >0
        /// and groups them into a logical group say IsDuplicate replicate of each other.This helps the user to identify the docs in
        /// Document Data Viewer with the help of Red color identification.
        /// </summary>
        private void GroupingLogInfo(DocumentMasterEntity document, DocumentHashMapEntity docHasMap,
                                     List <DocumentHashMapEntity> lsDocumentHash)
        {
            try
            {
                if (_tempHashInfo == string.Empty)
                {
                    _tempHashInfo        = docHasMap.HashValue;
                    _objAffectedDocument = new AffectedDocument
                    {
                        CollectionId = document.CollectionId.ToString(),
                        DocId        = document.DocumentReferenceId
                    };
                    if (!String.IsNullOrEmpty(document.NativeFilePath))
                    {
                        var strFileInfo = document.NativeFilePath;
                        var strFile     = strFileInfo.Split(Convert.ToChar(@"\"));
                        _objAffectedDocument.Name = strFile[strFile.Length - 1];
                    }
                    else
                    {
                        _objAffectedDocument.Name = document.DocumentTitle;
                    }
                    if (document.DocumentTitle != null)
                    {
                        _objAffectedDocument.BatesNumber = document.DocumentTitle;
                    }
                    _lsBatesNo = new List <string>();
                    _isNew     = true;
                }
                if (_tempHashInfo != string.Empty && _isNew == false)
                {
                    if (_tempHashInfo == docHasMap.HashValue)
                    {
                        _lsBatesNo.Add(document.DocumentTitle);
                        if (_intCount == lsDocumentHash.Count) //task.DuplicateDocumentCount
                        {
                            _objAffectedDocument.DuplicateList.Clear();
                            _lsBatesNo.SafeForEach(o => _objAffectedDocument.DuplicateList.Add(o));
                            _lsAffectedDocument.Add(_objAffectedDocument);
                        }
                    }
                    else
                    {
                        _objAffectedDocument.DuplicateList.Clear();
                        _lsBatesNo.SafeForEach(o => _objAffectedDocument.DuplicateList.Add(o));
                        _lsAffectedDocument.Add(_objAffectedDocument);

                        _objAffectedDocument = null;
                        _lsBatesNo           = null;
                        _lsBatesNo           = new List <string>();
                        _objAffectedDocument = new AffectedDocument
                        {
                            CollectionId = document.CollectionId.ToString(),
                            DocId        = document.DocumentReferenceId
                        };
                        if (!String.IsNullOrEmpty(document.NativeFilePath))
                        {
                            var strFileInfo = document.NativeFilePath;
                            var strFile     = strFileInfo.Split(Convert.ToChar(@"\"));
                            _objAffectedDocument.Name = strFile[strFile.Length - 1];
                        }
                        else
                        {
                            _objAffectedDocument.Name = document.DocumentTitle;
                        }
                        if (document.DocumentTitle != null)
                        {
                            _objAffectedDocument.BatesNumber = document.DocumentTitle;
                        }
                        _tempHashInfo = docHasMap.HashValue;
                    }
                }
                _isNew = false;
                _intCount++;
            }
            catch (Exception ex)
            {
                EvLog.WriteEntry(_jobid + Constants.ErrorForBatesNumber, ex.Message, EventLogEntryType.Error);
                LogException(_jobid, ex, Constants.ErrorForBatesNumber, LogCategory.Job, string.Empty,
                             ErrorCodes.ProblemInGenerateTasks);
            }
        }