Beispiel #1
0
 private void SetChosenReviews(int reviewId, bool chosen)
 {
     if (reviewId != 0)
     {
         if ((chosen) && !ChosenReviews.Contains(reviewId))
         {
             ChosenReviews.Add(reviewId);
             NotChosenReviews.Remove(reviewId);
         }
         else if ((!chosen) && (ChosenReviews.Contains(reviewId)))
         {
             ChosenReviews.Remove(reviewId);
             NotChosenReviews.Add(reviewId);
         }
     }
 }
Beispiel #2
0
        protected void gvReviews_PreRender(object sender, EventArgs e)
        {
            if (gvReviews.TopPagerRow != null)
            {
                gvReviews.TopPagerRow.Visible = true;
                ((TextBox)gvReviews.HeaderRow.FindControl("txtFilterId")).Text      = GetStringState(PRODUCT_REVIEW_ID_FILTER);
                ((TextBox)gvReviews.HeaderRow.FindControl("txtFilterAlias")).Text   = GetStringState(ALIAS_FILTER);
                ((TextBox)gvReviews.HeaderRow.FindControl("txtFilterComment")).Text = GetStringState(COMMENT_FILTER);
            }

            var reviews = (ProductReview[])gvReviews.DataSource;

            for (int i = 0; i < gvReviews.Rows.Count; i++)
            {
                CheckBox cb = gvReviews.Rows[i].FindControl("cbChosen") as CheckBox;

                if (ChosenReviews.Contains(reviews[i].Id))
                {
                    cb.Checked = true;
                }

                SetChosenReviews(reviews[i].Id, cb.Checked);
            }
        }