Exemple #1
0
        public bool saveInfomation(String title, String fathertype, String type, String content, String account, String question)
        {
            bool     result     = false;
            LoseType loseType   = null;
            LoseType fatherType = fatherType = loseTypesDao.Select(null, fathertype, null)[0];
            User     user       = null;

            if (loseTypesDao.Select(null, type, fatherType).Count > 0)
            {
                loseType = loseTypesDao.Select(null, type, fatherType)[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);
            }
            Finder finder = new Finder();

            finder.hidden        = false;
            finder.Complete      = false;
            finder.Time          = DateTime.Now;
            finder.LastReplyTime = finder.Time;
            finder.LoseType      = loseType;
            finder.Content       = content;
            finder.User          = user;
            finder.Question      = question;
            finder.Title         = title;
            if (finderDao.Create(finder))
            {
                result = true;
            }
            return(result);
        }
Exemple #2
0
 public List <LoseType> GetLoseTypes()
 {
     return(loseTypesDao.Select(null, null, null));
 }