public IActionResult ProfileDetails(int id)
        {
            UserProfile userProfile = new UserProfile();

            userProfile = profileData.GetProfileByID(id);
            if (userProfile.UserKey == null)
            {
                TempData["Message"] = "This profile does not exist";
                return(RedirectToAction("index", "home"));
            }
            else if (userProfile.IsPrivate && userProfile.UserKey != userManager.FindByNameAsync(User.Identity.Name).Result.Id)
            {
                TempData["Message"] = "This profile is private";
                return(RedirectToAction("index", "home"));
            }

            if (userProfile.ProfileImage == null)
            {
                TempData["Message"] = "you need to update your profile to view it!";
                return(RedirectToAction("index", "home"));
            }

            if (userProfile.IsPrivate)
            {
                TempData["Message"] = "Your profile is private";
            }

            userProfile.user            = userManager.FindByIdAsync(userProfile.UserKey).Result;
            userProfile.ProfileImageUrl = GetImageUrl(userProfile);
            userProfile.Certifications  = certData.GetCertificationsByAuthor(userProfile.user.Email);
            return(View(userProfile));
        }
Beispiel #2
0
        public IActionResult ListEditCertifications()
        {
            ViewData["Function"] = $"{User.Identity.Name}";
            var CertList = certData.GetCertificationsByAuthor(User.Identity.Name);

            if (CertList.Count() >= 1)
            {
                return(View(CertList));
            }
            TempData["Message"] = "You do not have any certifications to edit";
            return(RedirectToAction("index", "Home"));
        }