Пример #1
0
        private void btnAddAward_Click(object sender, EventArgs e)
        {
            AwardForm awardForm = new AwardForm();

            if (awardForm.ShowDialog(this) == DialogResult.OK)
            {
                Logic.AddAward(awardForm.Title, awardForm.Description);
            }
            RefreshAwardsGrid();
        }
Пример #2
0
        private void AddAward()
        {
            AwardForm awardForm = new AwardForm();

            awardForm.ShowDialog();
            if (awardForm.DialogResult == DialogResult.OK)
            {
                logic.AddAward(new Award(awardForm.Title, awardForm.Description));
                UpdateDgvAwards();
            }
        }
Пример #3
0
        private void EditAward()
        {
            Award     award     = (Award)dgvAwards.CurrentRow.DataBoundItem;
            AwardForm awardForm = new AwardForm(award);

            awardForm.ShowDialog();
            if (awardForm.DialogResult == DialogResult.OK)
            {
                award.Title       = awardForm.Title;
                award.Description = awardForm.Description;
                UpdateDgvAwards();
            }
        }
Пример #4
0
        private void btnEditAward_Click(object sender, EventArgs e)
        {
            if (dgvAwards.SelectedCells.Count == 1)
            {
                Award award = (Award)dgvAwards.SelectedCells[0].OwningRow.DataBoundItem;

                AwardForm awardForm = new AwardForm(award);

                if (awardForm.ShowDialog(this) == DialogResult.OK)
                {
                    Logic.UpdateAward(award, awardForm.Title, awardForm.Description);
                }
                RefreshAwardsGrid();
            }
        }