DateTime startDate;
if (!DateTime.TryParse(txtStartDate.Text, startDate))
{
throw new Exception("invalid startDate specified");
}
var trialPeriod = GetTrialPeriod;
if (!trialPeriod.HasValue)
trialPeriod = 0.0 // We could get a trial period from the database, so assume that there is no trial period.
var endDate = startDate.AddDays(trialPeriod);