public ActionResult Save(int rewardId = 0)
        {
            if (rewardId == 0)
            {
                ViewBag.Reward = new Reward()
                {
                    Title = "", Description = ""
                };
            }
            else
            {
                ViewBag.Reward = rewards.GetRewards().FirstOrDefault(c => c.ID == rewardId);
            }

            return(View());
        }
Exemple #2
0
        private void DisplayRewards()
        {
            ctlRewardDataGridView.DataSource = null;

            ctlRewardDataGridView.DataSource = Rewards.GetRewards();
        }
Exemple #3
0
 // GET: User
 public ActionResult Index()
 {
     ViewBag.Users   = users.GetUser().Select(UserDataGridView.GetModel).ToList();
     ViewBag.Rewards = rewards.GetRewards();
     return(View());
 }