private void NewCriteriaMenuItem_Click(object sender, EventArgs e)
{
// Make sure an award is selected!!!!
if (SelectedAwardNode == null || SelectedAwardNode.Parent == null)
{
MessageBox.Show("Please select an award!");
return;
}
// Is this the root criteria node?
TreeNode Node = AwardConditionsTree.SelectedNode;
if (Node == null)
{
Child = new NewCriteriaForm();
}
// If plus or div, open edit form
else if (Node.Tag is ConditionList)
{
ConditionList List = Node.Tag as ConditionList;
if (List.Type == ConditionType.Plus || List.Type == ConditionType.Div)
Child = new ConditionListForm(Node);
else
Child = new NewCriteriaForm();
}
// Base Condition
else
{
Child = new NewCriteriaForm();
}
// Show child form
Child.FormClosing += NewCriteria_Closing;
Child.Show();
}