protected void Page_Load(object sender, EventArgs e) { // SqlDataSource1.ConnectionString = Sigleton.Conexao.MsSQL.Strcnx; // getDados(); if (!IsPostBack) { daoFuncao = new DAOFuncao(); ddMes.DataSource = Solucon.DataHora.DataLib.Months(1,12); ddMes.DataValueField = "Num"; ddMes.DataTextField = "Name"; ddMes.DataBind(); ddAno.DataSource = Solucon.DataHora.DataLib.Years(2008,2009); ddAno.DataBind(); ddMes.SelectedValue = DateTime.Now.Month.ToString(); ddAno.SelectedValue = DateTime.Now.Year.ToString(); txbMatricula.Text = ""; txbNome.Text = ""; ddFuncao.DataSource = daoFuncao.listar(); ddFuncao.DataBind(); Solucon.WebControls.WebFormat.addItemDefault(ddFuncao, new ListItem("Todas", "0", true)); Solucon.RadControls.RadFormat.formatarGrid(RadGrid1); lstfuncCotaMens = new List<Funcionario>(); Session["selectFuncCotaMens"] = lstfuncCotaMens; } }
private void carregaListaFuncao() { if (ddFuncao.SelectedValue != "0") { ddFuncao.Items.Clear(); daoFuncao = new DAOFuncao(); ddFuncao.DataSource = daoFuncao.listar(); ddFuncao.DataBind(); /************ Item vazio *****************/ ddFuncao.Items.Add(new ListItem("Selecione", "0", true)); ddFuncao.Items.FindByValue("0").Selected = true; ddFuncao.Enabled = true; /*****************************************/ } else { ddFuncao.Items.Clear(); ddFuncao.Enabled = false; } }