예제 #1
0
        public bool saveReply(int id, String content, String account)
        {
            bool  result = false;
            Owner owenr  = null;
            User  user   = null;

            if (ownerDao.Select(id, null, null, null, null, null, null, null, null, 0).Count > 0)
            {
                owenr = ownerDao.Select(id, null, null, null, null, null, null, null, null, 0)[0];
            }
            else
            {
                return(result);
            }
            if (userDao.Select(null, account, null, null, null, null, null, null, null, null, null, null, null).Count > 0)
            {
                user = userDao.Select(null, account, null, null, null, null, null, null, null, null, null, null, null)[0];
            }
            else
            {
                return(result);
            }
            Reply reply = new Reply();

            reply.owner         = owenr;
            reply.ReplyContent  = content;
            reply.time          = DateTime.Now;
            reply.User          = user;
            owenr.LastReplyTime = reply.time;
            if (replyDao.Create(reply) && ownerDao.Edit(owenr))
            {
                result = true;
            }
            return(result);
        }
예제 #2
0
        public List <Owner> GetOwnerByType(String type, int index)
        {
            LoseType loseType = null;
            var      items    = loseTypesDao.Select(null, type, null);

            if (items.Count == 1)
            {
                foreach (LoseType item in items)
                {
                    loseType = item;
                }
                return(ownerDao.Select(null, null, null, null, null, null, loseType, null, null, index));
            }
            else
            {
                return(ownerDao.Select(null, null, null, null, null, null, null, null, null, index));
            }
        }
예제 #3
0
 public List <Owner> getOwnerByUser(User user, int index)
 {
     return(ownerDao.Select(null, user, null, null, null, null, null, null, null, index));
 }