Example #1
0
 public static bool SaveProgrammingComment(ProgrammingComment comment)
 {
     return SQLiteProcess.SaveProgrammingComment(comment);
 }
        public ResponseJson GetComment(int commentId)
        {
            if (needCheckLogin)
            {
                var token = Request.Headers.GetValues("token");
                if (token == null || AuthData.GetRole(token.ToString()) == Role.NoLogin)
                {
                    return ResponseJson.GetResponseJson(string.Empty, false);
                }
            }

            var data = DataProcess.GetProgrammingComment(commentId);
            if (data != null)
            {
                data = new ProgrammingComment()
                {
                    Id = data.Id,
                    Name = data.Name,
                    Email = data.Email,
                    Subject = data.Subject,
                    Message = data.Message,
                    IsDisplay = data.IsDisplay,
                    ContentId = data.ContentId,
                    CreatedDate = data.CreatedDate,
                    UpdatedDate = data.UpdatedDate,
                };
            }
            return ResponseJson.GetResponseJson(data);
        }