コード例 #1
0
ファイル: ViewGroup.aspx.cs プロジェクト: SPKT/MHX2
 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);
 }
コード例 #2
0
 public void DeleteCategory(BoardCategory category)
 {
     using (SPKTDataContext dc = _conn.GetContext())
     {
         dc.BoardCategories.Attach(category, true);
         dc.BoardCategories.DeleteOnSubmit(category);
         dc.SubmitChanges();
     }
 }
コード例 #3
0
ファイル: BoardService.cs プロジェクト: ngocpq/MHX2
 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);
 }
コード例 #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;
 }
コード例 #5
0
ファイル: AlertService.cs プロジェクト: ngocpq/MHX2
        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);
        }
コード例 #6
0
ファイル: AlertService.cs プロジェクト: ngocpq/MHX2
        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);
        }
コード例 #7
0
ファイル: AlertService.cs プロジェクト: SPKT/MHX2
        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);
        }
コード例 #8
0
ファイル: AlertService.cs プロジェクト: SPKT/MHX2
        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);
        }
コード例 #9
0
ファイル: AlertService.cs プロジェクト: SPKT/MHX2
        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);
        }
コード例 #10
0
ファイル: AddCategoryPresenter.cs プロジェクト: ngocpq/MHX2
 public AddCategoryPresenter()
 {
     _categoryService = new BoardService();
     boardCategory = new BoardCategory();
 }