Exemplo n.º 1
0
        /// <summary>
        /// Converts Review Set Details BEO to Merge Review Set Task BEO
        /// </summary>
        /// <param name="reviewSetBeo"></param>
        /// <returns></returns>
        private static MergeReviewSetTaskBEO ConvertToTaskBeo(ReviewsetDetailsBEO reviewSetBeo)
        {
            MergeReviewSetTaskBEO reviewSet = new MergeReviewSetTaskBEO
            {
                ReviewSetId             = reviewSetBeo.ReviewSetId,
                ReviewSetName           = reviewSetBeo.ReviewSetName,
                DatasetId               = reviewSetBeo.DatasetId,
                NumberOfDocumentsPerSet = reviewSetBeo.NumberOfDocumentsPerSet,
                NumberOfReviewSets      = reviewSetBeo.NumberOfReviewSets,
                StatusId             = reviewSetBeo.StatusId,
                ReviewsetDescription = reviewSetBeo.Description,
                StartDate            = reviewSetBeo.StartDate,
                DueDate           = reviewSetBeo.DueDate,
                ReviewSetLogic    = reviewSetBeo.ReviewSetLogic,
                SplittingOption   = reviewSetBeo.SplittingOption,
                SearchQuery       = reviewSetBeo.SearchQuery,
                KeepDuplicates    = reviewSetBeo.KeepDuplicates,
                KeepFamily        = reviewSetBeo.KeepFamily,
                ReviewSetGroup    = reviewSetBeo.ReviewSetGroup,
                AssignTo          = reviewSetBeo.AssignTo,
                NumberOfDocuments = reviewSetBeo.NumberOfDocuments
            };



            reviewSet.Documents.AddRange(reviewSetBeo.Documents);
            reviewSet.ReviewSetUserList.AddRange(reviewSetBeo.ReviewSetUserList);

            return(reviewSet);
        }
