private void button6_Click(object sender, EventArgs e) { DateTime seasonStart = dtSeasonStart.Value; DateTime seasonEnd = dtSeasonEnd.Value; DataSet ds_season = broker.ReturnSeasonSettings(); int rowCount = ds_season.Tables[0].Rows.Count; int result = 0; if (rowCount == 1) { result = broker.UpdateSeasonSettings(seasonStart, seasonEnd); } else { result = broker.AddSeasonSettings(seasonStart, seasonEnd); } if (result != 13) { MessageBox.Show("New season settings saved!"); } else { MessageBox.Show("Error while saving settings! ", "ERROR!", MessageBoxButtons.OK, MessageBoxIcon.Error); } RefreshSeasonSettings(); }