Example #1
0
        public void ExecuteSaveUserCommand(Object obj)
        {
            var result = socket.ChangeUser(userViewModel.SelectedUser);

            if (result == false)
            {
                MessageBox.Show("Fehler beim Ändern des Benutzers!");
            }

            parent.restartUserCommmand();
        }
Example #2
0
        private void ExecuteSaveUserCommand(Object obj)
        {
            if ((fleetManagementViewModel.ActiveViewModel as UserViewModel).SelectedUser != null)
            {
                //If Lists are equaly long
                if ((fleetManagementViewModel.ActiveViewModel as UserViewModel).Users.Count == (fleetManagementViewModel.ActiveViewModel as UserViewModel).entryUsers.Count)
                {
                    //Change every Input
                    for (int i = 0; i < (fleetManagementViewModel.ActiveViewModel as UserViewModel).Users.Count; i++)
                    {
                        //if((fleetManagementViewModel.ActiveViewModel as UserViewModel).entryUsers[i] != (fleetManagementViewModel.ActiveViewModel as UserViewModel).Users[i])
                        socket.ChangeUser((fleetManagementViewModel.ActiveViewModel as UserViewModel).entryUsers[i], (fleetManagementViewModel.ActiveViewModel as UserViewModel).Users[i]);
                    }

                    //Fetch new Users
                    fleetManagementViewModel.ActiveViewModel = new UserViewController().Initialize();
                    (fleetManagementViewModel.ActiveViewModel as UserViewModel).Users = new ObservableCollection <User>(socket.getAllUsers());
                    //Change Entry List
                    (fleetManagementViewModel.ActiveViewModel as UserViewModel).entryUsers = (fleetManagementViewModel.ActiveViewModel as UserViewModel).Users.ToList();
                }
            }
        }
Example #3
0
        public void ExecuteSaveUserCommand(Object obj)
        {
            if (userViewModel.SelectedUser != null)
            {
                //If Lists are equaly long
                if (userViewModel.Users.Count == userViewModel.entryUsers.Count)
                {
                    //Change every Input
                    for (int i = 0; i < userViewModel.Users.Count; i++)
                    {
                        if (userViewModel.entryUsers[i] != userViewModel.Users[i])
                        {
                            var result = socket.ChangeUser(userViewModel.entryUsers[i], userViewModel.Users[i]);
                            if (result == false)
                            {
                                MessageBox.Show("Fehler beim Ändern des Benutzers!");
                            }
                        }
                    }

                    parent.restartUserCommmand();
                }
            }
        }