private void AddReward() { AddReward add = new AddReward(); if (add.ShowDialog(this) == DialogResult.OK) { Reward reward = new Reward(); reward.Title = add.Title; reward.Description = add.Description; logic.AddReward(reward); } RefreshGrid(); }
private void EditReward() { if (ctlDataRewards.SelectedCells.Count > 0) { DataGridViewRow row = ctlDataRewards.SelectedCells[0].OwningRow; var id = (int)row.Cells[2].Value; Reward reward = logic.GetRewardById(id); AddReward edit = new AddReward(reward); if (edit.ShowDialog(this) == DialogResult.OK) { reward.Title = edit.Title; reward.Description = edit.Description; logic.EditReward(reward); } } RefreshGrid(); }