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

            if (form.ShowDialog() == DialogResult.OK)
            {
                listOfAwards.Add(new Award(_awardId, form.AwardName, form.AwardDesc));
                DisplayAwards();
            }
        }
Beispiel #2
0
        private void EditAward()
        {
            if (ctrGridAward.SelectedCells.Count > 0)
            {
                int   id    = (int)ctrGridAward.Rows[ctrGridAward.SelectedCells[0].RowIndex].Cells[2].Value;
                Award award = new Award();
                foreach (Award aw in listOfAwards.GetList())
                {
                    if (aw.AwardId == id)
                    {
                        award = aw;
                    }
                }

                var form = new AwardForm(award);
                if (form.ShowDialog() == DialogResult.OK)
                {
                    award.AwardName        = form.AwardName;
                    award.AwardDescription = form.AwardDesc;
                    listOfAwards.Edit(award);
                    DisplayAwards();
                }
            }
        }