public async static void SendNewAccountRegistrationData(string _email, string _password, string _firstName, string _lastName) { NewAccountDataModel model = new NewAccountDataModel() { Email = _email, Password = _password, FirstName = _firstName, LastName = _lastName }; string json = JsonConvert.SerializeObject(model); var requestMessage = new HttpRequestMessage(HttpMethod.Post, Constants.API_NEW_ACCOUNT_POST); requestMessage.Content = new StringContent(json); HttpResponseMessage response = await SendRequest(requestMessage); RegistrationResultEventArgs args = new RegistrationResultEventArgs(); if (response.StatusCode == System.Net.HttpStatusCode.OK) { args.Successful = true; args.Message = response.ReasonPhrase; } else { args.Successful = false; args.Message = response.ReasonPhrase; } RegistrationActionResult?.Invoke(null, args); }
private void RegistrationActionResult(object sender, RegistrationResultEventArgs e) { if (e.Successful) { MainPanel.Controls.Clear(); CreateRegistrationSuccessfulPanel(); } else { btn_SendRegistrationInfo.SetWaitingState(false); } }
private void RegistrationResult(object sender, RegistrationResultEventArgs args) { if (args.Successful) { ShowSuccessPanel(); } else { label_Response.Visible = true; label_Response.Text = args.Message; } }