Ejemplo n.º 1
0
 public void ViewProfile()
 {
     if (lvUsersList.SelectedItems.Count > 0)
     {
         List<User> usersList = DataServices.GetUsers();
         foreach (User user in usersList)
         {
             if(lvUsersList.SelectedItems[0].Text == user.username)
             {
                 AdminUserProfileForm profile = new AdminUserProfileForm(this, user);
                 profile.ShowDialog();
             }
         }
     }
     else
     {
         MessageBox.Show("Please select a user you want to view.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Ejemplo n.º 2
0
 private void llEditProfile_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     AdminUserProfileForm apf = new AdminUserProfileForm(this);
     apf.ShowDialog();
 }
Ejemplo n.º 3
0
        private void lvUsersList_DoubleClick(object sender, EventArgs e)
        {
            if (lvUsersList.SelectedItems.Count > 0)
            {
                List<User> usersList = DataServices.GetUsers();
                foreach (User user in usersList)
                {
                    try
                    {
                        if (lvUsersList.SelectedItems[0].Text == user.username)
                        {
                            AdminUserProfileForm profile = new AdminUserProfileForm(this, user);
                            profile.ShowDialog();
                        }
                    }
                    catch (Exception x)
                    {
                        MessageBox.Show(x.Message + " " + x.StackTrace);
                    }

                }
            }
            else
            {
                MessageBox.Show("Please select a user you want to view.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }