private void fetchFollowers()
 {
     //for follower list
     followers = new List <UInstaSR.User>();
     fcomp     = new List <FollowingComponent>();
     try
     {
         UFInstaSR.IuserfollowServiceClient ufclient = new UFInstaSR.IuserfollowServiceClient();
         int[] idlist = ufclient.getFollowerList(InstaDB.user.userId);
         UInstaSR.UserServiceClient uclient = new UInstaSR.UserServiceClient();
         foreach (int id in idlist)
         {
             UInstaSR.User u = uclient.getUser(id);
             this.followers.Add(u);
             FollowingComponent comp = new FollowingComponent();
             comp.Follower = u.username;
             comp.Uid      = u.userId;
             fcomp.Add(comp);
         }
         InstaDB.followers = this.followers;
     }
     catch (Exception ex)
     {
         Debug.WriteLine(ex.Message);
     }
 }
 private void button1_Click(object sender, EventArgs e)
 {
     Debug.WriteLine(listBox1.SelectedValue);
     try
     {
         UFInstaSR.IuserfollowServiceClient client = new UFInstaSR.IuserfollowServiceClient();
         client.followUser(InstaDB.user.userId, (int)listBox1.SelectedValue);
     }
     catch (Exception ex)
     {
         Debug.WriteLine(ex.Message);
     }
 }
示例#3
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         UFInstaSR.IuserfollowServiceClient client = new UFInstaSR.IuserfollowServiceClient();
         client.unfollowUser(InstaDB.user.userId, Uid);
         this.Visible = false;
     }
     catch (Exception ex)
     {
         Debug.WriteLine(ex.Message);
     }
 }