Esempio n. 1
0
        private void CreateNewUserStart(object obj)
        {
            var editUserDialog    = new EditUserDialog();
            var editUserViewModel = new EditUserDialogViewModel(new User(), _dataService, _userRepository);

            editUserDialog.ViewModel = editUserViewModel;

            editUserDialog.Show();
        }
Esempio n. 2
0
        private void EditUserStart(User obj)
        {
            var editUserDialog    = new EditUserDialog();
            var editUserViewModel = new EditUserDialogViewModel(obj, _dataService, _userRepository);

            editUserDialog.ViewModel = editUserViewModel;

            editUserDialog.Show();
        }
        private void Edit_Click(object sender, EventArgs e)
        {
            using (AcademyEntities academyDb = new AcademyEntities())
            {
                if (academyDb.Users.Any())
                {
                    this.Hide();

                    var id = Convert.ToInt32(AllUsersView.CurrentRow.Cells["Id"].Value);


                    EditUserDialog editUserDialog = new EditUserDialog(id);
                    editUserDialog.Show();
                    this.AddOwnedForm(editUserDialog);
                }
                else
                {
                    MessageBox.Show("No users existed!");
                }
            }
        }