Universe.Modules.Currency.BaseCurrencyConnector.StartTransactionPeriod C# (CSharp) Method

StartTransactionPeriod() private method

private StartTransactionPeriod ( int period, string periodType ) : System.DateTime
period int
periodType string
return System.DateTime
        DateTime StartTransactionPeriod (int period, string periodType)
        {
            DateTime then = DateTime.Now;
            switch (periodType)
            {
            case "sec":
                then = then.AddSeconds(-period);
                break;
            case "min":
                then = then.AddMinutes(-period);
                break;
            case "hour":
                then = then.AddHours(-period);
                break;
            case "day":
                then = then.AddDays(-period);
                break;
            case "week":
                then = then.AddDays(-period * 7);
                break;
            case "month":
                then = then.AddMonths(-period);
                break;
            case "year":
                then = then.AddYears(-period);
                break;
            }

            return then;
        }