/// <summary> /// Copies the base properties from a source FinancialTransaction object /// </summary> /// <param name="source">The source.</param> public void CopyPropertiesFrom(FinancialTransaction source) { this.Id = source.Id; this.AuthorizedPersonAliasId = source.AuthorizedPersonAliasId; this.BatchId = source.BatchId; this.CheckMicrEncrypted = source.CheckMicrEncrypted; this.CheckMicrHash = source.CheckMicrHash; this.CheckMicrParts = source.CheckMicrParts; this.FinancialGatewayId = source.FinancialGatewayId; this.FinancialPaymentDetailId = source.FinancialPaymentDetailId; this.ForeignGuid = source.ForeignGuid; this.ForeignKey = source.ForeignKey; this.FutureProcessingDateTime = source.FutureProcessingDateTime; this.IsReconciled = source.IsReconciled; this.IsSettled = source.IsSettled; this.MICRStatus = source.MICRStatus; this.ModifiedAuditValuesAlreadyUpdated = source.ModifiedAuditValuesAlreadyUpdated; this.NonCashAssetTypeValueId = source.NonCashAssetTypeValueId; this.ProcessedByPersonAliasId = source.ProcessedByPersonAliasId; this.ProcessedDateTime = source.ProcessedDateTime; this.ScheduledTransactionId = source.ScheduledTransactionId; this.SettledDate = source.SettledDate; this.SettledGroupId = source.SettledGroupId; this.SettledSourceDate = source.SettledSourceDate; this.ShowAsAnonymous = source.ShowAsAnonymous; this.SourceTypeValueId = source.SourceTypeValueId; this.Status = source.Status; this.StatusMessage = source.StatusMessage; this.Summary = source.Summary; this.SundayDate = source.SundayDate; this.TransactionCode = source.TransactionCode; this.TransactionDateTime = source.TransactionDateTime; this.TransactionSourceDate = source.TransactionSourceDate; this.TransactionTypeValueId = source.TransactionTypeValueId; this.CreatedDateTime = source.CreatedDateTime; this.ModifiedDateTime = source.ModifiedDateTime; this.CreatedByPersonAliasId = source.CreatedByPersonAliasId; this.ModifiedByPersonAliasId = source.ModifiedByPersonAliasId; this.Guid = source.Guid; this.ForeignId = source.ForeignId; }
/// <summary> /// Uploads the scanned item. /// </summary> /// <param name="scannedDocInfo">The scanned document information.</param> private void UploadScannedItem( ScannedDocInfo scannedDocInfo ) { RockRestClient client = EnsureUploadScanRestClient(); // upload image of front of doc string frontImageFileName = string.Format( "image1_{0}.png", DateTime.Now.ToString( "o" ).RemoveSpecialCharacters() ); int frontImageBinaryFileId = client.UploadBinaryFile( frontImageFileName, Rock.Client.SystemGuid.BinaryFiletype.CONTRIBUTION_IMAGE.AsGuid(), scannedDocInfo.FrontImagePngBytes, false ); // upload image of back of doc (if it exists) int? backImageBinaryFileId = null; if ( scannedDocInfo.BackImageData != null ) { // upload image of back of doc string backImageFileName = string.Format( "image2_{0}.png", DateTime.Now.ToString( "o" ).RemoveSpecialCharacters() ); backImageBinaryFileId = client.UploadBinaryFile( backImageFileName, Rock.Client.SystemGuid.BinaryFiletype.CONTRIBUTION_IMAGE.AsGuid(), scannedDocInfo.BackImagePngBytes, false ); } FinancialPaymentDetail financialPaymentDetail = new FinancialPaymentDetail(); financialPaymentDetail.CurrencyTypeValueId = scannedDocInfo.CurrencyTypeValue.Id; financialPaymentDetail.Guid = Guid.NewGuid(); var financialPaymentDetailId = client.PostData<FinancialPaymentDetail>( "api/FinancialPaymentDetails", financialPaymentDetail ).AsIntegerOrNull(); FinancialTransaction financialTransaction = new FinancialTransaction(); financialTransaction.BatchId = batchPage.SelectedFinancialBatch.Id; financialTransaction.TransactionCode = string.Empty; financialTransaction.Summary = string.Empty; financialTransaction.Guid = Guid.NewGuid(); financialTransaction.TransactionDateTime = batchPage.SelectedFinancialBatch.BatchStartDateTime; financialTransaction.FinancialPaymentDetailId = financialPaymentDetailId; financialTransaction.SourceTypeValueId = scannedDocInfo.SourceTypeValue.Id; financialTransaction.TransactionTypeValueId = transactionTypeValueContribution.Id; int? uploadedTransactionId; if ( scannedDocInfo.IsCheck ) { financialTransaction.TransactionCode = scannedDocInfo.CheckNumber; financialTransaction.MICRStatus = scannedDocInfo.BadMicr ? MICRStatus.Fail : MICRStatus.Success; FinancialTransactionScannedCheck financialTransactionScannedCheck = new FinancialTransactionScannedCheck(); // Rock server will encrypt CheckMicrPlainText to this since we can't have the DataEncryptionKey in a RestClient financialTransactionScannedCheck.FinancialTransaction = financialTransaction; financialTransactionScannedCheck.ScannedCheckMicrData = scannedDocInfo.ScannedCheckMicrData; financialTransactionScannedCheck.ScannedCheckMicrParts = scannedDocInfo.ScannedCheckMicrParts; uploadedTransactionId = client.PostData<FinancialTransactionScannedCheck>( "api/FinancialTransactions/PostScanned", financialTransactionScannedCheck ).AsIntegerOrNull(); } else { uploadedTransactionId = client.PostData<FinancialTransaction>( "api/FinancialTransactions", financialTransaction as FinancialTransaction ).AsIntegerOrNull(); } // upload FinancialTransactionImage records for front/back FinancialTransactionImage financialTransactionImageFront = new FinancialTransactionImage(); financialTransactionImageFront.BinaryFileId = frontImageBinaryFileId; financialTransactionImageFront.TransactionId = uploadedTransactionId.Value; financialTransactionImageFront.Order = 0; financialTransactionImageFront.Guid = Guid.NewGuid(); client.PostData<FinancialTransactionImage>( "api/FinancialTransactionImages", financialTransactionImageFront ); if ( backImageBinaryFileId.HasValue ) { FinancialTransactionImage financialTransactionImageBack = new FinancialTransactionImage(); financialTransactionImageBack.BinaryFileId = backImageBinaryFileId.Value; financialTransactionImageBack.TransactionId = uploadedTransactionId.Value; financialTransactionImageBack.Order = 1; financialTransactionImageBack.Guid = Guid.NewGuid(); client.PostData<FinancialTransactionImage>( "api/FinancialTransactionImages", financialTransactionImageBack ); } scannedDocInfo.TransactionId = uploadedTransactionId; financialTransaction.Id = uploadedTransactionId ?? 0; financialTransaction.CreatedDateTime = financialTransaction.CreatedDateTime ?? DateTime.Now; var transactionList = batchPage.grdBatchItems.DataContext as BindingList<FinancialTransaction>; transactionList.Insert( 0, financialTransaction ); _itemsUploaded++; ShowUploadStats(); ShowUploadSuccess(); }
/// <summary> /// Copies the base properties from a source FinancialTransaction object /// </summary> /// <param name="source">The source.</param> public void CopyPropertiesFrom( FinancialTransaction source ) { this.Id = source.Id; this.AuthorizedPersonAliasId = source.AuthorizedPersonAliasId; this.BatchId = source.BatchId; this.CheckMicrEncrypted = source.CheckMicrEncrypted; this.CheckMicrHash = source.CheckMicrHash; this.CheckMicrParts = source.CheckMicrParts; this.FinancialGatewayId = source.FinancialGatewayId; this.FinancialPaymentDetailId = source.FinancialPaymentDetailId; this.MICRStatus = source.MICRStatus; this.ProcessedByPersonAliasId = source.ProcessedByPersonAliasId; this.ProcessedDateTime = source.ProcessedDateTime; this.ScheduledTransactionId = source.ScheduledTransactionId; this.SourceTypeValueId = source.SourceTypeValueId; this.Summary = source.Summary; this.TransactionCode = source.TransactionCode; this.TransactionDateTime = source.TransactionDateTime; this.TransactionTypeValueId = source.TransactionTypeValueId; this.Guid = source.Guid; this.ForeignId = source.ForeignId; }