Exemplo n.º 1
0
        private void EditAccessLevelButton_Click(object sender, RoutedEventArgs e)
        {
            var userID = UserList[UsersListView.SelectedIndex].id;

            BackEnd.Enums.UserType newUserType = BackEnd.Enums.UserType.Seller;
            var index = AccessLevelChoiceComboBox.SelectedIndex;

            if (index != -1)
            {
                switch (index)
                {
                case 0:
                    newUserType = BackEnd.Enums.UserType.Seller;
                    break;

                case 1:
                    newUserType = BackEnd.Enums.UserType.WarehouseKeeper;
                    break;

                case 2:
                    newUserType = BackEnd.Enums.UserType.Technician;
                    break;

                case 3:
                    newUserType = BackEnd.Enums.UserType.Admin;
                    break;

                default:
                    break;
                }
                UserManagement.ChangeAccessLevel(userID, newUserType);
            }
        }