public void atualizaSecao() { funcCota = new Funcionario(); daoCota_Mensal = new DAOCota_mensal(); funcCota.Matricula = txbMatricula.Text; funcCota.Nome = txbNome.Text; funcCota.ID = Int32.Parse(ddFuncao.SelectedValue); Session["lstFuncCotaMens"] = daoCota_Mensal.listFuncCota(funcCota, Int16.Parse(ddMes.SelectedValue), Int16.Parse(ddAno.SelectedValue)); (Session["selectFuncCotaMens"] as List <Funcionario>).Clear(); }
protected void ibtGravar_Click(object sender, ImageClickEventArgs e) { List <Funcionario> lstfuncCotaMens = (Session["selectFuncCotaMens"] as List <Funcionario>); DAOCota_mensal daoCota_mensal = new DAOCota_mensal(); Cota_mensal cota_Mensal = new Cota_mensal(); foreach (Funcionario func in lstfuncCotaMens) { cota_Mensal.novo(); cota_Mensal.Funcionario.ID = func.ID; cota_Mensal.Qtde = Convert.ToInt32(txbQuantidade.Value); cota_Mensal.Mes = Int32.Parse(Session["mes"].ToString()); cota_Mensal.Ano = Int32.Parse(Session["ano"].ToString()); daoCota_mensal.aplicar(cota_Mensal); } Session.Remove("selectFuncCotaMens"); Session.Remove("mes"); Session.Remove("ano"); Response.Redirect("principal.aspx"); }