private void OnStatusIdChanged()
{
if (this.StatusId == 0)
{
this.IsCompleted = false;
this.StatusName = string.Empty;
this.StartDate = DateTime.MaxValue.Date;
this.CompletedDate = DateTime.MaxValue.Date;
return;
}
var status = Status.FetchStatus(new StatusDataCriteria { StatusId = this.StatusId });
this.StatusName = status.Name;
if (status.IsStarted)
{
this.CompletedDate = DateTime.MaxValue.Date;
if (this.StartDate == DateTime.MaxValue.Date)
{
this.StartDate = DateTime.Now.Date;
}
}
else if (status.IsCompleted)
{
this.CompletedDate = DateTime.MaxValue.Date;
}
else
{
this.StartDate = DateTime.MaxValue.Date;
this.CompletedDate = DateTime.MaxValue.Date;
}
}