Esempio n. 1
0
        public void Init(IUserProfile view, bool IsPostBack)
        {
            _view = view;

            int                    accountID            = _webContext.AccountID;
            bool                   IsUser               = false;
            List <Alert>           listAlert            = new List <Alert>();
            List <VisibilityLevel> _listVisibilityLevel = new List <VisibilityLevel>();

            _listVisibilityLevel = _privacyService.GetListVisibilityLevel();


            if (!IsPostBack)
            {
                int viewerID = -1;
                if (_userSession.LoggedIn)
                {
                    viewerID = _userSession.CurrentUser.AccountID;
                    if (accountID == viewerID)
                    {
                        _view.DisplayAccountInfo(viewerID, accountID);
                        IsUser = true;
                    }
                }
                if (accountID > 0)
                {
                    if (_userSession.LoggedIn)
                    {
                        _view.LoadStatusControl(_listVisibilityLevel, IsUser);
                        _view.DisplayAccountInfo(viewerID, accountID);
                        listAlert = _alertService.GetAlerts(_userSession.CurrentUser.AccountID, accountID);
                        _view.LoadAlert(listAlert, GetStatusToShow(_userSession.CurrentUser, _accountService.GetAccountByAccountID(accountID)));
                    }
                    else
                    {
                        _view.LoadAlert(_alertService.GetAlertsByAccountID(accountID));
                    }
                }
                if (accountID == 0)
                {
                    if (viewerID != -1)
                    {
                        _view.DisplayAccountInfo(viewerID, viewerID);
                        IsUser = true;
                        _view.LoadStatusControl(_listVisibilityLevel, IsUser);
                        _view.LoadAlert(_alertService.GetAlerts(viewerID, viewerID), GetStatusToShow(_userSession.CurrentUser, _accountService.GetAccountByAccountID(viewerID)));
                    }
                }
            }
        }
Esempio n. 2
0
        public void Init(IUserProfile view, bool IsPostBack)
        {
            if ((_userSession.LoggedIn == false) && (_webContext.AccountID <= 0))
                _redirector.GoToAccountLoginPage();
            else
            {
                _view = view;

                int accountID = _webContext.AccountID;
                bool IsUser = false;
                List<Alert> listAlert = new List<Alert>();
                List<VisibilityLevel> _listVisibilityLevel = new List<VisibilityLevel>();
                _listVisibilityLevel = _privacyService.GetListVisibilityLevel();
                if (!IsPostBack)
                {
                    int viewerID = -1;
                    if (_userSession.LoggedIn)
                    {
                        viewerID = _userSession.CurrentUser.AccountID;
                        if (accountID == viewerID)
                        {
                            _view.DisplayAccountInfo(viewerID, accountID);
                            IsUser = true;
                        }

                    }
                    if (accountID > 0)
                    {
                        if (_userSession.LoggedIn)
                        {
                            _view.LoadStatusControl(_listVisibilityLevel, IsUser);
                            _view.DisplayAccountInfo(viewerID, accountID);
                            listAlert = _alertService.GetAlerts(_userSession.CurrentUser.AccountID, accountID);
                            _view.LoadAlert(listAlert, GetStatusToShow(_userSession.CurrentUser, _accountService.GetAccountByAccountID(accountID)));
                        }
                        else
                            _view.LoadAlert(_alertService.GetAlertsByAccountID(accountID), GetStatusToShow(_userSession.CurrentUser, _accountService.GetAccountByAccountID(accountID)));
                    }
                    if (accountID == 0)
                    {
                        if (viewerID != -1)
                        {
                            _view.DisplayAccountInfo(viewerID, viewerID);
                            IsUser = true;
                            _view.LoadStatusControl(_listVisibilityLevel, IsUser);
                            _view.LoadAlert(_alertService.GetAlerts(viewerID, viewerID), GetStatusToShow(_userSession.CurrentUser, _accountService.GetAccountByAccountID(viewerID)));
                        }

                    }
                }

            }
        }