public static Recurrence CreateSpecificRecurringDate(RecurrenceType recurrenceType, DateTime startDate) { if (!recurrenceType.Equals(RecurrenceType.FixedDateAnnualRecurring) || !recurrenceType.Equals(RecurrenceType.DynamicDateRecurring)) { throw new ArgumentException("Incorrect recurrence type for this method", nameof(recurrenceType)); } return(new Recurrence(recurrenceType.DisplayName, startDate, 0, true)); }
public static Recurrence CreateUserSpecificNonRecurringDate(User user, RecurrenceType recurrenceType, DateTime startDate) { if (recurrenceType.Equals(RecurrenceType.HireDateRecurring)) { return(new Recurrence(recurrenceType.DisplayName, user.HireDate, 0, false)); } if (recurrenceType.Equals(RecurrenceType.BirthDateRecurring)) { return(new Recurrence(recurrenceType.DisplayName, user.DOB, 0, false)); } throw new ArgumentException("Incorrect recurrence type for this method", nameof(recurrenceType)); }
/// <summary> /// Returns true if CreateMandateBase instances are equal /// </summary> /// <param name="other">Instance of CreateMandateBase to be compared</param> /// <returns>Boolean</returns> public bool Equals(CreateMandateBase other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Alias == other.Alias || Alias != null && Alias.Equals(other.Alias) ) && ( Customer == other.Customer || Customer != null && Customer.Equals(other.Customer) ) && ( CustomerReference == other.CustomerReference || CustomerReference != null && CustomerReference.Equals(other.CustomerReference) ) && ( Language == other.Language || Language != null && Language.Equals(other.Language) ) && ( RecurrenceType == other.RecurrenceType || RecurrenceType != null && RecurrenceType.Equals(other.RecurrenceType) ) && ( SignatureType == other.SignatureType || SignatureType != null && SignatureType.Equals(other.SignatureType) ) && ( UniqueMandateReference == other.UniqueMandateReference || UniqueMandateReference != null && UniqueMandateReference.Equals(other.UniqueMandateReference) )); }
protected WeekDays GetValidWeekDays(RecurrenceType type, DayOfWeek dayOfWeek) { return((type.Equals(RecurrenceType.Daily)) ? WeekDays.EveryDay : DateTimeHelper.ToWeekDays(dayOfWeek)); }