Exemplo n.º 2
0
        /// <summary>
        /// converts to review set business entity to update the status
        /// </summary>
        /// <param name="reviewsetRecord"></param>
        /// <param name="status"></param>
        /// <returns></returns>
        private ReviewsetDetailsBEO ConvertToReviewsetBusinessEntity(ReviewsetRecord reviewsetRecord, int status)
        {
            ReviewsetDetailsBEO returnReviewset = new ReviewsetDetailsBEO();

            returnReviewset.ReviewSetId   = reviewsetRecord.ReviewSetId;
            returnReviewset.ReviewSetName = reviewsetRecord.ReviewSetName;
            returnReviewset.StatusId      = status;
            returnReviewset.ModifiedBy    = reviewsetRecord.CreatedBy;
            returnReviewset.DatasetId     = reviewsetRecord.DatasetId;

            returnReviewset.Description     = reviewsetRecord.ReviewSetDescription;
            returnReviewset.DueDate         = reviewsetRecord.DueDate;
            returnReviewset.KeepDuplicates  = reviewsetRecord.KeepDuplicatesTogether;
            returnReviewset.KeepFamily      = reviewsetRecord.KeepFamilyTogether;
            returnReviewset.ReviewSetGroup  = reviewsetRecord.ReviewSetGroup;
            returnReviewset.ReviewSetLogic  = reviewsetRecord.ReviewSetLogic;
            returnReviewset.SearchQuery     = reviewsetRecord.SearchQuery;
            returnReviewset.SplittingOption = reviewsetRecord.SplittingOption;
            returnReviewset.StartDate       = reviewsetRecord.StartDate;

            returnReviewset.NumberOfDocuments    = reviewsetRecord.NumberOfDocuments;
            returnReviewset.NumberOfReviewedDocs = reviewsetRecord.NumberOfReviewedDocs;

            return(returnReviewset);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Updates the reviewset status to Active in DB
        /// </summary>
        /// <param name="reviewsetRecord"></param>
        /// <param name="status"></param>
        /// <param name="isAuditable"></param>
        private void UpdateReviewSetStatus(ReviewsetRecord reviewsetRecord, int status, bool isAuditable = true)
        {
            ReviewsetDetailsBEO reviewsetEntity = ConvertToReviewsetBusinessEntity(reviewsetRecord, status);

            reviewsetEntity.IsAuditable = isAuditable;
            using (EVTransactionScope transScope = new EVTransactionScope(TransactionScopeOption.Suppress))
            {
                //if all the documents are added successfully then update the status of review set
                ReviewSetBO.UpdateReviewSet(reviewsetEntity, false);
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// converts to review set business entity to update the status
        /// </summary>
        /// <param name="reviewsetRecord"></param>
        /// <returns></returns>
        private ReviewsetDetailsBEO ConvertToReviewsetBusinessEntity(ReviewsetRecord reviewsetRecord)
        {
            var returnReviewset = new ReviewsetDetailsBEO
            {
                ReviewSetId          = reviewsetRecord.ReviewSetId,
                ReviewSetName        = reviewsetRecord.ReviewSetName,
                StatusId             = Constants.Active,
                ModifiedBy           = reviewsetRecord.CreatedBy,
                DatasetId            = reviewsetRecord.DatasetId,
                Description          = reviewsetRecord.ReviewSetDescription,
                DueDate              = reviewsetRecord.DueDate,
                KeepDuplicates       = reviewsetRecord.KeepDuplicatesTogether,
                KeepFamily           = reviewsetRecord.KeepFamilyTogether,
                ReviewSetGroup       = reviewsetRecord.ReviewSetGroup,
                ReviewSetLogic       = reviewsetRecord.ReviewSetLogic,
                SearchQuery          = reviewsetRecord.SearchQuery,
                SplittingOption      = reviewsetRecord.SplittingOption,
                StartDate            = reviewsetRecord.StartDate,
                NumberOfDocuments    = reviewsetRecord.NumberOfDocuments,
                NumberOfReviewedDocs = reviewsetRecord.NumberOfReviewedDocs
            };

            return(returnReviewset);
        }
        /// <summary>
        /// converts to review set business entity to update the status
        /// </summary>
        /// <param name="reviewsetRecord"></param>
        /// <param name="status"></param>
        /// <returns></returns>
        private ReviewsetDetailsBEO ConvertToReviewsetBusinessEntity(ReviewsetRecord reviewsetRecord, int status)
        {
            ReviewsetDetailsBEO returnReviewset = new ReviewsetDetailsBEO();
            returnReviewset.ReviewSetId = reviewsetRecord.ReviewSetId;
            returnReviewset.ReviewSetName = reviewsetRecord.ReviewSetName;
            returnReviewset.StatusId = status;
            returnReviewset.ModifiedBy = reviewsetRecord.CreatedBy;
            returnReviewset.DatasetId = reviewsetRecord.DatasetId;

            returnReviewset.Description = reviewsetRecord.ReviewSetDescription;
            returnReviewset.DueDate = reviewsetRecord.DueDate;
            returnReviewset.KeepDuplicates = reviewsetRecord.KeepDuplicatesTogether;
            returnReviewset.KeepFamily = reviewsetRecord.KeepFamilyTogether;
            returnReviewset.ReviewSetGroup = reviewsetRecord.ReviewSetGroup;
            returnReviewset.ReviewSetLogic = reviewsetRecord.ReviewSetLogic;
            returnReviewset.SearchQuery = reviewsetRecord.SearchQuery;
            returnReviewset.SplittingOption = reviewsetRecord.SplittingOption;
            returnReviewset.StartDate = reviewsetRecord.StartDate;

            returnReviewset.NumberOfDocuments = reviewsetRecord.NumberOfDocuments;
            returnReviewset.NumberOfReviewedDocs = reviewsetRecord.NumberOfReviewedDocs;

            return returnReviewset;

        }
Exemplo n.º 6
0
        /// <summary>
        /// Generates No.of Reviewsets to be created tasks
        /// </summary>
        /// <param name="jobParameters">Create Reviewset BEO</param>
        /// <param name="lastCommitedTaskCount">int</param>
        /// <returns>List of Create ReviewsetJob Tasks (BEOs)</returns>
        protected override Tasks <MergeReviewSetTaskBEO> GenerateTasks(MergeReviewSetJobBEO jobParameters, out int lastCommitedTaskCount)
        {
            Tasks <MergeReviewSetTaskBEO> tasks = new Tasks <MergeReviewSetTaskBEO>();

            lastCommitedTaskCount = 0;
            try
            {
                if (jobParameters != null)
                {
                    string datasetId = jobParameters.DatasetId.ToString(CultureInfo.InvariantCulture);
                    /* Get Dataset Details for dataset id to get know about the Collection id and the Matter ID*/
                    DatasetBEO datasetEntity = DataSetService.GetDataSet(datasetId);
                    string     sMatterId     = datasetEntity.Matter.FolderID.ToString(CultureInfo.InvariantCulture);
                    jobParameters.Activity = Constants.Create;

                    List <RVWDocumentBEO>        docList      = new List <RVWDocumentBEO>();
                    List <MergeReviewSetTaskBEO> mergedRsList = new List <MergeReviewSetTaskBEO>();

                    foreach (string reviewsetId in jobParameters.MergedReviewSetIds)
                    {
                        ReviewsetDetailsBEO reviewsetDetailsBeo = ReviewSetService.GetReviewSetDetails(sMatterId, reviewsetId);

                        ReviewerSearchResults qualifiedDocuments = new ReviewerSearchResults();
                        jobParameters.ReviewSetId = reviewsetId;
                        var queryContext = ConstructDocQueryEntity(jobParameters, datasetEntity);
                        queryContext.TransactionName = "MergeReviewSetJob - DoAtomicWork";
                        ReviewerSearchResults searchDocs = JobSearchHandler.GetAllDocuments(queryContext, false);

                        if (searchDocs != null)
                        {
                            searchDocs.ResultDocuments.SafeForEach(x => qualifiedDocuments.ResultDocuments.Add(x));
                        }

                        List <RVWDocumentBEO> iterationDocuments = qualifiedDocuments.ResultDocuments.
                                                                   Select(d => new RVWDocumentBEO
                        {
                            DocumentId   = d.DocumentID,
                            MatterId     = d.MatterID,
                            CollectionId = d.CollectionID,
                            FamilyId     = d.FamilyID
                        }).ToList();

                        reviewsetDetailsBeo.Documents.Clear();
                        reviewsetDetailsBeo.Documents.AddRange(iterationDocuments);
                        reviewsetDetailsBeo.StatusId = 2;
                        MergeReviewSetTaskBEO mReviewsetDetailsBeo = ConvertToTaskBeo(reviewsetDetailsBeo);
                        docList.AddRange(reviewsetDetailsBeo.Documents);
                        mergedRsList.Add(mReviewsetDetailsBeo);
                    }
                    jobParameters.Documents.AddRange(docList);
                    tasks.Add(mergedRsList);
                    MergeReviewSetTaskBEO lstUpdateReviewSetTaskBeo = ConvertToTaskBeo(jobParameters);
                    tasks.Add(lstUpdateReviewSetTaskBeo);

                    for (int i = 1; i <= tasks.Count; i++)
                    {
                        tasks[i - 1].TaskNumber = i;
                    }
                }
                else
                {
                    lastCommitedTaskCount = 0;
                    EvLog.WriteEntry(Constants.JobLogName + Constants.GenerateTasks, Constants.JobParamND, EventLogEntryType.Error);
                    JobLogInfo.AddParameters(Constants.JobParamND);
                    JobLogInfo.IsError = true;
                }
            }
            catch (Exception ex)
            {
                LogException(JobLogInfo, ex, LogCategory.Job, string.Empty, ErrorCodes.ProblemInGenerateTasks);
            }
            return(tasks);
        }
        /// <summary>
        /// converts to review set business entity to update the status
        /// </summary>
        /// <param name="reviewsetRecord"></param>
        /// <returns></returns>
        private ReviewsetDetailsBEO ConvertToReviewsetBusinessEntity(ReviewsetRecord reviewsetRecord)
        {
            var returnReviewset = new ReviewsetDetailsBEO
            {
                ReviewSetId = reviewsetRecord.ReviewSetId,
                ReviewSetName = reviewsetRecord.ReviewSetName,
                StatusId = Constants.Active,
                ModifiedBy = reviewsetRecord.CreatedBy,
                DatasetId = reviewsetRecord.DatasetId,
                Description = reviewsetRecord.ReviewSetDescription,
                DueDate = reviewsetRecord.DueDate,
                KeepDuplicates = reviewsetRecord.KeepDuplicatesTogether,
                KeepFamily = reviewsetRecord.KeepFamilyTogether,
                ReviewSetGroup = reviewsetRecord.ReviewSetGroup,
                ReviewSetLogic = reviewsetRecord.ReviewSetLogic,
                SearchQuery = reviewsetRecord.SearchQuery,
                SplittingOption = reviewsetRecord.SplittingOption,
                StartDate = reviewsetRecord.StartDate,
                NumberOfDocuments = reviewsetRecord.NumberOfDocuments,
                NumberOfReviewedDocs = reviewsetRecord.NumberOfReviewedDocs
            };

            return returnReviewset;
        }