Пример #1
0
        public ActionResult Edit(int rewardId)
        {
            var rewards       = rewardsBL;
            var currentReward = rewardsBL.GetList().FirstOrDefault(u => u.ID == rewardId);

            return(View(RewardViewModel.GetViewModel(currentReward, rewards.GetList())));
        }
Пример #2
0
        public ActionResult Add()
        {
            var rewards = new List <RewardViewModel>();

            foreach (var reward in rewardsBL.GetList())
            {
                rewards.Add(RewardViewModel.GetViewModel(reward, null));
            }
            return(View("Edit", new UserViewModel()
            {
                AvailableRewards = rewards
            }));
        }