Ejemplo n.º 1
0
        private void addButton_Click(object sender, EventArgs e)
        {
            UserFactory  factory = new UserFactory();
            EditUserForm form    = new EditUserForm(UserFactory.Empty);

            form.ShowDialog();

            if (form.SavedUser.IsEmpty == false)
            {
                AddUserToView(form.SavedUser);
            }
        }
Ejemplo n.º 2
0
        private void EditSelected()
        {
            if (usersListview.SelectedItems.Count == 1)
            {
                ListViewItem listviewitem = usersListview.SelectedItems[0];
                User         user         = (User)listviewitem.Tag;

                UserFactory  factory = new UserFactory();
                EditUserForm form    = new EditUserForm(user);
                form.ShowDialog();

                if (form.SavedUser.IsEmpty == false)
                {
                    UpdateUserInView(form.SavedUser);
                }
            }
        }