/// <summary> /// Adding a new Criteria /// </summary> 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(); }
/// <summary> /// New Criteria menu item click /// </summary> private void NewCriteria_Click(object sender, EventArgs e) { if (List.Type == ConditionType.Plus || List.Type == ConditionType.Div) { if (ConditionTree.Nodes[0].Nodes.Count > 1) { MessageBox.Show("Only 2 criteria's allowed per List."); return; } } else if (List.Type == ConditionType.Not) { if (ConditionTree.Nodes[0].Nodes.Count == 2) { MessageBox.Show("Only 1 criteria allowed per List."); return; } } // Make sure we are only adding to the root condition list Child = new NewCriteriaForm(); Child.FormClosing += Child_FormClosing; Child.Show(); }
/// <summary> /// New Criteria menu item click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void NewCriteria_Click(object sender, EventArgs e) { if (List.Type == ConditionType.Plus || List.Type == ConditionType.Div) { if (ConditionTree.Nodes[0].Nodes.Count > 1) { MessageBox.Show("Only 2 criteria's allowed per List."); return; } } else if (List.Type == ConditionType.Not) { if (ConditionTree.Nodes[0].Nodes.Count == 2) { MessageBox.Show("Only 1 criteria allowed per List."); return; } } // Make sure we are only adding to the root condition list Child = new NewCriteriaForm(); Child.FormClosing += new FormClosingEventHandler(Child_FormClosing); Child.Show(); }