|
using System;
namespace TodoListViewer
{
/// <summary>
/// Summary description for CTask.
/// </summary>
public class CTask
{
private Int16 m_iPriority;
private Single m_sngHoursEst;
private Int16 m_iPercentComplete;
private String m_strAllocatedTo;
private String m_strStartDate;
private String m_strDueDate;
private String m_strCompleteDate;
private String m_strNotes;
private String m_strTitle;
private Boolean m_fComplete;
public CTask()
{
m_iPriority = -1;
m_sngHoursEst = 0.0f;
m_iPercentComplete = -1;
m_strAllocatedTo = "";
m_strStartDate = "";
m_strDueDate = "";
m_strCompleteDate = "";
m_strNotes = "";
m_strTitle = "";
m_fComplete = false;
}
public Int16 Priority
{
get
{
return m_iPriority;
}
set
{
if(value >= 0 && value <= 10)
{
m_iPriority = value;
}
}
}
public Single HoursEst
{
get
{
return m_sngHoursEst;
}
set
{
m_sngHoursEst = value;
}
}
public Int16 PercentComplete
{
get
{
return m_iPercentComplete;
}
set
{
if(value >= 0 && value <= 100)
{
m_iPercentComplete = value;
}
}
}
public String AllocatedTo
{
get
{
return m_strAllocatedTo;
}
set
{
m_strAllocatedTo = value;
}
}
public String StartDate
{
get
{
return m_strStartDate;
}
set
{
m_strStartDate = FormatDateString(value);
}
}
public String DueDate
{
get
{
return m_strDueDate;
}
set
{
m_strDueDate = FormatDateString(value);
}
}
public String CompleteDate
{
get
{
return m_strCompleteDate;
}
set
{
m_strCompleteDate = FormatDateString(value);
}
}
public String Notes
{
get
{
return m_strNotes;
}
set
{
m_strNotes = value;
}
}
public String Title
{
get
{
return m_strTitle;
}
set
{
m_strTitle = value;
}
}
public Boolean Complete
{
get
{
return m_fComplete;
}
set
{
m_fComplete = value;
}
}
private String FormatDateString(String strDate)
{
String strReturn;
try
{
strReturn = Convert.ToDateTime(strDate).ToString("MM/dd/yyyy");
}
catch
{
strReturn = strDate;
}
return strReturn;
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.