public bool NameInUse(Scoring_NodeTypes type, string name) { switch (type) { //case Scoring_NodeTypes.Actors: // foreach (ActorDataStruct s1 in _ActorList) // { // if (s1.ID == name) // { // MessageBox.Show(string.Format("An object with ID ({0}) already exists within this subtree. Please choose another ID.", name), "Cannot complete update."); // return true; // } // } // break; //case Scoring_NodeTypes.Location: // foreach (LocationDataStruct s1 in _LocationList) // { // if (s1.ID == name) // { // MessageBox.Show(string.Format("An object with ID ({0}) already exists within this subtree. Please choose another ID.", name), "Cannot complete update."); // return true; // } // } // break; case Scoring_NodeTypes.Scoring_Rule: foreach (ScoringRuleDataStruct s1 in _ScoringRuleList) { if (s1.ID == name) { MessageBox.Show(string.Format("An object with ID ({0}) already exists within this subtree. Please choose another ID.", name), "Cannot complete update."); return true; } } break; //case Scoring_NodeTypes.Existence_Rule: // foreach (ExistenceRuleDataStruct s1 in _ExistenceRuleList) // { // if (s1.ID == name) // { // MessageBox.Show(string.Format("An object with ID ({0}) already exists within this subtree. Please choose another ID.", name), "Cannot complete update."); // return true; // } // } // break; case Scoring_NodeTypes.Score: foreach (ScoreDataStruct s1 in _ScoreList) { if (s1.ID == name) { MessageBox.Show(string.Format("An object with ID ({0}) already exists within this subtree. Please choose another ID.", name), "Cannot complete update."); return true; } } break; } return false; }
public void ShowPanel(Scoring_NodeTypes type) { switch (type) { //case Scoring_NodeTypes.Actors: // if (_selected_control != ctl_Actor1) // { // if (_selected_control != null) // { // _selected_control.Hide(); // } // _selected_control = ctl_Actor1; // _selected_control.Show(); // } // break; //case Scoring_NodeTypes.Location: // if (_selected_control != ctl_Location1) // { // if (_selected_control != null) // { // _selected_control.Hide(); // } // _selected_control = ctl_Location1; // _selected_control.Show(); // } // break; case Scoring_NodeTypes.Scoring_Rule: if (_selected_control != ctl_ScoringRule1) { if (_selected_control != null) { _selected_control.Hide(); } _selected_control = ctl_ScoringRule1; _selected_control.Show(); } break; //case Scoring_NodeTypes.Existence_Rule: // if (_selected_control != ctl_ExistenceRule1) // { // if (_selected_control != null) // { // _selected_control.Hide(); // } // _selected_control = ctl_ExistenceRule1; // _selected_control.Show(); // } // break; case Scoring_NodeTypes.Score: if (_selected_control != ctl_Score1) { if (_selected_control != null) { _selected_control.Hide(); } _selected_control = ctl_Score1; _selected_control.Show(); } break; } }