Ejemplo n.º 1
0
        private void Load()
        {
            var(type, list) = Connection.GetUserBelongings();
            _curItem        = new UserInfo();
            _toDelete?.Clear();
            UserIdentity.Items.Clear();
            UserEdit.Visibility = Visibility.Hidden;
            switch (type)
            {
            case 1:
                Identity.Content = "BOSS";
                UserIdentity.Items.Add("管理员");
                UserIdentity.Items.Add("教师");
                UserIdentity.Items.Add("选手");
                break;

            case 2:
                Identity.Content = "管理员";
                UserIdentity.Items.Add("教师");
                UserIdentity.Items.Add("选手");
                break;

            case 3:
                Identity.Content = "教师";
                UserIdentity.Items.Add("选手");
                break;
            }
            UserIdentity.SelectedIndex = 0;
            _curUserList.Clear();
            foreach (var i in list)
            {
                _curUserList.Add(i);
            }
            ListView.ItemsSource = _curUserList;
        }