예제 #1
0
        private void AddAward()
        {
            var form = new AwardForm();

            if (form.ShowDialog() == DialogResult.OK)
            {
                listOfAwards.Add(new Award(_awardId++, form.AwardName, form.AwardDesc));
                ctrGridAward.DataSource = null;
                ctrGridAward.DataSource = listOfAwards;
            }
        }
예제 #2
0
        private void EditAward()
        {
            Award award = (Award)ctrGridAward.SelectedCells[0].OwningRow.DataBoundItem;
            var   form  = new AwardForm(award);

            if (form.ShowDialog() == DialogResult.OK)
            {
                award.AwardName        = form.AwardName;
                award.AwardDescription = form.AwardDesc;
                DisplayAwards();
            }
        }