void btnConnect_Click(object sender, EventArgs e) { switch (_friendStatus) { case Constants.TelligentFriendStatus.NotSpecified: if (TelligentService.CreateFriendRequest(CurrentMember.ScreenName, TargetScreenName, String.Format(DictionaryConstants.ConnectAction, TargetScreenName, "REPLACE"))) { //Change Text btnConnect.Text = DictionaryConstants.RequestSent; //TODO: send connection email } break; case Constants.TelligentFriendStatus.Approved: if (TelligentService.DeleteFriendRequest(CurrentMember.ScreenName, TargetScreenName)) { btnConnect.Text = DictionaryConstants.ConnectBtnText; } break; } }
protected void btnConnect_Click(object sender, EventArgs e) { //Check community permissions //this.ProfileRedirect(Constants.UserPermission.CommunityUser); //Check status and perform appropriate action switch (Status) { case Constants.TelligentFriendStatus.NotSpecified: //call service to create connection if (TelligentService.CreateFriendRequest(CurrentMember.ScreenName, UserName, String.Format(DictionaryConstants.ConnectAction, UserName, "REPLACE"))) { //Change Text Text = DictionaryConstants.RequestSent; //TODO: send connection email } break; case Constants.TelligentFriendStatus.Recieved: //accept request if (TelligentService.UpdateFriendRequest(CurrentMember.ScreenName, UserName, "Approved")) { Response.Redirect(Request.RawUrl, true); } break; case Constants.TelligentFriendStatus.Approved: //View user activity Response.Redirect(MembershipHelper.GetPublicProfileActivityUrl(UserName)); break; case Constants.TelligentFriendStatus.Pending: //Nothing to do but wait until friendship request approved default: break; } }