Example #1
0
        private void AddUserButton_Click(object sender, EventArgs e)
        {
            UsersListForm users_list = new UsersListForm(client.GetUsersList().Data.Split(' ')
                                                         .Where(u => !UserList.Items.Contains(u)).ToArray());

            users_list.ShowDialog();

            if (users_list.SelectedUser != null)
            {
                ActionResult res = client.AddUserToContacts(users_list.SelectedUser);
                if (res.Result)
                {
                    UserList.Items.Add(users_list.SelectedUser);
                }
                else
                {
                    MessageBox.Show(ErrorMessages.ERR_UNDEFINED_RESPONSE, ErrorMessages.ERR_ERROR,
                                    MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }