protected void tbGuardar_Click(object sender, EventArgs e)
        {
            GuiaBusiness guiaBusiness = new GuiaBusiness(WebConfigurationManager.ConnectionStrings["GestionAmbiental"].ConnectionString);
            Guia         guia         = new Guia();

            guia.NombreGuia     = tbNombreGuia.Text;
            guia.AnioAprobacion = Int32.Parse(tbAnio.Text);
            guia.Vigente        = true;

            if (lbAreasTematicas.Items.Count > 0)
            {
                for (int i = 0; i < lbAreasTematicas.Items.Count; i++)
                {
                    AreaTematica areaTematica = new AreaTematica();

                    areaTematica.CodArea        = 0;
                    areaTematica.NombreTematica = lbAreasTematicas.Items[i].Text;

                    areaTematica.Funcionario.CodFuncionario = 1;
                    guia.ListaAreasTematicas.AddLast(areaTematica);
                }

                guiaBusiness.IngresarGuiaAmbiental(guia, codFuncionario);

                Response.Redirect("~/EncargadosTematicas.aspx?codGuia=" + guia.CodGuia);
            }
        }
Ejemplo n.º 2
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            GuiaBusiness guiaBusiness = new GuiaBusiness(WebConfigurationManager.ConnectionStrings["PRA_DFGKP"].ConnectionString);

            guiaBusiness.IngresarGuiaAmbiental(Int32.Parse(TX_anoPublicacion.Text), Convert.ToDateTime(TX_anno.Text + "-" + TX_mes.Text + "-" + TX_dia.Text), TX_nombreGuia.Text);
        }