Exemplo n.º 1
0
 public ThreadController(IForumsRepository repo, IUsersRepository userRepo, UserManager <User> userManager, SignInManager <User> signInManager)
 {
     _Repo          = repo;
     _UserRepo      = userRepo;
     _UserManager   = userManager;
     _SignInManager = signInManager;
 }
Exemplo n.º 2
0
        public void Moniter()
        {
            while (true)
            {
                LoggerHelper.Info("Monitor thread starting...");

                IAccountRepository accountRep = Factory.Factory <IAccountRepository> .GetConcrete();

                IForumThreadRepository threadRep = Factory.Factory <IForumThreadRepository> .GetConcrete();

                IForumMessageRepository msgRep = Factory.Factory <IForumMessageRepository> .GetConcrete();

                IBlogStoryRepository blogRep = Factory.Factory <IBlogStoryRepository> .GetConcrete();

                IForumsRepository forumRep = Factory.Factory <IForumsRepository> .GetConcrete();

                accountRep.PersistAll();
                threadRep.PersistAll();
                msgRep.PersistAll();
                blogRep.PersistAll();
                forumRep.PersistAll();

                LoggerHelper.Info("Monitor thread completing persist...");
                Thread.Sleep(6000000);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 通过关键字查找帖子
        /// </summary>
        /// <param name="keywords">关键字</param>
        /// <param name="index">分页起始点</param>
        /// <param name="count">取数据条数</param>
        /// <returns>查找的帖子列表集合</returns>
        public IList <ThreadsDspModel> FetchThreadsDspModelByKeyWords(string keywords, int index, int count)
        {
            IList <ThreadsDspModel> mylist   = new List <ThreadsDspModel>();
            DbDataReader            reader   = helper.GetPageList("fbs_Message", "CreationDate", "Subject like '%" + keywords + "%' and ParentMessageID='" + Guid.Empty + "'", index, count);
            IForumsRepository       forumRep = FBS.Factory.Factory <IForumsRepository> .GetConcrete();

            if (reader.HasRows)
            {
                while (reader.Read())
                {
                    ThreadsDspModel model = new ThreadsDspModel();
                    Forum           forum = forumRep.GetByKey(new Guid(reader["ForumID"].ToString()));
                    model.Body         = reader["Body"].ToString();
                    model.ClickCount   = System.Int16.Parse(reader["RewardPoints"].ToString());
                    model.CreationDate = DateTime.Parse(reader["CreationDate"].ToString());
                    model.ID           = new Guid(reader["ThreadID"].ToString());
                    model.LastModified = DateTime.Parse(reader["ModifiedDate"].ToString());
                    model.MessageCount = 0;
                    //model.MessageID =new Guid( reader["MessageID"].ToString());
                    model.Title     = reader["Subject"].ToString();
                    model.UserID    = new Guid(reader["AccountID"].ToString());
                    model.UserName  = forum.Name; //注意这里借用变量了,注意呀
                    model.MessageID = forum.Id;   //注意这里同样借用变量了,注意
                    mylist.Add(model);
                }
            }
            return(mylist);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 此函数未使用
        /// 获取贴吧含分页
        /// </summary>
        /// <param name="index"></param>
        /// <param name="count"></param>
        /// <returns></returns>
        public IList <ForumDspModel> FetchForumDspModel(int index, int count)
        {
            IList <ForumDspModel> mylist   = new List <ForumDspModel>();
            IForumsRepository     forumRep = FBS.Factory.Factory <IForumsRepository> .GetConcrete();

            foreach (Forum forum in forumRep.FindAll(new Specification <Forum>(c => c.Id != null).OrderBy(c => c.CreationDate).Skip(index).Take(count)))
            {
                ForumDspModel model = new ForumDspModel()
                {
                    CreationTime = forum.CreationDate, ForumDsp = forum.Dsp, ForumName = forum.Name, ModifiedTime = forum.ModifiedDate, ID = forum.Id, ThreadCount = forum.ThreadCount
                };
                mylist.Add(model);
            }
            return(mylist);
        }
Exemplo n.º 5
0
 public PostController(IForumsRepository repo, IUsersRepository usersRepo, UserManager <User> userManager)
 {
     _Repo        = repo;
     _UsersRepo   = usersRepo;
     _UserManager = userManager;
 }
 public SubforumController(IForumsRepository repo)
 {
     _Repo = repo;
 }
Exemplo n.º 7
0
 public ForumController(IForumsRepository repo, IUsersRepository userRepo)
 {
     _Repo     = repo;
     _UserRepo = userRepo;
 }