public string AddComment(string content, string url, int parentId) { string result = string.Empty; try { var commentMgr = new CommentMgr(); var feedback = new Feedback(); feedback.FullText = content; feedback.Description = content; feedback.Url = url; feedback.Type = "COMMENT"; feedback.ParentId = parentId; commentMgr.Add(feedback); return result; } catch (Exception ex) { throw ex; } }
public string AddFeedback(string url, string type) { string result = string.Empty; try { var commentMgr = new CommentMgr(); var feedback = new Feedback(); feedback.Url = url; feedback.Type = type; commentMgr.AddFeedback(feedback); result = JsonConvert.SerializeObject(feedback); } catch { } return result; }
public string GetCommentByUrl(string url) { string result = string.Empty; try { var commentMgr = new CommentMgr(); var feedback = new Feedback(); feedback.Url = url; var listOfComment = commentMgr.GetByUrl(feedback); JsonSerializer _jsonWriter = new JsonSerializer { NullValueHandling = NullValueHandling.Ignore }; result = JsonConvert.SerializeObject(listOfComment, new JsonSerializerSettings { DefaultValueHandling = DefaultValueHandling.Ignore }); return result; } catch (Exception ex) { throw ex; } }
public string GetStat(string url) { string result = string.Empty; try { var commentMgr = new CommentMgr(); SiteStat siteStat = commentMgr.GetSiteStat(url); result = JsonConvert.SerializeObject(siteStat); return result; } catch (Exception ex) { throw ex; } }