private DateTime calcDate(DateTime from, DojoMembershipDayType dateType) { switch (dateType) { case DojoMembershipDayType.CurrentDay: return(from); case DojoMembershipDayType.FirstOfYear: return(Amns.GreyFox.Scheduling.DateManipulator.FirstOfYear(from)); case DojoMembershipDayType.FirstOfMonth: return(Amns.GreyFox.Scheduling.DateManipulator.FirstOfMonth(from)); case DojoMembershipDayType.EndOfMonth: return(Amns.GreyFox.Scheduling.DateManipulator.EndOfMonth(from)); case DojoMembershipDayType.EndOfFollowingMonth: return(Amns.GreyFox.Scheduling.DateManipulator.EndOfFollowingMonth(from)); case DojoMembershipDayType.EndOfFollowingYear: return(Amns.GreyFox.Scheduling.DateManipulator.EndOfFollowingYear(from)); case DojoMembershipDayType.EndOfYear: return(Amns.GreyFox.Scheduling.DateManipulator.EndOfYear(from)); default: goto case DojoMembershipDayType.CurrentDay; } }
public static DojoMembershipTemplate MembershipTemplate( string name, string description, bool purchaseRequired, bool testRequired, bool attendanceRequired, decimal fee, decimal startupFee, DojoMembershipDayType membershipStart, DojoMembershipDayType membershipEnd, DojoOrganization organization, int orderNum, int proRateMonthA, int proRateDayA, decimal proRateFeeA, DojoMembershipDayType proRateEndA, int proRateMonthB, int proRateDayB, decimal proRateFeeB, DojoMembershipDayType proRateEndB, int proRateMonthC, int proRateDayC, decimal proRateFeeC, DojoMembershipDayType proRateEndC, int ageYearsMin, int ageYearsMax, int memberForMin, int memberForMax, DojoRank rankMin, DojoRank rankMax) { DojoMembershipTemplate template = new DojoMembershipTemplate(); template.Name = name; template.Description = description; template.PurchaseRequired = purchaseRequired; template.TestRequired = testRequired; template.AttendanceRequired = attendanceRequired; template.MembershipStart = membershipStart; template.MembershipEnd = membershipEnd; template.Organization = organization; template.OrderNum = orderNum; template.ProRateMonthA = proRateMonthA; template.ProRateDayA = proRateDayA; template.ProRateFeeA = proRateFeeA; template.ProRateEndA = proRateEndA; template.ProRateMonthB = proRateMonthB; template.ProRateDayB = proRateDayB; template.ProRateFeeB = proRateFeeB; template.ProRateEndB = proRateEndB; template.ProRateMonthC = proRateMonthC; template.ProRateDayC = proRateDayC; template.ProRateFeeC = proRateFeeC; template.ProRateEndC = proRateEndC; template.AgeYearsMin = ageYearsMin; template.AgeYearsMax = ageYearsMax; template.MemberForMin = memberForMin; template.MemberForMax = memberForMax; template.RankMin = rankMin; template.RankMax = rankMax; return(template); }