Пример #1
0
        public ActionResult ProvideGift()
        {
            var items = new List<Gift>();
            var images = new List<string>
            {
                "http://www.medianigeria.com/wp-content/uploads/2015/01/de-gea.jpg",
                "http://localhost:12870/images/banner.jpg",
                "http://blog.pluralsight.com//wp-content/uploads/pluralsight/2011/12/gift-box-icon.jpg"
            };
            var rand = new Random((int) DateTime.Now.Ticks);
            for(var i=0;i<20;i++)
                items.Add(new Gift{Description = "some descr", Name = "Gift Name", PhotoUrl = images[rand.Next(images.Count)]});
            var model = new ProvideGiftModel
            {
                Items = items,
                UserPhoto = "http://www.medianigeria.com/wp-content/uploads/2015/01/de-gea.jpg"
            };

            return View(model);
        }
Пример #2
0
 public ActionResult ProvideGift(ProvideGiftModel model)
 {
     TempData["friends"] = GetFriends();
     return RedirectToAction("GiftsProvided");
 }