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();
        }
コード例 #2
0
        /// <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);
        }
コード例 #3
0
ファイル: MainWindow.cs プロジェクト: zenogantner/MML-KDD
    // 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 ...");
        }
    }
コード例 #4
0
        public static void Login(string login, string password)
        {
            UserNameInput.SendKeys(login);
            PasswordInput.SendKeys(password);
            SubmitButton.Click();

            HomePage.VerifyLoggedState();
        }
コード例 #5
0
        public EnrollInput()
        {
            this.Owner = Application.Current.MainWindow;
            InitializeComponent();

            UserNameInput.Text = "New User";
            UserNameInput.Focus();
            UserNameInput.SelectAll();
        }
コード例 #6
0
 private void OnUsernameTaken(Message msg)
 {
     ChangeUIThreadSafe(() =>
     {
         UserNameInput.IsReadOnly = false;
         UsernameLabel.Content    = "НИК ЗАНЯТ. Другой избери";
         UserNameInput.SelectAll();
         CheckUsernameButton.IsEnabled = true;
     });
 }
コード例 #7
0
        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());
        }
コード例 #8
0
 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();
 }
コード例 #9
0
 /// <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");
 }
コード例 #10
0
 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);
 }
コード例 #11
0
        /// <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;
            }
        }
コード例 #12
0
ファイル: ALoginPageModel.cs プロジェクト: row49382/MAQS
 /// <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);
 }
コード例 #13
0
 public void EnterUserName(string name)
 {
     ClearUserNameInput();
     UserNameInput.SendKeys(name);
 }
コード例 #14
0
 public void ClearUserNameInput()
 {
     UserNameInput.Clear();
 }