public void ValorarLibro(string IDUser, string IDLibro, string IDPago, string Valor) { LibrosDAO DAOLibros = new LibrosDAO(); DataTable dt = new DataTable(); string outputJSON; int value = 0; try { DAOLibros.UpdRantingLibros(int.Parse(IDPago), int.Parse(IDUser), int.Parse(IDLibro), int.Parse(Valor)); //string test = serializer.Serialize(rows); value = 1; } catch (Exception) { value = 0; } JsonResult OBJson = new JsonResult { Result = value }; outputJSON = ser.Serialize(OBJson); Context.Response.Write(ser.Serialize(OBJson)); }
private void RatingLibros(int Numero) { LibrosDAO Rating = new LibrosDAO(); cart1 = (String[])Session["ALL"]; ID = int.Parse(cart1[5]); Rating.UpdRantingLibros(int.Parse(IDPago.Text), ID, int.Parse(IdLibro.Text), Numero); ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "Rating();", true); Response.Redirect("~/Forms/MisCompras.aspx"); }