Пример #1
0
        public void Fill(Domain.User user)
        {
            user.name          = nameTextBox.Text;
            user.firstName     = firstNameTextBox.Text;
            user.email         = emailTextBox.Text.Trim();
            user.active        = activeBox.IsChecked.Value;
            user.administrator = adminCheckBox.IsChecked.Value;
            user.login         = loginTextBox.Text.Trim();
            user.password      = passwordTextBox.Password;
            if (!user.IsAdmin())
            {
                string profilS = (string)profilcomboBox.SelectedItem;
                user.profil = getProfilByName(profilS);;

                //Domain.Profil profil = (Domain.Profil)profilcomboBox.SelectedItem;
                //user.profil = profil;
            }
            foreach (UIElement el in this.RelationPanel.panel.Children)
            {
                UserRelations.UserRelationItemPanel item = (UserRelations.UserRelationItemPanel)el;
                if (item.userComboBox.SelectedItem == null && item.roleComboBox.SelectedItem == null)
                {
                    continue;
                }
                Domain.Relation relation = new Domain.Relation();
                item.RelationItem.owner = item.userComboBox.SelectedItem as string;
                item.RelationItem.role  = item.roleComboBox.SelectedItem as string;
            }
        }
Пример #2
0
 public void Display(Domain.User user)
 {
     currentUser              = user;
     nameTextBox.Text         = user.name;
     firstNameTextBox.Text    = user.firstName;
     emailTextBox.Text        = user.email;
     adminCheckBox.IsChecked  = user.IsAdmin();
     activeBox.IsChecked      = user.active;
     loginTextBox.Text        = user.login;
     passwordTextBox.Password = user.password;
     ManageAdministratorView(user.IsAdmin());
     if (!user.IsAdmin() && user.profil != null)
     {
         profilcomboBox.SelectedItem = user.profil.name;
     }
     RelationPanel.DisplayUserRelations(user);
 }