Exemplo n.º 1
0
        private void ModifyPasswardForm_Load(object sender, EventArgs e)
        {
            List <UserClass> userLst = UserSql.LoadUserList();

            foreach (UserClass user in userLst)
            {
                this.cmbUser.Items.Add(user);
            }
        }
Exemplo n.º 2
0
 private void LoadUserList( )
 {
     //从数据库加载所有可用的用户
     this.UserList = UserSql.LoadUserList();
     this.cmbUser.Items.Clear();
     if (this.UserList != null)
     {
         foreach (UserClass user in this.UserList)
         {
             this.cmbUser.Items.Add(user);
         }
         //默认选中第一个用户
         if (this.cmbUser.Items.Count > 0)
         {
             this.cmbUser.SelectedIndex = 0;
         }
     }
 }
Exemplo n.º 3
0
        private void LoadUserList()
        {
            //清空原有数据显示
            this.treeUser.Nodes.Clear();
            //加载用户列表
            List <UserClass> userList = UserSql.LoadUserList();

            if (userList != null)
            {
                //依次显示所有的用户信息
                foreach (UserClass user in userList)
                {
                    TreeNode node = new TreeNode();
                    node.Text = user.Name;
                    node.Tag  = user;
                    this.treeUser.Nodes.Add(node);
                }
            }
        }