Exemplo n.º 1
0
        public ActionResult AddCommentToSummary(string Text, string CreatedBy, string SummaryId)
        {
            PointDataComment comment = new PointDataComment()
            {
                Text = Text,
                CreatedOn = DateTime.UtcNow,
                CreatedById = long.Parse(CreatedBy),
                SummaryId = long.Parse(SummaryId)
            };

            comment.Save();

            PointDataSummary summary = PointDataSummary.All().FirstOrDefault(s => s.Id == long.Parse(SummaryId));
            summary.CommentCount += 1;
            summary.Save();

            return Json(new { Text = comment.Text, Date = comment.CreatedOn.ToString("dd MMM yyy hh:mm") }, JsonRequestBehavior.AllowGet);
        }
Exemplo n.º 2
0
 public static void Setup(int testItems)
 {
     SetTestRepo();
     for(int i=0;i<testItems;i++){
         PointDataComment item=new PointDataComment();
         _testRepo._items.Add(item);
     }
 }
Exemplo n.º 3
0
 public static void Setup(PointDataComment item)
 {
     SetTestRepo();
     _testRepo._items.Add(item);
 }