Example #1
0
        protected void gvParametros_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName.Equals("AGREGAR"))
            {
                Parametro p = new Parametro();
                TextBox   txtNombreParametro = (TextBox)gvParametros.FooterRow.FindControl("txNombreParametro");
                TextBox   txtValorN          = (TextBox)gvParametros.FooterRow.FindControl("txValorNumero");
                TextBox   txtValorC          = (TextBox)gvParametros.FooterRow.FindControl("txValorCaracter");

                String Resultado = p.GuardarNuevo(txtNombreParametro.Text.ToUpper(), txtValorN.Text, txtValorC.Text.ToUpper());

                gvParametros.DataSource = main.Parametros.Catalogo();
                gvParametros.DataBind();
                if (Resultado.Equals("OK"))
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Datos agregados Correctamente')", true);
                }
            }
        }