private void TryUpdatingExpandLockOnParent(WorkItem item)
{
var parent = WorkflowRepository.GetWorkItem(item.Parent.Id);
if (WorkflowRepository.GetChildWorkItems(item.Parent).All(WorkflowRepository.IsDone))
{
parent = parent.UpdateStatus(WorkItemStatus.Normal);
}
else
{
parent = parent.UpdateStatus(WorkItemStatus.ExpandLocked);
}
WorkflowRepository.UpdateWorkItem(parent);
}