コード例 #1
0
ファイル: View_Scoring.cs プロジェクト: wshanshan/DDD
        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;
        }
コード例 #2
0
ファイル: CntP_Scoring.cs プロジェクト: wshanshan/DDD
        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;

            }
        }