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 + "'); "); }
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); } }
private void SetupPageFollowMode() { WebService.StreamService streamService = new WebService.StreamService(); if (Request["c"] != null) { streamService.FollowUser(this.UserSettings.Id, Convert.ToInt64(Request["c"])); } UserSettings settings = ProfileSettings != null ? ProfileSettings : UserSettings; if (!(settings is Group)) { string json = streamService.getFriendListData(settings.UserKey, this.PortalId, Affine.Utils.ConstsUtil.FriendListModes.FOLLOWING, 0, 25); ScriptManager.RegisterStartupScript(this, Page.GetType(), "FollowingList", "$(function(){ Aqufit.Page.atiFollowingList.generateStreamDom('" + json + "'); });", true); json = streamService.getFriendListData(settings.UserKey, this.PortalId, Affine.Utils.ConstsUtil.FriendListModes.FOLLOWERS, 0, 25); ScriptManager.RegisterStartupScript(this, Page.GetType(), "FollowerList", "$(function(){ Aqufit.Page.atiFollowerList.generateStreamDom('" + json + "'); });", true); } }
protected void bAjaxPostback_Click(object sender, EventArgs e) { try { Affine.Data.Managers.IDataManager dataMan = Affine.Data.Managers.LINQ.DataManager.Instance; Affine.WebService.StreamService ss = new WebService.StreamService(); long mid = 0; long gid = Convert.ToInt64(hiddenGroupKey.Value);; switch (hiddenAjaxAction.Value) { case "makeAdmin": mid = Convert.ToInt64(hiddenAjaxValue.Value); dataMan.makeMemberGroupAdmin(UserSettings.Id, gid, mid); string json = ss.getMemberListDataOfRelationship(gid, (int)Affine.Utils.ConstsUtil.Relationships.GROUP_ADMIN, 0, 10); RadAjaxManager1.ResponseScripts.Add(" Aqufit.Page.atiMemberListAdmin.generateStreamDom('" + json + "'); "); break; case "removeAdmin": mid = Convert.ToInt64(hiddenAjaxValue.Value); dataMan.removeMemberGroupAdmin(UserSettings.Id, gid, mid); string json2 = ss.getMemberListDataOfRelationship(gid, (int)Affine.Utils.ConstsUtil.Relationships.GROUP_MEMBER, 0, 25); RadAjaxManager1.ResponseScripts.Add(" Aqufit.Page.atiMemberList.generateStreamDom('" + json2 + "'); "); break; case "removeMember": mid = Convert.ToInt64(hiddenAjaxValue.Value); dataMan.removeMemberGroup(UserSettings.Id, gid, mid); break; case "sendGroupInvite": long usid = Convert.ToInt64(hiddenAjaxValue.Value); dataMan.inviteUserToGroup(usid, gid); break; case "friendData": int skip = Convert.ToInt32(hiddenAjaxValue.Value); int take = Convert.ToInt32(hiddenAjaxValue2.Value); json = ss.getFriendListData(UserSettings.UserKey, this.PortalId, Affine.Utils.ConstsUtil.FriendListModes.FRIEND, skip, take, gid); RadAjaxManager1.ResponseScripts.Add(" Aqufit.Page.atiFriendList.generateStreamDom('" + json + "'); Aqufit.Page.atiLoading.remove(); "); break; } } catch (Exception ex) { RadAjaxManager1.ResponseScripts.Add("Aqufit.Windows.ErrorDialog('" + ex.Message.Replace("'", "") + "'); "); } }
protected void bAjaxPostback_Click(object sender, EventArgs e) { try { Affine.Data.Managers.IDataManager dataMan = Affine.Data.Managers.LINQ.DataManager.Instance; Affine.WebService.StreamService ss = new WebService.StreamService(); long mid = 0; long gid = Convert.ToInt64(hiddenGroupKey.Value);; switch (hiddenAjaxAction.Value) { case "makeAdmin": mid = Convert.ToInt64(hiddenAjaxValue.Value); dataMan.makeMemberGroupAdmin(UserSettings.Id, gid, mid); string json = ss.getMemberListDataOfRelationship(gid, (int)Affine.Utils.ConstsUtil.Relationships.GROUP_ADMIN, 0, 10); RadAjaxManager1.ResponseScripts.Add(" Aqufit.Page.atiMemberListAdmin.generateStreamDom('" + json + "'); "); break; case "removeAdmin": mid = Convert.ToInt64(hiddenAjaxValue.Value); dataMan.removeMemberGroupAdmin(UserSettings.Id, gid, mid); string json2 = ss.getMemberListDataOfRelationship(gid, (int)Affine.Utils.ConstsUtil.Relationships.GROUP_MEMBER, 0, 25); RadAjaxManager1.ResponseScripts.Add(" Aqufit.Page.atiMemberList.generateStreamDom('" + json2 + "'); "); break; case "removeMember": mid = Convert.ToInt64(hiddenAjaxValue.Value); dataMan.removeMemberGroup(UserSettings.Id, gid, mid); break; case "sendGroupInvite": long usid = Convert.ToInt64(hiddenAjaxValue.Value); dataMan.inviteUserToGroup(usid, gid); break; case "friendData": int skip = Convert.ToInt32(hiddenAjaxValue.Value); int take = Convert.ToInt32(hiddenAjaxValue2.Value); json = ss.getFriendListData(UserSettings.UserKey, this.PortalId, Affine.Utils.ConstsUtil.FriendListModes.FRIEND, skip, take, gid); RadAjaxManager1.ResponseScripts.Add(" Aqufit.Page.atiFriendList.generateStreamDom('" + json + "'); Aqufit.Page.atiLoading.remove(); "); break; } } catch (Exception ex) { RadAjaxManager1.ResponseScripts.Add("Aqufit.Windows.ErrorDialog('" + ex.Message.Replace("'","") + "'); "); } }