private EnhancementSlotModel GetSlotModel(Guid requirementId)
        {
            EnhancementSlotModel slotModel;
            EnhancementModel     enhModel;
            RequirementModel     reqModel;
            string tableName = "";

            slotModel = new EnhancementSlotModel();
            reqModel  = GetRequirementModel(requirementId);
            //tableName = TableNamesModel.GetNameFromId(reqModel.Id);
            tableName = TableNamesModel.GetTableNameFromId(reqModel.TableNamesId);

            if (tableName == "EnhancementSlot")
            {
                slotModel.Initialize(reqModel.ApplytoId);
            }

            if (tableName == "Enhancement")
            {
                enhModel = new EnhancementModel();
                enhModel.Initialize(reqModel.ApplytoId);
                slotModel.Initialize(enhModel.EnhancementSlotId);
            }

            return(slotModel);
        }
        private string GetTreeName(Guid requirementId)
        {
            string               treeName = "";
            RequirementModel     reqModel;
            string               tableName = "";
            EnhancementSlotModel slotModel;
            EnhancementModel     enhModel;

            reqModel  = GetRequirementModel(requirementId);
            tableName = TableNamesModel.GetTableNameFromId(reqModel.TableNamesId);
            slotModel = new EnhancementSlotModel();

            if (tableName == "EnhancementSlot")
            {
                slotModel.Initialize(reqModel.ApplytoId);
                treeName = EnhancementTreeModel.GetNameFromId(slotModel.EnhancementTreeId);
            }

            if (tableName == "Enhancement")
            {
                enhModel = new EnhancementModel();
                enhModel.Initialize(reqModel.ApplytoId);
                slotModel.Initialize(enhModel.EnhancementSlotId);
                treeName = EnhancementTreeModel.GetNameFromId(slotModel.EnhancementTreeId);
            }

            return(treeName);
        }
        private string GetApplyToName(Guid requirementId)
        {
            string           applyToName;
            string           tableName;
            RequirementModel reqModel;
            EnhancementModel enhancementModel;

            reqModel = GetRequirementModel(requirementId);
            //tableName = "Class";

            tableName = TableNamesModel.GetTableNameFromId(reqModel.TableNamesId);

            if (tableName == "Ability")
            {
                applyToName = AbilityModel.GetNameFromId(reqModel.ApplytoId);
            }
            else if (tableName == "Alignments")
            {
                applyToName = AlignmentModel.GetNameFromID(reqModel.ApplytoId);
            }
            else if (tableName == "Attribute")
            {
                applyToName = AttributeModel.GetNameFromId(reqModel.ApplytoId);
            }
            else if (tableName == "Character")
            {
                applyToName = "Level";
            }
            else if (tableName == "Class")
            {
                applyToName = ClassModel.GetNameFromId(reqModel.ApplytoId);
            }
            else if (tableName == "Enhancement")
            {
                //"Pos " + model.DisplayOrder.ToString() + ":: " + model.Name)
                enhancementModel = new EnhancementModel();
                enhancementModel.Initialize(reqModel.ApplytoId);
                applyToName = "Pos " + enhancementModel.DisplayOrder + ":: " + enhancementModel.Name;
            }
            else if (tableName == "EnhancementSlot")
            {
                applyToName = BuildSlotName(GetSlotModel(requirementId));
            }
            else if (tableName == "Feat")
            {
                applyToName = FeatModel.GetNameFromId(reqModel.ApplytoId);
            }
            else if (tableName == "Race")
            {
                applyToName = RaceModel.GetNameFromId(reqModel.ApplytoId);
            }
            else if (tableName == "Skill")
            {
                applyToName = SkillModel.GetNameFromId(reqModel.ApplytoId);
            }
            else
            {
                applyToName = "";
            }
            Debug.WriteLine("ApplyToName = " + applyToName);
            return(applyToName);
        }