/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void UpdateReviewStatus_Click(object sender, EventArgs e) { ReviewAdmin reviewAdmin = new ReviewAdmin(); Review review = reviewAdmin.GetByReviewID(ItemId); if (review != null) { if (ListReviewStatus.SelectedValue == "I") { review.Status = "I"; } else if (ListReviewStatus.SelectedValue == "A") { review.Status = "A"; } else { review.Status = "N"; } } reviewAdmin.Update(review); Response.Redirect(ListPageLink); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnUpdate_Click(object sender, EventArgs e) { ReviewAdmin reviewAdmin = new ReviewAdmin(); Review review = reviewAdmin.GetByReviewID(ItemId); if (review != null) { review.Subject = HttpUtility.HtmlEncode(Headline.Text.Trim()); review.Pros = HttpUtility.HtmlEncode(Pros.Text.Trim()); review.Cons = HttpUtility.HtmlEncode(Cons.Text.Trim()); review.Comments = HttpUtility.HtmlEncode(Comments.Text.Trim()); if(ListReviewStatus.SelectedValue == "I") { review.Status = "I"; } else if (ListReviewStatus.SelectedValue == "A") { review.Status = "A"; } else { review.Status = "N"; } bool Status = reviewAdmin.Update(review); if (Status) { Response.Redirect(ListPageLink); } else { //throw error message } } }