/// <summary> /// Re name produced image(s) based on Bates Number /// </summary> private void RenameImagesBasedOnBatesNumber(ProductionDocumentDetail productionDocumentDetail) { try { if (!productionDocumentDetail.Profile.IsOneImagePerPage || String.IsNullOrEmpty(productionDocumentDetail.StartingBatesNumber)) { return; } if (string.IsNullOrEmpty(productionDocumentDetail.Profile.ProductionPrefix) || string.IsNullOrEmpty(productionDocumentDetail.Profile.ProductionStartingNumber)) { return; } var productionConversionHelper = new ProductionConversionHelper(); var producedImages = productionConversionHelper.RenameProducedImages(productionDocumentDetail); if (!producedImages.Any()) { return; } productionConversionHelper.UpdateProducedImageFilePath( productionDocumentDetail.DocumentId, productionDocumentDetail.ProductionCollectionId, _matterId, producedImages, productionDocumentDetail.CreatedBy); } catch (Exception exception) { //Log the error message for failed documents var message = ConErrorOnRenameImage + productionDocumentDetail.DCNNumber; LogMessage(productionDocumentDetail, false, message, false); //continue the production process with out rename images exception.Trace().Swallow(); } }
/// <summary> /// Re name produced image(s) based on Bates Number /// </summary> private void RenameImagesBasedOnBatesNumber(ProductionDocumentDetail productionDocumentDetail) { try { if (!productionDocumentDetail.Profile.IsOneImagePerPage || String.IsNullOrEmpty(productionDocumentDetail.StartingBatesNumber)) return; if (string.IsNullOrEmpty(productionDocumentDetail.Profile.ProductionPrefix) || string.IsNullOrEmpty(productionDocumentDetail.Profile.ProductionStartingNumber)) return; var productionConversionHelper = new ProductionConversionHelper(); var producedImages = productionConversionHelper.RenameProducedImages(productionDocumentDetail); if (!producedImages.Any()) return; productionConversionHelper.UpdateProducedImageFilePath( productionDocumentDetail.DocumentId, productionDocumentDetail.ProductionCollectionId, _matterId, producedImages, productionDocumentDetail.CreatedBy); } catch (Exception exception) { //Log the error message for failed documents var message = ConErrorOnRenameImage + productionDocumentDetail.DCNNumber; LogMessage(productionDocumentDetail, false, message, false); //continue the production process with out rename images exception.Trace().Swallow(); } }