public void ProcessRequest(HttpContext context) { context.Response.ContentType = "application/json"; string PageSizeStr = context.Request.QueryString["pagesize"]; string CurrentPageStr = context.Request.QueryString["currentpage"]; int CurrentPage = 0; int PageSize = 0; int FriendshipCount = 0; if (!int.TryParse(PageSizeStr, out PageSize) || !int.TryParse(CurrentPageStr, out CurrentPage)) { context.Response.Write("{success:false,msg:'参数错误。'}"); return; } CY.UME.Core.Business.Account CurrentAccount = CY.UME.Core.Global.GetCurrentAccount(); if (CurrentAccount == null) { context.Response.Write("{success:false,msg:'用户登录超时,请重新登录!'}"); return; } CY.UME.Core.PagingInfo pageinfo = new Core.PagingInfo { CurrentPage = 1, PageSize = int.MaxValue }; IList<CY.UME.Core.Business.Friendship> FriendList = CY.UME.Core.Business.Friendship.GetAllFriendship(CurrentAccount, pageinfo); if (FriendList == null) { context.Response.Write("{success:false,msg:'获取用户失败,请稍后再试。'}"); return; } FriendshipCount = CY.UME.Core.Business.Friendship.GetFriendshipCount(CurrentAccount); StringBuilder sb = new StringBuilder(); sb.Append("{success:true,msg:'获取成功。',fcount:'" + FriendshipCount + "',html:'"); sb.Append("<table cellpadding=\"0\" cellspacing=\"0\">"); foreach (CY.UME.Core.Business.Friendship friend in FriendList) { sb.Append("<tr class=\"right_g\">"); sb.Append("<td width=\"41\">"); sb.Append("<img src=\"../Theme/V3/images/Addressee_Write_tx.gif\" />"); sb.Append("</td>"); sb.Append("<td width=\"195\">"); sb.Append("<a class=\"friend\" aid=\"" + friend.Friend.Id + "\" href=\"javascript:void(0);\">" + friend.Friend.Name + "</a>"); sb.Append("</td>"); sb.Append("</tr>"); } sb.Append("</table>"); sb.Append("'}"); context.Response.Write(sb.ToString()); }
public static PagingInfo ToModel(this Core.PagingInfo pagingInfo) { if (pagingInfo == null) { return(null); } return(new PagingInfo() { PageNumber = pagingInfo.PageNumber, PageSize = pagingInfo.PageSize, TotalPages = pagingInfo.TotalPages }); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "application/json"; string PageSizeStr = context.Request.QueryString["pagesize"]; string CurrentPageStr = context.Request.QueryString["currentpage"]; string LoadType = context.Request.QueryString["type"]; string IsReadStr = context.Request.QueryString["isread"]; int CurrentPage = 1; int PageSize = 0; int IsRead = 2; if (!int.TryParse(PageSizeStr, out PageSize) || !int.TryParse(CurrentPageStr, out CurrentPage)) { context.Response.Write("{success:false,msg:'参数错误。'}"); return; } try { CY.UME.Core.Business.Account CurrentAccount = CY.UME.Core.Global.GetCurrentAccount(); if (CurrentAccount == null) { context.Response.Write("{success:false,msg:'用户登录超时,请重新登录!'}"); return; } CY.UME.Core.PagingInfo pageinfo = new Core.PagingInfo { CurrentPage = CurrentPage, PageSize = PageSize }; CY.UME.Core.Business.Messages message = new Core.Business.Messages(); int Type = 0; if (String.IsNullOrEmpty(LoadType) || !int.TryParse(LoadType, out Type)) { message.Type = 2;//收件 message.AccountId = CurrentAccount.Id; } else { if (Type == 2) { message.Type = 2;//收件 message.AccountId = CurrentAccount.Id; } if (Type == 1) {//发件 message.AuthorId = CurrentAccount.Id; } if (Type == 3 || Type == 4) {//草稿或已删除 message.AccountId = CurrentAccount.Id; } } if (int.TryParse(IsReadStr, out IsRead) && IsRead != 2) message.IsRead = 0;//未读邮件 message.Type = Type; CY.UME.Web.Message.Index index = new Web.Message.Index(); context.Response.Write("{success:true,html:'" + index.BindMessages(message, pageinfo) + "'}"); } catch { context.Response.Write("{success:false,msg:'服务器忙,请稍后重试。'}"); } }
/// <summary> /// 绑定所有收藏 /// </summary> public void SetFavoritesListByAll() { Core.Business.Favorites favorite = new Core.Business.Favorites(); favorite.AccountId = SpaceAccount.Id; CY.UME.Core.PagingInfo pageinfo = new Core.PagingInfo { CurrentPage = 1, PageSize = CY.Utility.Common.ConvertUtility.ConvertToInt( HF_PageSize.Value, 30) }; if (LoadType == Core.Business.Favorites.FavoriteTypeEnum.all.ToString()) { BindFavoritesList(favorite, pageinfo, LoadType); HF_TotalRecords.Value = CY.UME.Core.Business.Favorites.GetFavoritesCount(favorite, LoadType).ToString(); } else if (LoadType == Core.Business.Favorites.FavoriteTypeEnum.blog.ToString()) { BindFavoritesList(favorite, pageinfo, LoadType); HF_TotalRecords.Value = CY.UME.Core.Business.Favorites.GetFavoritesCount(favorite, LoadType).ToString(); } else if (LoadType == Core.Business.Favorites.FavoriteTypeEnum.miniblog.ToString()) { BindFavoritesList(favorite, pageinfo, LoadType); HF_TotalRecords.Value = CY.UME.Core.Business.Favorites.GetFavoritesCount(favorite, LoadType).ToString(); } else if (LoadType == Core.Business.Favorites.FavoriteTypeEnum.pubtopic.ToString()) { BindFavoritesList(favorite, pageinfo, LoadType); HF_TotalRecords.Value = CY.UME.Core.Business.Favorites.GetFavoritesCount(favorite, LoadType).ToString(); } else if (LoadType == Core.Business.Favorites.FavoriteTypeEnum.picture.ToString()) { BindFavoritesList(favorite, pageinfo, LoadType); HF_TotalRecords.Value = CY.UME.Core.Business.Favorites.GetFavoritesCount(favorite, LoadType).ToString(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { CY.UME.Core.PagingInfo pageInfo = new Core.PagingInfo { CurrentPage = 1, PageSize = CY.Utility.Common.ConvertUtility.ConvertToInt(HF_PageSize.Value, 10) }; string LoadType = Request.QueryString["t"]; int Type = 0; CY.UME.Core.Business.Messages message = new Core.Business.Messages(); //收件、发件、草稿、已删除、通知(或许) if (String.IsNullOrEmpty(LoadType) || !int.TryParse(LoadType, out Type)) { Type = 2;//收件 message.AccountId = CurrentAccount.Id; Tab.Index = 0; } else { if (Type == 2) {//收件 message.AccountId = CurrentAccount.Id; Tab.Index = 0; } if (Type == 1) {//发件 message.AuthorId = CurrentAccount.Id; LblDescription.Text = "收件人"; Tab.Index = 1; } if (Type == 3 || Type == 4) {//草稿或已删除 message.AccountId = CurrentAccount.Id; message.AuthorId = CurrentAccount.Id; Tab.Index = 3; } if (Type == 4) {//已删除 Tab.Index = 2; } } message.Type = Type; HF_LoadType.Value = Type.ToString(); if (Request.QueryString["i"] != null) HF_Select_Index.Value = Request.QueryString["i"]; //总条数 Total = CY.UME.Core.Business.Messages.GetMessagesNumberByAccountIdOrAuthorId(message); if (Request.QueryString["ir"] != null) {//未读邮件 message.IsRead = 0; HF_IsRead.Value = "0"; } LblMessageList.Text = BindMessages(message, pageInfo); HF_TotalRecords.Value = CY.UME.Core.Business.Messages.GetMessagesNumberByAccountIdOrAuthorId(message).ToString();//筛选后的总数,用于分页 //未读邮件数量 if (message.Type == 2) {//收件里面的未读邮件 message.IsRead = 0; UnRead = CY.UME.Core.Business.Messages.GetMessageUnReadAndReadTotalByAccountIdAndType(message); MsgNumInfo = "<a href=\"?t=2&ir=0\" title=\"只显示未读邮件\"><b>" + UnRead + "封未读</b></a><span> / 共" + Total + "封</span>"; } HF_SiteUrl.Value = SiteUrl; } }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "application/json"; StringBuilder sb = new StringBuilder(); long AccountId = 0; int pageNum, pageSize = 0; bool IsShowDel = false; string PageSize = context.Request.QueryString["PageSize"]; string LoadType = context.Request.QueryString["LoadType"]; string strPageSize = context.Request.QueryString["pageSize"].ToString(); string strPageNum = context.Request.QueryString["currentNum"].ToString(); if (!long.TryParse(context.Request.QueryString["AccountId"].ToString(), out AccountId) || !int.TryParse(strPageNum, out pageNum) || !int.TryParse(strPageSize, out pageSize)) { context.Response.Write("{success:false,msg:'参数错误'}"); return; } Core.Business.Favorites favorite = new Core.Business.Favorites(); favorite.AccountId = AccountId; CY.UME.Core.PagingInfo pageinfo = new Core.PagingInfo { CurrentPage = pageNum, PageSize = pageSize }; IList<Core.Business.Favorites> FavoritesList = CY.UME.Core.Business.Favorites.GetAllFavoritesByType(favorite, pageinfo, LoadType); CY.UME.Web.Favorites.Index index = new Web.Favorites.Index();//收藏首页上的代码 CY.UME.Core.Business.Account CurrentAccount = CY.UME.Core.Global.GetCurrentAccount(); if (CurrentAccount != null) IsShowDel = true; foreach (Core.Business.Favorites fav in FavoritesList) { sb.Append("<div>"); sb.Append("<div class=\"collect_main\">"); sb.Append("<div class=\"collect_main_rizhi\">"); sb.Append(fav.TypeName + "</div>"); sb.Append("<div class=\"collect_main_time\">"); sb.Append(fav.DateCreated.ToString("yyyy-MM-dd HH:mm")); sb.Append("</div>"); sb.Append("<div class=\"collect_main_list\">"); sb.Append("<ul>"); sb.Append("<li class=\"tm\">"); sb.Append(index.GetContentByTypeAndId(fav.Type, fav.InstanceId)); sb.Append("</li>"); sb.Append("<li><span>来自:</span><a target=\"_blank\" href=\"../Home.aspx?uid=" + fav.AuthorId + "\">" + fav.AuthorName + "</a></li>"); sb.Append("<!--<li><span>》继续阅读</span></li>-->"); sb.Append("<li><span>"); sb.Append(fav.Content == "" ? "" : "“" + fav.Content + "”"); sb.Append("</span></li>"); sb.Append("<li><span><a class=\"reply\" fid=\"" + fav.Id + "\" href=\"javascript:void(0);\">评论(<span id=\"ReplyNum\">" + fav.ReplyNum + "</span>)</a></span></li>"); sb.Append("</ul>"); sb.Append("</div>"); if (IsShowDel && CurrentAccount.Id == fav.AccountId) {//用户在线切是自己的收藏,才显示删除按钮 sb.Append("<a href=\"javascript:void(0);\" class=\"delete\"><img src=\"../Theme/V3/images/Index/index_icon13.gif\" title=\"删除信息\"></a>"); } sb.Append("<div id=\"replylist\"></div>"); sb.Append("</div>"); sb.Append("<div class=\"fengexian\"></div>"); sb.Append("<div class=\"clear\"></div>"); sb.Append("</div>"); } context.Response.Write("{success:true,fav:'" + sb.ToString() + "'}"); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "application/json"; CY.UME.Core.Business.Account CurrentAccount = CY.UME.Core.Global.GetCurrentAccount(); if (CurrentAccount == null) { context.Response.Write("{success:false,msg:'用户未登录。'}"); return; } string SiteUrl = CY.UME.Core.Global.GetSiteUrl(); StringBuilder sb = new StringBuilder(); CY.UME.Core.Business.Messages message = new Core.Business.Messages(); message.Type = 2;//收件 message.IsRead = 0; message.AccountId = CurrentAccount.Id; //收件箱里面未读的数量 int MyMailNum = CY.UME.Core.Business.Messages.GetMessagesNumberByAccountIdOrAuthorId(message); int MessageNum = 0; CY.UME.Core.PagingInfo pageInfo = new Core.PagingInfo { CurrentPage = 1, PageSize = int.MaxValue }; CY.UME.Web.Message.ReplyTips ReplyTips = new Web.Message.ReplyTips(); List<CY.UME.Core.Business.Notice> NoticeList = ReplyTips.GetNoticeList(pageInfo); StringBuilder SBLeaveMessage = new StringBuilder(); StringBuilder SBGroupAndActive = new StringBuilder(); StringBuilder SBApplication = new StringBuilder(); if (NoticeList != null && NoticeList.Count > 0) { for (int i = 0; i < NoticeList.Count; i++) { switch (NoticeList[i].Type) { case "friend": //sb.Append("{Count:'" + NoticeList[i].Id + "',Type:'" + NoticeList[i].Type + "'"); if (NoticeList[i].InstanceId.Length > 0) { long accountId; if (CY.Utility.Common.ParseUtility.TryParseInt64(NoticeList[i].InstanceId, out accountId)) { CY.UME.Core.Business.Account account = CY.UME.Core.Business.Account.Load(accountId); if (account == null) { NoticeList[i].DeleteOnSave(); NoticeList[i].Save(); continue; } SBApplication.Append("<li InstanceId=\"" + NoticeList[i].InstanceId + "\" Type=\"" + NoticeList[i].Type + "\">"); SBApplication.Append("你收到<span class=\"msg_color\">" + NoticeList[i].Num + "条</span>好友请求"); SBApplication.Append("<a target=\"_blank\" href=\"javascript:void(0);\" class=\"confirm\">查看</a>"); SBApplication.Append("</li>"); MessageNum++; } } break; case "groupinvite": //sb.Append("{Count:'" + NoticeList[i].Id + "',InstanceId:'" + NoticeList[i].InstanceId + "',Type:'" + NoticeList[i].Type + "'"); if (NoticeList[i].InstanceId.Length > 0) { int groupinviteId = 0; int.TryParse(NoticeList[i].InstanceId, out groupinviteId); CY.UME.Core.Business.Group GroupInviteGroup = CY.UME.Core.Business.Group.Load(groupinviteId); if (GroupInviteGroup == null) { NoticeList[i].DeleteOnSave(); NoticeList[i].Save(); continue; } SBGroupAndActive.Append("<li InstanceId=\"" + NoticeList[i].InstanceId + "\" Type=\"" + NoticeList[i].Type + "\">"); SBGroupAndActive.Append("你收到<span class=\"msg_color\">" + NoticeList[i].Num + "条</span>群组邀请"); SBGroupAndActive.Append("<a target=\"_blank\" href=\"javascript:void(0);\" class=\"confirm\">查看</a>"); SBGroupAndActive.Append("</li>"); MessageNum++; } break; case "activeInviteFriend": //sb.Append("{Count:'" + NoticeList[i].Id + "',InstanceId:'" + NoticeList[i].InstanceId + "',Type:'" + NoticeList[i].Type + "'"); if (NoticeList[i].InstanceId.Length > 0) { int activeInviteFriendId = 0; int.TryParse(NoticeList[i].InstanceId, out activeInviteFriendId); CY.UME.Core.Business.Activities active = CY.UME.Core.Business.Activities.Load(activeInviteFriendId); if (active == null) { NoticeList[i].DeleteOnSave(); NoticeList[i].Save(); continue; } SBGroupAndActive.Append("<li InstanceId=\"" + NoticeList[i].InstanceId + "\" Type=\"" + NoticeList[i].Type + "\">"); SBGroupAndActive.Append("你收到<span class=\"msg_color\">" + NoticeList[i].Num + "条</span>活动邀请"); SBGroupAndActive.Append("<a target=\"_blank\" href=\"javascript:void(0);\" class=\"confirm\">查看</a>"); SBGroupAndActive.Append("</li>"); MessageNum++; } break; case "info": //sb.Append("{Count:'" + NoticeList[i].Id + "',Type:'" + NoticeList[i].Type + "'"); SBApplication.Append("<li InstanceId=\"" + NoticeList[i].InstanceId + "\" Type=\"" + NoticeList[i].Type + "\">"); SBApplication.Append("你收到<span class=\"msg_color\">" + NoticeList[i].Num + "条</span>留言"); SBApplication.Append("<a target=\"_blank\" href=\"" + SiteUrl + "/Home.aspx#msg\" class=\"confirm\">查看</a>"); SBApplication.Append("</li>"); MessageNum++; break; //case "inforeply": // long inforId; // if (CY.Utility.Common.ParseUtility.TryParseInt64(NoticeList[i].InstanceId, out inforId)) // { // CY.UME.Core.Business.SpaceComment spacecomm = CY.UME.Core.Business.SpaceComment.Load(inforId); // CY.UME.Core.Business.SpaceComment spacecomm2 = CY.UME.Core.Business.SpaceComment.Load(spacecomm.ReferedId); // if (spacecomm2 == null) // { // NoticeList[i].DeleteOnSave(); // NoticeList[i].Save(); // continue; // } // else // { // sb.Append("{Count:'" + NoticeList[i].Id + "',InstanceId:'" + NoticeList[i].InstanceId + "',Type:'" + NoticeList[i].Type + "'"); // sb.Append(",SpaceComment:'"); // sb.Append(CY.Utility.Common.StringUtility.EscapeString( // CY.Utility.Common.StringUtility.CutString(spacecomm2.Content, 25, "..."))); // sb.Append("',SpaceOwerId:'"); // sb.Append(spacecomm2.AccountId); // sb.Append("'"); //MessageNum++; // } // } // break; case "blogreply": long blogId; if (CY.Utility.Common.ParseUtility.TryParseInt64(NoticeList[i].InstanceId, out blogId)) { CY.UME.Core.Business.Blog blog = CY.UME.Core.Business.Blog.Load(blogId); if (blog == null) { NoticeList[i].DeleteOnSave(); NoticeList[i].Save(); continue; } SBLeaveMessage.Append("<li InstanceId=\"" + NoticeList[i].InstanceId + "\" Type=\"" + NoticeList[i].Type + "\">"); SBLeaveMessage.Append("你收到<span class=\"msg_color\">" + NoticeList[i].Num + "条</span>日志的回复"); SBLeaveMessage.Append("</li>"); MessageNum++; } break; case "miniblogreply": if (NoticeList[i].InstanceId.Length > 0) { long miniblogId; if (CY.Utility.Common.ParseUtility.TryParseInt64(NoticeList[i].InstanceId, out miniblogId)) { CY.UME.Core.Business.MiniBlog miniblog = CY.UME.Core.Business.MiniBlog.Load(miniblogId); if (miniblog == null) { NoticeList[i].DeleteOnSave(); NoticeList[i].Save(); continue; } SBLeaveMessage.Append("<li InstanceId=\"" + NoticeList[i].InstanceId + "\" Type=\"" + NoticeList[i].Type + "\">"); SBLeaveMessage.Append("你收到<span class=\"msg_color\">" + NoticeList[i].Num + "条</span> <a target=\"_blank\" href=\"" + SiteUrl + "/MiniBlogList.aspx?SpaceId=" + miniblog.AccountId + "&MiniBlogId=" + miniblog.Id + "\">"); SBLeaveMessage.Append(CY.Utility.Common.StringUtility.CutString(miniblog.Content, 10, "...")); SBLeaveMessage.Append("</a> 微博的回复"); SBLeaveMessage.Append("</li>"); MessageNum++; } } break; case "picreply": long picId; if (CY.Utility.Common.ParseUtility.TryParseInt64(NoticeList[i].InstanceId, out picId)) { CY.UME.Core.Business.Picture pic = CY.UME.Core.Business.Picture.Load(picId); if (pic == null) { NoticeList[i].DeleteOnSave(); NoticeList[i].Save(); continue; } CY.UME.Core.Business.Album album = CY.UME.Core.Business.Album.Load(pic.AlbumId); if (album == null) { NoticeList[i].DeleteOnSave(); NoticeList[i].Save(); continue; } SBLeaveMessage.Append("<li InstanceId=\"" + NoticeList[i].InstanceId + "\" Type=\"" + NoticeList[i].Type + "\">"); SBLeaveMessage.Append("你收到<span class=\"msg_color\">" + NoticeList[i].Num + "条</span> <a target=\"_blank\" href=\"" + SiteUrl + "/Album/PictureDetailInfo.aspx?pictureId=" + pic.Id + "\">"); SBLeaveMessage.Append(CY.Utility.Common.StringUtility.CutString(pic.Name, 10, "...")); SBLeaveMessage.Append("</a> 图片的回复"); SBLeaveMessage.Append("</li>"); MessageNum++; } break; case "topicreply": if (NoticeList[i].InstanceId.Length > 0) { Guid topicId = new Guid(NoticeList[i].InstanceId); CY.UME.Core.Business.Topic topic = CY.UME.Core.Business.Topic.Load(topicId); CY.UME.Core.Business.TopicExtend topicex = CY.UME.Core.Business.TopicExtend.Load(topicId); CY.UME.Core.Business.Group TopicReplyGroup = CY.UME.Core.Business.Group.Load(int.Parse(topicex.InstanceId)); if (topic == null) { NoticeList[i].DeleteOnSave(); NoticeList[i].Save(); continue; } SBLeaveMessage.Append("<li InstanceId=\"" + NoticeList[i].InstanceId + "\" Type=\"" + NoticeList[i].Type + "\">"); SBLeaveMessage.Append("你收到<span class=\"msg_color\">" + NoticeList[i].Num + "条</span> <a target=\"_blank\" href=\"" + SiteUrl + "/Group/TopicDetailInfo.aspx?TopicId=" + topic.Id + "\">"); SBLeaveMessage.Append(CY.Utility.Common.StringUtility.CutString(topic.Title, 10, "...")); SBLeaveMessage.Append("</a> 群组话题的回复"); SBLeaveMessage.Append("</li>"); MessageNum++; } break; case "groupinforeply": if (NoticeList[i].InstanceId.Length > 0) { int groupinfoId = 0; if (!int.TryParse(NoticeList[i].InstanceId, out groupinfoId)) { NoticeList[i].DeleteOnSave(); NoticeList[i].Save(); continue; } CY.UME.Core.Business.Group groupInfo = CY.UME.Core.Business.Group.Load(groupinfoId); if (groupInfo == null) { NoticeList[i].DeleteOnSave(); NoticeList[i].Save(); continue; } SBLeaveMessage.Append("<li InstanceId=\"" + NoticeList[i].InstanceId + "\" Type=\"" + NoticeList[i].Type + "\">"); SBLeaveMessage.Append("你收到<span class=\"msg_color\">" + NoticeList[i].Num + "条</span> 来自“"); SBLeaveMessage.Append("<a target=\"_blank\" href=\"" + SiteUrl + "/Group/Group.aspx?groupId=" + groupinfoId + "\">"); SBLeaveMessage.Append(CY.Utility.Common.StringUtility.CutString(groupInfo.Name, 10, "...")); SBLeaveMessage.Append("” </a>群组留言的回复"); SBLeaveMessage.Append("</li>"); MessageNum++; } break; case "activitesinforeply": if (NoticeList[i].InstanceId.Length > 0) { int activeId = 0; if (!int.TryParse(NoticeList[i].InstanceId, out activeId)) { NoticeList[i].DeleteOnSave(); NoticeList[i].Save(); continue; } CY.UME.Core.Business.Activities ActivitesInfoReply = CY.UME.Core.Business.Activities.Load(activeId); if (ActivitesInfoReply == null) { NoticeList[i].DeleteOnSave(); NoticeList[i].Save(); continue; } SBLeaveMessage.Append("<li InstanceId=\"" + NoticeList[i].InstanceId + "\" Type=\"" + NoticeList[i].Type + "\">"); SBLeaveMessage.Append("你收到<span class=\"msg_color\">" + NoticeList[i].Num + "条</span> “"); SBLeaveMessage.Append("<a target=\"_blank\" href=\"" + SiteUrl + "/Activities/ActiveDetail2.aspx?aid=" + ActivitesInfoReply + "\">"); SBLeaveMessage.Append(CY.Utility.Common.StringUtility.CutString(ActivitesInfoReply.Name, 10, "...")); SBLeaveMessage.Append("” </a>活动的回复"); SBLeaveMessage.Append("</li>"); MessageNum++; } break; case "activeTopicReply": if (NoticeList[i].InstanceId.Length > 0) { Guid topicId = new Guid(); topicId = new Guid(NoticeList[i].InstanceId.ToString()); CY.UME.Core.Business.Topic topic = CY.UME.Core.Business.Topic.Load(topicId); if (topic == null) { NoticeList[i].DeleteOnSave(); NoticeList[i].Save(); continue; } CY.UME.Core.Business.TopicExtend te = CY.UME.Core.Business.TopicExtend.Load(topicId); if (te == null) { NoticeList[i].DeleteOnSave(); NoticeList[i].Save(); continue; } CY.UME.Core.Business.Activities active = CY.UME.Core.Business.Activities.Load(int.Parse(te.InstanceId)); if (active == null) { NoticeList[i].DeleteOnSave(); NoticeList[i].Save(); continue; } SBLeaveMessage.Append("<li InstanceId=\"" + NoticeList[i].InstanceId + "\" Type=\"" + NoticeList[i].Type + "\">"); SBLeaveMessage.Append("你收到<span class=\"msg_color\">" + NoticeList[i].Num + "条 <a target=\"_blank\" href=\"" + SiteUrl + "/Group/TopicDetailInfo.aspx?TopicId=" + topic.Id + "\">"); SBLeaveMessage.Append(CY.Utility.Common.StringUtility.CutString(topic.Title, 10, "...")); SBLeaveMessage.Append("</a> 活动话题的回复"); SBLeaveMessage.Append("</li>"); MessageNum++; } break; case "activeCheck": if (NoticeList[i].InstanceId.Length > 0) { int id = CY.Utility.Common.ConvertUtility.ConvertToInt(NoticeList[i].InstanceId, 0); CY.UME.Core.Business.Activities active = CY.UME.Core.Business.Activities.Load(id); if (active == null) { NoticeList[i].DeleteOnSave(); NoticeList[i].Save(); continue; } SBLeaveMessage.Append("<li InstanceId=\"" + NoticeList[i].InstanceId + "\" Type=\"" + NoticeList[i].Type + "\">"); SBLeaveMessage.Append("你的“"); SBLeaveMessage.Append("<a target=\"_blank\" class=\"a_tag\" title=\"" + active.Name + "\" href=\"" + SiteUrl + "/Activities/ActiveDetail2.aspx?aid=" + active.Id + "\">"); SBLeaveMessage.Append(CY.Utility.Common.StringUtility.CutString(active.Name, 16, "...")); SBLeaveMessage.Append("</a>”活动已经通过管理员审核"); SBLeaveMessage.Append("<a href=\"javascript:void(0);\" class=\"confirm\">忽略</a>"); SBLeaveMessage.Append("</li>"); MessageNum++; } break; case "activeCheckNo": if (NoticeList[i].InstanceId.Length > 0) { int id = CY.Utility.Common.ConvertUtility.ConvertToInt(NoticeList[i].InstanceId, 0); CY.UME.Core.Business.Activities active = CY.UME.Core.Business.Activities.Load(id); if (active == null) { NoticeList[i].DeleteOnSave(); NoticeList[i].Save(); continue; } //sb.Append("{Count:1,InstanceId:'" + NoticeList[i].InstanceId + "'"); //sb.Append(",Type:'" + NoticeList[i].Type + "'"); //sb.Append(",activeId:" + active.Id); //sb.Append(",activeName:'" + CY.Utility.Common.StringUtility.EscapeString(active.Name) + "'"); //sb.Append(",content:'" + CY.Utility.Common.StringUtility.EscapeString(NoticeList[i].Content) + "'"); MessageNum++; } break; case "relativegroup"://友情小组 if (NoticeList[i].InstanceId.Length > 0) { Guid id = new Guid(NoticeList[i].InstanceId); CY.UME.Core.Business.RelativeGroup rg = CY.UME.Core.Business.RelativeGroup.Load(id); if (rg == null || rg.IsChecked) continue; CY.UME.Core.Business.Group group = CY.UME.Core.Business.Group.Load(rg.GroupId); CY.UME.Core.Business.Group relativeGroup = CY.UME.Core.Business.Group.Load(rg.RelativeGroupId); if (group == null || relativeGroup == null) { NoticeList[i].DeleteOnSave(); NoticeList[i].Save(); continue; } SBGroupAndActive.Append("<li InstanceId=\"" + NoticeList[i].InstanceId + "\" Type=\"" + NoticeList[i].Type + "\">"); SBGroupAndActive.Append("你收到<span class=\"msg_color\">" + NoticeList[i].Num + "条</span>友情小组邀请"); SBGroupAndActive.Append("<a target=\"_blank\" href=\"javascript:void(0);\" class=\"confirm\">查看</a>"); SBGroupAndActive.Append("</li>"); MessageNum++; } break; } } } else { } //CY.Utility.Common.StringUtility.EscapeString( context.Response.Write("{success:true,html:'"); if (SBLeaveMessage.Length > 0) context.Response.Write("<ul>" + SBLeaveMessage.ToString() + "</ul>"); if (SBGroupAndActive.Length > 0) context.Response.Write("<ul>" + SBGroupAndActive.ToString() + "</ul>"); if (SBApplication.Length > 0) context.Response.Write("<ul>" + SBApplication.ToString() + "</ul>"); context.Response.Write("',mailnum:'" + MyMailNum + "',msgnum:'" + MessageNum + "'}"); }