コード例 #1
0
 public static Messages_ReplyService instance()
 {
     if (_instance == null)
     {
         _instance = new Messages_ReplyService();
     }
     return(_instance);
 }
コード例 #2
0
        public Messages Single(Guid id)
        {
            Messages result = new Messages();

            _db.Execute(() =>
            {
                result = _db.Single <Messages>(m => m.ID == id);
            });
            result.ReplyItems = Messages_ReplyService.instance().GetTop(result.ID);

            result.Count++;
            this.Update(result);
            return(result);
        }
コード例 #3
0
        public IEnumerable <Messages> GetEnum(Guid cid, bool?isChild = true)
        {
            IEnumerable <Messages> result = new List <Messages>();

            _db.Execute(() =>
            {
                result = _db.GetList <Messages>(m => m.CompanyID == cid);
            });
            if (isChild.Value)
            {
                result.Each(m =>
                {
                    m.ReplyItems = Messages_ReplyService.instance().GetTop(m.ID);
                });
            }
            return(result);
        }