private void simpleButton1_Click(object sender, EventArgs e) { var error = false; try { var service = new IadmClient(); var data = new Users() { username = id, password = textEdit1.Text }; service.EditPassword(data); service.Close(); } catch (Exception) { error = true; XtraMessageBox.Show("ada kesalahan"); } if (error == false) { Close(); } }