Exemple #1
0
        public void cargarGrilla()
        {
            n_Review n_review = new n_Review();

            gvReviews.DataSource = n_review.getTabla();
            gvReviews.DataBind();
        }
Exemple #2
0
        public void cargarListReview(int cod)
        {
            n_Review n_review = new n_Review();

            lvReview.DataSource = n_review.getTablaReviewJuego(cod);
            lvReview.DataBind();
        }
Exemple #3
0
        public Review_Juego armarReviewJuego()
        {
            Review_Juego review_juego = new Review_Juego();
            n_Review     n_review     = new n_Review();
            Review       review       = new Review();

            String id = Request.QueryString["cod"];

            review = n_review.ObtenerUltimoReview();

            review_juego.cod_juego   = int.Parse(id);
            review_juego.cod_usuario = Session["UsuarioLogeado"].ToString();
            review_juego.cod_review  = review.cod_review;

            return(review_juego);
        }
Exemple #4
0
        protected void gvReviews_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            String s_detalle = ((TextBox)gvReviews.Rows[e.RowIndex].FindControl("txtDetalle_edit")).Text;
            String s_fecha   = ((TextBox)gvReviews.Rows[e.RowIndex].FindControl("txtFecha_edit")).Text;
            String s_cod     = ((Label)gvReviews.Rows[e.RowIndex].FindControl("lblCod")).Text;

            Review review = new Review();

            review.cod_review   = int.Parse(s_cod);
            review.fecha_review = DateTime.Parse(s_fecha);
            review.detalle      = s_detalle;
            review.estado       = true;

            n_Review n_review = new n_Review();

            n_review.editarReview(review);

            gvReviews.EditIndex = -1;
            cargarGrilla();
        }
Exemple #5
0
        protected void btnPublicar_Click(object sender, EventArgs e)
        {
            n_Review      n_review      = new n_Review();
            Review        review        = new Review();
            n_ReviewJuego n_reviewJuego = new n_ReviewJuego();
            Review_Juego  review_juego  = new Review_Juego();

            review = armarReview();

            if (!existeReview())
            {
                n_review.insertarReview(review);

                review_juego = armarReviewJuego();
                if (n_reviewJuego.InsertarReviewJuego(review_juego))
                {
                    lblEstadoReview.Text      = "Exito al publicar el review";
                    lblEstadoReview.ForeColor = System.Drawing.Color.Green;
                    txtReview.Text            = "";
                    Response.AppendHeader("Refresh", "3");
                }
                else
                {
                    lblEstadoReview.Text      = "Un error inesperado a ocurrido";
                    lblEstadoReview.ForeColor = System.Drawing.Color.Red;
                    txtReview.Text            = "";
                }
            }
            else
            {
                lblEstadoReview.Text      = "Un error inesperado a ocurrido";
                lblEstadoReview.ForeColor = System.Drawing.Color.Red;
                txtReview.Text            = "";
                Response.AppendHeader("Refresh", "5");
            }
        }