private void btnRegister_Click(object sender, EventArgs e) { HCMISRegistrations.RegistrationsSoapClient soapClient = new HCMISRegistrations.RegistrationsSoapClient(); int?facilityID = null; if (txtFacilityID.Text != "") { facilityID = int.Parse(txtFacilityID.Text); } bool registered = false; int userType = RegistrationHelper.GetUserTypeID(cboUserType.Text); int registrationID = soapClient.RegisterNewUser(txtUserName.Text, userType, facilityID, txtAssemblyName.Text, Program.HCMISVersionString, txtAuthenticationCode.Text); registered = -1 != registrationID; if (registered) { //Save Authentication code to the registry int?userID = null; if (txtFacilityID.Text != "") { userID = int.Parse(txtFacilityID.Text); } RegistrationHelper.SaveAuthenticationInfoToRegistry(txtAuthenticationCode.Text, userType, userID, registrationID); XtraMessageBox.Show("Successfully Registered.", "Registration"); this.Close(); } else { XtraMessageBox.Show("Registration failed!", "Registration"); } }