Exemplo n.º 1
0
        public void Reset(BaseRecurrency recurrency)
        {
            Reset();
            SetBaseValues(recurrency);

            if (recurrency != null)
            {
                switch (recurrency.GetType())
                {
                case RecurrencyType.Daily:
                    SetDailyValues(recurrency as DailyRecurrency);
                    break;

                case RecurrencyType.Weekly:
                    SetWeeklyValues(recurrency as WeeklyRecurrency);
                    break;

                case RecurrencyType.Monthly:
                    SetMonthlyValues(recurrency as MonthlyRecurrency);
                    break;

                case RecurrencyType.Yearly:
                    SetYearlyValues(recurrency as YearlyRecurrency);
                    break;

                default:
                    throw new ArgumentException("Unknown recurrency type");
                }

                Type = recurrency.GetType();
            }
        }
Exemplo n.º 2
0
        public void Reset(BaseRecurrency recurrency)
        {
            Reset();
            SetBaseValues(recurrency);

            if (recurrency != null)
            {
                switch (recurrency.GetType())
                {
                    case RecurrencyType.Daily:
                        SetDailyValues(recurrency as DailyRecurrency);
                        break;
                    case RecurrencyType.Weekly:
                        SetWeeklyValues(recurrency as WeeklyRecurrency);
                        break;
                    case RecurrencyType.Monthly:
                        SetMonthlyValues(recurrency as MonthlyRecurrency);
                        break;
                    case RecurrencyType.Yearly:
                        SetYearlyValues(recurrency as YearlyRecurrency);
                        break;
                    default:
                        throw new ArgumentException("Unknown recurrency type");

                }

                Type = recurrency.GetType();
            }
        }
 private void CheckEquals_Base(RecurrencyInfo info, BaseRecurrency recurrency)
 {
     Assert.AreEqual(recurrency.StartDate, info.StartDate);
     Assert.AreEqual(recurrency.EndDate, info.EndDate);
     Assert.AreEqual(recurrency.Occurrences, info.Occurrences);
 }
Exemplo n.º 4
0
 private void SetBaseValues(BaseRecurrency recurrency)
 {
     StartDate   = recurrency.StartDate;
     EndDate     = recurrency.EndDate;
     Occurrences = recurrency.Occurrences;
 }
Exemplo n.º 5
0
 public RecurrencyInfo(BaseRecurrency recurrency)
 {
     Reset(recurrency);
 }
Exemplo n.º 6
0
 private void SetBaseValues(BaseRecurrency recurrency)
 {
     StartDate = recurrency.StartDate;
     EndDate = recurrency.EndDate;
     Occurrences = recurrency.Occurrences;
 }
Exemplo n.º 7
0
 public RecurrencyInfo(BaseRecurrency recurrency)
 {
     Reset(recurrency);
 }