/// <summary> /// Temporary method to strip our current feat Description of the HTML tags that are no longer needed. /// </summary> public static void FixFeatDescriptions() { int count; FeatModel model; List <string> featNames; string newDescription; featNames = FeatModel.GetNames(); count = featNames.Count(); //count = 1; for (int i = 0; i < count; i++) { model = new FeatModel(); model.Initialize(featNames[i]); if (model.Description != null) { newDescription = StripHTMLfromOldDescriptions(model.Description); model.Description = newDescription; model.Save(); } } }
private void SaveRecord() { if (NewRecord == true || RecordChanged == true) { Model.Save(); } //lets update the feattypes that need updating foreach (FeatTypeSelection selection in FeatTypesSelected) { //See if we need to delete a record if (selection.DeleteRecord == true && selection.Model.Id != Guid.Empty) { selection.Model.Delete(); } //see if we need to add a record if (selection.DeleteRecord == false && selection.Model.Id == Guid.Empty) { selection.Model.FeatId = Model.Id; selection.Model.Save(); } } //lets update the Feat Targets that need updating foreach (FeatTargetSelection selection in FeatTargetsSelected) { //see if we need to delete a record if (selection.DeleteRecord == true && selection.Model.Id != Guid.Empty) { selection.Model.Delete(); } //see if we need to add a record if (selection.DeleteRecord == false && selection.Model.Id == Guid.Empty) { selection.Model.FeatId = Model.Id; selection.Model.Save(); } } //See if we need save records for Requirements Panels if (NewRecord == true) { FeatRequirementsRP2.RecordId = Model.Id; } if (FeatRequirementsRP2.HaveRecordsChanged() == true) { FeatRequirementsRP2.SaveRecords(); } //See if we need to save records for the Modifiers panel if (NewRecord == true) { MP2Modifiers.RecordId = Model.Id; } if (MP2Modifiers.HaveRecordsChanged() == true) { MP2Modifiers.SaveRecords(); } //cache the name strings for later comparison since we have updated the database DatabaseName = Model.Name; }