public void Init(IManageProfile view, bool IsPostback) { _view = view; if (_userSession.LoggedIn == true) { _listVisibilityLevel = _privacyRepository.GetVisibilityLevels(); profile = _profileService.LoadProfileByUserName(_userSession.Username); _listProfileAttributeType = _profileAttributeService.GetProfileAttributeType(); if (profile != null) { _listPrivacyFlags = _privacyRepository.GetPrivacyFlagsByProfileID(profile.ProfileID); _view.loadProfileAttribute(_listProfileAttributeType, _listVisibilityLevel, _listPrivacyFlags, profile); } else { profile = new Profile(); profile.AccountID = _userSession.CurrentUser.AccountID; profile.profileName = _userSession.CurrentUser.UserName; _profileService.SaveProfileTable(profile); AddProfileAttribute(_listProfileAttributeType, profile); } //_view.LoadProfile(profile); _view.ShowProfileName(profile.profileName); LoadProfile(IsPostback); } else { _redirector.GoToAccountLoginPage(); } }
public List <VisibilityLevel> GetListVisibilityLevel() { return(_privacyRepository.GetVisibilityLevels()); }