Beispiel #1
0
 public void LoadForum(BoardForum forum, List<BoardPost> threads, BoardCategory category, Group group)
 {
     uc.forum = forum;
     uc.category= category;
     uc.Threads=threads;
     uc.group = group;
        pnlForum.Controls.Add(uc);
 }
Beispiel #2
0
 public void DeleteCategory(BoardCategory category)
 {
     using (SPKTDataContext dc = _conn.GetContext())
     {
         dc.BoardCategories.Attach(category, true);
         dc.BoardCategories.DeleteOnSubmit(category);
         dc.SubmitChanges();
     }
 }
Beispiel #3
0
 public void SaveNewBoard(BoardCategory category)
 {
     category.CreateDate = DateTime.Now;
     category.LastPostDate = DateTime.Now;
     category.PostCount = 0;
     category.ThreadCount = 0;
     category.LastPostByAccountID = 0;
     category.LastPostByUsername = null;
     _categoryRepository.SaveCategory(category);
 }
Beispiel #4
0
 public Int32 SaveCategory(BoardCategory category)
 {
     category.UpdateDate = DateTime.Now;
     using (SPKTDataContext dc = _conn.GetContext())
     {
         if (category.CategoryID > 0)
         {
             dc.BoardCategories.Attach(category, true);
         }
         else
         {
             dc.BoardCategories.InsertOnSubmit(category);
         }
         dc.SubmitChanges();
     }
     return category.CategoryID;
 }
Beispiel #5
0
        public void AddNewBoardPostAlert(BoardCategory category, BoardForum forum, BoardPost post, BoardPost thread, Group group)
        {
            Init();
            alert.AlertTypeID = (int)AlertType.AlertTypes.NewBoardPost;
            alertMessage = "<div class=\"AlertHeader\">" + GetProfileImage(_userSession.CurrentUser.AccountID) +
                           GetProfileUrl(_userSession.CurrentUser.UserName) + " has just added a new post: <b>" +
                           post.Name + "</b></div>";

            /*alertMessage += "<div class=\"AlertRow\"><a href=\"" + _webContext.RootUrl + "forums/" + category.PageName +
                           "/" + forum.PageName + "/" + thread.PageName + ".aspx" + "\">" + _webContext.RootUrl +
                           "forums/" + category.PageName + "/" + forum.PageName + "/" + thread.PageName +
                           ".aspx</a></div>";*/
            alertMessage += "<div class=\"AlertRow\"><a href=\"" + _webContext.RootUrl + "Groups/ViewGroupForumPost" + ".aspx?PostID=" +post.PostID + "&GroupID=" + group.GroupID +"</a></div>";
            alert.Message = alertMessage;
            SaveAlert(alert);
            SendAlertToGroup(alert, group);
        }
Beispiel #6
0
        public void AddNewBoardThreadAlert(BoardCategory category, BoardForum forum, BoardPost post)
        {
            Init();
            alert.AlertTypeID = (int)AlertType.AlertTypes.NewBoardThread;
            alertMessage = "<div class=\"AlertHeader\">" + GetProfileImage(_userSession.CurrentUser.AccountID) +
                           GetProfileUrl(_userSession.CurrentUser.UserName) + " has just added a new thread on the board: <b>" +
                           post.Name + "</b></div>";

            alertMessage += "<div class=\"AlertRow\"><a href=\"" + _webContext.RootUrl + "forums/" + category.PageName +
                           "/" + forum.PageName + "/" + post.PageName + ".aspx" + "\">" + _webContext.RootUrl +
                           "forums/" + category.PageName + "/" + forum.PageName + "/" + post.PageName +
                           ".aspx</a></div>";
            alert.Message = alertMessage;
            SaveAlert(alert);
            SendAlertToFriends(alert);
        }
