private void SetupPageFriendMode() { atiFriendListScript.ControlMode = DesktopModules_ATI_Base_controls_ATI_FriendListScript.Mode.FRIEND_LIST; WebService.StreamService streamService = new WebService.StreamService(); UserSettings settings = ProfileSettings != null ? ProfileSettings : UserSettings; if (settings is Group) { if (this.UserSettings.Id != settings.Id) { atiFriendListScript.ControlMode = DesktopModules_ATI_Base_controls_ATI_FriendListScript.Mode.FRIEND_REQUEST; } tabFollowing.Visible = pageViewFollowing.Visible = false; tabFollowers.Visible = pageViewFollowers.Visible = false; string json = streamService.getMemberListData(settings.Id, 0, 25, this.UserSettings.Id); ScriptManager.RegisterStartupScript(this, Page.GetType(), "FriendList", "$(function(){ Aqufit.Page.atiFriendListScript.generateStreamDom('" + json + "'); });", true); } else { if (this.UserSettings.Id != settings.Id) { atiFriendListScript.ControlMode = DesktopModules_ATI_Base_controls_ATI_FriendListScript.Mode.FRIEND_REQUEST; } string json = streamService.getFriendListData(settings.UserKey, this.PortalId, Affine.Utils.ConstsUtil.FriendListModes.FRIEND, 0, 25, this.UserSettings.Id); ScriptManager.RegisterStartupScript(this, Page.GetType(), "FriendList", "$(function(){ Aqufit.Page.atiFriendListScript.generateStreamDom('" + json + "'); });", true); } }
protected void bAjaxPostback_Click(object sender, EventArgs e) { string status = string.Empty; try { Affine.Data.Managers.IDataManager dataManager = Affine.Data.Managers.LINQ.DataManager.Instance; Affine.WebService.StreamService streamService = new WebService.StreamService(); int skip = 0; int take = 0; string json = string.Empty; switch (hiddenAjaxAction.Value) { case "friendRequest": long fid = Convert.ToInt64(hiddenAjaxValue.Value); dataManager.sendFriendRequest(UserSettings.Id, fid); status = "Friend request has been sent."; break; case "friendListDataPage": skip = Convert.ToInt32(hiddenAjaxValue.Value); take = Convert.ToInt32(hiddenAjaxValue2.Value); if (ProfileSettings is Group) { json = streamService.getMemberListData(ProfileSettings.Id, skip, take, this.UserSettings.Id); } else { json = streamService.getFriendListData(ProfileSettings.UserKey, ProfileSettings.PortalKey, Affine.Utils.ConstsUtil.FriendListModes.FRIEND, skip, take, this.UserSettings.Id); } RadAjaxManager1.ResponseScripts.Add(" Aqufit.Page.atiFriendListScript.generateStreamDom('" + json + "'); "); break; case "followingListDataPage": skip = Convert.ToInt32(hiddenAjaxValue.Value); take = Convert.ToInt32(hiddenAjaxValue2.Value); json = streamService.getFriendListData(ProfileSettings.UserKey, ProfileSettings.PortalKey, Affine.Utils.ConstsUtil.FriendListModes.FOLLOWING, skip, take); RadAjaxManager1.ResponseScripts.Add(" Aqufit.Page.atiFollowingList.generateStreamDom('" + json + "'); "); break; case "followerListDataPage": skip = Convert.ToInt32(hiddenAjaxValue.Value); take = Convert.ToInt32(hiddenAjaxValue2.Value); json = streamService.getFriendListData(ProfileSettings.UserKey, ProfileSettings.PortalKey, Affine.Utils.ConstsUtil.FriendListModes.FOLLOWERS, skip, take); RadAjaxManager1.ResponseScripts.Add(" Aqufit.Page.atiFollowerList.generateStreamDom('" + json + "'); "); break; } } catch (Exception ex) { status = "ERROR: There was a problem with the action (" + ex.Message + ")"; } RadAjaxManager1.ResponseScripts.Add("UpdateStatus('" + status + "'); "); }