protected void ddlMesPeriodo_TextChanged(object sender, EventArgs e) { IVentas bdd = new BusinessLogic(); ListItem selectedItem = ddlMesPeriodo.SelectedItem; if (!string.IsNullOrEmpty(selectedItem.Value)) { int mes = int.Parse(selectedItem.Value); int year = int.Parse(selectedItem.Text.Split('-').Where(val => !string.IsNullOrEmpty(val)).ToArray()[1]); Session.Add("MesSelected", mes); Session.Add("AñoSelected", year); if (bdd.VentasAprobadas(CalculaFechaPeriodo(mes,year))) { ShowError("El ciclo esta cerrado", true); BlockControls(false,false); } else { lblError.Visible = false; } } }