Exemplo n.º 1
0
        public override void OnLoginAuthenticated()
        {
            var member = LoggedInMember;

            if (member != null)
            {
                SetUserContext(member);
                return;
            }

            var employer = LoggedInEmployer;

            if (employer != null)
            {
                // There is one special case that remains from previous work: Autopeople.

                var partner = _partnersQuery.GetPartner(employer.Id);
                if (partner != null)
                {
                    // Set the context.

                    var community = _communitiesQuery.GetCommunity(partner.Name);
                    if (community != null)
                    {
                        var vertical = _verticalsQuery.GetVertical(community.Id);
                        if (vertical != null)
                        {
                            ActivityContext.Current.Set(vertical);
                            return;
                        }
                    }
                }

                SetEmployerContext(employer);
                return;
            }

            var custodian = LoggedInCustodian;

            if (custodian != null)
            {
                SetUserContext(custodian);
            }
        }
Exemplo n.º 2
0
        private bool SetPartnerEmployerVertical(Guid employerId)
        {
            var partner = _partnersQuery.GetPartner(employerId);

            if (partner != null)
            {
                // Set the context.

                var community = _communitiesQuery.GetCommunity(partner.Name);
                if (community != null)
                {
                    var vertical = _verticalsQuery.GetVertical(community.Id);
                    if (vertical != null)
                    {
                        ActivityContext.Current.Set(vertical);
                        return(true);
                    }
                }
            }

            return(false);
        }