private void changeEmailStep1(object sender, EventArgs e) { inputForm.Closed -= changeEmailStep1; if (string.IsNullOrEmpty(inputForm.input)) { MessageBox.Show("You must enter an email!"); return; } SQLReference.UserData uData = createUserdata(); uData.Email = inputForm.input; client.SetUserDataCompleted += endSetData; client.SetUserDataAsync(M.username, uData, uData); }
private void cmdChangeMessaging_Click(System.Object sender, System.Windows.RoutedEventArgs e) { SQLReference.UserData uData = createUserdata(); if (lblProfileMessaging.Text == "Allow Messaging: Yes") { uData.Allow_Messaging = false; } else { uData.Allow_Messaging = true; } client.SetUserDataCompleted += endSetData; client.SetUserDataAsync(M.username, uData, uData); }
SQLReference.UserData createUserdata() { SQLReference.UserData uData = new SQLReference.UserData(); if (lblProfileMessaging.Text == "Allow Messaging: Yes") { uData.Allow_Messaging = true; } else { uData.Allow_Messaging = false; } uData.Password = MyPassword; uData.Email = lblProfileEmail.Text.Replace("Email: ", ""); return(uData); }
private void updateProfile(SQLReference.UserData uData, bool showRating) { if (!string.IsNullOrEmpty(M.mySet)) { lblPool.Text = "Pool: " + M.mySet; } if (showRating) { lblRating.Text = "Rating: " + uData.Rating; imgRating.Width = uData.Rating * 10 + 1; if (uData.Rating < 4) { imgRating.Fill = new System.Windows.Media.SolidColorBrush(Colors.Blue); lblRatingDescription.Text = "Underpowered"; } else if (uData.Rating < 6) { imgRating.Fill = new System.Windows.Media.SolidColorBrush(Colors.Green); lblRatingDescription.Text = "Balanced"; } else { imgRating.Fill = new System.Windows.Media.SolidColorBrush(Colors.Red); lblRatingDescription.Text = "Overpowered"; } lblRatingNumber.Text = "Number of Ratings: " + uData.Rating_Number; } MyPassword = uData.Password; System.Text.StringBuilder fakePassword = new System.Text.StringBuilder(); for (short n = 1; n <= MyPassword.Length; n++) { fakePassword.Append("*"); } lblProfilePassword.Text = "Password: "******"Email: " + uData.Email; lblProfileMessaging.Text = "Allow Messaging: " + (uData.Allow_Messaging ? "Yes" : "No"); }