Exemplo n.º 1
0
    private void initializeGroupRegistration()
    {
        // is group registration even enabled?
        if (!targetEvent.EnableGroupRegistrations)
        {
            return; // NOPE!
        }
        var api = GetConciegeAPIProxy();

        List <string> entitiesEligibleForGroupRegistration = GroupRegistrationLogic.GetEntitiesEligibleForGroupRegistration(targetEvent, CurrentEntity, api);

        if (entitiesEligibleForGroupRegistration == null || entitiesEligibleForGroupRegistration.Count == 0)
        {
            return; // nothing to do - this person isn't eligible to group register anyone
        }
        List <NameValueStringPair> companies = new List <NameValueStringPair>();

        foreach (var e in entitiesEligibleForGroupRegistration)
        {
            string name = api.GetName(e).ResultValue;
            if (string.IsNullOrWhiteSpace(name))
            {
                continue;                                  // nothing to do
            }
            companies.Add(new NameValueStringPair(name, e));
        }


        rptGroupRegistration.DataSource = companies;
        rptGroupRegistration.DataBind();
    }
Exemplo n.º 2
0
    protected override bool CheckSecurity()
    {
        var api      = GetConciegeAPIProxy();
        var entities = GroupRegistrationLogic.GetEntitiesEligibleForGroupRegistration(targetEvent, CurrentEntity, api);

        if (entities == null || !entities.Contains(targetOrganization.ID))
        {
            GoTo("/AccessDenied.aspx"); // security violation
        }
        return(base.CheckSecurity());
    }