protected void Page_Load(object sender, EventArgs e) { try { long Id = 0; if (Session["user"] != null) { Id = long.Parse(Session["user"].ToString()); } else { Response.Redirect("../../Login.aspx"); return; } if (Id != 0) { Account = CY.UME.Core.Business.Account.Load(Id); List<CY.UME.Core.Business.Friendship> friendships = Account.GetMostClosedFriendships(12); foreach (CY.UME.Core.Business.Friendship fs in friendships) { if (fs.Friend != null) { Friends.Add(fs.Friend); } } TotalFriendCount = Account.GetFriendsCount(); } } catch { return; } }
protected void Page_Load(object sender, EventArgs e) { if (CurrentAccount!=null && SpaceAccount == null) { SpaceAccount = CurrentAccount; } }
protected void Page_Load(object sender, EventArgs e) { SetTitle("我的群组话题"); long spaceId = 0; loadType = HF_LoadType.Value; if (Request.QueryString["uid"] == null) { SpaceAccount = CurrentAccount; } else if (long.TryParse(Request.QueryString["uid"].ToString(), out spaceId)) { SpaceAccount = CY.UME.Core.Business.Account.Load(spaceId); } else { SpaceAccount = CurrentAccount; } if (SpaceAccount == null) { //转到404页面 Response.Redirect(SiteUrl + "/Login"); return; } if (!IsPostBack) { myGroupCount = CY.UME.Core.Business.Group.GetGroupsCountByType(-2, SpaceAccount, null); if (myGroupCount < 1) { string url = SiteUrl + "/Group/GroupList.aspx?type=-2"; Response.Redirect(url); return; } //绑定我的群组 BindMyGroup(SpaceAccount); if (Request.QueryString["type"] != null) { loadType = Request.QueryString["type"].ToString(); if (Request.QueryString["i"] != null) { HF_Select_Index.Value = Request.QueryString["i"].ToString(); } } CY.UME.Core.PagingInfo pageInfo = new CY.UME.Core.PagingInfo(); pageInfo.CurrentPage = 1; pageInfo.PageSize = pageSize; recordCount = CY.UME.Core.Business.Topic.GetTopicCountByGroupsWhereAccountIn(CurrentAccount.Id); HF_TotalRecords.Value = recordCount.ToString(); HF_SiteUrl.Value = SiteUrl; HF_PageSize.Value = pageSize.ToString(); HF_CurrentAccount_Id.Value = SpaceAccount.Id.ToString(); BindGroupTopics(loadType, pageInfo, SpaceAccount.Id.ToString()); } }
protected void btnAdd_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(tbName.Text.Trim())) { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script>alert('姓名不能为空');</script>"); tbName.Focus(); return; } else if (string.IsNullOrEmpty(tbPass.Text.Trim()) || string.IsNullOrEmpty(tbPassConfirm.Text.Trim())) { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script>alert('密码不能为空');</script>"); tbPass.Focus(); return; } else if (!string.Equals(tbPass.Text.Trim(), tbPassConfirm.Text.Trim())) { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script>alert('二次密码不相同');</script>"); tbPassConfirm.Focus(); return; } else { try { CY.UME.Core.Business.AccountExtend aTemp = CY.UME.Core.Business.AccountExtend.Load(tbEmail.Text.Trim()); if (aTemp== null) { CY.UME.Core.Business.Account account = new CY.UME.Core.Business.Account(); account.Name = tbName.Text.Trim(); account.IsPublic = true; account.DateCreated = DateTime.Now; account.Save(); CY.UME.Core.Business.AccountExtend accountExtent = CY.UME.Core.Business.AccountExtend.Load(account.Id); accountExtent.IsEmailChecked = true; accountExtent.Email = tbEmail.Text.Trim(); CY.Security.SecurityHelper sh = new CY.Security.SecurityHelper(); accountExtent.Password = sh.ComputeMD5Hash(tbPass.Text.Trim()); accountExtent.IsShow = 0; accountExtent.Save(); Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script>alert('新增成功');window.location.href='PublicAccount.aspx'</script>"); } else { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script>alert('邮箱不能重复');</script>"); tbEmail.Focus(); return; } } catch (Exception ex) { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script>alert('" + ex.Message + "');</script>"); return; } } }
private void BindContolInfo() { SpaceAccount = base.CurrentAccount; userInfo.SpaceAccount = SpaceAccount; userInfo.CurrentAccount = base.CurrentAccount; myGroup.CurrentAccount = CurrentAccount; myFriend.CurrentAccount = CurrentAccount; //hotOrganizerMy.CurentAccount = CurrentAccount; }
private void BindContolInfo() { SpaceAccount = base.CurrentAccount; userInfo.SpaceAccount = SpaceAccount; userInfo.CurrentAccount = base.CurrentAccount; HotTopic.currentAccount = base.CurrentAccount; LeaveWord.CurrentAccount = base.CurrentAccount; meun1.CurrentAccount = base.CurrentAccount; }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["blogId"] == null) { throw new Exception("参数错误"); } else { long blogId = 0; if (long.TryParse(Request.QueryString["blogId"].ToString(), out blogId)) { blog = CY.UME.Core.Business.Blog.Load(blogId); //获取博客信息 if (blog == null) { throw new Exception("访问页面不存在"); } //if (!blog.CheckViewPermission(CurrentAccount)) //{ // throw new Exception("您无权访问该页面"); //} long spaceId = blog.AccountId; SpaceAccount = CY.UME.Core.Business.Account.Load(spaceId); blogComments = CY.UME.Core.Business.BlogComment.GetAllBlogCommentsByBlogId(blog); //获取博客评论信息 CY.UME.Core.PagingInfo pagingInfo = new CY.UME.Core.PagingInfo(); pagingInfo.CurrentPage = 1; pagingInfo.PageSize = 10; IList<CY.UME.Core.Business.Blog> Blogs = CY.UME.Core.Business.Blog.GetTopBlogsByAccountId(SpaceAccount, pagingInfo, blog.ViewSet); blogBriefList.Blogs = Blogs; blogBriefList.spaceAccount = SpaceAccount; //增加博客阅读数 if (CurrentAccount != null && blog.AccountId != (CurrentAccount == null ? SpaceAccount.Id : base.CurrentAccount.Id)) { CY.UME.Core.Business.Blog.AddBlogViewNum(blog.Id); } SetTitle(blog.Subject); HF_AccountId.Value = spaceId.ToString(); HF_BlogId.Value = blogId.ToString(); blog_HiddenTotalRecords.Value = Blogs.Count.ToString(); blog_HiddenReplyTotalRecords.Value = blogComments.Count.ToString(); } else { throw new Exception("参数错误"); } UserInfo1.SpaceAccount = SpaceAccount; } }
protected void Page_Load(object sender, EventArgs e) { int spaceId = 0; if (Request.QueryString["SpaceId"] == null) { SpaceAccount = base.CurrentAccount; } else if (int.TryParse(Request.QueryString["SpaceId"].ToString(), out spaceId)) { SpaceAccount = CY.UME.Core.Business.Account.Load(spaceId); if (SpaceAccount == null) { SpaceAccount = base.CurrentAccount; } } else { SpaceAccount = base.CurrentAccount; } CY.UME.Core.Business.AccountExtend ae = SpaceAccount.ExtendInfo; CY.UME.Core.Business.AccountExtend cae = base.CurrentAccount.ExtendInfo; if (ae == null || ae.LibUserId < 1) { try { MyStatus.Enabled = false; MyBooks.Enabled = false; BookInfo1.Enabled = false; Attention1.Enabled = false; Enabled = false; } catch { } } MyStatus.SpaceAccount = SpaceAccount; MyBooks.SpaceAccountId = SpaceAccount.Id; MyBooks.CurrentAccountId = base.CurrentAccount.Id; try { BookInfo1.SpaceAccount = SpaceAccount; Attention1.CurrentAccount = base.CurrentAccount; } catch { } personalState.SpaceAccount = SpaceAccount; personalState.CurrentAccount = base.CurrentAccount; AccountCode.Text = SpaceAccount.Code; }
protected void Page_Load(object sender, EventArgs e) { SetTitle("好友列表"); long spaceId = 0; loadType = HF_Load_Type.Value; if (Request.QueryString["uid"] == null) { SpaceAccount = CurrentAccount; } else if (long.TryParse(Request.QueryString["uid"].ToString(), out spaceId)) { SpaceAccount = CY.UME.Core.Business.Account.Load(spaceId); } else { SpaceAccount = CurrentAccount; } if (SpaceAccount == null) { //转到404页面 Response.Redirect(SiteUrl + "/Login"); return; } if (!IsPostBack) { if (Request.QueryString["type"] != null) { loadType = Request.QueryString["type"].ToString(); if (Request.QueryString["i"] != null) { HF_Select_Index.Value = Request.QueryString["i"].ToString(); } } CY.UME.Core.PagingInfo pInfo = new CY.UME.Core.PagingInfo(); pInfo.CurrentPage = 1; pInfo.PageSize = pageSize; BindFriendList(loadType, SpaceAccount.Id.ToString(), pInfo); //加载列表 HF_SiteUrl.Value = SiteUrl; HF_CuurentAccountId.Value = SpaceAccount.Id.ToString(); UserInfo1.SpaceAccount = SpaceAccount; HF_Load_Type.Value = loadType.ToLower(); } }
/// <summary> /// 我关注人的动态 /// </summary> protected void BindAccountTrends() { CY.UME.Core.Business.Account account = new CY.UME.Core.Business.Account(); int Topnum = 0; int pageSize = 5; string oderby = ""; string isdiver = "2"; string topnum = "5"; string type = ""; //CY.UME.Core.Business.Account acc = CY.UME.Core.Business.Account.Load(CurrentAccount.Id); List<CY.UME.Core.Business.Account> acclist = new List<CY.UME.Core.Business.Account>(); CY.UME.Core.PagingInfo pinfo = new CY.UME.Core.PagingInfo { CurrentPage = 1, PageSize = pageSize }; if (oderby == "" || oderby == "newcear" || oderby == "name") { if (isdiver != "2") { if (type == "followed") { acclist = CY.UME.Core.Business.Account.GetFollowedAccountByCurrentAccount(CurrentAccount.Id, pinfo, oderby) as List<CY.UME.Core.Business.Account>; } else { acclist = CY.UME.Core.Business.Account.GetFollowerAccountByCurrentAccount(CurrentAccount.Id, pinfo, oderby) as List<CY.UME.Core.Business.Account>; } if (isdiver == "1") { Topnum = pageSize - acclist.Count; CY.UME.Core.PagingInfo pinfotemp = new CY.UME.Core.PagingInfo { CurrentPage = 1, PageSize = pageSize }; List<CY.UME.Core.Business.Account> frendlist = CY.UME.Core.Business.Friendship.GetAllFriendshipByOder(CurrentAccount.Id, pinfotemp, oderby, Topnum) as List<CY.UME.Core.Business.Account>; acclist.AddRange(frendlist); } } if (isdiver == "2") { if (CurrentAccount == null) acclist = CY.UME.Core.Business.Friendship.GetAllFriendshipByOder(SpaceAccount.Id, pinfo, oderby, int.Parse(topnum)) as List<CY.UME.Core.Business.Account>; else acclist = CY.UME.Core.Business.Friendship.GetAllFriendshipByOder(CurrentAccount.Id, pinfo, oderby, int.Parse(topnum)) as List<CY.UME.Core.Business.Account>; } } RPT_AccountTrendsList.DataSourceID = ""; RPT_AccountTrendsList.DataSource = acclist; RPT_AccountTrendsList.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["uid"] != null) { long Uid = CY.Utility.Common.ConvertUtility.ConvertToLong(Request.QueryString["uid"], -1); if (Uid != -1) { CY.UME.Core.Business.Account account = new CY.UME.Core.Business.Account(); account.Id = Uid; lblBlog.Text = Core.Business.Blog.GetBlogsNum(account, 0).ToString(); lblAlbum.Text = Core.Business.Album.GetAlbumCountByAccount(account).ToString(); lblMiniBlog.Text = Core.Business.MiniBlog.GetMiniBlogsCountByAccount(account).ToString(); } } }
protected void Page_Load(object sender, EventArgs e) { SetTitle("许愿墙 "); if (SpaceAccount == null) { SpaceAccount = base.CurrentAccount; } if (!IsPostBack) { //Header1.ShowBigNav = true; if (CurrentAccount != null) { personalState.SpaceAccount = base.CurrentAccount; personalState.CurrentAccount = base.CurrentAccount; } if (Request.QueryString["uid"] != null) { long uid = CY.Utility.Common.ConvertUtility.ConvertToLong(Request.QueryString["uid"], -1); CY.UME.Core.Business.Account account = CY.UME.Core.Business.Account.Load(uid); personalState.SpaceAccount = account; SpaceAccount = account; } /******************第一天活动****************************/ if (Request.QueryString["mfd"] != null) { string isFirstDayParam =Server.UrlDecode(Request.QueryString["mfd"].ToString().Trim()); if (isFirstDayParam == "myfirstday") { IsFirstDay = "1"; } } /****************第一天活动结束**************************/ } }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["uid"] == null || Request.QueryString["albumId"] == null) { throw new Exception("参数错误"); } long spaceAccountId = 0; string strSpaceAccountId = Request.QueryString["uid"].ToString(); string strAlbumId = Request.QueryString["albumId"].ToString(); if (!long.TryParse(strSpaceAccountId, out spaceAccountId)) { throw new Exception("参数无效"); } ViewState["spaceAccountId"] = spaceAccountId; ViewState["albumId"] = strAlbumId; SpaceAccount = CY.UME.Core.Business.Account.Load(spaceAccountId); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { CY.UME.Core.PagingInfo pageInfo = new CY.UME.Core.PagingInfo(); pageInfo.CurrentPage = 1; pageInfo.PageSize = 18; CY.UME.Core.Business.AccountGroup ag = new CY.UME.Core.Business.AccountGroup(); IList<CY.UME.Core.Business.AccountGroup> agList = ag.GetAccountGroupByGroupIdAndRoleAndAccountId(group,-1, 2, null, pageInfo); foreach (CY.UME.Core.Business.AccountGroup agTemp in agList) { CY.UME.Core.Business.Account account = new CY.UME.Core.Business.Account(); account = CY.UME.Core.Business.Account.Load(agTemp.AccountId); accountList.Add(account); } } }
protected void Page_Load(object sender, EventArgs e) { try { acc = CY.UME.Core.Business.Account.Load(SpaceAccount.Id); if (acc != null && !acc.IsNew) { if (acc.Id.ToString() != Session["user"].ToString()) { showmobile = false; } CearedNum = CY.UME.Core.Business.AccountFollower.GetNumberByFollower(acc) + CY.UME.Core.Business.Friendship.GetFriendshipCount(acc); FansNum = CY.UME.Core.Business.AccountFollower.GetNumberByAccount(acc) + CY.UME.Core.Business.Friendship.GetFriendshipCount(acc); MicroblogNum = CY.UME.Core.Business.MiniBlog.GetMiniBlogsCountByAccount(acc); if (acc.ExtendInfo != null && acc.ExtendInfo.Id != 0) { if (acc.ExtendInfo.ResideCity != null) { LblCity.Text = acc.ExtendInfo.ResideCity.Name; } if (acc.ExtendInfo.ResideProvince != null) { lbProvince.Text = acc.ExtendInfo.ResideProvince.Name; } if (acc.UniversityInfo != null) { lbUniversity.Text = acc.UniversityInfo.Name; } } } } catch { return; } }
public void BindFriend(String AccountName, String IsChecked, String Sort, Boolean isTrue) { CY.UME.Core.PagingInfo pagingInfo = new CY.UME.Core.PagingInfo(); pagingInfo.CurrentPage = AspNetPager1.CurrentPageIndex; pagingInfo.PageSize = AspNetPager1.PageSize = SetCurrentPageSize1.CurrentPageSize; CY.UME.Core.Business.Account account = new CY.UME.Core.Business.Account(); account.Id = CY.Utility.Common.ConvertUtility.ConvertToInt(ViewState["AccountId"], -1); account.Name = AccountName; DataTable FriendShipTB = CY.UME.Core.Business.Friendship.GetAllFriendShipByAccount(account, CY.Utility.Common.ConvertUtility.ConvertToInt(IsChecked, -1), Sort, pagingInfo); if (FriendShipTB.Rows.Count >= 1) { if (isTrue) { AspNetPager1.RecordCount = CY.UME.Core.Business.Friendship.GetFriendshipCountByAccount(account, CY.Utility.Common.ConvertUtility.ConvertToInt(IsChecked, -1)); //绑定总条数 GetAccountsCount } //绑定用户 AspNetPager1.Visible = true; Repeater2.Visible = false; Repeater1.Visible = true; Repeater1.DataSourceID = ""; Repeater1.DataSource = FriendShipTB; Repeater1.DataBind(); } else { Repeater1.Visible = false; Repeater2.Visible = true; Repeater2.DataSourceID = ""; Repeater2.DataSource = BindNoData("暂无数据"); Repeater2.DataBind(); AspNetPager1.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { CY.UME.Core.Business.Album album = new CY.UME.Core.Business.Album(); #region validate al_HiddenSiteUrl.Value = SiteUrl; al_HiddenCurrentAccountId.Value = CurrentAccount.Id.ToString(); long spaceId = 0, albumId = 0; int groupId = 0; SetTitle("上传照片 "); if (Request.QueryString["uid"] == null) { SpaceAccount = CurrentAccount; } else if (long.TryParse(Request.QueryString["uid"].ToString(), out spaceId)) { SpaceAccount = CY.UME.Core.Business.Account.Load(spaceId); } else { SpaceAccount = CurrentAccount; } if (Request.QueryString["albumId"] != null && long.TryParse(Request.QueryString["albumId"].ToString(), out albumId)) { album = CY.UME.Core.Business.Album.Load(albumId); } if (Request.QueryString["gid"] == null) { throw new Exception("页面不存在"); } if (!int.TryParse(Request.QueryString["gid"].ToString(), out groupId)) { throw new Exception("页面不存在"); } al_HiddenGroupId.Value = groupId.ToString(); group = CY.UME.Core.Business.Group.Load(groupId); #endregion //UserInfo1.SpaceAccount = SpaceAccount; if (!IsPostBack) { if (Request.QueryString["code"] != null) { string advParam = Request.QueryString["code"].ToString(); CY.UME.Core.Business.AdvancedPage ap = CY.UME.Core.Business.AdvancedPage.SelectByCode(advParam); if (ap != null) { flashUpload.QueryParameters = "code=" + advParam + "&"; album = GetActivityAlbum(ap.Code, ap.Id.ToString(), ap.Name); HiddenActivityAlbumId.Value = album.Id.ToString(); } } /*********************第一天活动************************/ else if (Request.QueryString["mfd"] != null) { string myfirstdayParam = Server.UrlDecode(Request.QueryString["mfd"].ToString()); if (myfirstdayParam == "myfirstday") { flashUpload.QueryParameters = "IsFirstDay=myfirstday&"; HiddenIsFirstDay.Value = "myfirstday"; album = GetActivityAlbum("myfirstday", "myfirstday", "找人相册"); HiddenActivityAlbumId.Value = album.Id.ToString(); } } /***********************第一天活动结束*****************/ if (album == null || album.Id == 0) { string strAlbumId = BingAlbumType(CurrentAccount,group); if (strAlbumId == "false") { Page.ClientScript.RegisterClientScriptBlock(GetType(), "", "<script>cy.ume.ui.window({ title: '提示', content:'请先创建相册'});window.location.href='AlbumEdit.aspx?SpaceId=" + CurrentAccount.Id.ToString() + "'</script>"); return; } LblTitle.Text = "上传图片"; flashUpload.QueryParameters = "albumId=" + strAlbumId + "&accountId=" + CurrentAccount.Id.ToString() + "&groupId=" + groupId.ToString(); //LblAlbum.Visible = false; } else { LblDescription.Visible = false; DDLAlbum.Visible = false; //LblAlbum.Visible = true; //LblAlbum.Text = album.Name; LblTitle.Text = album.Name; flashUpload.QueryParameters += "albumId=" + album.Id.ToString() + "&accountId=" + CurrentAccount.Id.ToString() + "&groupId=" + groupId.ToString(); } string noticeContent = String.Empty; noticeContent = TBXNoticeInfo.Text.Trim(); if (noticeContent.Length == 0) { noticeContent = "上传了新照片"; } if (CBMagic.Checked) { noticeContent = "<span class=\"magic\">" + noticeContent; noticeContent += "</span>"; } flashUpload.QueryParameters += "¬iceContent=" + Server.UrlEncode(noticeContent); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Guid topicId = new Guid(); if (Request.QueryString["TopicId"] == null) { throw new Exception("您所访问的页面不存在"); } if (Request.QueryString["TopicId"].ToString().Trim().Length == 0) { throw new Exception("您所访问的页面不存在"); } else { topicId = new Guid(Request.QueryString["TopicId"].ToString().Trim()); } CY.UME.Core.Business.Account author = new CY.UME.Core.Business.Account(); topic = CY.UME.Core.Business.Topic.Load(topicId); CY.UME.Core.Business.TopicExtend te = new CY.UME.Core.Business.TopicExtend(); CY.UME.Core.Business.Group group = new CY.UME.Core.Business.Group(); if (topic == null) { topic = new CY.UME.Core.Business.Topic(); AuthorName = "无"; topic.AccountId = 0; topic.Content = "<div style='font-size:18px;'>该话题所属群不存在或已被组长删除。</div>"; groupId = 3;//返回默认群,3为Ume创造者。 } else { author = CY.UME.Core.Business.Account.Load(topic.AccountId); if (author != null) AuthorName = author.Name; if (CurrentAccount != null) { tdi_HiddenCurrentAccountId.Value = CurrentAccount.Id.ToString(); } else { tdi_HiddenCurrentAccountId.Value = "0"; } topic.ViewNum += 1; topic.Save(); te = CY.UME.Core.Business.TopicExtend.Load(topic.Id); if (te != null) group = CY.UME.Core.Business.Group.Load(int.Parse(te.InstanceId)); //if (group == null) //{ // throw new Exception("该话题所属群不存在或已被删除"); //} if (group != null) uc_NewestTopices.group = group; bool ismember = group.CheckIsGroupMember(CurrentAccount); bool ismanage = group.CheckIsManager(CurrentAccount); if (group.AddTopicReplyPermission == 0) { topicreply = true; } else if (group.AddTopicReplyPermission == 1) { if (ismember) { topicreply = true; } } groupId = group.Id; AuthorId = te.AccountId; GroupName = group.Name; HF_GroupId.Value = groupId.ToString(); int pageSize = 20; int pageNum = 1; CY.UME.Core.PagingInfo pageInfo = new CY.UME.Core.PagingInfo(); pageInfo.CurrentPage = pageNum; pageInfo.PageSize = pageSize; topicReplyList = CY.UME.Core.Business.TopicReply.GetReplyByTopicIdAndPages(topicId, pageInfo); int topicreplycount = CY.UME.Core.Business.TopicReply.GetReplyCountByTopicId(topic.Id); uc_GroupInfo.group = group; tdi_HiddenPageSize.Value = pageSize.ToString(); tdi_HiddenRecordsCount.Value = topicreplycount.ToString(); tdi_HiddenSiteUrl.Value = SiteUrl; tdi_HiddenTopicId.Value = topic.Id.ToString(); int activeId = 0; if (int.TryParse(Request.QueryString["activeId"], out activeId)) {//活动 CY.UME.Core.Business.Activities active = CY.UME.Core.Business.Activities.Load(activeId); if (active != null) GroupName = active.Name; HF_ActiveId.Value = activeId.ToString(); } SetTitle(GroupName + " - 话题"); } } }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "application/json"; CY.UME.Core.Business.Account currentAccount; #region Validation currentAccount = CY.UME.Core.Global.GetCurrentAccount(); if (currentAccount == null) { context.Response.Write("{success:false,msg:'登录超时,请重新登录'}"); return; } #endregion try { StringBuilder sb = new StringBuilder(); sb.Append("{success: true, "); List<CY.UME.Core.Business.Notice> notices = currentAccount.GetUnreadNotice("info"); notices.AddRange(currentAccount.GetUnreadNotice("inforeply")); notices.AddRange(currentAccount.GetUnreadNotice("blogreply")); //notices.AddRange(currentAccount.GetUnreadNotice("miniblog")); notices.AddRange(currentAccount.GetUnreadNotice("miniblogreply")); notices.AddRange(currentAccount.GetUnreadNotice("picreply")); /*************************我的第一天********************************/ notices.AddRange(currentAccount.GetUnreadNotice("firstpicreply")); /***********************我的第一天结束******************************************/ notices.AddRange(currentAccount.GetUnreadNotice("pubtopic")); notices.AddRange(currentAccount.GetUnreadNotice("topicreply")); notices.AddRange(currentAccount.GetUnreadNotice("groupinforeply")); /*******活动*************/ notices.AddRange(currentAccount.GetUnreadNotice("activeinforeply"));//活动留言回复 notices.AddRange(currentAccount.GetUnreadNotice("activites")); //活动发起新话题 notices.AddRange(currentAccount.GetUnreadNotice("activeTopic")); //活动审核通过 notices.AddRange(currentAccount.GetUnreadNotice("activeCheck"));//活动审核通过 notices.AddRange(currentAccount.GetUnreadNotice("activeTopicReply"));//活动话题回复 notices.AddRange(currentAccount.GetUnreadNotice("activeCheckNo"));//活动审核不通过 /********************/ sb.Append("notices: ["); int count = 0; if (notices.Count > 0) { CY.UME.Core.Business.NoticeComparer comparer = new CY.UME.Core.Business.NoticeComparer(); notices.Sort(comparer); CY.UME.Core.Business.Account author = new CY.UME.Core.Business.Account(); for (int i = 0, j = notices.Count; i < j; i++) { CY.UME.Core.Business.Notice notice = notices[i]; if (notice.Type != "activeCheck") { author = CY.UME.Core.Business.Account.Load(notice.AuthorId); if (author == null) { continue; } } StringBuilder cur = new StringBuilder(); cur.Append("{id:'"); cur.Append(notice.Id); cur.Append("', authorId:'"); cur.Append(notice.AuthorId); cur.Append("', accountId:'"); cur.Append(notice.AccountId); cur.Append("', authorName:'"); cur.Append(CY.Utility.Common.StringUtility.EscapeString(author.Name)); cur.Append("',content: '"); cur.Append(CY.Utility.Common.StringUtility.EscapeString(notice.Content)); cur.Append("',type:'"); cur.Append(notice.Type); cur.Append("',instanceId:'"); cur.Append(notice.InstanceId); cur.Append("'"); switch (notice.Type) { case "miniblogreply": long miniBlogId; if (CY.Utility.Common.ParseUtility.TryParseInt64(notice.InstanceId, out miniBlogId)) { CY.UME.Core.Business.MiniBlog miniBlog = CY.UME.Core.Business.MiniBlog.Load(miniBlogId); if (miniBlog == null) { notice.DeleteOnSave(); notice.Save(); continue; } else { cur.Append(",miniBlogContent:'"); cur.Append(CY.Utility.Common.StringUtility.EscapeString(miniBlog.Content)); cur.Append("',miniBlogOwerId:'"); cur.Append(miniBlog.AccountId); cur.Append("'"); } } break; case "blogreply": long blogId; if (CY.Utility.Common.ParseUtility.TryParseInt64(notice.InstanceId, out blogId)) { CY.UME.Core.Business.Blog blog = CY.UME.Core.Business.Blog.Load(blogId); if (blog == null) { notice.DeleteOnSave(); notice.Save(); continue; } else { cur.Append(",blogSubject:'"); cur.Append(CY.Utility.Common.StringUtility.EscapeString( CY.Utility.Common.StringUtility.CutString(blog.Subject, 30, "..."))); cur.Append("',blogOwerId:'"); cur.Append(blog.AccountId); cur.Append("'"); } } break; case "picreply": long picId; if (CY.Utility.Common.ParseUtility.TryParseInt64(notice.InstanceId, out picId)) { CY.UME.Core.Business.Picture pic = CY.UME.Core.Business.Picture.Load(picId); if (pic == null) { notice.DeleteOnSave(); notice.Save(); continue; } else { cur.Append(",pictureId:'"); cur.Append(pic.Id); cur.Append("',pictureName:'"); cur.Append(CY.Utility.Common.StringUtility.EscapeString(CY.Utility.Common.StringUtility.CutString(pic.Name, 30, "..."))); cur.Append("'"); } } break; /**************************************************废除的代码/************************************************* case "firstpicreply": if (notice.InstanceId.Length > 0) { Guid firstpicId = new Guid(notice.InstanceId); CY.UME.Core.Business.FirstDayAccountPic firstpic = CY.UME.Core.Business.FirstDayAccountPic.Load(firstpicId); if (firstpic == null) { notice.DeleteOnSave(); notice.Save(); continue; } else { cur.Append(",firstPictureId:'"); cur.Append(firstpicId); cur.Append("'"); } } break;*/ case "topicreply": if (notice.InstanceId.Length > 0) { Guid topicId = new Guid(notice.InstanceId); CY.UME.Core.Business.Topic topic = CY.UME.Core.Business.Topic.Load(topicId); if (topic == null) { notice.DeleteOnSave(); notice.Save(); continue; } else { cur.Append(",topicId:'"); cur.Append(topicId); cur.Append("',topicName:'"); cur.Append(CY.Utility.Common.StringUtility.EscapeString(CY.Utility.Common.StringUtility.CutString(topic.Title, 30, "...")) + "'"); } } break; case "pubtopic": if (notice.InstanceId.Length > 0) { Guid topicId = new Guid(notice.InstanceId); CY.UME.Core.Business.Topic topic = CY.UME.Core.Business.Topic.Load(topicId); if (topic == null) { notice.DeleteOnSave(); notice.Save(); continue; } CY.UME.Core.Business.TopicExtend te = CY.UME.Core.Business.TopicExtend.Load(topicId); if (te == null) { notice.DeleteOnSave(); notice.Save(); continue; } int groupId = 0; if (!int.TryParse(te.InstanceId, out groupId)) { notice.DeleteOnSave(); notice.Save(); continue; } CY.UME.Core.Business.Group group = CY.UME.Core.Business.Group.Load(groupId); if (group == null) { notice.DeleteOnSave(); notice.Save(); continue; } cur.Append(",topicId:'"); cur.Append(topicId); cur.Append("',topicName:'"); cur.Append(CY.Utility.Common.StringUtility.EscapeString(CY.Utility.Common.StringUtility.CutString(topic.Title, 30, "...")) + "'"); cur.Append(",groupId:" + groupId); cur.Append(",groupName:'" + CY.Utility.Common.StringUtility.EscapeString(group.Name) + "'"); } break; case "groupinforeply": if (notice.InstanceId.Length > 0) { int groupinfoId = 0; if (!int.TryParse(notice.InstanceId, out groupinfoId)) { continue; } CY.UME.Core.Business.Group groupInfo = CY.UME.Core.Business.Group.Load(groupinfoId); if (groupInfo == null) { continue; } cur.Append(",groupId:" + groupinfoId); cur.Append(",groupName:'" + CY.Utility.Common.StringUtility.EscapeString(groupInfo.Name) + "'"); } break; case "activeinforeply": case "activites": if (notice.InstanceId.Length > 0) { int activeId = 0; if (!int.TryParse(notice.InstanceId, out activeId)) { continue; } CY.UME.Core.Business.Activities active = CY.UME.Core.Business.Activities.Load(activeId); if (active == null) { continue; } cur.Append(",activeId:" + activeId); cur.Append(",activeName:'" + CY.Utility.Common.StringUtility.EscapeString(active.Name) + "'"); } break; case "activeTopic": case "activeTopicReply": if (notice.InstanceId.Length > 0) { Guid topicId = new Guid(); topicId = new Guid(notice.InstanceId.ToString()); CY.UME.Core.Business.Topic topic = CY.UME.Core.Business.Topic.Load(topicId); if (topic == null) continue; CY.UME.Core.Business.TopicExtend te = CY.UME.Core.Business.TopicExtend.Load(topicId); if (te == null) continue; CY.UME.Core.Business.Activities active = CY.UME.Core.Business.Activities.Load(int.Parse(te.InstanceId)); if (active == null) { continue; } cur.Append(",activeId:" + active.Id); cur.Append(",activeName:'" + CY.Utility.Common.StringUtility.EscapeString(active.Name) + "'"); cur.Append(",topicID:'" + topic.Id + "'"); cur.Append(",topicTitle:'" + CY.Utility.Common.StringUtility.EscapeString(topic.Title) + "'"); } break; case "activeCheck": if (notice.InstanceId.Length > 0) { int id = CY.Utility.Common.ConvertUtility.ConvertToInt(notice.InstanceId, 0); CY.UME.Core.Business.Activities active = CY.UME.Core.Business.Activities.Load(id); if (active == null) continue; cur.Append(",activeId:" + active.Id); cur.Append(",activeName:'" + CY.Utility.Common.StringUtility.EscapeString(active.Name) + "'"); } break; case "activeCheckNo": if (notice.InstanceId.Length > 0) { int id = CY.Utility.Common.ConvertUtility.ConvertToInt(notice.InstanceId, 0); CY.UME.Core.Business.Activities active = CY.UME.Core.Business.Activities.Load(id); if (active == null) continue; cur.Append(",activeId:" + active.Id); cur.Append(",activeName:'" + CY.Utility.Common.StringUtility.EscapeString(active.Name) + "'"); cur.Append(",content:'"+CY.Utility.Common.StringUtility.EscapeString(notice.Content)+"'"); } break; } cur.Append("},"); count++; sb.Append(cur.ToString()); } if (count > 0) { sb.Remove(sb.Length - 1, 1); } } sb.Append("],count: "); sb.Append(count); sb.Append("}"); context.Response.Write(sb.ToString()); } catch { context.Response.Clear(); context.Response.Write("{success: false, msg: '服务器忙,请稍后再试'}"); } }
protected void Page_Load(object sender, EventArgs e) { long spaceId = 0; if (Request.QueryString["SpaceId"] == null) { throw new Exception("参数错误"); } else if (!long.TryParse(Request.QueryString["SpaceId"].ToString(), out spaceId)) { throw new Exception("参数错误"); } SpaceAccount = CY.UME.Core.Business.Account.Load(spaceId); if (CurrentAccount.Equals(SpaceAccount)) { HF_IsEdit.Value = true.ToString(); } else { HF_IsEdit.Value = false.ToString(); } SetTitle("相册"); if (!IsPostBack) { BindAlbumList(); BindAccountTrends(); UserInfo1.SpaceAccount = SpaceAccount; //VisitorList.CurrentAccount = SpaceAccount; FollowerListId.CurrentFollower = SpaceAccount; } }
protected void Page_Load(object sender, EventArgs e) { SetTitle("群组照片 "); #region 判断验证 long pictureId = 0; int groupId = 0; if (Request.QueryString["pictureId"] == null) { throw new Exception("参数不存在"); } else if (!long.TryParse(Request.QueryString["pictureId"].ToString(), out pictureId)) { throw new Exception("参数不合法"); } picture = CY.UME.Core.Business.Picture.Load(pictureId); if (picture == null) { throw new Exception("图片不存在或已被删除"); } album = CY.UME.Core.Business.Album.Load(picture.AlbumId); albumExtend = CY.UME.Core.Business.AlbumExtend.Load(album.Id); SpaceAccount = CY.UME.Core.Business.Account.Load(albumExtend.AccountId); if (SpaceAccount == null) { throw new Exception("访问页面不存在"); } if (Request.QueryString["groupId"] == null) { throw new Exception("参数不存在"); } if (!int.TryParse(Request.QueryString["groupId"].ToString(), out groupId)) { throw new Exception("参数不合法"); } group = CY.UME.Core.Business.Group.Load(groupId); al_HiddenGroupId.Value = groupId.ToString(); if (CurrentAccount == null || CurrentAccount.Id != SpaceAccount.Id) { if (album.ViewPermission == 1)//仅好友才能访问 { if (CurrentAccount == null || !SpaceAccount.HasFriendshipWith(CurrentAccount))//判断是否是好友 { Response.Write("您无权访问该页面"); return; } } else if (album.ViewPermission == 2)//密码访问 { if (Session["AlbumPassword"] == null) { Response.Redirect("ViewEnAlbum.aspx?uid=" + SpaceAccount.Id + "&albumId=" + album.Id); return; } else { string password = Session["AlbumPassword"].ToString(); if (password != album.ViewPassword)//判断密码是否正确 { Response.Redirect("ViewEnAlbum.aspx?uid=" + SpaceAccount.Id + "&albumId=" + album.Id); return; } } } else if (album.ViewPermission == 3) { Response.Write("您无权访问该页面"); return; } } #endregion if (!IsPostBack) { if (CurrentAccount != null) { HF_CurrentAccount_Id.Value = CurrentAccount.Id.ToString(); } LblTitleName.Text = group.Name; picInfoMana.Visible = true; LblAlbumName.Text = album.Name; if (album.IsAvatar) {//头像相册 uploadPic.Visible = false; UploadAvatar.Visible = true; } else {//普通相册 uploadPic.Visible = true; UploadAvatar.Visible = false; } LBLAlbumNameAndLink.Text = "<a href=\"PictureList.aspx?albumId=" + album.Id + "&spaceId=" + CurrentAccount.Id + "\">" + LblAlbumName.Text + "</a>"; //UserInfo1.SpaceAccount = SpaceAccount;//个人信息 FollowerListId.CurrentFollower = SpaceAccount; CY.UME.Core.PagingInfo pagingInfo = new CY.UME.Core.PagingInfo(); pagingInfo.CurrentPage = 1; pagingInfo.PageSize = int.MaxValue; IList<CY.UME.Core.Business.Picture> picList = CY.UME.Core.Business.Picture.GetAllPicture(album, pagingInfo); StringBuilder sb = new StringBuilder(); sb.Append("{"); sb.Append("TotalRecords:'" + album.PhotoCount.ToString() + "'"); sb.Append(",AccountId:'" + SpaceAccount.Id.ToString() + "'"); sb.Append(",CurrentId:'" + (CurrentAccount == null ? "0" : CurrentAccount.Id.ToString()) + "'"); sb.Append(",AlbumId:'" + album.Id.ToString() + "'"); sb.Append(",PictureId:'" + pictureId.ToString() + "'"); sb.Append(",SiteUrl:'" + SiteUrl + "'"); sb.Append(",Pictures:["); int Num = 1; bool IsCheck = false; foreach (CY.UME.Core.Business.Picture pic in picList) { if (pic.Id == picture.Id) { IsCheck = true; } if (!IsCheck) { Num++; } sb.Append("{"); sb.Append("Id:'" + pic.Id + "'"); sb.Append(",Remark:'" + pic.Remark + "'"); sb.Append(",DateCreated:'" + pic.DateCreated.ToString("yyyy年MM月dd") + "'"); sb.Append(",Name:'" + pic.Name + "'"); sb.Append(",AlbumViewPermission:'" + album.ViewPermission + "'"); sb.Append("},"); } sb.Remove(sb.Length - 1, 1); sb.Append("],CurrentNum:'" + Num.ToString() + "'"); sb.Append("}"); HiddenJson.Value = sb.ToString(); HF_SiteUrl.Value = SiteUrl; HF_Album_Id.Value = album.Id.ToString(); HF_TotalRecords.Value = CY.UME.Core.Business.Picture.GetAllPicture(album, pagingInfo).Count.ToString();//该相册照片数量 //HiddenAccountDiff.Value = accountDiff; //绑定评论 pictureCommentList = CY.UME.Core.Business.PictureComment.GetPicCommentByPagesAndPicId(picture); RPT_PicCommentList.DataSourceID = ""; RPT_PicCommentList.DataSource = pictureCommentList; RPT_PicCommentList.DataBind(); } }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "application/json"; try { long instanceId; // 空间用户的标识 || 群Id long referedId; // 回复留言的标识 string content; string type = String.Empty;//类型(SpaceCommentExtend) CY.UME.Core.Business.Account currentAccount; // 留言的用户 CY.UME.Core.Business.Account spaceAccount = new CY.UME.Core.Business.Account(); // 所在个人主页的用户 CY.UME.Core.Business.SpaceComment referedComment = new CY.UME.Core.Business.SpaceComment(); // 所回复的留言 CY.UME.Core.Business.SpaceComment comment = new CY.UME.Core.Business.SpaceComment(); // 留言 CY.UME.Core.Business.Group group = new CY.UME.Core.Business.Group();//群组 CY.UME.Core.Business.Activities active = new CY.UME.Core.Business.Activities();//活动 #region Validateion and Get Basic Data if (!CY.Utility.Common.ParseUtility.TryParseInt64(context.Request.Form["uid"], out instanceId) || !CY.Utility.Common.ParseUtility.TryParseInt64(context.Request.Form["referedId"], out referedId)) { context.Response.Write("{success:false,msg:'参数错误'}"); return; } if (context.Request.Form["type"] != null) { type = context.Request.Form["type"].ToString(); } currentAccount = CY.UME.Core.Global.GetCurrentAccount(); if (currentAccount == null) { context.Response.Write("{success:false,msg:'登录超时,请重新登录'}"); return; } // 所在个人主页的用户 if (instanceId == 0 && type.Length == 0) { instanceId = currentAccount.Id; spaceAccount = currentAccount; } else if (type.Length == 0) { spaceAccount = CY.UME.Core.Business.Account.Load(instanceId); if (spaceAccount == null) { context.Response.Write("{success:false,msg:'用户不存在'}"); return; } } else if (type == "group") { group = CY.UME.Core.Business.Group.Load((int)instanceId); if (group == null) { context.Response.Write("{success:false,msg:'该群组不存在或已被删除'}"); return; } } else if (type == "active") { active = CY.UME.Core.Business.Activities.Load((int)instanceId); if (active == null) { context.Response.Write("{success:false,msg:'该活动不存在或已被删除'}"); return; } } // 所回复的留言 if (referedId > 0) { referedComment = CY.UME.Core.Business.SpaceComment.Load(referedId); if (referedComment == null) { context.Response.Write("{success:false,msg:'所回复的留言已被删除'}"); return; } } // 留言内容 content = context.Request.Form["content"]; if (string.IsNullOrEmpty(content)) { context.Response.Write("{success:false,msg:'留言内容不能为空'}"); return; } #endregion #region Leave Msg,Notice if (type.Length == 0)//个人空间留言 { // 将留言或者回复信息发送给空间主人 comment.AccountId = spaceAccount.Id; comment.Content = content; comment.IsPublic = (context.Request.Form["isPublic"] == "0") ? false : true; comment.ReferedId = referedId; comment.AuthorId = currentAccount.Id; comment.DateCreated = DateTime.Now; comment.InstanceId = 0; comment.IP = CY.Utility.Common.RequestUtility.ClientIP; comment.Save(); if (spaceAccount.Id != currentAccount.Id) // 不是在自己空间,留言则通知空间主人,回复则通知所回复的留言的作者 { CY.UME.Core.Business.Notice notice = new CY.UME.Core.Business.Notice(); notice.AuthorId = comment.AuthorId; notice.IsReaded = false; notice.DateCreated = DateTime.Now; notice.InstanceId = comment.Id.ToString(); if (comment.ReferedId < 1) // 留言 { notice.Type = "info"; notice.AccountId = instanceId; //notice.Content = currentAccount.Name + "给您留言了"; notice.Content = "给您留言了"; notice.Save(); } else // 回复 { if (referedComment.Id > 0) { notice.Type = "inforeply"; notice.AccountId = referedComment.AuthorId; if (referedComment.AuthorId == spaceAccount.Id) // 回复空间主人 { //notice.Content = currentAccount.Name + "回复了您的留言"; notice.Content = "回复了您的留言"; } else // 在别人页面回复了另外一个人 { //notice.Content = currentAccount.Name + "回复了您在 " + spaceAccount.Name + " 处的留言"; notice.Content = "回复了您在 " + spaceAccount.Name + " 处的留言"; // 在所引用的留言的作者处添加一条回复副本 CY.UME.Core.Business.SpaceComment commentCopy = new CY.UME.Core.Business.SpaceComment(); commentCopy.AccountId = referedComment.AuthorId; commentCopy.AuthorId = currentAccount.Id; commentCopy.Content = comment.Content; commentCopy.DateCreated = comment.DateCreated; commentCopy.InstanceId = comment.InstanceId; commentCopy.IP = comment.IP; commentCopy.IsPublic = comment.IsPublic; commentCopy.ReferedId = comment.ReferedId; commentCopy.Save(); notice.InstanceId = commentCopy.Id.ToString(); } notice.Save(); } } } else // 在自己空间内 { if (referedComment.Id > 0 && referedComment.AuthorId != currentAccount.Id) // 为回复他人 { CY.UME.Core.Business.Notice notice = new CY.UME.Core.Business.Notice(); notice.AuthorId = comment.AuthorId; notice.IsReaded = false; notice.DateCreated = DateTime.Now; notice.Type = "inforeply"; notice.AccountId = referedComment.AuthorId; //notice.Content = currentAccount.Name + "回复了您的留言"; notice.Content = "回复了您的留言"; // 在所引用的留言的作者处添加一条回复副本,方便其在他的个人空间内查看到 CY.UME.Core.Business.SpaceComment commentCopy = new CY.UME.Core.Business.SpaceComment(); commentCopy.AccountId = referedComment.AuthorId; commentCopy.AuthorId = currentAccount.Id; commentCopy.Content = comment.Content; commentCopy.DateCreated = comment.DateCreated; commentCopy.InstanceId = comment.InstanceId; commentCopy.IP = comment.IP; commentCopy.IsPublic = comment.IsPublic; commentCopy.ReferedId = comment.ReferedId; commentCopy.Save(); notice.InstanceId = commentCopy.Id.ToString(); notice.Save(); } } } else if (type == "group")//群留言 { //保存留言 comment.AuthorId = currentAccount.Id; comment.AccountId = 0; comment.Content = content; comment.DateCreated = DateTime.Now; comment.InstanceId = group.Id; comment.IP = CY.Utility.Common.RequestUtility.ClientIP; comment.IsPublic = true; comment.ReferedId = referedId; comment.Save(); //保存到留言扩展信息 CY.UME.Core.Business.SpaceCommentExtend spaceCommentExtend = new CY.UME.Core.Business.SpaceCommentExtend(); spaceCommentExtend.AccountId = group.CreatorId; spaceCommentExtend.Id = comment.Id; spaceCommentExtend.InstanceId = group.Id.ToString(); spaceCommentExtend.Type = "group"; spaceCommentExtend.Save(); //留言回复通知 if (referedId > 0 && referedComment.AuthorId != currentAccount.Id) { CY.UME.Core.Business.Notice groupLeaveWordsNotice = new CY.UME.Core.Business.Notice(); groupLeaveWordsNotice.AccountId = referedComment.AuthorId; groupLeaveWordsNotice.AuthorId = comment.AuthorId; groupLeaveWordsNotice.Content = "回复了您的留言"; groupLeaveWordsNotice.DateCreated = DateTime.Now; groupLeaveWordsNotice.InstanceId = comment.InstanceId.ToString(); groupLeaveWordsNotice.IsReaded = false; groupLeaveWordsNotice.Type = "groupinforeply"; groupLeaveWordsNotice.Save(); } } else if (type == "active")//活动留言 { //保存留言 comment.AuthorId = currentAccount.Id; comment.AccountId = active.Sponsor; comment.Content = content; comment.DateCreated = DateTime.Now; comment.InstanceId = active.Id; comment.IP = CY.Utility.Common.RequestUtility.ClientIP; comment.IsPublic = true; comment.ReferedId = referedId; comment.Save(); //保存到留言扩展信息 CY.UME.Core.Business.SpaceCommentExtend spaceCommentExtend = new CY.UME.Core.Business.SpaceCommentExtend(); spaceCommentExtend.AccountId = active.Sponsor; spaceCommentExtend.Id = comment.Id; spaceCommentExtend.InstanceId = active.Id.ToString(); spaceCommentExtend.Type = "active"; spaceCommentExtend.Save(); //留言回复通知 if (referedId > 0 && referedComment.AuthorId != currentAccount.Id) { CY.UME.Core.Business.Notice groupLeaveWordsNotice = new CY.UME.Core.Business.Notice(); groupLeaveWordsNotice.AccountId = referedComment.AuthorId; groupLeaveWordsNotice.AuthorId = comment.AuthorId; groupLeaveWordsNotice.Content = "回复了您的留言"; groupLeaveWordsNotice.DateCreated = DateTime.Now; groupLeaveWordsNotice.InstanceId = comment.InstanceId.ToString(); groupLeaveWordsNotice.IsReaded = false; groupLeaveWordsNotice.Type = "activeinforeply"; groupLeaveWordsNotice.Save(); } } #endregion StringBuilder sb = new StringBuilder(); sb.Append("{success:true, msg: '添加成功!', account: {"); sb.Append("Id: " + comment.AuthorId); sb.Append(", Name: '"); sb.Append(currentAccount.Name); sb.Append("'}, commentId: "); sb.Append(comment.Id); sb.Append("}"); context.Response.Write(sb.ToString()); } catch (Exception ex) { context.Response.Write("{success:false, msg:'添加失败!错误信息:" + CY.Utility.Common.StringUtility.RemoveIllegalCharacters(ex.Message) + "'}"); } }
protected void Page_Load(object sender, EventArgs e) { SetTitle("相册 "); int spaceId = 0; if (Request.QueryString["SpaceId"] == null) { SpaceAccount = CurrentAccount; } else if (int.TryParse(Request.QueryString["SpaceId"].ToString(), out spaceId)) { SpaceAccount = CY.UME.Core.Business.Account.Load(spaceId); } else { SpaceAccount = CurrentAccount; } if (SpaceAccount == null) { throw new Exception("访问页面不存在"); } if (!IsPostBack) { CY.UME.Core.PagingInfo pagingInfo = new CY.UME.Core.PagingInfo(); pagingInfo.CurrentPage = 1; pagingInfo.PageSize = 6; int viewSet; if (CurrentAccount != null) { if (CurrentAccount.Id == SpaceAccount.Id) { viewSet = 0; } else if (CurrentAccount.HasFriendshipWith(SpaceAccount)) { viewSet = 1; } else { viewSet = 2; } } else { viewSet = 2; } LblAlbum.Text = CY.UME.Core.Business.Album.GetAll(SpaceAccount, false).Count.ToString(); IList<CY.UME.Core.Business.Album> albumList = CY.UME.Core.Business.Album.GetAlbumByPagesAndAccountId(SpaceAccount, pagingInfo, viewSet); foreach (CY.UME.Core.Business.Album album in albumList) { if (album.ViewPermission == 2) album.CoverPath = CY.UME.Core.Global.AlbumCoverNoPublishAddress; else if(album.PhotoCount==0) album.CoverPath =CY.UME.Core.Global.AlbumCoverAddress; if (!album.IsAvatar) { albums.Add(album); } } personalState.SpaceAccount = SpaceAccount; personalState.CurrentAccount = CurrentAccount; } }
protected void Page_Load(object sender, EventArgs e) { LoadType = HF_Load_Type.Value; if (!IsPostBack) { long AccountId; //获取自己的收藏 if (CurrentAccount != null && Request.QueryString["uid"] == null) { AccountId = CurrentAccount.Id; SpaceAccount = CurrentAccount; } else if (Request.QueryString["uid"] != null && long.TryParse(Request.QueryString["uid"], out AccountId)) {//外来户 SpaceAccount = CY.UME.Core.Business.Account.Load(AccountId); } if (SpaceAccount == null) { //转到404页面 Response.Redirect(SiteUrl + "/Login"); return; } HF_SiteUrl.Value = SiteUrl; HF_CurrentAccount_Id.Value = SpaceAccount.Id.ToString();//当前访问页面的用户 UserInfo1.SpaceAccount = SpaceAccount; favoritesFollower.CurrentFollower = SpaceAccount; Core.Business.Favorites favorite = new Core.Business.Favorites(); favorite.AccountId = SpaceAccount.Id; //绑定收藏总数(All) FavTotal = CY.UME.Core.Business.Favorites.GetFavoritesCount(favorite, Core.Business.Favorites.FavoriteTypeEnum.all.ToString()).ToString(); if (Request.QueryString["t"] != null) { LoadType = Request.QueryString["t"].ToString(); if (Request.QueryString["i"] != null) { HF_Select_Index.Value = Request.QueryString["i"].ToString(); } } SetFavoritesListByAll(); } }
protected void Page_Load(object sender, EventArgs e) { SetTitle("留言板"); if (!IsPostBack) { #region Get space Account and Current Account CurrentAccountId = base.CurrentAccount.Id; if (CY.Utility.Common.ParseUtility.TryParseInt64(Request.QueryString["uid"], out SpaceId)) { if (SpaceId != base.CurrentAccount.Id) { spaceAccount = CY.UME.Core.Business.Account.Load(SpaceId); if (spaceAccount == null) { spaceAccount = base.CurrentAccount; } } else { spaceAccount = base.CurrentAccount; } } else { spaceAccount = base.CurrentAccount; SpaceId = base.CurrentAccount.Id; } UserInfo1.SpaceAccount = spaceAccount; int.TryParse(Request.QueryString["activeid"], out ActiveId); #endregion PageSize = CY.Utility.Common.ConvertUtility.ConvertToInt(HF_PageSize.Value, 20); string LoadType = Request.QueryString["t"] != null ? Request.QueryString["t"].ToString() : ""; if (LoadType == "1") {//“全部”获得焦点 PageSize = int.MaxValue; LblDefault.Text = "<div class='daohang2_btn06'><a href='?" + (ActiveId == 0 ? "uid=" + SpaceId : "activeID=" + ActiveId) + "'>TOP 20</a></div>"; LblAll.Text = "<div class='daohang2_btn01'><a href='?t=1" + (ActiveId == 0 ? "&uid=" + SpaceId : "&activeID=" + ActiveId) + "'>全部</a></div>"; } else {//“TOP 20”获得焦点 LblDefault.Text = "<div class='daohang2_btn01'><a href='?" + (ActiveId == 0 ? "uid=" + SpaceId : "activeID=" + ActiveId) + "'>TOP 20</a></div>"; LblAll.Text = "<div class='daohang2_btn06'><a href='?t=1" + (ActiveId == 0 ? "&uid=" + SpaceId : "&activeID=" + ActiveId) + "'>全部</a></div>"; if (base.CurrentAccount.Id == spaceAccount.Id) {//自己看自己的 Count = spaceAccount.GetSpaceCommentsCount(new bool?()); } else {//别人在看自己的 Count = spaceAccount.GetPublicSpaceCommentsUnionSpecifiedAccountRelatedCommentsCount(base.CurrentAccount.Id); } } CY.UME.Core.PagingInfo pageInfo = new CY.UME.Core.PagingInfo { CurrentPage = 0, PageSize = PageSize }; if (CurrentAccount != null && ActiveId == 0) {//个人留言 if (spaceAccount.Id == CurrentAccount.Id) { CommentsList = spaceAccount.GetSpaceComments(IsPublic, pageInfo); } else { CommentsList = spaceAccount.GetPublicSpaceCommentsUnionSpecifiedAccountRelatedComments(CurrentAccount.Id, pageInfo); } LeaveMessageName = spaceAccount.Name;//当前进入该页面的用户名称 HF_LeaveMessageType.Value = ""; } if (ActiveId != 0) {//活动过来的 CY.UME.Core.Business.Activities activities = CY.UME.Core.Business.Activities.Load(ActiveId); if (activities == null) return; LeaveMessageName = activities.Name;//活动名称 HF_LeaveMessageType.Value = activities.Id.ToString();//活动Id CommentsList = activities.GetActiveLevelWords(pageInfo).ToList(); pageInfo.PageSize = int.MaxValue; Count = activities.GetActiveLevelWords(pageInfo).Count();//活动留言条数 HF_LeaveMessageType.Value = "active";//AJAX读取时使用 } RPT_MessageList.DataSourceID = ""; RPT_MessageList.DataSource = CommentsList; RPT_MessageList.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { SetTitle("日志 "); long spaceId = 0, type = -1; if (Request.QueryString["SpaceId"] == null) { SpaceAccount = CurrentAccount; } else if (long.TryParse(Request.QueryString["SpaceId"].ToString(), out spaceId)) { SpaceAccount = CY.UME.Core.Business.Account.Load(spaceId); } else { SpaceAccount = CurrentAccount; } if (Request.QueryString["Type"] != null) { long.TryParse(Request.QueryString["Type"].ToString(), out type); } if (!IsPostBack) { this.VisitorList.CurrentAccount = base.CurrentAccount; CY.UME.Core.PagingInfo pagingInfo = new CY.UME.Core.PagingInfo(); pagingInfo.CurrentPage = 1; pagingInfo.PageSize = 6; int BlogCount = 0; int viewSet; if (CurrentAccount != null && CurrentAccount.Id == SpaceAccount.Id) { viewSet = 0; } else if (CurrentAccount != null && CurrentAccount.HasFriendshipWith(SpaceAccount)) { viewSet = 1; } else { viewSet = 2; } CY.UME.Core.Business.Blog blog = new CY.UME.Core.Business.Blog(); BlogCount = blog.GetCountByAccountIdAndTypeAndViewSet(SpaceAccount, viewSet, type); blog_HiddenTotalRecords.Value = BlogCount.ToString(); blog_HiddenPageSize.Value = pagingInfo.PageSize.ToString(); blog_HiddenViewSet.Value = viewSet.ToString(); blog_HiddenType.Value = type.ToString(); blog_CurrentAccount.Value = CurrentAccount.Id.ToString(); blog_HiddenSiteUrl.Value = SiteUrl; blogFollower.CurrentFollower = SpaceAccount; IList<CY.UME.Core.Business.Blog> BlogList = blog.GetBlogsByAccountIdAndTypeAndViewSet(SpaceAccount, pagingInfo, viewSet, type); //BindType(); //selType.Value = type.ToString(); foreach (CY.UME.Core.Business.Blog b in BlogList) { string strContent = CY.Utility.Common.StringUtility.NoHTML(b.BlogContent); strContent = Server.HtmlDecode(strContent); strContent = strContent.Replace("\r\n", ""); strContent = CY.Utility.Common.StringUtility.CutString(strContent.Trim(), 400, "..."); strContent = strContent.Replace("&", "&"); b.BlogContent = strContent; b.Subject = Server.HtmlEncode( CY.Utility.Common.StringUtility.CutString(b.Subject, 30, "...") ); } RP_BlogList.DataSourceID = ""; RP_BlogList.DataSource = BlogList; RP_BlogList.DataBind(); UserInfo1.SpaceAccount = SpaceAccount; //blogList.SpaceAccount = SpaceAccount; //blogList.CurrentAccount = CurrentAccount; //blogList.Blogs = Blogs; //blogBriefList.Blogs = Blogs; //blogBriefList.spaceAccount = SpaceAccount; } }
protected void Page_Load(object sender, EventArgs e) { //CY.UME.Core.Business.Account currentAccount = Session["user"] as CY.UME.Core.Business.Account; //if (currentAccount == null) //{ // Response.Redirect("~/Login.aspx"); // return; //} ViewState["accountId"] = CurrentAccount.Id; long spaceId = 0; if (Request.QueryString["SpaceId"] == null || !long.TryParse(Request.QueryString["SpaceId"].ToString(),out spaceId)) { throw new Exception("参数错误"); } if (spaceId != CurrentAccount.Id) { throw new Exception("您无权执行此操作"); } SetTitle("相册"); SpaceAccount = CY.UME.Core.Business.Account.Load(spaceId); personalState.SpaceAccount = SpaceAccount; personalState.CurrentAccount = CurrentAccount; if (!IsPostBack) { if (Request.QueryString["albumId"] == null)//添加 { ViewState["IsModify"] = false; } else { ViewState["IsModify"] = true; long albumId = 0; if (!long.TryParse(Request.QueryString["albumId"].ToString(),out albumId)) { throw new Exception("参数不合法"); } ViewState["albumId"] = albumId; album = CY.UME.Core.Business.Album.Load(albumId); TBXAlbumName.Text = album.Name; SelViewPermission.Value = album.ViewPermission.ToString(); if (album.ViewPermission == 2) { passPanel.Attributes.Remove("style"); passPanel.Visible = true; modPassPanel.Visible = true; } } } }
protected void Page_Load(object sender, EventArgs e) { int spaceId = 0; if (Request.QueryString["activeID"] != null) { activeID = CY.Utility.Common.ConvertUtility.ConvertToInt(Request.QueryString["activeID"], 0); CY.UME.Core.Business.Activities active = CY.UME.Core.Business.Activities.Load(activeID); if (active != null) SetTitle(active.Name + "活动图片"); if (CurrentAccount != null) SpaceAccount = CurrentAccount; } else { if (Request.QueryString["SpaceId"] == null) { throw new Exception("参数错误"); } else if (!int.TryParse(Request.QueryString["SpaceId"].ToString(), out spaceId)) { throw new Exception("参数错误"); } SetTitle("相册 "); SpaceAccount = CY.UME.Core.Business.Account.Load(spaceId); if (SpaceAccount == null) SpaceAccount = CurrentAccount; } CY.UME.Core.Business.Album album = new CY.UME.Core.Business.Album(); bool IsAdaPage = false; #region validate if (Request.QueryString["albumId"] == null) { throw new Exception("参数无效"); } if (!long.TryParse(Request.QueryString["albumId"].ToString(), out albumId)) { throw new Exception("参数错误"); } album = CY.UME.Core.Business.Album.Load(albumId); #endregion if (!IsPostBack) { if (album == null) { //LblError.Text = "请求相册不存在或已被删除"; //LblError.Visible = true; //pictureListControl.pictureList = null; } else { int pageSize = CY.Utility.Common.ConvertUtility.ConvertToInt(pl_HiddenPageSize.Value, 9); CY.UME.Core.PagingInfo pageInfo = new CY.UME.Core.PagingInfo(); pageInfo.CurrentPage = 1; pageInfo.PageSize = pageSize; IList<CY.UME.Core.Business.Picture> picList = CY.UME.Core.Business.Picture.GetAllPicture(album, pageInfo); RPT_PictureList.DataSourceID = ""; RPT_PictureList.DataSource = picList; RPT_PictureList.DataBind(); if (SpaceAccount != null) { pl_HiddenAccountId.Value = SpaceAccount.Id.ToString(); HF_CurrentAccount_Id.Value = pl_HiddenAccountId.Value; } HF_SiteUrl.Value = SiteUrl; pl_HiddenTotalRecords.Value = album.PhotoCount.ToString(); pl_HiddenAlbumId.Value = album.Id.ToString(); HiddenAccountDiff.Value = accountDiff; if (activeID == 0) { if (CurrentAccount != null && spaceId != 0) LBLAlbumList.Text = "<a href=\"AlbumList.aspx?SpaceId=" + spaceId + "\">我的相册</a>>"; else LBLAlbumList.Text = "<a href=\"AlbumList.aspx?SpaceId=" + spaceId + "\">" + SpaceAccount.Name + "的相册</a>>"; } LblAlbumName.Text = CY.Utility.Common.StringUtility.CutString(album.Name, 20, "..."); LblAlbumName.ToolTip = album.Name; } //uploadPic.Visible = avtarPic.Visible = createdAlbum.Visible = DeleteAlbum.Visible = true; if (activeID == 0 && CurrentAccount != null && SpaceAccount.Id == CurrentAccount.Id) { if (IsAdaPage) { DeleteAlbum.Visible = false; uploadPic.Visible = true; return; } createdAlbum.Visible = true; DeleteAlbum.Visible = true; uploadPic.Visible = true; uploadPic.InnerHtml = "<a href=\"UploadPicture.aspx?SpaceId=" + SpaceAccount.Id + "&albumId=" + album.Id + "\">上传照片</a>"; if (!album.IsAvatar) { avtarPic.Visible = false; uploadPic.Visible = true; modifyAlbum.Visible = true; modifyAlbum.InnerHtml = "<a href=\"AlbumEdit.aspx?SpaceId=" + SpaceAccount.Id + "&albumId=" + album.Id + "\">编辑相册</a>"; } else { avtarPic.Visible = true; uploadPic.Visible = false; } } else { //if (album.ViewPermission == 2) //{ // if (Session["AlbumPassword"] == null || Session["AlbumPassword"].ToString() != album.ViewPassword) // { // Response.Redirect("ViewEnAlbum.aspx?uid=" + SpaceAccount.Id.ToString() + "&albumId=" + albumId.ToString()); // return; // } //} } if (CurrentAccount == null) { //personalState.Visible = false; } else { BingAlbumType(CurrentAccount, album.Id); } UserInfo1.SpaceAccount = SpaceAccount; FollowerListId.CurrentFollower = SpaceAccount; //personalState.CurrentAccount = CurrentAccount; //pictureListControl.currentAccount = CurrentAccount; //pictureListControl.spaceAccount = SpaceAccount; } }
protected void Page_Load(object sender, EventArgs e) { int spaceId; #region - Get Current Account and Space Account - if (CurrentAccount != null) { if (CY.Utility.Common.ParseUtility.TryParseInt32(Request.QueryString["uid"], out spaceId)) { spaceAccount = CY.UME.Core.Business.Account.Load(spaceId); if (spaceAccount == null) { spaceAccount = base.CurrentAccount; } if (spaceAccount == null) { Response.Redirect(SiteUrl + "/Login.aspx"); return; } if (spaceAccount.Id != base.CurrentAccount.Id) { if (base.CurrentAccount.HasFriendshipWith(spaceAccount)) { HF_IsFriend.Value = true.ToString(); } else { HF_SiteUrl.Value = false.ToString(); if (base.CurrentAccount.HasFollowedWith(spaceAccount)) { HF_IsFollower.Value = true.ToString(); } else { HF_IsFollower.Value = false.ToString(); } } } if (!IsPostBack) { } } else { spaceAccount = base.CurrentAccount; } } else { if (CY.Utility.Common.ParseUtility.TryParseInt32(Request.QueryString["uid"], out spaceId)) { spaceAccount = CY.UME.Core.Business.Account.Load(spaceId); } if (spaceAccount == null) { try { Response.Redirect(SiteUrl + "/Login.aspx"); } catch { } return; } } #endregion HF_SiteUrl.Value = SiteUrl; HF_InAccount_Id.Value = spaceAccount.Id.ToString(); HF_CurrentAccount_Id.Value = CurrentAccount == null ? spaceAccount.Id.ToString() : CurrentAccount.Id.ToString(); HF_SpaceAccountName.Value = spaceAccount.Name; BindUserInfo(spaceAccount.Id); BindFriendInfo(spaceAccount); BindBlog(spaceAccount); BindAlbum(spaceAccount); BindFavorites(); BindComment(spaceAccount); CY.UME.Core.Business.Group group = new CY.UME.Core.Business.Group(); //群组 RPT_InGroup.DataSourceID = ""; RPT_InGroup.DataSource = group.GetGroupsByAccountIdAndPages(spaceAccount, new CY.UME.Core.PagingInfo { CurrentPage = 1, PageSize = 4 }, false); RPT_InGroup.DataBind(); //活动 RPT_ActivityList.DataSourceID = ""; RPT_ActivityList.DataSource = CY.UME.Core.Business.Activities.GetMyActiviteCheck(spaceAccount.Id, new CY.UME.Core.PagingInfo { CurrentPage = 1, PageSize = 2 }); RPT_ActivityList.DataBind(); SetTitle(spaceAccount.Name + " "); base.ExecuteClientScript("$('#login_msg').html('用户名或密码不正确!');"); }
protected void Page_Load(object sender, EventArgs e) { //base.CSSName = "ume2"; long spaceAccountId = 0, miniBlogId = 0; int page = 1; if (Request.QueryString["SpaceId"] == null) { spaceAccountId = CurrentAccount.Id; } if (!long.TryParse(Request.QueryString["SpaceId"].ToString(), out spaceAccountId)) { spaceAccountId = CurrentAccount.Id; } if (Request.QueryString["miniBlogId"] != null) { if (long.TryParse(Request.QueryString["miniBlogId"].ToString(), out miniBlogId)) { CY.UME.Core.Business.MiniBlog miniblog = CY.UME.Core.Business.MiniBlog.Load(miniBlogId); if (miniblog != null) { int rownum = CY.UME.Core.Business.MiniBlog.GetRowNumByMiniBlog(miniblog); page = (int)Math.Ceiling((double)rownum / 20); } } } SpaceAccount = CY.UME.Core.Business.Account.Load(spaceAccountId); SetTitle(SpaceAccount.Name + " 的微博"); UserInfo1.SpaceAccount = SpaceAccount; HiddenCurrentAccountId.Value = CurrentAccount.Id.ToString(); HiddenSpaceAccountId.Value = SpaceAccount.Id.ToString(); ; mbl_HiddenTotalRecords.Value = CY.UME.Core.Business.MiniBlog.GetMiniBlogsCountByAccount(SpaceAccount).ToString(); HiddenSiteUrl.Value = SiteUrl.ToString(); HiddenCurrentPage.Value = page.ToString(); HiddenMiniBlogId.Value = miniBlogId.ToString(); //BindMiniBlogList(); }