Beispiel #1
0
        private void changeToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            var reward = new Common.Reward()
            {
                ID         = (int)Rewards_dataGridView.SelectedRows[0].Cells[0].Value,
                Title      = (string)Rewards_dataGridView.SelectedRows[0].Cells[1].Value,
                Decription = (string)Rewards_dataGridView.SelectedRows[0].Cells[2].Value,
            };
            var form = new RewardForm(reward);

            if (form.ShowDialog() == DialogResult.OK)
            {
                _memory.UpdateReward(form.GetReward());
                UpdateTables();
            }
        }
Beispiel #2
0
 private void addNewRewardToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (_memory == null)
     {
         MessageBox.Show("choose data source");
     }
     else
     {
         var form = new RewardForm();
         if (form.ShowDialog() == DialogResult.OK)
         {
             _memory.AddReward(form.GetReward());
             UpdateTables();
         }
     }
 }