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(); }
private void AddAward() { AwardForm awardForm = new AwardForm(); awardForm.ShowDialog(); if (awardForm.DialogResult == DialogResult.OK) { logic.AddAward(new Award(awardForm.Title, awardForm.Description)); UpdateDgvAwards(); } }
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(); } }
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(); } }