public DataTable insertarpqr(E_PQR user) { DataTable pqr = new DataTable(); NpgsqlConnection conectar = new NpgsqlConnection(ConfigurationManager.ConnectionStrings["Postgres"].ConnectionString); try { NpgsqlDataAdapter dataAdapter = new NpgsqlDataAdapter("seguridad.agregar_pqr", conectar); dataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure; dataAdapter.SelectCommand.Parameters.Add("_correo", NpgsqlDbType.Varchar).Value = user.Correo; dataAdapter.SelectCommand.Parameters.Add("_queja", NpgsqlDbType.Varchar).Value = user.Queja; ; conectar.Open(); dataAdapter.Fill(pqr); } catch (Exception Ex) { throw Ex; } finally { if (conectar != null) { conectar.Close(); } } return(pqr); }
protected void B_PQR_Click(object sender, EventArgs e) { ClientScriptManager cm = this.ClientScript; E_PQR nuevo = new E_PQR(); Dao_PQR pqr = new Dao_PQR(); nuevo.Correo = TB_correo.Text; nuevo.Queja = TB_queja.Text; pqr.insertarpqr(nuevo); cm.RegisterClientScriptBlock(this.GetType(), "", "<script type='text/javascript'>alert('PQR recibido,en breve responderemos tu Pqr al correo ');window.location=\"PQR_cliente.aspx\"</script>"); }