/// <summary> /// Delete a single document for document id /// </summary> /// <param name="task">DeleteDataSetTaskBEO</param> /// <param name="jobParameters">DeleteDataSetJobBEO</param> private void DeleteDocument(DeleteDataSetTaskBEO task, DeleteDataSetJobBEO jobParameters) { if (jobParameters != null) { DocumentBO.BatchDelete(jobParameters.MatterId, jobParameters.DataSetId, task.DocumentId, false, false); } }
public DocumentBO GenerateAndDocumentNo(DocumentBO oDoc, string ConfigValue) { DocumentBO documentBO = new DocumentBO(); DataSet dataSet = new DataSet(); try { using (SqlConnection sqlCon = new SqlConnection(Constant.DBConnectionString)) { SqlCommand sqlCmd = new SqlCommand("sspGenNumberAddtoDoc", sqlCon); sqlCon.Open(); sqlCmd.CommandType = CommandType.StoredProcedure; sqlCmd.Parameters.Add(new SqlParameter("@TenantID", oDoc.TenantID)); // sqlCmd.Parameters.Add(new SqlParameter("@DocumentName", oDoc.DocumentName)); sqlCmd.Parameters.Add(new SqlParameter("@DocType", oDoc.DocType)); sqlCmd.Parameters.Add(new SqlParameter("@CreatedBy", oDoc.CreatedBy)); sqlCmd.Parameters.Add(new SqlParameter("@OrgDocName", oDoc.OrgDocName)); // sqlCmd.Parameters.Add(new SqlParameter("@GenDocName", oDoc.GenDocName)); sqlCmd.Parameters.Add(new SqlParameter("@ConfigValue", ConfigValue)); SqlDataAdapter adaptar = new SqlDataAdapter(sqlCmd); adaptar.Fill(dataSet, "My Data Set"); sqlCon.Close(); documentBO.DocNumber = Convert.ToString(dataSet.Tables[1].Rows[0].ItemArray[1]); documentBO.DocID = Convert.ToInt32(dataSet.Tables[1].Rows[0].ItemArray[0]); } } catch (Exception ex) { _ErrMsg = ex.Message; throw; } return(documentBO); }
/// <summary> /// Update Fields in Search Engine /// </summary> /// <returns></returns> private bool UpdateNearDuplicationFieldsInSearchEngine() { bool status = false; try { Tracer.Info( "Near Duplication EV Update Worker: Update fields in search engine, started time {0} for job run id :{1}", DateTime.Now, PipelineId); var documentBeos = new List <DocumentBeo>(); foreach (var document in _documentsFieldsForSearchEngineUpdate) { documentBeos.Add(DocumentBO.ToDocumentBeo(document.Key, document.Value)); } _indexManagerProxy.BulkUpdateDocumentsAsync(documentBeos); status = true; Tracer.Info( "Near Duplication EV Update Worker: Update fields in search engine, completed time {0} for job run id :{1}", DateTime.Now, PipelineId); } catch (Exception ex) { ReportToDirector(ex); ex.Trace().Swallow(); } return(status); }
/// <summary> /// This method helps to generate tasks to group duplicate documents from vault and search sub-system /// </summary> private void GeneratetasksForGroupOperation(List <DocumentHashMapEntity> lsDocumentHash, string strDuplicateFiledVal) { if (lsDocumentHash.Count > 0) { foreach (var docHasMap in lsDocumentHash) { _task = new DeduplicationJobTaskBEO { IsGroup = true, CollectionId = docHasMap.CollectionId.ToString(), MatterId = _matterId, DocumentReferenceId = docHasMap.DocumentReferenceId, HashValue = docHasMap.HashValue, DuplicateField = strDuplicateFiledVal, DuplicateDocumentCount = lsDocumentHash.Count }; _taskNumber++; _task.TaskNumber = _taskNumber; _task.TaskComplete = false; _task.TaskPercent = 100.0 / lsDocumentHash.Count; _task.TaskKey = DocumentBO.GetDCNNumber(_matterId, docHasMap.CollectionId.ToString(), docHasMap.DocumentReferenceId, _createdByUserName); _tasks.Add(_task); var document = _vault.GetDocumentMasterData(new Guid(_task.CollectionId), _task.DocumentReferenceId); GroupingLogInfo(document, docHasMap, lsDocumentHash); } TaskCount = _tasks.Count; _affectedDocList = _lsAffectedDocument; EvLog.WriteEntry(_jobid + Constants.GenerateTaskGrouping, string.Empty, EventLogEntryType.Information); } }
public static string LoadDocument(int intSchoolID, int intTrustMID, int intStudentMID, int intEmployeeMID) { try { #region Bind Section DataTable dtStudent = new DataTable(); DocumentBL objDocumentBL = new DocumentBL(); DocumentBO objDocumentBO = new DocumentBO(); ApplicationResult objResultSection = new ApplicationResult(); objResultSection = objDocumentBL.Document_SelectAll_ForDropDown(intSchoolID, intTrustMID, intStudentMID, intEmployeeMID); if (objResultSection != null) { dtStudent = objResultSection.resultDT; if (dtStudent.Rows.Count > 0) { for (int i = 0; i < dtStudent.Rows.Count; i++) { } } } string res = ""; res = DataSetToJSON(dtStudent); return(res); #endregion } catch (Exception ex) { throw ex; } }
public void Document_BO_Test1() { DocumentBO _docBO = new DocumentBO(); Guid iId = new Guid("e4ca836a-14dd-4620-bf0b-91ba89450f96"); DocumentViewModel vmItem = new DocumentViewModel() { Name = ORIGINL_NAME }; _docBO.Add(vmItem, iId); Assert.IsNotNull(vmItem.Id); Assert.AreNotEqual(Guid.Empty, vmItem.Id); vmItem.Name = NEW_NAME; bool result = _docBO.Save(vmItem, iId); Assert.IsTrue(result); string newName = _docBO.Get(vmItem.Id, iId).Name; Assert.AreEqual(NEW_NAME, newName); result = _docBO.Delete(vmItem.Id, iId); Assert.IsTrue(result); }
public string UpdateDocNum(DocumentBO objtoken) { string rtnappuserId = ""; try { using (SqlConnection sqlCon = new SqlConnection(Constant.DBConnectionString)) { SqlCommand sqlCmd = new SqlCommand("sspCreateTokenNumber", sqlCon); sqlCon.Open(); sqlCmd.CommandType = CommandType.StoredProcedure; sqlCmd.Parameters.Add(new SqlParameter("@TenantID", objtoken.TenantID)); sqlCmd.Parameters.Add(new SqlParameter("@DocNumber", objtoken.DocNumber)); sqlCmd.Parameters.Add(new SqlParameter("@DocID", objtoken.DocID)); sqlCmd.Parameters.Add(new SqlParameter("@TokenID", objtoken.TokenID)); SqlDataReader reader = sqlCmd.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { rtnappuserId = Convert.ToString(reader[0]); } } sqlCon.Close(); } } catch (Exception ex) { _ErrMsg = ex.Message; throw; } return(rtnappuserId); }
protected void btnSubmit_Click(object sender, EventArgs e) { try { if (uploadCoverPage.HasFile && uploadFile.HasFile) { string strExtensionFile = System.IO.Path.GetExtension(uploadFile.FileName); string strExtensionCover = System.IO.Path.GetExtension(uploadCoverPage.FileName); if ((strExtensionCover == ".jpg" || strExtensionCover == ".jpeg" || strExtensionCover == ".png" || strExtensionCover == ".bmp") && (strExtensionFile == ".docx" || strExtensionFile == ".docm" || strExtensionFile == ".pdf" || strExtensionFile == ".xlsx" || strExtensionFile == ".xlsm")) { string strname = uploadFile.FileName.ToString(); string fileName = DateTime.Now.ToString("yyyyMMddHHmmss"); uploadFile.SaveAs(Server.MapPath("~/Document/") + fileName + strname); string filename = System.IO.Path.GetFileName(uploadFile.FileName); //string strFile = uploadFile.FileName.ToString(); //string fileName = DateTime.Now.ToString("yyyyMMddHHmmss"); //uploadFile.SaveAs(Server.MapPath("~/Documents/") + fileName + strFile); //string docFileName = System.IO.Path.GetFileName(uploadFile.FileName); //string strname = uploadCoverPage.FileName.ToString(); //string coverPageName = DateTime.Now.ToString("yyyyMMddHHmmss"); //uploadCoverPage.SaveAs(Server.MapPath("~/Images/") + coverPageName + strname); //string coverFileName = System.IO.Path.GetFileName(uploadCoverPage.FileName); DocumentBO uploadDoc = new DocumentBO { ResourceId = txtBoxResCode.Text, Title = txtBoxTitle.Text, Author = txtBoxAuthor.Text, Subject = txtBoxSubject.Text, Year = int.Parse(txtBoxYear.Text), CoverPage = "s", // CoverPage = "~/Images/" + coverFileName + strname, File = "~/Documents/" + fileName + strname, UploadedOn = DateTime.Now, UploadedBy = Session["UserId"].ToString(), Description = txtBoxDesc.Text }; UserBAL uploadDocument = new UserBAL(); int result = uploadDocument.AddDocuments(uploadDoc); if (result >= 1) { lblStatus.Text = "Uploaded Successfully!"; } else { lblStatus.Text = "Resource Does not exist"; } } } else { lblStatus.Text = "Please fill the mandatory fields!"; } } catch (Exception ex) { lblStatus.Text = ex.Message; } }
/// <summary> /// Copy Image Files /// </summary> /// <param name="documentDetail">documentDetail</param> /// <param name="errorMessage">errorMessage</param> /// <returns></returns> private bool CopyImageFiles(ExportDocumentDetail documentDetail, out string errorMessage) { #region assertion documentDetail.ShouldNotBe(null); #endregion var result = true; var imageErrorBuilder = new StringBuilder(); try { var pageCount = 0; if (documentDetail.ImageFiles != null && documentDetail.ImageFiles.Count > 0) { var imageFieldId = DocumentBO.GetFieldIdByNameForExportJob(_dataset, _fieldImageFileName, false); var fieldValue = DocumentBO.GetFieldValueForExportJob(Convert.ToInt64(_exportLoadJobDetailBeo.MatterId), _dataset.CollectionId, documentDetail.DocumentId, imageFieldId); var imageFileName = (!string.IsNullOrEmpty(fieldValue)) ?fieldValue: string.Empty; imageFileName = Regex.Replace(imageFileName, Constants.FileSpecialCharactersRegex, string.Empty); //Remove the illegal character in the filename if (string.IsNullOrEmpty(imageFileName)) { imageErrorBuilder.Append(Constants.ExportImageNoValueCopyErrorMessage); errorMessage = imageErrorBuilder.ToString(); return(false); } Int64 noOfImageFiles = documentDetail.ImageFiles.Count; var imgFileNames = new List <string>(); if (_lstBatesAndDpnFieldTypes.Contains(_imageNameFieldType) && imageFileName.Contains(','))//if field value contains , then it means field is bates field { imgFileNames = GetFileNamesForCommaSeperatedFields(imageFileName, noOfImageFiles, imgFileNames); } else { bool status = GetFileNamesWithStatus(ref imgFileNames, noOfImageFiles, imageFileName, out errorMessage); if (!status) { return(false); } } CopyFilesToTargetPath(documentDetail, ref result, imageErrorBuilder, ref pageCount, imgFileNames); } else { imageErrorBuilder.Append(Constants.ExportImageNoValueCopyErrorMessage); errorMessage = imageErrorBuilder.ToString(); return(false); } } catch (Exception ex) { ex.AddUsrMsg("Export File Copy Worker: Unable to copy image files for job run id: {0}", PipelineId).Trace().Swallow(); result = false; } errorMessage = imageErrorBuilder.ToString(); return(result); }
/// <summary> /// Get Title ,author and document control number /// </summary> /// <param name="matterId">matter id</param> /// <param name="collectionId">collection id</param> /// <param name="documentId">document id</param> /// <param name="title">title</param> /// <param name="author">author</param> /// <param name="docCtlNumber">Document control number</param> private void GetDocumentMetaData(string matterId, string collectionId, string documentId, ref string title, ref string author, ref string docCtlNumber) { author = Constants.NotApplicable; title = Constants.NotApplicable; docCtlNumber = Constants.NotApplicable; string fileSize = null; string datasetName = null; DocumentBO.GetDocumentMetaDataForPrintAndEmail(matterId, collectionId, documentId, ref title, ref author, ref docCtlNumber, ref fileSize, ref datasetName); }
/// <summary> /// Bulk Add Load File image records /// </summary> /// <param name="jobId">Job Id</param> /// <param name="fileData">File Data</param> private bool BulkAddLoadFileImageRecords(int jobId, Dictionary <string, List <string> > fileData) { try { var sourceData = new DataTable(); var jobIdColum = new DataColumn { DataType = Type.GetType("System.Int32"), ColumnName = ColumnJobId }; sourceData.Columns.Add(jobIdColum); var mappingFieldColumn = new DataColumn { DataType = Type.GetType("System.String"), ColumnName = ColumnDocumentKey }; sourceData.Columns.Add(mappingFieldColumn); var filePathsColumn = new DataColumn { DataType = Type.GetType("System.String"), ColumnName = ColumnImagePaths }; sourceData.Columns.Add(filePathsColumn); foreach (var data in fileData) { var row = sourceData.NewRow(); row[ColumnJobId] = jobId; row[ColumnDocumentKey] = data.Key; row[ColumnImagePaths] = string.Join(",", data.Value); sourceData.Rows.Add(row); } var stopWatch = Stopwatch.StartNew(); var status = DocumentBO.BulkAddImageRecords(m_Parameters.MatterId, sourceData); stopWatch.Stop(); Tracer.Info("Job {0} : Time taken for add load file image records in database {1} m.s", jobId, stopWatch.ElapsedMilliseconds); return(status); } catch (Exception ex) { var errorMessage = String.Format("Error on bulk copy image files records {0} :", ex.ToDebugString()); LogMessage(false, errorMessage); ex.Trace(); throw; } }
/// <summary> /// Clean import load file resources /// </summary> private void CleanUpImportLoadFileResources() { try { DocumentBO.DeleteLoadFileImagePath(MatterId, JobId); } catch (Exception ex) { ex.Trace().Swallow(); Tracer.Error("Job Id {0} - Error occurred on cleanup load file resources", JobId); } }
string GetDcnFieldValue (string matterId, string collectionId, string documentId) { matterId.ShouldNotBeEmpty(); collectionId.ShouldNotBeEmpty(); documentId.ShouldNotBeEmpty(); var fields = DataSetBO.GetDatasetFieldsOfType(matterId, new Guid(collectionId), Constants.DCNFieldTypeId); var dcnFieldValue = string.Empty; if (fields.Count > 0) { var dcnField = DocumentBO.GetDocumentFieldById(matterId, collectionId, documentId, fields[0].ID); dcnFieldValue = dcnField.FieldValue; } return(string.IsNullOrEmpty(dcnFieldValue) ? string.Empty : dcnFieldValue); }
/// <summary> /// Checks the tag exists to include native. /// </summary> /// <param name="collectionId">The collection identifier.</param> /// <param name="documentId">The document identifier.</param> /// <param name="tagNameToIncludeNative">The tag name to include native.</param> /// <returns>boolean</returns> private bool CheckTagExistsToIncludeNative(string collectionId, string documentId, string tagNameToIncludeNative) { try { var tags = new List <RVWTagBEO>(); //Get document all tags for the document DocumentBO.GetDocumentTags(ref tags, matterId.ToString(CultureInfo.InvariantCulture), collectionId, documentId, false, false); //return true if selected tag exists in the tag list else return false. return(tags.Exists(f => f.TagDisplayName.Contains(tagNameToIncludeNative))); } catch (Exception ex) { ex.Trace().Swallow(); return(false); } }
/// <summary> /// Deletes the DataSet From EvMaster /// </summary> /// <param name="task">DeleteDataSetTaskBEO</param> /// <param name="jobParameters">DeleteDataSetJobBEO</param> private void DeleteDataSetFromEvMaster(DeleteDataSetTaskBEO task, DeleteDataSetJobBEO jobParameters) { if (jobParameters != null) { string datasetUuid = string.Format("{0}{1}{2}{3}{4}{5}{6}{7}{8}{9}{10}", Constants.Matter, Constants.Hyphen, jobParameters.MatterId, Constants.Hyphen, Constants.Dataset, Constants.Hyphen, jobParameters.DataSetId, Constants.Hyphen, Constants.Collection, Constants.Hyphen, jobParameters.CollectionId); DataSetBO.DeleteDataSetFromEVMaster(datasetUuid); var externalizationEnabled = Convert.ToBoolean(CmgServiceConfigBO.GetServiceConfigurationsforConfig(Constants.ExternalizationConfiguration)); if (externalizationEnabled) { DocumentBO.DeleteExternalization(jobParameters.MatterId, task.ExtractionPath, task.DocumentSets); } } }
public int DocumentManager(DocumentBO _objDoc, char operation) { Hashtable hsparams = new Hashtable(); hsparams.Add("@DocId", _objDoc.DocId); hsparams.Add("@inReferenceSAID", _objDoc.ReferenceSAID); hsparams.Add("@inUIC", _objDoc.UIC); hsparams.Add("@inSAID", _objDoc.SAID); hsparams.Add("@inDocument", _objDoc.Document); hsparams.Add("@inDocumentName", _objDoc.DocumentName); hsparams.Add("@inDocType", _objDoc.DocType); hsparams.Add("@inClientType", _objDoc.ClientType); hsparams.Add("@inStatus", _objDoc.Status); hsparams.Add("@inAdvisorId", _objDoc.AdvisorID); hsparams.Add("@OperationName", operation); return(ExecuteNonQuery("DocumentManager", hsparams)); }
private int GetPageCountForImages(long matterId, string collectionId, string docReferenceId) { var pageCount = 0; //Get all the brava file names for the document in a list (.xdl, .zdl..) var fileNames = DocumentBO.GetBinaryReferenceIdFromPropertiesOnly(matterId.ToString(CultureInfo.InvariantCulture), collectionId, docReferenceId, "4"); if (fileNames == null || !fileNames.Any()) { return(pageCount); } var xdlCount = fileNames.Distinct().Count(s => s.EndsWith(Constants.RedactItDocumentExtension)); if (xdlCount > 0) { pageCount = fileNames.Distinct().Count(s => s.EndsWith(Constants.RedactItPageExtension)); } return(pageCount); }
public EmailTokenGen(DocumentBO objdoc) { try { DocumentBO EmailToken = new DocumentBO(); EmailToken.DocID = objdoc.DocID; EmailToken.TokenID = Guid.NewGuid().ToString(); EmailToken.DocNumber = objdoc.DocNumber; EmailToken.TenantID = objdoc.TenantID; DocumentDA objDA = new DocumentDA(); string token = objDA.UpdateDocNum(objdoc); } catch (Exception e) { } }
/// <summary> /// Create the markup file for document /// </summary> public string GetMarkUpFile(string sourcePath, string documentId) { var markupFile = string.Empty; var markupObject = DocumentBO.GetRedactionXml( _jobParameter.MatterId.ToString(CultureInfo.InvariantCulture), _redactableSetCollectionId, documentId); //If markup file exists write to disk if (markupObject != null && !string.IsNullOrEmpty(markupObject.MarkupXml)) { //Add the version string var markupXmlText = Constants.xmlVersionString.Replace(Constants.Slash, string.Empty) + markupObject.MarkupXml; //Apply user selections like to include or exclude markups var markupXml = ApplyUserMarkupSelections(markupXmlText); markupFile = Path.Combine(sourcePath, Guid.NewGuid().ToString()); markupXml.Save(markupFile); } return(markupFile); }
/// <summary> /// Create separator between the documents /// </summary> /// <param name="path">path</param> /// <param name="matterId">matter id</param> /// <param name="collectionId">collection id</param> /// <param name="documentId">document id</param> public void CreateseparatorSheet(string path, string matterId, string collectionId, string documentId) { path.ShouldNotBeEmpty(); matterId.ShouldNotBeEmpty(); collectionId.ShouldNotBeEmpty(); documentId.ShouldNotBeEmpty(); var title = string.Empty; var author = string.Empty; var documentCtlNo = string.Empty; //Get title and Author of the document GetDocumentMetaData(matterId, collectionId, documentId, ref title, ref author, ref documentCtlNo); //Get Document level tag var tagList = new List <RVWTagBEO>(); DocumentBO.GetDocumentTags(ref tagList, matterId, collectionId, documentId, false); //Construct Separator sheet in the shared var sb = new StringBuilder(string.Empty); sb.Append(Constants.HtmlHeadForseparatorSheet); sb.Append(Constants.HtmlContentForDCN); sb.Append(documentCtlNo); sb.Append(Constants.HtmlContentForTitle); sb.Append(title); sb.Append(Constants.HtmlContentForAuthor); sb.Append(author); sb.Append(Constants.HtmlContentForTags); //Add tags to Html Content var alt = 0; tagList.ForEach(o => AddTags(sb, ref alt, o)); sb.Append(Constants.HtmlContentForEndOfseparatorSheet); var folderName = path.Substring(0, path.LastIndexOf("\\")); if (!Directory.Exists(folderName)) { Directory.CreateDirectory(folderName); } File.WriteAllText(path, sb.ToString(), Encoding.UTF8); }
private RVWDocumentBEO GetDocumentData(string documentId, string collectionId, out bool isError) { RVWDocumentBEO document = null; isError = false; try { using (new EVTransactionScope(System.Transactions.TransactionScopeOption.Suppress)) { document = DocumentBO.GetDocumentDataViewFromVaultWithOutContent(matterId.ToString(CultureInfo.InvariantCulture), collectionId, documentId, string.Empty, true, false); } } catch (Exception ex) { ex.Trace().Swallow(); isError = true; } return(document); }
private List <RVWDocumentTagBEO> GetDocumentTags(string documentId, out bool isError) { List <RVWDocumentTagBEO> tags = null; isError = false; try { var tagdetails = new List <RVWTagBEO>(); using (new EVTransactionScope(System.Transactions.TransactionScopeOption.Suppress)) { tags = DocumentBO.GetDocumentTags(ref tagdetails, matterId.ToString(CultureInfo.InvariantCulture), _dataset.CollectionId, documentId, false, false); } } catch (Exception ex) { ex.Trace().Swallow(); isError = true; } return(tags); }
/// <summary> /// Set Image source files /// </summary> public void SetImageSourceFiles(ExportDocumentDetail documentDetail, ExportOption exportOption) { if (!exportOption.IsImage && !exportOption.IsProduction) { return; } var imageCollectionId = exportOption.IsImage ? exportOption.ImageSetCollectionId : exportOption.ProductionSetCollectionId; var documentFiles = DocumentBO.GetImagesForExportLoadFile(documentDetail.DocumentId, exportOption.IsImage, exportOption.IsProduction, imageCollectionId, Convert.ToInt32(_exportLoadJobDetailBeo.MatterId)); if ((documentDetail.ImageFiles != null && documentDetail.ImageFiles.Any()) && documentFiles.Any()) { var sourceFiles = documentFiles.OrderBy(p => p.Path).ToList(); var pathIndex = 0; foreach (var image in documentDetail.ImageFiles) { if (pathIndex > sourceFiles.Count) { break; } image.SourceFilePath = sourceFiles[pathIndex].Path; image.DestinationFolder = string.Format("{0}{1}", documentDetail.ExportBasePath, image.DestinationFolder); pathIndex++; } } else { var lstImgFiles = new List <ExportFileInformation>(); if (documentFiles != null) { lstImgFiles.AddRange(ConvertToExportFileInformation(documentFiles)); } documentDetail.ImageFiles = lstImgFiles; } }
public IList <DocumentBO> GetSupportingDocuments(string Orderno) { try { string sql = "SELECT d.originalfilename,d.filesizeinmb, d.originalfiletype from dbo.document d inner join dbo.tms_orderheaderdocuments dod" + @" on d.documentkey =dod.documentkey where dod.orderno =" + "'" + Orderno + "'"; var list = new List <DocumentBO>(); conn = new NpgsqlConnection(connString); conn.Open(); using (var cmd = new NpgsqlCommand(sql, conn)) { // cmd.Parameters.AddWithValue("_orderno", Orderno); cmd.CommandType = System.Data.CommandType.Text; var reader = cmd.ExecuteReader(); while (reader.Read()) { var docDO = new DocumentBO() { name = Convert.ToString(reader["originalfilename"]), FileType = Convert.ToString(reader["originalfiletype"]), size = Convert.ToInt32(reader["filesizeinmb"]), }; list.Add(docDO); } reader.Close(); } return(list); } catch (Exception msg) { throw msg; } finally { conn.Close(); } }
private static List <BulkDocumentInfoBEO> GetDuplicateDocumentList(string matterId, string collectionId, List <BulkDocumentInfoBEO> duplicateMaster) { var duplicateDocuments = DocumentBO.GetDocumentDuplicatesExpressWithFamilyId (matterId, collectionId, duplicateMaster); var duplicateDocumentsConverted = new List <BulkDocumentInfoBEO>(); if (duplicateDocuments != null && duplicateDocuments.Any()) { duplicateDocuments.SafeForEach(o => duplicateDocumentsConverted.Add(new BulkDocumentInfoBEO { DocumentId = o.DocumentReferenceId, FromOriginalQuery = false, DuplicateId = o.DuplicateId, FamilyId = o.Relationship, DCN = o.DCN })); } return(duplicateDocumentsConverted); }
private void GetDocumentFields(List <ExportDocumentDetail> exportDocuments) { documentContentFieldsValueCollection = new Dictionary <string, string>(); var documentIds = exportDocuments.Select(document => document.DocumentId).ToList(); var resultDocuments = DocumentBO.BulkGetDocumentsFieldsForExportJob(Convert.ToInt64(_exportLoadJobDetailBeo.MatterId), _dataset.CollectionId, documentIds, _selectedFieldIds); if (resultDocuments != null) { foreach (var exportDocument in exportDocuments) { var document = resultDocuments.FirstOrDefault(d => d.DocumentId == exportDocument.DocumentId); if (document != null) { exportDocument.Fields = document.FieldList; } } } }
public IList <DocumentBO> GetSupportingDocumentsForDO(Guid Orderkey) { try { string sql = "SELECT originalfilename, originalfiletype from dbo.document d (nolock) inner join dbo.tms_orderheaderdocuments dod" + "on d.documentkey =dod.documentkey where dod.orderkey = _orderKey"; var list = new List <DocumentBO>(); conn = new NpgsqlConnection(connString); conn.Open(); using (var cmd = new NpgsqlCommand(sql, conn)) { cmd.Parameters.AddWithValue("_orderKey", Orderkey); cmd.CommandType = System.Data.CommandType.Text; var reader = cmd.ExecuteReader(); while (reader.Read()) { var docDO = new DocumentBO() { name = Convert.ToString(reader["originalfilename"]), FileType = Convert.ToString(reader["originalfiletype"]) }; list.Add(docDO); } reader.Close(); } return(list); } catch (Exception msg) { throw msg; } finally { conn.Close(); } }
/// <summary> /// Get total document count. /// </summary> private Int64 SetTotalDocumentsCount() { var queryObject = new SearchQueryEntity(); queryObject.QueryList.Add(new Query(_searchQuery)); queryObject.MatterId = Convert.ToInt32(_dataset.Matter.FolderID); queryObject.DatasetId = Convert.ToInt32(_dataset.FolderID); if (!string.IsNullOrEmpty(_reviewsetId)) { queryObject.ReviewsetId = _reviewsetId; } queryObject.IsConceptSearchEnabled = _isIncludeConceptSearch; queryObject.LogSearchHistory = false; // Getting the All document and Tag document count from DB if (_parametersExportLoadFile.ExportLoadFileInfo != null) { switch (_parametersExportLoadFile.ExportLoadFileInfo.DocumentSelection) { case DocumentSelection.SavedQuery: var reviewerSearchService = new RVWReviewerSearchService(_webContext.Object); using (var transScope = new EVTransactionScope(TransactionScopeOption.Suppress)) { _totalDocumentCount = reviewerSearchService.GetDocumentCount(queryObject); } break; case DocumentSelection.Tag: _totalDocumentCount = DocumentBO.GetNoOfDocumentsByTag(queryObject.MatterId, _dataset.CollectionId, _parametersExportLoadFile.ExportLoadFileInfo.TagId); break; default: _totalDocumentCount = DocumentBO.GetNoOfDocuments(queryObject.MatterId, _dataset.CollectionId); break; } } return(_totalDocumentCount); }
public int AddSchedule(DocumentBO docBo, ScheduleBO schBO) { string connection = ConfigurationManager.ConnectionStrings["TSConnect"].ConnectionString; using (SqlConnection con = new SqlConnection(connection)) { con.Open(); SqlCommand cmd = new SqlCommand("TS_AddSchedule", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@batchId", schBO.BatchId); cmd.Parameters.AddWithValue("@userId", docBo.UploadedBy); cmd.Parameters.AddWithValue("@DateFrom", schBO.StartFrom); cmd.Parameters.AddWithValue("@dateTo", schBO.EndOn); cmd.Parameters.AddWithValue("@timeSlot", schBO.TimeSlot); cmd.Parameters.AddWithValue("@Subject", schBO.Subject); cmd.Parameters.AddWithValue("@notes", docBo.File); cmd.Parameters.AddWithValue("@uploadedOn", docBo.UploadedOn); cmd.Parameters.AddWithValue("@desc", docBo.Description); int result = cmd.ExecuteNonQuery(); return(result); } }
public void Document_BO_Test2() { IDocumentBO _docBO = new DocumentBO(); IProblemBO _probBO = new ProblemBO(); Guid iId = new Guid("e4ca836a-14dd-4620-bf0b-91ba89450f96"); ProblemViewModel problem = new ProblemViewModel() { Number = 1, Content = "Test Number 1" }; TestViewModel testVm = new TestViewModel() { Name = ORIGINL_NAME, Description = "Blah" }; _docBO.Add(testVm, iId); _probBO.AddToCollection(problem, testVm.Id, iId); Assert.Inconclusive(); }