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 Comments_Load(object sender, EventArgs e) { pictureBox1.Image = comp.PostImage; label1.Text = comp.Title; try { flowLayoutPanel1.Controls.Clear(); UInstaSR.UserServiceClient uclient = new UInstaSR.UserServiceClient(); CInstaSR.IcommentServiceClient client = new CInstaSR.IcommentServiceClient(); this.commentlist = client.fetchComment(comp.Pid).OrderByDescending(c => c.creation_date).ToList(); foreach (CInstaSR.Comment comment in commentlist) { CommentComponent c = new CommentComponent(); c.CommentText = comment.comment; c.Username = uclient.getUser(comment.userId).username; subcomlist.Add(c); flowLayoutPanel1.Controls.Add(c); } } catch (Exception ex) { Debug.WriteLine(ex.Message); } }