Add project files.

This commit is contained in:
2019-11-18 16:59:38 +01:00
parent 5ec0c4fa3e
commit eef116b5f6
22 changed files with 841 additions and 0 deletions

View File

@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BrokerageLib.PaymentSystem {
public class PaymentDate {
/// <summary>
/// Calculates a payment date 30 days in the future
/// from the provided date.
/// If the payment date is on a weekend,
/// then move it to the first work day after the
/// proposed date
/// </summary>
/// <param name="startingDate">the date to use as starting date.</param>
/// <returns></returns>
public DateTime CalculateFuturePaymentDate(DateTime startingDate) {
var tempDate = startingDate.AddDays(30);
switch (tempDate.DayOfWeek)
{
case DayOfWeek.Saturday:
tempDate = tempDate.AddDays(2);
break;
case DayOfWeek.Sunday:
tempDate = tempDate.AddDays(1); // Error in our code here!
break;
}
return tempDate;
}
}
}