private void CreateAdministrator() { RegistrationService.CustomerServiceClient rs = null; try { rs = ServiceAgent.GetServiceClient(); var response = rs.RegisterNewUser(_customerId, UserNameTextBox.Text, PasswordTextBox.Text, _fullName, EmailTextBox.Text, CurrentCulture.TwoLetterISOLanguageName); if (response.Success) { registrationFormPlaceholder.Visible = false; RecieptPlaceHolder.Visible = true; } else { ServiceErrorLabel.Visible = true; ServiceErrorLabel.Text = response.Response; } } catch (EndpointNotFoundException exception) { OnError(exception); ServiceErrorLabel.Text = (string)System.Web.HttpContext.GetLocalResourceObject("~/Activation.aspx", "User_CreateAdministrator_Could_not_contact_service_at_the_moment__Please_try_again_later"); ServiceErrorLabel.Visible = true; } catch (TimeoutException exception) { OnError(exception); ServiceErrorLabel.Text = (string)System.Web.HttpContext.GetLocalResourceObject("~/Activation.aspx", "User_CreateAdministrator_Could_not_contact_service_at_the_moment__Please_try_again_later"); ServiceErrorLabel.Visible = true; } finally { if (rs != null) { rs.Close(); } } }
private bool CheckCustomerId() { var exists = false; CustomerServiceClient rs = null; try { rs = ServiceAgent.GetServiceClient(); if (rs.ExistsApplicationName(ApplicationNameTextBox.Text)) { exists = true; } } catch (EndpointNotFoundException exception) { OnError(exception); ApplicationNameAvailableValidator.ErrorMessage = GetLocalResourceObject("ApplicationNameUnableToValidate").ToString(); ServiceErrorLabel.Visible = true; } catch (TimeoutException exception) { OnError(exception); ApplicationNameAvailableValidator.ErrorMessage = GetLocalResourceObject("ApplicationNameUnableToValidate").ToString(); ServiceErrorLabel.Visible = true; } finally { if (rs != null) { rs.Close(); } } return(exists); }
private void AppendCustomerDetails() { RegistrationService.CustomerServiceClient rs = null; try { rs = ServiceAgent.GetServiceClient(); var customer = rs.GetCustomerByCustomerId(_customerId); customer.CreatorUserName = UserNameTextBox.Text; customer.CreatorEmail = EmailConfirmTextBox.Text; rs.SaveCustomer(customer); } catch (EndpointNotFoundException exception) { OnError(exception); ServiceErrorLabel.Visible = true; } catch (TimeoutException exception) { OnError(exception); ServiceErrorLabel.Visible = true; } finally { if (rs != null) { rs.Close(); } } }