Exemplo n.º 1
0
        private void addUserToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AddUpdateUser addForm = new AddUpdateUser(usersAndAwardsBLL);

            addForm.Text = "Add User";

            if (addForm.ShowDialog() == DialogResult.OK)
            {
                usersAndAwardsBLL.AddUser(addForm.FirstName, addForm.LastName, addForm.Birthday, addForm.UsersAwards);
                displayUsers();
            }
        }
Exemplo n.º 2
0
        private void UpdateUser_Click(object sender, EventArgs e)
        {
            if (dataUsers.CurrentRow == null)
            {
                ErrorForm errorForm = new ErrorForm("Choose row in user table");
                errorForm.ShowDialog();
            }
            else
            {
                int currentrow = Int32.Parse(dataUsers.CurrentRow.Cells[0].Value.ToString());

                AddUpdateUser updateUser = new AddUpdateUser(currentrow, usersAndAwardsBLL);

                updateUser.Text = "Update User";

                if (updateUser.ShowDialog() == DialogResult.OK)
                {
                    usersAndAwardsBLL.UpdateUser(currentrow, updateUser.FirstName, updateUser.LastName, updateUser.Birthday, updateUser.UsersAwards);
                    displayUsers();
                }
            }
        }