public JsonResult GetReplyById(int id)
        {
            dto_Reply r = B_Topic.GetReplyById(id);

            if (r != null)
            {
                T_User u = B_UserRedis.GetUser(r.UserId);
                r.UserName = u == null ? "" : u.UserName;
            }
            return(Json(r));
        }
Example #2
0
        public static dto_Reply GetReplyById(int id)
        {
            dto_Reply result = null;
            string    sql    = "select Id, UserId, TopicId, ReplyContent, CreateDate, Good from T_Reply where Id = @Id ";

            using (var reader = MySqlHelper.ExecuteReader(Util.GetConnectString(BBSConnString), sql.ToString(), "@Id".ToInt32InPara(id)))
            {
                if (reader != null && reader.HasRows)
                {
                    result = MySqlDBHelper.ConvertDataReaderToEntitySingle <dto_Reply>(reader);
                }
            }
            return(result);
        }