//Add a user
        private void addUserButton_Click(object sender, EventArgs e)
        {
            AlterUser    form         = new AlterUser(null);
            DialogResult dialogResult = form.ShowDialog();

            if (dialogResult == DialogResult.OK)
            {
                bool count = false;
                foreach (User user in users)
                {
                    if (user.username.Equals(form.user.username))
                    {
                        count = true;
                    }
                }
                if (!count)
                {
                    users.Add(form.user);
                    //Send users to server
                    network.AddUser(form.user);
                    fillUsersList();
                }
                form.Dispose();
            }
        }
 //Add a user
 private void addUserButton_Click(object sender, EventArgs e)
 {
     AlterUser form = new AlterUser(null);
     DialogResult dialogResult = form.ShowDialog();
     if(dialogResult == DialogResult.OK)
     {
         bool count = false;
         foreach (User user in users)
             if (user.username.Equals(form.user.username))
                 count = true;
         if (!count)
         {
             users.Add(form.user);
             //Send users to server
             network.AddUser(form.user);
             fillUsersList();
         }
         form.Dispose();
     }
 }
        //Alter user
        private void changeUserButton_Click(object sender, EventArgs e)
        {
            String       username = usersDataGridView.CurrentCell.Value.ToString();
            DialogResult dialogResult;

            foreach (User user in users)
            {
                if (user.username.Equals(username))
                {
                    Form form = new AlterUser(user);
                    dialogResult = form.ShowDialog();
                    if (dialogResult == DialogResult.OK)
                    {
                        //Send users to server
                        fillUsersList();
                        network.SaveUsers(users);
                        form.Dispose();
                    }
                }
            }
        }
 //Alter user
 private void changeUserButton_Click(object sender, EventArgs e)
 {
     String username = usersDataGridView.CurrentCell.Value.ToString();
     DialogResult dialogResult;
     foreach (User user in users)
     {
         if (user.username.Equals(username))
         {
             Form form = new AlterUser(user);
             dialogResult = form.ShowDialog();
             if (dialogResult == DialogResult.OK)
             {
                 //Send users to server
                 fillUsersList();
                 network.SaveUsers(users);
                 form.Dispose();
             }
         }
     }
 }