Esempio n. 1
0
        private void SaveScreen()
        {
            if (NewRecord == true || HasRaceDataChanged == true)
            {
                ModelofRace.Save();
            }

            for (int i = 0; i < Constant.NumHeroicLevels; i++)
            {
                if (NewRecord == true || HasRaceDetailsChanged[i] == true)
                {
                    if (ModelofRaceDetail[i].RaceId == Guid.Empty)
                    {
                        ModelofRaceDetail[i].RaceId = ModelofRace.Id;
                    }
                    ModelofRaceDetail[i].Save();
                }
            }
            //if we are dealing with a new record we need to send the new id to the autograntedfeat form so it
            //will update the records properly.
            if (NewRecord == true)
            {
                autoGrantedFeatsPanel1.UpdateMainRecordId(ModelofRace.Id);
            }
            if (autoGrantedFeatsPanel1.HasAutoGrantedFeatsChanged() == true)
            {
                autoGrantedFeatsPanel1.SaveAutoGrantedFeats();
            }

            //cache the name and abbreviation strings for later comparisons
            // (we have now updated the databse, so update these as well)
            DatabaseName         = ModelofRace.Name;
            DatabaseAbbreviation = ModelofRace.Abbreviation;
        }