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);
     }
 }
Beispiel #2
0
 private void RegisterButton_Click(object sender, EventArgs e)
 {
     try
     {
         string        username = NameInput.Text;
         string        email    = EmailInput.Text;
         string        pass     = PasswordInput.Text;
         string        repass   = ConfirmPasswordInput.Text;
         UInstaSR.User user     = new UInstaSR.User();
         user.username      = username;
         user.password      = pass;
         user.email         = email;
         user.dob           = new DateTime(dateTimePicker1.Value.Ticks);
         user.creation_date = DateTime.Now;
         UInstaSR.UserServiceClient client = new UInstaSR.UserServiceClient();
         client.CreateUser(user);
         this.Visible = false;
         Form f = new Login();
         f.Visible = true;
     }
     catch (Exception ex)
     {
         Debug.WriteLine(ex.Message);
     }
 }
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         string email = textBox1.Text;
         string pass  = textBox2.Text;
         UInstaSR.UserServiceClient client = new UInstaSR.UserServiceClient();
         UInstaSR.User user = client.getUserByEmail(email);
         if (user.password.Equals(pass))
         {
             InstaDB.loggedIn = true;
             InstaDB.user     = user;
             Form f = new Home();
             f.Show();
             this.Visible = false;
         }
     }
     catch (Exception ex)
     {
         Debug.WriteLine(ex.Message);
     }
 }