Beispiel #1
0
        private void CreateReward()
        {
            var formReward = new FormReward();

            if (formReward.ShowDialog(this) == DialogResult.OK)
            {
                _rewardsBL.Add(new Reward(formReward.Title, formReward.Description));
            }
        }
        public IActionResult AddReward()
        {
            string rewardTitle       = Request.Form["uTitle"];
            string rewardDescription = Request.Form["uDescription"];

            _rewardsBL.Add(new Entites.Reward(0, rewardTitle, rewardDescription));

            return(RedirectToAction("Index"));
        }
Beispiel #3
0
        private void RegisterNewReward()
        {
            RewardForm form = new RewardForm();

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                rewards.Add(form.Title, form.Description);
                DisplayReward();
            }
        }
Beispiel #4
0
 public ActionResult Save(RewardViewModel rewardModel)
 {
     if (rewardModel != null)
     {
         if (rewardModel.ID == default(int))// add
         {
             rewardsBL.Add(rewardModel.ToReward());
         }
         else // update
         {
             var reward = rewardModel.ToReward();
             rewardsBL.Edit(reward);
         }
     }
     return(RedirectToAction("Index"));
 }