예제 #1
0
        private void DeleteReward(object sender, EventArgs e)
        {
            int id = (int)ctlRewardDataGridView.SelectedCells[0].OwningRow.Cells[0].Value;

            Rewards.DeleteReward(id);

            DisplayRewards();
            DisplayUsers();
        }
        public ActionResult Delete(int rewardId)
        {
            var currentReward = rewards.GetRewards().FirstOrDefault(u => u.ID == rewardId);

            if (currentReward != null)
            {
                rewards.DeleteReward(currentReward.ID);
            }

            return(RedirectToAction("Index", "User"));
        }