Beispiel #1
0
        public bool Read(NotifyQueryForm form)
        {
            var mapper = Common.GetMapper();

            NotifyDao notifydao = new NotifyDao(mapper);

            notifydao.Update(new NotifyUpdateForm
            {
                QueryForm = form,
                Entity    = new Notify {
                    IsRead = 1
                },
            });

            return(true);
        }
Beispiel #2
0
        public FullReplyInfo GetReplyDetailList(string replyID)
        {
            var       mappper   = Common.GetMapper();
            ReplyDao  dao       = new ReplyDao(mappper);
            NotifyDao notifyDao = new NotifyDao(mappper);
            var       current   = dao.QueryFullReplyInfo(new ReplyQueryForm {
                ID = replyID
            }).FirstOrDefault();
            var replies = new List <ReplyWithChild>();

            if (current.ReplyID == "0")
            {
                replies = dao.QueryFullReplyInfo(new ReplyQueryForm {
                    ReplyID = replyID, OrderByColumn = "CreateTime", OrderBy = OrderBy.DESC
                });
            }
            else
            {
                current = dao.QueryFullReplyInfo(new ReplyQueryForm {
                    ID = current.ReplyID
                }).FirstOrDefault();
                replies = dao.QueryFullReplyInfo(new ReplyQueryForm {
                    ReplyID = current.ID, OrderByColumn = "CreateTime", OrderBy = OrderBy.DESC
                });
            }
            var replyids = (from r in replies
                            select r.ID).Distinct().ToList();

            notifyDao.Update(new NotifyUpdateForm
            {
                Entity = new Notify {
                    IsRead = 1
                },
                QueryForm = new NotifyQueryForm {
                    ReplyIDs = replyids
                },
            });
            if (current != null)
            {
                current.Children = new List <ReplyWithChild>();
                current.Children.AddRange(replies);
            }
            return(current);
        }
Beispiel #3
0
        public bool ReadReply(ReplyQueryForm form)
        {
            var       mapper    = Common.GetMapper();
            ReplyDao  replyDao  = new ReplyDao(mapper);
            NotifyDao notifyDao = new NotifyDao(mapper);
            var       replies   = replyDao.Query(form);
            var       ids       = (from r in replies
                                   select r.ID).ToList();

            notifyDao.Update(new NotifyUpdateForm
            {
                QueryForm = new NotifyQueryForm {
                    ReplyIDs = ids
                },
                Entity = new Notify {
                    IsRead = 1
                }
            });
            return(true);
        }