예제 #1
0
 public static void ModificarConvenio(CONVENIO convenioModificado)
 {
     try
     {
         ///Modifica el convenio especifico
         ConvenioModelo.ModificarConvenio(convenioModificado);
     }
     catch (Exception ex)
     {
         throw new Exception("Hubo un error en la capa del Modelo: " + ex.Message.ToString());
     }
 }
예제 #2
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            bool   pubbit     = rbtnSiMedio.Checked;
            bool   propInt    = rbtnSiPropInt.Checked;
            bool   ods        = rbtnSiODS.Checked;
            int?   natmod     = null;
            int?   becmod     = null;
            int    rec        = 2;
            int    tipoconv   = 2;
            int    tipo2      = 2;
            int    sector     = 1;
            int    actecon    = 3;
            int    acteconnum = 0;
            int    ambito     = 2;
            int?   odsselect;
            String eje   = "";
            float? monto = null;

            ///Tipo de modalidad
            if (rbtnPresencial.Checked == true)
            {
                natmod = Convert.ToInt32(rbtnPresencial.Value);
            }
            else if (rbtnVirtual.Checked == true)
            {
                natmod = Convert.ToInt32(rbtnVirtual.Value);
            }
            else if (rbtnMixta.Checked == true)
            {
                natmod = Convert.ToInt32(rbtnMixta.Value);
            }
            ///tipo modalidad beca
            if (rbtnPresencialBecas.Checked == true)
            {
                becmod = Convert.ToInt32(rbtnPresencialBecas.Value);
            }
            else if (rbtnVirtualBecas.Checked == true)
            {
                becmod = Convert.ToInt32(rbtnVirtualBecas.Value);
            }
            else if (rbtnMixtaBecas.Checked == true)
            {
                becmod = Convert.ToInt32(rbtnMixtaBecas.Value);
            }
            ///tipo de recurso
            if (rbtnFinancieros.Checked == true)
            {
                rec = Convert.ToInt32(rbtnFinancieros.Value);
            }
            else if (rbtnHumanos.Checked == true)
            {
                rec = Convert.ToInt32(rbtnHumanos.Value);
            }
            else if (rbtnInfraestructura.Checked == true)
            {
                rec = Convert.ToInt32(rbtnInfraestructura.Value);
            }
            else if (rbtnEquipo.Checked == true)
            {
                rec = Convert.ToInt32(rbtnEquipo.Value);
            }
            else if (rbtnTecnologicos.Checked == true)
            {
                rec = Convert.ToInt32(rbtnTecnologicos.Value);
            }
            ///revisar si hay monto
            if (txtMonto.Text.Length != 0)
            {
                monto = float.Parse(txtMonto.Text);
            }
            //revisar tipo convenio
            if (rbtnBilateral.Checked == true)
            {
                tipoconv = Convert.ToInt32(rbtnBilateral.Value);
            }
            else if (rbtnMultilateral.Checked == true)
            {
                tipoconv = Convert.ToInt32(rbtnMultilateral.Value);
            }
            if (rbtnMarco.Checked == true)
            {
                tipo2 = Convert.ToInt32(rbtnMarco.Value);
            }
            else if (rbtnEspecifico.Checked == true)
            {
                tipo2 = Convert.ToInt32(rbtnEspecifico.Value);
            }
            ///sector
            if (rbtnPublico.Checked == true)
            {
                sector = Convert.ToInt32(rbtnPublico.Value);
            }
            else if (rbtnPrivado.Checked == true)
            {
                sector = Convert.ToInt32(rbtnPrivado.Value);
            }
            else if (rbtnSocial.Checked == true)
            {
                sector = Convert.ToInt32(rbtnSocial.Value);
            }
            ///act econ
            if (rbtnPrimaria.Checked == true)
            {
                actecon    = Convert.ToInt32(rbtnPrimaria.Value);
                acteconnum = Convert.ToInt32(primariaDDL.SelectedValue);
            }
            else if (rbtnSecundaria.Checked == true)
            {
                actecon    = Convert.ToInt32(rbtnSecundaria.Value);
                acteconnum = Convert.ToInt32(secundariaDDL.SelectedValue);
            }
            else if (rbtnTerciaria.Checked == true)
            {
                actecon    = Convert.ToInt32(rbtnTerciaria.Value);
                acteconnum = Convert.ToInt32(terciariaDDL.SelectedValue);
            }
            ///ambito
            if (rbtnMunicipal.Checked == true)
            {
                ambito = Convert.ToInt32(rbtnMunicipal.Value);
            }
            else if (rbtnEstatal.Checked == true)
            {
                ambito = Convert.ToInt32(rbtnEstatal.Value);
            }
            else if (rbtnRegional.Checked == true)
            {
                ambito = Convert.ToInt32(rbtnRegional.Value);
            }
            else if (rbtnNacional.Checked == true)
            {
                ambito = Convert.ToInt32(rbtnNacional.Value);
            }
            else if (rbtnInternacional.Checked == true)
            {
                ambito = Convert.ToInt32(rbtnInternacional.Value);
            }
            ///eje
            if (cbxEducacion.Checked == true)
            {
                eje = cbxEducacion.Value + "_";
            }
            if (cbxCiencia.Checked == true)
            {
                eje = cbxCiencia.Value + "_";
            }
            if (cbxDesarrollo.Checked == true)
            {
                eje = eje + cbxDesarrollo.Value + "_";
            }
            if (cbxCultura.Checked == true)
            {
                eje = eje + cbxCultura.Value + "_";
            }
            if (cbxDeporte.Checked == true)
            {
                eje = eje + cbxDeporte.Value + "_";
            }
            if (cbxOtro.Checked == true)
            {
                eje = eje + txtOtro.Text.ToUpper() + "_";
            }
            ///ods
            if (ods == false)
            {
                odsselect = null;
            }
            else
            {
                odsselect = Convert.ToInt32(odsDDL.SelectedValue);
            }
            ///modificar
            try
            {
                var      numCon             = Convert.ToInt32(Request.QueryString["NUM"]);
                CONVENIO convenioModificado = ConvenioModelo.BuscarConvenioPorNumero(numCon);
                convenioModificado.nombreInstrumento   = NomJurDDL.SelectedValue.ToString();
                convenioModificado.publicadoActivo     = pubbit;
                convenioModificado.publicadoDonde      = txtMedio.Text.ToUpper();
                convenioModificado.objetivoInstrumento = ObjJurDDL.SelectedValue;
                convenioModificado.idNaturaleza        = Convert.ToInt32(NaturalezaDDL.SelectedValue);
                convenioModificado.naturalezaModalidad = natmod;
                convenioModificado.becas                  = txtBecas.Text.ToUpper();
                convenioModificado.movilidad              = becmod;
                convenioModificado.prestacionServicio     = txtPrestacion.Text.ToUpper();
                convenioModificado.donacion               = txtDonacion.Text.ToUpper();
                convenioModificado.comodato               = txtComodato.Text.ToUpper();
                convenioModificado.educacionContinua      = txtEducacion.Text.ToUpper();
                convenioModificado.nombreRepITH           = txtNombreRepITH.Text.ToUpper();
                convenioModificado.nombreInstitucion      = txtNombreInstitucion.Text.ToUpper();
                convenioModificado.nombreRepInstitucion   = txtNombreRepInstitucion.Text.ToUpper();
                convenioModificado.cargoRepInstitucion    = txtCargoRepInstitucion.Text.ToUpper();
                convenioModificado.idRecursos             = rec;
                convenioModificado.montoRecursoFinanciero = monto;
                convenioModificado.propiedadIntelActivo   = propInt;
                convenioModificado.propiedadIntelDonde    = txtPropiedadInt.Text.ToUpper();
                convenioModificado.entregable             = txtEntregables.Text.ToUpper();
                convenioModificado.idTipoConvenio         = tipoconv;
                convenioModificado.idTipoConvenioEsp      = tipo2;
                convenioModificado.idSector               = sector;
                convenioModificado.idActEcon              = actecon;
                convenioModificado.cantidadActEcon        = acteconnum;
                convenioModificado.idAmbito               = ambito;
                convenioModificado.eje       = eje;
                convenioModificado.ODSActivo = ods;
                convenioModificado.idODS     = odsselect;
                ConvenioModelo.ModificarConvenio(convenioModificado);
                mensaje.Visible = true;
                string javaScript = "OcultarMensaje();";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "script", javaScript, true);
                Response.Redirect("Convenio.aspx");
            }
            catch (Exception ex)
            {
                var datos = "<script> alert('" + ex.Message + "') </script>";
            }
        }