public void cbPeriodChange(object sender, EventArgs e) { int itemIndex = cmbPeriod.SelectedIndex; if (itemIndex != 0) { if (itemIndex != 1) { if (itemIndex == 2) { fSession = -1; txtSession.Text = ""; } } else { fSession = -1; txtSession.Text = ""; } } else { fSession = PIBUtils.GetSession(DateTimePicker1.Value); txtSession.Text = Convert.ToString(fSession); } RefreshTrends(); }