protected void btnTest1_Click(object sender, EventArgs e) { users = new List<User>(); lstbxUsers.Items.Clear(); userListTest = new TestListUser(); try { lblRunTest1.Visible = userListTest.run(LoginSession.adminURL, LoginSession.userToken.token_id); lblRunTest1.Text = "PASS"; foreach (User u in userListTest.users) { users.Add(u); } foreach (User u in users) { lstbxUsers.Items.Add(u.name); } } catch (Exception x) { lblUser.Text = x.Message; lblRunTest1.Visible = true; lblRunTest1.Text = "FAIL"; pnlUserInfo.Visible = true; } }
protected void Page_Load(object sender, EventArgs e) { if (sender != null && sender.GetType().Equals(this.GetType())) { if (((UsersList)sender).CurrentTest != null) { userListTest = ((UsersList)sender).CurrentTest; users = ((UsersList)sender).testList; } else { userListTest = new TestListUser(); users = new List<User>(); } } else { userListTest = new TestListUser(); users = new List<User>(); } }