protected void SaveCultures() { if (EditedBadWord == null) { return; } // Remove old items string newValues = ValidationHelper.GetString(usWordCultures.Value, null); string currentValues = GetCurrentValues(); string items = DataHelper.GetNewItemsInList(newValues, currentValues); if (!String.IsNullOrEmpty(items)) { string[] newItems = items.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries); // Add all new cultures to word foreach (string item in newItems) { int cultureId = ValidationHelper.GetInteger(item, 0); BadWordCultureInfoProvider.RemoveBadWordFromCulture(EditedBadWord.WordID, cultureId); } } // Add new items items = DataHelper.GetNewItemsInList(currentValues, newValues); if (!String.IsNullOrEmpty(items)) { string[] newItems = items.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries); // Add all new cultures to word foreach (string item in newItems) { int cultureId = ValidationHelper.GetInteger(item, 0); BadWordCultureInfoProvider.AddBadWordToCulture(EditedBadWord.WordID, cultureId); } } ShowChangesSaved(); }
protected void SaveCultures() { // Remove old items string newValues = ValidationHelper.GetString(usWordCultures.Value, null); string currentValues = GetCurrentValues(); string items = DataHelper.GetNewItemsInList(newValues, currentValues); if (!String.IsNullOrEmpty(items)) { string[] newItems = items.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries); if (newItems != null) { // Add all new cultures to word foreach (string item in newItems) { int cultureId = ValidationHelper.GetInteger(item, 0); BadWordCultureInfoProvider.RemoveBadWordFromCulture(badWordId, cultureId); } } } // Add new items items = DataHelper.GetNewItemsInList(currentValues, newValues); if (!String.IsNullOrEmpty(items)) { string[] newItems = items.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries); if (newItems != null) { // Add all new cultures to word foreach (string item in newItems) { int cultureId = ValidationHelper.GetInteger(item, 0); BadWordCultureInfoProvider.AddBadWordToCulture(badWordId, cultureId); } } } lblInfo.Visible = true; lblInfo.Text = GetString("General.ChangesSaved"); }