Here's a start...
public class ProductKey
{
private static DateTime endDate,startDate;
public ProductKey()
{
}
public ProductKey(DateTime startDate)
{
StartDate = startDate;
}
public ProductKey(DateTime startDate, DateTime endDate)
{
StartDate = startDate;
EndDate = endDate;
}
public ProductKey(DateTime startDate, DateTime endDate,string[] keyParts)
{
StartDate = startDate;
EndDate = endDate;
KeyParts = keyParts;
}
public ProductKey(string[] keyParts)
{
KeyParts = keyParts;
}
public string[] KeyParts
{
get;
set;
}
public DateTime StartDate
{
get
{
return startDate;
}
set
{
startDate = value;
}
}
public DateTime EndDate
{
get
{
return endDate;
}
set
{
endDate = value;
}
}
public int DaysRemaining
{
get
{
if (startDate != null && endDate != null)
return endDate.Subtract(startDate).Days;
else
return 0;
}
set
{
endDate = startDate.Add(new TimeSpan(value, 0, 0));
}
}
}