예제 #1
0
        public IActionResult Profile()
        {
            VolunteerProfileViewModel model;

            /*var ads = new List<AdvertSingleViewModel>();
             * for (int i = 0; i < 20; i++)
             * {
             *  ads.Add(new AdvertSingleViewModel()
             *  {
             *      Id = (i + 1),
             *      Position = "Any pos pos pos",
             *      Description = "Any Description"
             *  });
             * }
             *
             * model = new VolunteerProfileViewModel()
             * {
             *  Username = "******",
             *  FirstName = "Veselin",
             *  LastName = "Penev",
             *  Age = 25,
             *  Contact = "*****@*****.**",
             *  SignedInAds = new IndexSingleAdViewModel() { Ads = ads }
             *
             * };*/

            try
            {
                model = service.GetSignedVolunteer();
            }
            catch (ArgumentException e)
            {
                TempData["username"] = "";
                TempData["errorMsg"] = e.Message; //"You need to be logged in"
                return(LogInError());
            }

            return(View(model));
        }