Beispiel #7
0
        public void AddNewBoardThreadAlert(BoardCategory category, BoardForum forum, BoardPost post)
        {
            Init();
            alert.AlertTypeID = (int)AlertType.AlertTypes.NewBoardThread;
            /*alertMessage = "<div >" + GetProfileImage(_userSession.CurrentUser.AccountID) +
                           GetProfileUrl(_userSession.CurrentUser.UserName) + " vừa mới thêm bài viết mới: <b>" +
                           post.Name + "</b></div>";

            alertMessage += "<div ><a href=\"" + _webContext.RootUrl + "forums/" + category.PageName +
                           "/" + forum.PageName + "/" + post.PageName + ".aspx" + "\">" + _webContext.RootUrl +
                           "forums/" + category.PageName + "/" + forum.PageName + "/" + post.PageName +
                           ".aspx</a></div>";*/
            alertMessage = "<div >" + GetProfileImage(_userSession.CurrentUser.AccountID) + "<br>" +
               GetProfileUrl(_userSession.CurrentUser.UserName) + " vừa mới đăng bài viết: ";

            alertMessage += "<a href=\"" + _webContext.RootUrl + "forums/" + category.PageName +
                           "/" + forum.PageName.ToLower() + "/" + post.PageName.ToLower() + ".aspx" + "\">" + post.Name + "</a></div>";
            alert.Message = alertMessage;
            alert.Message = alertMessage;
            SaveAlert(alert);
            //SendAlertToFriends(alert);
        }
Beispiel #8
0
        public void AddNewBoardThreadAlert(BoardCategory category, BoardForum forum, BoardPost post, Group group)
        {
            //Right
            Init();
            alert.AlertTypeID = (int)AlertType.AlertTypes.NewBoardThread;
            /*alertMessage = "<div >" + GetProfileImage(_userSession.CurrentUser.AccountID) +
                           GetProfileUrl(_userSession.CurrentUser.UserName) + "vừa mới thêm bài viết mới ở trên: <b>" +
                           post.Name + "</b></div>";*/

            /*alertMessage += "<div ><a href=\'" + _webContext.RootUrl + "forums/" + category.PageName +
                           "/" + forum.PageName + "/" + post.PageName + ".aspx" + "\">" + _webContext.RootUrl +
                           "forums/" + category.PageName + "/" + forum.PageName + "/" + post.PageName +
                           ".aspx'>"+post.Name+"</a></div>";*/
            alertMessage += "<div >"+ GetProfileImage(_userSession.CurrentUser.AccountID)+"</br>"+
                           GetProfileUrl(_userSession.CurrentUser.UserName) + "vừa mới thêm bài viết mới <b>"+ "<a href=\"" + _webContext.RootUrl + "Groups/ViewGroupForumPost" + ".aspx?PostID=" + post.PostID + "&GroupID=" + group.GroupID + "\">"+
                           post.Name + "</a></div>";
            alert.Message = alertMessage;
            SaveAlert(alert);
            SendAlertToGroup(alert, group);
        }
Beispiel #9
0
        public void AddNewBoardPostAlert(BoardCategory category, BoardForum forum, BoardPost post, BoardPost thread)
        {
            Init();
            alert.AlertTypeID = (int)AlertType.AlertTypes.NewBoardPost;
            alertMessage = "<div >" + GetProfileImage(_userSession.CurrentUser.AccountID) +"<br>"+
                           GetProfileUrl(_userSession.CurrentUser.UserName) + " vừa mới trả lời bài viết: ";

            alertMessage += "<a href=\"" + _webContext.RootUrl + "forums/" + category.PageName.ToLower() +
                           "/" + forum.PageName.ToLower() + "/" + thread.PageName.ToLower() + ".aspx" + "\">"+thread.Name+":"+post.Post.Substring(0,10)+"..."+"</a></div>";
            alert.Message = alertMessage;
            SaveAlert(alert);
            //SendAlertToFriends(alert);
        }
Beispiel #10
0
 public AddCategoryPresenter()
 {
     _categoryService = new BoardService();
     boardCategory = new BoardCategory();
 }