예제 #1
0
        private void toolStripMenuItem14_Click(object sender, EventArgs e)
        {
            AddUpdateAward addAward = new AddUpdateAward();

            addAward.Text = "Add Award";

            if (addAward.ShowDialog() == DialogResult.OK)
            {
                usersAndAwardsBLL.AddAward(addAward.Title, addAward.Description);
                displayAwards();
            }
        }
예제 #2
0
        private void UpdateAward_Click(object sender, EventArgs e)
        {
            //AddUpdateAward updateAward = new AddUpdateAward(usersAndAwardsBLL, Int32.Parse(dataUsers.CurrentRow.Cells[0].Value.ToString()));
            if (dataAwards.CurrentRow == null)
            {
                ErrorForm errorForm = new ErrorForm("Choose row in awards table");
                errorForm.ShowDialog();
            }
            else
            {
                int currentrow = Int32.Parse(dataAwards.CurrentRow.Cells[0].Value.ToString());

                AddUpdateAward updateAward = new AddUpdateAward(currentrow, usersAndAwardsBLL);

                updateAward.Text = "Update Award";

                if (updateAward.ShowDialog() == DialogResult.OK)
                {
                    usersAndAwardsBLL.UpdateAward(currentrow, updateAward.Title, updateAward.Description);
                    displayAwards();
                }
            }
        }