/// <summary> /// Clones this FinancialPersonSavedAccount object to a new FinancialPersonSavedAccount object /// </summary> /// <param name="source">The source.</param> /// <param name="deepCopy">if set to <c>true</c> a deep copy is made. If false, only the basic entity properties are copied.</param> /// <returns></returns> public static FinancialPersonSavedAccount Clone(this FinancialPersonSavedAccount source, bool deepCopy) { if (deepCopy) { return(source.Clone() as FinancialPersonSavedAccount); } else { var target = new FinancialPersonSavedAccount(); target.CopyPropertiesFrom(source); return(target); } }
/// <summary> /// Copies the properties from another FinancialPersonSavedAccount object to this FinancialPersonSavedAccount object /// </summary> /// <param name="target">The target.</param> /// <param name="source">The source.</param> public static void CopyPropertiesFrom(this FinancialPersonSavedAccount target, FinancialPersonSavedAccount source) { target.PersonId = source.PersonId; target.ReferenceNumber = source.ReferenceNumber; target.Name = source.Name; target.MaskedAccountNumber = source.MaskedAccountNumber; target.TransactionCode = source.TransactionCode; target.GatewayEntityTypeId = source.GatewayEntityTypeId; target.CurrencyTypeValueId = source.CurrencyTypeValueId; target.CreditCardTypeValueId = source.CreditCardTypeValueId; target.Id = source.Id; target.Guid = source.Guid; }
/// <summary> /// Deletes the specified item. /// </summary> /// <param name="item">The item.</param> /// <returns></returns> public override bool Delete(FinancialPersonSavedAccount item) { if (item.FinancialPaymentDetailId.HasValue) { var paymentDetailsService = new FinancialPaymentDetailService((Rock.Data.RockContext) this.Context); var paymentDetail = paymentDetailsService.Get(item.FinancialPaymentDetailId.Value); if (paymentDetail != null) { paymentDetailsService.Delete(paymentDetail); } } return(base.Delete(item)); }
/// <summary> /// Copies the properties from another FinancialPersonSavedAccount object to this FinancialPersonSavedAccount object /// </summary> /// <param name="target">The target.</param> /// <param name="source">The source.</param> public static void CopyPropertiesFrom(this FinancialPersonSavedAccount target, FinancialPersonSavedAccount source) { target.Id = source.Id; target.FinancialGatewayId = source.FinancialGatewayId; target.FinancialPaymentDetailId = source.FinancialPaymentDetailId; target.ForeignGuid = source.ForeignGuid; target.ForeignKey = source.ForeignKey; target.GroupId = source.GroupId; target.Name = source.Name; target.PersonAliasId = source.PersonAliasId; target.ReferenceNumber = source.ReferenceNumber; target.TransactionCode = source.TransactionCode; target.CreatedDateTime = source.CreatedDateTime; target.ModifiedDateTime = source.ModifiedDateTime; target.CreatedByPersonAliasId = source.CreatedByPersonAliasId; target.ModifiedByPersonAliasId = source.ModifiedByPersonAliasId; target.Guid = source.Guid; target.ForeignId = source.ForeignId; }