public CreateUserRequest(User user)
        {
            RestUrl = String.Format("user");
            Method = Method.PUT;

            Username = user.Username;
            Password = user.Password;
            Prename = user.Prename;
            Name = user.Name;
            Admin = user.IsAdmin;
            Active = user.IsActive;
        }
        public UpdateUserRequest(User user)
        {
            RestUrl = String.Format("user/{0}", user.Id);
            Method = Method.POST;

            Username = user.Username;
            Password = user.Password;
            Prename = user.Prename;
            Name = user.Name;
            Admin = user.IsAdmin;
            Active = user.IsActive;
        }
        public void Test_CreateUser()
        {
            var createUserResponse = new CreateUserResponse();
            createUserResponse.Id = 42;

            var user = new User();
            user.Username = "******";
            user.Password = "******";
            user.Prename = "Moritz";
            user.Name = "Moeller";
            user.IsAdmin = true;
            user.IsActive = true;
            var retrievedCreateUserResponse = client.CreateUser(user);

            Assert.AreEqual(createUserResponse.Id, retrievedCreateUserResponse.Id);
        }
 public void showEditUser(User user)
 {
     Content = new CreateUserViewModel(this,user);
 }
        /// <summary>
        /// Initiiert die Clientsession mit den benötigten Werten und setzt den richtigen Content für den User.
        /// </summary>
        /// <param name="user">Der Benutzer der eingeloggt wurde.</param>
        private void LoggedIn(User user)
        {
            // Benutzer ist eingelogged -> Setzen des aktuellen Benutzers und der MainView bescheid sagen.
            ClientSession.Instance.User = user;
            ClientSession.Instance.UpdateWorkflows(null);
            ClientSession.Instance.CurrentWorkflow = ClientSession.Instance.Workflows.ElementAtOrDefault(0);

            if (user.IsAdmin)
            {
                ClientSession.Instance.SubscribeToUserMessages();
                Content = new ManagerContainerViewModel();
                TitleContent = "Editor";
            }
            else
            {
                //ClientSession.Instance.subscribeToJobMessages();
                Content = new ClientContainerViewModel();
                TitleContent = "Client";
            }

            // Setzt den ersten workflow als current workflow.
            HelloContent = "Hallo " + user.Username;
            UserLoggedIn = true;
        }
 public CreateUserViewModel(UserManagerBaseViewModel baseViewModel,User user):this(baseViewModel)
 {
     this.User = user;
 }