private void EditPodcast_Click(object sender, EventArgs e) { String title = textBoxName.Text; String url = textBoxUrl.Text; String category = textBoxCat.Text; if (textBoxCat.Text == "") { category = "0"; } int i = Convert.ToInt32(numericUpDownFrekvens.Value); int v = 0; String[] arrayOfText = { title, url, category }; Podcast p = (Podcast)comboBoxPodcast.SelectedValue; XmlGenerator xmlG = new XmlGenerator(); Validator val = new Validator(); foreach (String s in arrayOfText) { if (val.ValidateTextBoxNotEmpty(s) == true) { v++; } } if (v == 3) { xmlG.EditValuePodcast(p, title, category, url); MessageBox.Show("Sucsess Title=" + title + " Category=" + category + " Url=" + url + " Intervall=" + i); } else { MessageBox.Show("Saknar värde i något av fälten."); } refreshData(); }