/// <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; } }