Ejemplo n.º 1
0
        private Rock.Model.FinancialPledge BuildFinancialPledge(RockContext rockContext, DateTime startDate, DateTime endDate)
        {
            var financialPledge = new Rock.Model.FinancialPledge();

            financialPledge.ForeignKey = financialPledgeForeignKey;
            financialPledge.StartDate  = startDate;
            financialPledge.EndDate    = endDate;

            return(financialPledge);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Copies the properties from another FinancialPledge object to this FinancialPledge object
 /// </summary>
 /// <param name="target">The target.</param>
 /// <param name="source">The source.</param>
 public static void CopyPropertiesFrom(this FinancialPledge target, FinancialPledge source)
 {
     target.PersonId               = source.PersonId;
     target.AccountId              = source.AccountId;
     target.TotalAmount            = source.TotalAmount;
     target.PledgeFrequencyValueId = source.PledgeFrequencyValueId;
     target.StartDate              = source.StartDate;
     target.EndDate = source.EndDate;
     target.Id      = source.Id;
     target.Guid    = source.Guid;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Clones this FinancialPledge object to a new FinancialPledge 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 FinancialPledge Clone(this FinancialPledge source, bool deepCopy)
 {
     if (deepCopy)
     {
         return(source.Clone() as FinancialPledge);
     }
     else
     {
         var target = new FinancialPledge();
         target.CopyPropertiesFrom(source);
         return(target);
     }
 }
 /// <summary>
 /// Copies the properties from another FinancialPledge object to this FinancialPledge object
 /// </summary>
 /// <param name="target">The target.</param>
 /// <param name="source">The source.</param>
 public static void CopyPropertiesFrom(this FinancialPledge target, FinancialPledge source)
 {
     target.Id                      = source.Id;
     target.AccountId               = source.AccountId;
     target.EndDate                 = source.EndDate;
     target.PersonAliasId           = source.PersonAliasId;
     target.PledgeFrequencyValueId  = source.PledgeFrequencyValueId;
     target.StartDate               = source.StartDate;
     target.TotalAmount             = source.TotalAmount;
     target.CreatedDateTime         = source.CreatedDateTime;
     target.ModifiedDateTime        = source.ModifiedDateTime;
     target.CreatedByPersonAliasId  = source.CreatedByPersonAliasId;
     target.ModifiedByPersonAliasId = source.ModifiedByPersonAliasId;
     target.Guid                    = source.Guid;
     target.ForeignId               = source.ForeignId;
 }
Ejemplo n.º 5
0
        public void FinancialPledgeDateKeyGetsSetCorrectly()
        {
            var testList = TestDataHelper.GetAnalyticsSourceDateTestData();

            foreach (var keyValue in testList)
            {
                var financialPledge = new Rock.Model.FinancialPledge();
                financialPledge.StartDate = keyValue.Value;
                Assert.AreEqual(keyValue.Key, financialPledge.StartDateKey);
            }

            testList = TestDataHelper.GetAnalyticsSourceDateTestData();

            foreach (var keyValue in testList)
            {
                var financialPledge = new Rock.Model.FinancialPledge();
                financialPledge.EndDate = keyValue.Value;
                Assert.AreEqual(keyValue.Key, financialPledge.EndDateKey);
            }
        }