private void btnCreateUser_Click(object sender, EventArgs e) { CreateUserForm form = new CreateUserForm(); if (form.ShowDialog() == DialogResult.OK) { if (new DTOManagers.UserDTOManager().CreateUser(form.Username, form.Password) != null) { MessageBox.Show("Kreiran user: "******"Greska!"); } } }
private void btnUpdateUser_Click(object sender, EventArgs e) { int id = int.Parse(txtUpdateUser.Text); UserDTO user = new DTOManagers.UserDTOManager().GetUser(id); CreateUserForm form = new CreateUserForm(true, user.Username); if (form.ShowDialog() == DialogResult.OK) { if (new DTOManagers.UserDTOManager().UpdateUser(user.Id, form.Password, form.Username, form.NewPassword) != null) { MessageBox.Show("Uspesno azuriran user"); } else { MessageBox.Show("Greska"); } } }