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()); }
private void DisplayRewards() { ctlRewardDataGridView.DataSource = null; ctlRewardDataGridView.DataSource = Rewards.GetRewards(); }
// GET: User public ActionResult Index() { ViewBag.Users = users.GetUser().Select(UserDataGridView.GetModel).ToList(); ViewBag.Rewards = rewards.GetRewards(); return(View()); }