Пример #1
0
        /// <summary>
        /// 获取指定商品的交易日志JSON数据
        /// </summary>
        /// <param name="goodsid">指定商品</param>
        /// <param name="pagesize">页面大小</param>
        /// <param name="pageindex">当前页面</param>
        /// <param name="orderby">排序字段</param>
        /// <param name="ascdesc">排序方式</param>
        /// <returns></returns>
        public static StringBuilder GetLeaveWordJson(int leaveWordId)
        {
            StringBuilder leaveWordJson = new StringBuilder();

            leaveWordJson.Append("[");

            if (leaveWordId <= 0)
            {
                leaveWordJson.Append("{{'id' : 0, 'isbuyer' : 0, 'uid' : 0, 'username' : '', 'postdatetime' : '', 'message' : ''}}");
            }
            else
            {
                Goodsleavewordinfo goodsleavewordinfo = GoodsLeaveWords.GetGoodsLeaveWordById(leaveWordId);

                if (goodsleavewordinfo == null || goodsleavewordinfo.Id <= 0)
                {
                    leaveWordJson.Append("{{'id' : 0, 'isbuyer' : 0, 'uid' : 0, 'username' : '', 'postdatetime' : '', 'message' : ''}}");
                }
                else
                {
                    leaveWordJson.Append(string.Format("{{'id' : {0}, 'isbuyer' : {1}, 'uid' : {2}, 'username' : '{3}', 'postdatetime' : '{4}', 'message' : '{5}'}}",
                                                       goodsleavewordinfo.Id,
                                                       goodsleavewordinfo.Isbuyer == 1 ? "true" : "false",
                                                       goodsleavewordinfo.Uid,
                                                       goodsleavewordinfo.Username,
                                                       goodsleavewordinfo.Postdatetime.ToString("yyyy-MM-dd"),
                                                       goodsleavewordinfo.Message.Replace("\r\n", "<br />")));
                }
            }
            return(leaveWordJson.Append("]"));
        }
Пример #2
0
 /// <summary>
 /// 获取指定商品的交易日志JSON数据
 /// </summary>
 /// <param name="goodsid">指定商品</param>
 /// <param name="pagesize">页面大小</param>
 /// <param name="pageindex">当前页面</param>
 /// <param name="orderby">排序字段</param>
 /// <param name="ascdesc">排序方式</param>
 /// <returns></returns>
 public override StringBuilder GetLeaveWordJson(int goodsid, int pagesize, int pageindex, string orderby, int ascdesc)
 {
     return(GoodsLeaveWords.GetLeaveWordJson(goodsid, pagesize, pageindex, orderby, ascdesc));
 }
Пример #3
0
 /// <summary>
 /// 获取指定商品的交易日志JSON数据
 /// </summary>
 /// <param name="goodsid">指定商品</param>
 /// <param name="pagesize">页面大小</param>
 /// <param name="pageindex">当前页面</param>
 /// <param name="orderby">排序字段</param>
 /// <param name="ascdesc">排序方式</param>
 /// <returns></returns>
 public override StringBuilder GetLeaveWordJson(int leavewordid)
 {
     return(GoodsLeaveWords.GetLeaveWordJson(leavewordid));
 }