private void addNewUser_Click(object sender, RoutedEventArgs e) { foreach (User user in Users) { if (user.Username == UserNameInput.Text) { MessageBox.Show("Användarnamnet finns redan!"); UserNameInput.Clear(); return; } } try { manageUsers.AddUser(UserNameInput.Text, passWordInput.Password, mechanicDropDown.SelectedIndex, Users, Mechanics); } catch { MessageBox.Show("Felaktigt användarnamn eller lösenord." + "Lösenordet ska innehålla mellan 5 & 10 tecken och användarnamnet ska bestå av en giltig mejladress"); } UserNameInput.Clear(); passWordInput.Clear(); UpdateUserList(); }
/// <summary> /// Adds data from user name, second name, phone number, /// skype, linkedIn inputs to a list and compares it with the expected. /// </summary> /// <param name="expected"></param> /// <returns></returns> public bool IsPreviouslyEnteredDataPresent(IList <string> expected) { IList <string> actual = new List <string>(); actual.Add(UserNameInput.GetAttribute("value")); actual.Add(UserSurnameInput.GetAttribute("value")); //rip the phone mask string phoneMasked = PhoneNumberInput.GetAttribute("value"); string[] arr = phoneMasked.Split(new[] { '(', ')', '-' }); string phoneRaw = arr[1] + arr[2].Substring(1) + arr[3] + arr[4]; actual.Add(phoneRaw); actual.Add(SkypeInput.GetAttribute("value")); actual.Add(LinkedInInput.GetAttribute("value")); if (Enumerable.SequenceEqual(expected, actual)) { return(true); } return(false); }
// TODO re-activate protected virtual void OnSaveRatingsAsActionActivated(object sender, System.EventArgs e) { //var user_name = GtkSharpUtils.StringInput(this, "Enter Name"); string user_name; { UserNameInput dialog = new UserNameInput(); dialog.Run(); Console.Error.WriteLine("finished running dialog"); user_name = dialog.UserName; dialog.Destroy(); } if (user_name != string.Empty) { Console.Error.WriteLine("save as " + user_name); SaveRatings(user_name); ratings.Clear(); rating_predictor.RemoveUser(current_user_id); user_mapping.ToInternalID(++current_user_external_id); PredictAllRatings(); } else { Console.Error.WriteLine("Aborting saving of user ..."); } }
public static void Login(string login, string password) { UserNameInput.SendKeys(login); PasswordInput.SendKeys(password); SubmitButton.Click(); HomePage.VerifyLoggedState(); }
public EnrollInput() { this.Owner = Application.Current.MainWindow; InitializeComponent(); UserNameInput.Text = "New User"; UserNameInput.Focus(); UserNameInput.SelectAll(); }
private void OnUsernameTaken(Message msg) { ChangeUIThreadSafe(() => { UserNameInput.IsReadOnly = false; UsernameLabel.Content = "НИК ЗАНЯТ. Другой избери"; UserNameInput.SelectAll(); CheckUsernameButton.IsEnabled = true; }); }
public ActionResult editName(int id, [FromBody] UserNameInput userNameChange) { //string newUserName = userName.ToString(); //string newUserName = System.Text.Json.JsonSerializer.Deserialize(String)(userName); PlayerManager PM = new PlayerManager(); PM.editPlayerUsername(id, userNameChange.username); return(Ok()); }
public void LogIn(string username, string password) { PopupLoginWindow.Click(); UserNameInput.Click(); UserNameInput.Clear(); UserNameInput.SendKeys(username); PasswordInput.Click(); PasswordInput.Clear(); PasswordInput.SendKeys(password); SubmitButton.Click(); }
/// <summary> /// Fills all the fields in the block with dummy data. /// </summary> public void FillAllFieldsWithDummyData() { UserNameInput.Clear(); UserNameInput.SendKeys("TestName"); UserSurnameInput.Clear(); UserSurnameInput.SendKeys("TestSurname"); PhoneNumberInput.Clear(); PhoneNumberInput.SendKeys("258887744"); SkypeInput.Clear(); SkypeInput.SendKeys("TestSkype"); LinkedInInput.Clear(); LinkedInInput.SendKeys("TestLinkedIn"); }
public void LogInKeys( string userStory, string userName, string userEmail, string userNumber, string userLocation ) { UserStoryTexarea.SendKeys(userStory); UserNameInput.SendKeys(userName); UserEmailInput.SendKeys(userEmail); UserNumberInput.SendKeys(userNumber); UserLocationInput.SendKeys(userLocation); }
/// <summary> /// Fills the corresponding input with pre-defined data and adds it to the list. /// </summary> /// <param name="inputName"></param> /// <param name="listToUpdate"></param> public void FillInputWithDummyData(string inputName, IList <string> listToUpdate) { switch (inputName) { case "Name": UserNameInput.Clear(); UserNameInput.SendKeys("TestName"); listToUpdate.Add("TestName"); break; case "Surname": UserSurnameInput.Clear(); UserSurnameInput.SendKeys("TestSurname"); listToUpdate.Add("TestSurname"); break; case "Phone number": PhoneNumberInput.Clear(); PhoneNumberInput.SendKeys("258887744"); listToUpdate.Add("258887744"); break; case "Skype": SkypeInput.Clear(); SkypeInput.SendKeys("TestSkype"); listToUpdate.Add("TestSkype"); break; case "LinkedIn": LinkedInInput.Clear(); LinkedInInput.SendKeys("TestLinkedIn"); listToUpdate.Add("TestLinkedIn"); break; default: break; } }
/// <summary> /// Enter the user credentials /// </summary> /// <param name="userName">The user name</param> /// <param name="password">The user password</param> public void EnterCredentials(string userName, string password) { UserNameInput.SendKeys(userName); PasswordInput.SendKeys(password); }
public void EnterUserName(string name) { ClearUserNameInput(); UserNameInput.SendKeys(name); }
public void ClearUserNameInput() { UserNameInput.Clear(); }