示例#1
0
        public void Init(IHome View, bool IsPostBack)
        {
            _view = View;
            List <VisibilityLevel> _listVisibilityLevel = new List <VisibilityLevel>();

            _listVisibilityLevel = _privacyService.GetListVisibilityLevel();
            if (_userSession.LoggedIn == true)
            {
                IProfileRepository _profileRepository = new ProfileRepository();
                Profile            profile            = _profileRepository.GetProfileByAccountID(_userSession.CurrentUser.AccountID);
                if (profile == null)
                {
                    _redirector.Redirect("~/Profiles/ManageProfile.aspx");
                }
                else
                {
                    _view.LoadStatusControl(_listVisibilityLevel, true);
                    account = _userSession.CurrentUser;
                    if (!IsPostBack)
                    {
                        _view.LoadStatus(GetStatusToShow(account));
                    }
                }
            }
            else
            {
                account = null;
                _redirector.GoToAccountLoginPage();
            }
            _view.DisplayCurrentAccount(account);
        }
示例#2
0
        public void Init(IHome View)
        {
            _view = View;

            if(_userSession.LoggedIn==true)
            {
                account=_userSession.CurrentUser;

            }
            else
                account=null;
            _view.DisplayCurrentAccount(account);
        }
示例#3
0
        public void Init(IHome View, bool IsPostBack)
        {
            _view = View;
            List<VisibilityLevel> _listVisibilityLevel = new List<VisibilityLevel>();
            _listVisibilityLevel = _privacyService.GetListVisibilityLevel();
            if (_userSession.LoggedIn == true)
            {
                IProfileRepository _profileRepository = new ProfileRepository();
                Profile profile = _profileRepository.GetProfileByAccountID(_userSession.CurrentUser.AccountID);
                if (profile == null)
                    _redirector.Redirect("~/Profiles/ManageProfile.aspx");
                else
                {
                    _view.LoadStatusControl(_listVisibilityLevel, true);
                    account = _userSession.CurrentUser;
                    if (!IsPostBack)
                    {
                        _view.LoadStatus(GetStatusToShow(account), GetAlertToShow(account));

                    }
                }
            }
            else
            {
                account = null;
                _redirector.GoToAccountLoginPage();
            }
            _view.DisplayCurrentAccount(account);
        }