public UserDetailPageNew(UserViewModelNew userViewModel)
        {
            InitializeComponent();
            if (userViewModel != null)
            {
                _userViewModel = userViewModel.Clone();
                _originalUserModel = userViewModel;
                Title = "User Details";
                //_userNameTbx.IsEnabled = false;
                _userViewModel.IsReadOnlyUserName = true;
            }
            else
            {
                _userViewModel = new UserViewModelNew();
                Title = "Add User";

            }

            DataContext = _userViewModel;

            CommandBindings.Add(new CommandBinding(NavigationCommands.BrowseHome, GoHomeExecuted, CommandCanExecute));
            CommandBindings.Add(new CommandBinding(NavigationCommands.BrowseBack, GoHomeExecuted, CommandCanExecute));
        }
Exemplo n.º 2
0
 public void RestoreState(UserViewModelNew model)
 {
     if (model != null)
     {
         UserName = model.UserName;
         Description = model.Description;
         _user.GroupMembership.Clear();
         foreach (Group group in model._user.GroupMembership)
         {
             AddGroupMembership(new GroupViewModel(group));
         }
     }
 }
Exemplo n.º 3
0
        public UserViewModelNew Clone()
        {
            var clone = new UserViewModelNew();
            clone.UserName = UserName;
            clone.Description = Description;
            foreach (Group group in _user.GroupMembership)
            {
                clone.AddGroupMembership(new GroupViewModel(group));
            }
            clone.FullName = FullName;
            clone.UserIcon = UserIcon;
            clone.Title = Title;
            clone.EnableStdAuthentication = EnableStdAuthentication;
            clone.Password = Password;
            clone.PreferredLanguage = PreferredLanguage;
            clone.Email = Email;
            clone.LastLogonDate = LastLogonDate;
            clone.LockStatus = LockStatus;
            clone.InvalidAuthenticationCount = InvalidAuthenticationCount;
            clone.EnableWindowsAuth = EnableWindowsAuth;
            clone.OperatorCode = OperatorCode;
            clone.LookupCode = LookupCode;
            clone.ShortHeading = ShortHeading;
            clone.DefaultBusinessUnit = DefaultBusinessUnit;
            clone.Sun5Language = Sun5Language;
            clone.DefaultLedger = DefaultLedger;
            clone.TemporaryWorkFolder = TemporaryWorkFolder;
            clone.EnableSun5Authorizer = EnableSun5Authorizer;
            clone.AuthorizationPassword = AuthorizationPassword;
            clone.InvalidAuthorizationCount = InvalidAuthorizationCount;
            clone.EnableDirectoryAuth = EnableDirectoryAuth;
            clone.DirectoryServiceAccount = DirectoryServiceAccount;

            return clone;
        }