protected void Page_Load(object sender, EventArgs e) { _ProductReviewId = AlwaysConvert.ToInt(Request.QueryString["ReviewId"]); _ProductReview = ProductReviewDataSource.Load(_ProductReviewId); if (_ProductReview != null) { _ProductId = _ProductReview.Product.Id; } else { _ProductId = AlwaysConvert.ToInt(Request.QueryString["ProductId"]); } _Product = ProductDataSource.Load(_ProductId); if (!Page.IsPostBack) { InitializeForm(); } //INIT ReviewBody COUNTDOWN AbleCommerce.Code.PageHelper.SetMaxLengthCountDown(ReviewBody, ReviewMessageCharCount); ReviewMessageCharCount.Text = ((int)(ReviewBody.MaxLength - ReviewBody.Text.Length)).ToString(); if (AbleContext.Current.Store.Settings.ProductReviewTermsAndConditions != string.Empty) { ReviewTermsLink.Visible = true; ReviewTermsLink.NavigateUrl = NavigationHelper.GetMobileStoreUrl(string.Format("~/ReviewTerms.aspx?ProductId={0}", _Product.Id)); } else { ReviewTermsLink.Visible = false; reviewInstruction.Visible = false; } }
protected void GoButton_Click(object sender, EventArgs e) { List <int> reviewIds = GetSelectedReviewIds(); if (reviewIds.Count > 0) { if (ReviewAction.SelectedValue == "Delete") { foreach (int reviewId in reviewIds) { ProductReviewDataSource.Delete(reviewId); } } else if ((ReviewAction.SelectedValue == "Approve") || (ReviewAction.SelectedValue == "Disapprove")) { bool approved = (ReviewAction.SelectedValue == "Approve"); foreach (int reviewId in reviewIds) { ProductReview review = ProductReviewDataSource.Load(reviewId); review.IsApproved = approved; review.Save(); } } ReviewGrid.DataBind(); } ReviewAction.SelectedIndex = 0; }
protected void Page_Load(object sender, EventArgs e) { ReviewerProfile profile = AbleContext.Current.User.ReviewerProfile; _ProductReviewId = AlwaysConvert.ToInt(Request.QueryString["ReviewId"]); _ProductReview = ProductReviewDataSource.Load(_ProductReviewId); if (_ProductReview == null || _ProductReview.ReviewerProfileId != profile.Id) { Response.Redirect("~/Members/MyProductReviews.aspx"); } _Product = ProductDataSource.Load(_ProductReview.ProductId); if (_Product == null) { Response.Redirect("~/Members/MyProductReviews.aspx"); } ProductName.Text = _Product.Name; ProductReviewForm1.ReviewCancelled += new EventHandler(ProductReviewForm1_ReviewCancelled); ProductReviewForm1.ReviewSubmitted += new EventHandler(ProductReviewForm1_ReviewSubmitted); }
protected void Page_Load(object sender, EventArgs e) { _ProductReviewId = AlwaysConvert.ToInt(Request.QueryString["ReviewId"]); _ProductReview = ProductReviewDataSource.Load(_ProductReviewId); if (_ProductReview == null) { Response.Redirect("Default.aspx"); } if (!Page.IsPostBack) { ReviewerProfile profile = _ProductReview.ReviewerProfile; ProductLink.NavigateUrl = string.Format(ProductLink.NavigateUrl, _ProductReview.ProductId); ProductLink.Text = _ProductReview.Product.Name; ReviewDate.Text = string.Format(ReviewDate.Text, _ProductReview.ReviewDate); Approved.Checked = _ProductReview.IsApproved; ReviewerEmail.Text = profile.Email; ReviewerName.Text = profile.DisplayName; ReviewerLocation.Text = profile.Location; Rating.Text = string.Format(Rating.Text, _ProductReview.Rating); ReviewTitle.Text = _ProductReview.ReviewTitle; ReviewBody.Text = _ProductReview.ReviewBody; } }
protected void Page_Load(object sender, EventArgs e) { _ProductReviewId = AlwaysConvert.ToInt(Request.QueryString["ReviewId"]); _ProductReview = ProductReviewDataSource.Load(_ProductReviewId); if (_ProductReview != null) { _ProductId = _ProductReview.Product.Id; } else { _ProductId = AlwaysConvert.ToInt(Request.QueryString["ProductId"]); } _Product = ProductDataSource.Load(_ProductId); if (!Page.IsPostBack) { InitializeForm(); } //INIT ReviewBody COUNTDOWN AbleCommerce.Code.PageHelper.SetMaxLengthCountDown(ReviewBody, ReviewMessageCharCount); ReviewMessageCharCount.Text = ((int)(ReviewBody.MaxLength - ReviewBody.Text.Length)).ToString(); }