private void SaveTree()
        {
            if (NewRecord == true || RecordChanged == true)
            {
                TreeModel.Save();

                //Lets update the Sub Tables next (EnhancementSlot Records)
                for (int i = 0; i < SlotChanged.Count; i++)
                {
                    if (SlotDeleted[i] == true)
                    {
                        if (SlotModels[i].Id != Guid.Empty)
                        {
                            SlotModels[i].Delete();
                            SlotChanged[i] = false;
                        }
                    }
                    if (SlotChanged[i] == true)
                    {
                        SlotModels[i].EnhancementTreeId = TreeModel.Id;
                        SlotModels[i].SlotIndex         = i;
                        SlotModels[i].Save();
                    }
                }
            }
            //Lets see if we need to update EnhancementTreeRequirement records
            if (TreeRP2.HaveRecordsChanged() == true)
            {
                TreeRP2.RecordId = TreeModel.Id;
                TreeRP2.SaveRecords();
            }

            //cache the TreeName String for later comparison since we have updated the database
            DatabaseName = TreeModel.Name;
        }
        private bool HasDataChanged()
        {
            if (NewRecord == true)
            {
                return(true);
            }

            if (RecordChanged == true)
            {
                return(true);
            }

            if (TreeRP2.HaveRecordsChanged() == true)
            {
                return(true);
            }

            //no data has changed, so return false
            return(false);
        }