Example #1
0
 void BindPtAndReviewsAndReplys()
 {
     UserProductReviewAndReplyQuery query = new UserProductReviewAndReplyQuery();
     query.PageIndex = this.pager.PageIndex;
     query.PageSize = this.pager.PageSize;
     int total = 0;
     DataSet userProductReviewsAndReplys = CommentsHelper.GetUserProductReviewsAndReplys(query, out total);
     this.dlstPts.DataSource = userProductReviewsAndReplys.Tables[0].DefaultView;
     this.dlstPts.DataBind();
     this.pager.TotalRecords = total;
 }
Example #2
0
 static string BuildUserReviewsAndReplysQuery(UserProductReviewAndReplyQuery query)
 {
     StringBuilder builder = new StringBuilder();
     builder.Append(" SELECT ProductId FROM Hishop_ProductReviews ");
     builder.AppendFormat(" AND ProductId IN (SELECT ProductId FROM Hishop_Products)", new object[0]);
     builder.Append(" GROUP BY ProductId");
     return builder.ToString();
 }
Example #3
0
 public override DataSet GetUserProductReviewsAndReplys(UserProductReviewAndReplyQuery query, out int total)
 {
     DbCommand storedProcCommand = database.GetStoredProcCommand("ac_Member_UserReviewsAndReplys_Get");
     database.AddInParameter(storedProcCommand, "PageIndex", DbType.Int32, query.PageIndex);
     database.AddInParameter(storedProcCommand, "PageSize", DbType.Int32, query.PageSize);
     database.AddInParameter(storedProcCommand, "IsCount", DbType.Boolean, query.IsCount);
     database.AddInParameter(storedProcCommand, "UserId", DbType.Int32, HiContext.Current.User.UserId);
     database.AddInParameter(storedProcCommand, "sqlPopulate", DbType.String, BuildUserReviewsAndReplysQuery(query));
     database.AddOutParameter(storedProcCommand, "Total", DbType.Int32, 4);
     DataSet set = database.ExecuteDataSet(storedProcCommand);
     set.Relations.Add("PtReviews", set.Tables[0].Columns["ProductId"], set.Tables[1].Columns["ProductId"], false);
     total = (int)database.GetParameterValue(storedProcCommand, "Total");
     return set;
 }
Example #4
0
 public abstract DataSet GetUserProductReviewsAndReplys(UserProductReviewAndReplyQuery query, out int total);
Example #5
0
 static string BuildUserReviewsAndReplysQuery(UserProductReviewAndReplyQuery query)
 {
     StringBuilder builder = new StringBuilder();
     builder.Append(" SELECT ProductId FROM distro_ProductReviews ");
     builder.AppendFormat(" WHERE UserId = {0} ", HiContext.Current.User.UserId);
     builder.AppendFormat(" AND ProductId IN (SELECT ProductId FROM distro_Products WHERE DistributorUserId={0} )", HiContext.Current.SiteSettings.UserId);
     builder.Append(" GROUP BY ProductId");
     return builder.ToString();
 }
Example #6
0
 public static DataSet GetUserProductReviewsAndReplys(UserProductReviewAndReplyQuery query, out int total)
 {
     return CommentDataProvider.Instance().GetUserProductReviewsAndReplys(query, out total);
 }