Exemple #1
0
    protected void btnGuardar_Click(object sender, EventArgs e)
    {
        try
        {
            int    resIdConv = -1;
            string keyIdConv = null;

            if (Session["idConvPaga"] != null)
            {
                keyIdConv = Session["idConvPaga"].ToString();
            }

            if (Session["idPaga"] != null)
            {
                resIdConv = AdministrarPagadurias.RegistrarConvenio(keyIdConv, Session["idPaga"].ToString(), txtConvCodigo.Text,
                                                                    txtConvNombre.Text, txtConvRespAprob.Text, txtFecAprob.Text, ddlPeriodicidad.SelectedValue, txtObservaciones.Text,
                                                                    ddlEstado.SelectedValue);


                if (resIdConv >= 0)
                {
                    Session["idConvPaga"] = resIdConv;
                    //MensajeForm("Convenio almacenado correctamente.", "ConveniosPagaduria.aspx");
                    MensajeForm("Convenio almacenado correctamente.", "~/gestion/pagadurias/convenios");
                }
                else
                {
                    MensajeForm("No se ha podido registrar el Convenio. Por favor intentelo nuevamente", null);
                }
            }
            else
            {
                MensajeForm("No se ha podido identificar la pagaduria sobre la cual se quiere registrar el convenio. Por favor intentelo nuevamente",
                            "~/gestion/pagadurias/");
            }
        }
        catch (Exception ex)
        {
            MensajeForm("Ha ocurrido un problema con su petición", null);
        }
    }