Exemplo n.º 1
0
 public ActionResult Index()
 {
     var account = new AccountInfo();
     try
     {
         var profile = ProfileService.GetUserProfile(account.GetUserName());
         string imageFile = AppDomain.CurrentDomain.BaseDirectory + "/content/img/DefaultUser.png";
         var buffer = string.IsNullOrEmpty(profile.ProfilePicture) ? imageFile : profile.ProfilePicture;
         var model = new UserProfileModel()
         {
             FirstName = profile.FirstName,
             LastName = profile.LastName,
             FullName = profile.FullName,
             EmailAddress = profile.EmailAddress,
             MobilePhone = profile.MobilePhone,
             ProfilePicture = buffer,
             Notes = profile.Notes,
             Department = profile.Department,
             JobTitle = profile.JobTitle,
             FullProfileLink = ApplicationConfiguration.ProfileUri
         };
         ViewBag.Title = "My Profile";
         return View(model);
     }
     catch (Exception ex) { throw ex; }
 }
Exemplo n.º 2
0
 public ActionResult ShowSearchProfile(string profileName)
 {
     try
     {
         var profile = ProfileService.GetUserProfile(profileName);
         profileName = profileName.ToUpper().Contains(ApplicationConfiguration.Domain.ToUpper())
             ? profileName
             : ApplicationConfiguration.Domain + profileName.StartWithBackwardSlash();
         string imageFile = AppDomain.CurrentDomain.BaseDirectory + "/content/img/DefaultUser.png";
         var buffer = string.IsNullOrEmpty(profile.ProfilePicture) ? imageFile : profile.ProfilePicture;
         var model = new UserProfileModel()
         {
             FirstName = profile.FirstName,
             LastName = profile.LastName,
             FullName = profile.FullName,
             EmailAddress = profile.EmailAddress,
             MobilePhone = profile.MobilePhone,
             ProfilePicture = buffer,
             Notes = profile.Notes,
             Department = profile.Department,
             JobTitle = profile.JobTitle,
             FullProfileLink = ApplicationConfiguration.ModernProfileUri + "?accountname=" + profileName
                 
         };
         ViewBag.Title = "Profile";
         ViewBag.AdvanceSearch = "True";
         return View("Index", model);
     }
     catch (Exception ex) { throw ex; }
 }
Exemplo n.º 3
0
        public ActionResult ShowMultipleProfiles(string appsettingkey)
        {
            try
            {
                var profiles = new List<UserProfileModel>();
                var arr = ConfigurationManager.AppSettings[appsettingkey].Split(",".ToCharArray()).ToList();
                foreach (var id in arr)
                {
                    var profile = ProfileService.GetUserProfile(id);
                    var profileName = id.ToUpper().Contains(ApplicationConfiguration.Domain.ToUpper())
                    ? id
                    : ApplicationConfiguration.Domain + id.StartWithBackwardSlash();
                    string imageFile = AppDomain.CurrentDomain.BaseDirectory + "/content/img/DefaultUser.png";
                    var buffer = string.IsNullOrEmpty(profile.ProfilePicture) ? imageFile : profile.ProfilePicture;
                    var model = new UserProfileModel()
                    {
                        FirstName = profile.FirstName,
                        LastName = profile.LastName,
                        FullName = profile.FullName,
                        EmailAddress = profile.EmailAddress,
                        MobilePhone = profile.MobilePhone,
                        ProfilePicture = buffer,
                        Notes = profile.Notes,
                        Department = profile.Department,
                        JobTitle = profile.JobTitle,
                        FullProfileLink = ApplicationConfiguration.ModernProfileUri + "?accountname=" + profileName
                    };
                    profiles.Add(model);
                }

                return PartialView("_MultipleProfiles", profiles);
            }
            catch (Exception ex) { throw ex; }
        }