Пример #1
0
    protected override void InitializeTargetObject()
    {
        base.InitializeTargetObject();

        if (ContextID == null)
        {
            GoToMissingRecordPage();
        }

        Search s = new Search(msPayment.CLASS_NAME);

        s.AddCriteria(Expr.Equals("ID", ContextID));
        s.AddOutputColumn("LocalID");
        s.AddOutputColumn("Date");
        s.AddOutputColumn("Total");
        s.AddOutputColumn("Owner.Name");
        s.AddOutputColumn("Owner");
        s.AddOutputColumn("AmountRefunded");
        s.AddOutputColumn("BillingAddress");


        var sr = APIExtensions.GetSearchResult(s, 0, 1);

        if (sr.TotalRowCount == 0)
        {
            GoToMissingRecordPage();
        }

        targetPayment = sr.Table.Rows[0];

        if (string.IsNullOrWhiteSpace(LeaderOfId))
        {
            return;
        }

        var leaderOf = APIExtensions.LoadObjectFromAPI(LeaderOfId);

        switch (leaderOf.ClassType)
        {
        case msChapter.CLASS_NAME:
            targetChapter = leaderOf.ConvertTo <msChapter>();
            break;

        case msSection.CLASS_NAME:
            targetSection = leaderOf.ConvertTo <msSection>();
            break;

        case msOrganizationalLayer.CLASS_NAME:
            targetOrganizationalLayer = leaderOf.ConvertTo <msOrganizationalLayer>();
            break;

        default:
            QueueBannerError(string.Format("Invalid leader object type specified '{0}'",
                                           leaderOf.ClassType));
            GoHome();
            return;
        }
    }
    protected void loadEventOwners()
    {
        if (!string.IsNullOrWhiteSpace(targetEvent.Chapter))
            targetChapter = LoadObjectFromAPI<msChapter>(targetEvent.Chapter);

        if (!string.IsNullOrWhiteSpace(targetEvent.Section))
            targetSection = LoadObjectFromAPI<msSection>(targetEvent.Section);

        if (!string.IsNullOrWhiteSpace(targetEvent.OrganizationalLayer))
            targetOrganizationalLayer = LoadObjectFromAPI<msOrganizationalLayer>(targetEvent.OrganizationalLayer);
    }
Пример #3
0
    /// <summary>
    /// Initializes the target object for the page
    /// </summary>
    /// <remarks>Many pages have "target" objects that the page operates on. For instance, when viewing
    /// an event, the target object is an event. When looking up a directory, that's the target
    /// object. This method is intended to be overriden to initialize the target object for
    /// each page that needs it.</remarks>
    protected override void InitializeTargetObject()
    {
        base.InitializeTargetObject();

        targetSection = LoadObjectFromAPI <msSection>(ContextID);
        if (targetSection == null)
        {
            GoToMissingRecordPage();
            return;
        }
    }
    /// <summary>
    /// Initializes the target object for the page
    /// </summary>
    /// <remarks>Many pages have "target" objects that the page operates on. For instance, when viewing
    /// an event, the target object is an event. When looking up a directory, that's the target
    /// object. This method is intended to be overriden to initialize the target object for
    /// each page that needs it.</remarks>
    protected override void InitializeTargetObject()
    {
        base.InitializeTargetObject();

        targetSection = LoadObjectFromAPI <msSection>(ContextID);

        if (targetSection == null)
        {
            GoToMissingRecordPage();
            return;
        }

        targetSectionLeader = targetSection.Leaders.Find(x => x.Individual == CurrentEntity.ID);

        if (targetSectionLeader == null)
        {
            GoToMissingRecordPage();
            return;
        }

        targetMembershipOrganization = LoadObjectFromAPI <msMembershipOrganization>(targetSection.MembershipOrganization);

        if (targetMembershipOrganization == null)
        {
            GoToMissingRecordPage();
            return;
        }

        targetSearchManifest = MultiStepWizards.ViewSectionMembers.SearchManifest;

        if (targetSearchManifest == null || targetSearchManifest.DefaultSelectedFields.Count == 0)
        {
            targetSearchManifest = buildSearchManifest();
            MultiStepWizards.ViewSectionMembers.SearchManifest = targetSearchManifest;
        }

        using (IConciergeAPIService proxy = GetConciegeAPIProxy())
        {
            List <string> availableFields = defaultFieldFullPaths;

            //If the Membership Organization has defined criteria fields available to leaders use them but prefix with "Membership." because the settings are based on the Membership search
            //while this is a section membership search
            if (targetMembershipOrganization.LeaderSearchFields != null)
            {
                availableFields = (from field in targetMembershipOrganization.LeaderSearchFields select "Membership." + field).ToList();
            }

            targetCriteriaFields = proxy.GetSearchFieldMetadataFromFullPath(msSectionMembership.CLASS_NAME, null, availableFields).ResultValue;
        }
    }
Пример #5
0
    /// <summary>
    /// Initializes the target object for the page
    /// </summary>
    /// <remarks>Many pages have "target" objects that the page operates on. For instance, when viewing
    /// an event, the target object is an event. When looking up a directory, that's the target
    /// object. This method is intended to be overriden to initialize the target object for
    /// each page that needs it.</remarks>
    protected override void InitializeTargetObject()
    {
        base.InitializeTargetObject();

        targetEvent = LoadObjectFromAPI <msEvent>(ContextID);
        if (targetEvent == null)
        {
            GoToMissingRecordPage();
            return;
        }

        onlyShowGuestSpouseRegistrations = Request.QueryString["guestOnly"] == "true";

        targetOrder = new msOrder();


        if (!string.IsNullOrWhiteSpace(EntityId))
        {
            targetEntity = LoadObjectFromAPI <msEntity>(EntityId);
            if (targetEntity == null)
            {
                GoToMissingRecordPage();
                return;
            }
        }
        else
        {
            targetEntity = ConciergeAPI.CurrentEntity;
        }

        targetOrder.BillTo = targetOrder.ShipTo = targetEntity.ID;

        if (!string.IsNullOrWhiteSpace(targetEvent.Chapter))
        {
            targetChapter = LoadObjectFromAPI <msChapter>(targetEvent.Chapter);
        }

        if (!string.IsNullOrWhiteSpace(targetEvent.Section))
        {
            targetSection = LoadObjectFromAPI <msSection>(targetEvent.Section);
        }

        if (!string.IsNullOrWhiteSpace(targetEvent.OrganizationalLayer))
        {
            targetOrganizationalLayer = LoadObjectFromAPI <msOrganizationalLayer>(targetEvent.OrganizationalLayer);
        }
    }
Пример #6
0
    protected void loadCommitteeOwners()
    {
        if (!string.IsNullOrWhiteSpace(targetCommittee.Chapter))
        {
            targetChapter = LoadObjectFromAPI <msChapter>(targetCommittee.Chapter);
        }

        if (!string.IsNullOrWhiteSpace(targetCommittee.Section))
        {
            targetSection = LoadObjectFromAPI <msSection>(targetCommittee.Section);
        }

        if (!string.IsNullOrWhiteSpace(targetCommittee.OrganizationalLayer))
        {
            targetOrganizationalLayer = LoadObjectFromAPI <msOrganizationalLayer>(targetCommittee.OrganizationalLayer);
        }
    }
Пример #7
0
    /// <summary>
    /// Initializes the target object for the page
    /// </summary>
    /// <remarks>Many pages have "target" objects that the page operates on. For instance, when viewing
    /// an event, the target object is an event. When looking up a directory, that's the target
    /// object. This method is intended to be overriden to initialize the target object for
    /// each page that needs it.</remarks>
    protected override void InitializeTargetObject()
    {
        base.InitializeTargetObject();

        targetSection = LoadObjectFromAPI <msSection>(ContextID);

        if (targetSection == null)
        {
            GoToMissingRecordPage();
            return;
        }

        if (!string.IsNullOrWhiteSpace(targetSection.LinkedOrganization))
        {
            linkedOrganization = LoadObjectFromAPI <msOrganization>(targetSection.LinkedOrganization);
        }
    }
Пример #8
0
    protected void loadEventOwners(IConciergeAPIService proxy)
    {
        if (!string.IsNullOrWhiteSpace(targetEvent.Chapter))
        {
            targetChapter = proxy.LoadObjectFromAPI <msChapter>(targetEvent.Chapter);
        }

        if (!string.IsNullOrWhiteSpace(targetEvent.Section))
        {
            targetSection = proxy.LoadObjectFromAPI <msSection>(targetEvent.Section);
        }

        if (!string.IsNullOrWhiteSpace(targetEvent.OrganizationalLayer))
        {
            targetOrganizationalLayer = proxy.LoadObjectFromAPI <msOrganizationalLayer>(targetEvent.OrganizationalLayer);
        }
    }
Пример #9
0
    /// <summary>
    /// Initializes the target object for the page
    /// </summary>
    /// <remarks>Many pages have "target" objects that the page operates on. For instance, when viewing
    /// an event, the target object is an event. When looking up a directory, that's the target
    /// object. This method is intended to be overriden to initialize the target object for
    /// each page that needs it.</remarks>
    protected override void InitializeTargetObject()
    {
        base.InitializeTargetObject();

        if (MultiStepWizards.ViewSectionMembers.SearchManifest == null || MultiStepWizards.ViewSectionMembers.SearchBuilder == null)
        {
            GoTo(string.Format("~/sections/ViewSectionMembers_SelectFields.aspx?contextID={0}", ContextID));
            return;
        }

        targetSection = LoadObjectFromAPI <msSection>(ContextID);

        if (targetSection == null)
        {
            GoToMissingRecordPage();
        }

        targetSearch = getSearch();
    }
Пример #10
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (!IsValid)
        {
            return;
        }


        unbindObjectFromPage();

        targetSection = SaveObject(targetSection).ConvertTo <msSection>();

        if (linkedOrganization != null)
        {
            linkedOrganization = SaveObject(linkedOrganization).ConvertTo <msOrganization>();
        }

        QueueBannerMessage("Section information was updated sucessfully.");

        GoTo(string.Format("~/sections/ViewSection.aspx?contextID={0}", ContextID));
    }
    protected void gvLeaders_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        switch (e.CommandName.ToLower())
        {
        case "deleteleader":
            targetSection.Leaders.RemoveAll(
                x => x.Individual == e.CommandArgument.ToString());
            using (IConciergeAPIService serviceProxy = GetServiceAPIProxy())
            {
                targetSection = serviceProxy.Save(targetSection).ResultValue.ConvertTo <msSection>();
            }
            loadAndBindLeaders();
            break;

        case "editleader":
            string nextUrl = string.Format("~/sections/EditSectionLeader.aspx?contextID={0}&individualID={1}", ContextID,
                                           e.CommandArgument);
            GoTo(nextUrl);
            break;
        }
    }
Пример #12
0
    /// <summary>
    /// Initializes the target object for the page
    /// </summary>
    /// <remarks>Many pages have "target" objects that the page operates on. For instance, when viewing
    /// an event, the target object is an event. When looking up a directory, that's the target
    /// object. This method is intended to be overriden to initialize the target object for
    /// each page that needs it.</remarks>
    protected override void InitializeTargetObject()
    {
        base.InitializeTargetObject();

        targetEntity = string.IsNullOrWhiteSpace(ContextID) ? ConciergeAPI.CurrentEntity : LoadObjectFromAPI <msEntity>(ContextID);

        if (targetEntity == null)
        {
            GoToMissingRecordPage();
            return;
        }

        if (string.IsNullOrWhiteSpace(LeaderOfId))
        {
            return;
        }

        var leaderOf = APIExtensions.LoadObjectFromAPI(LeaderOfId);

        switch (leaderOf.ClassType)
        {
        case msChapter.CLASS_NAME:
            targetChapter = leaderOf.ConvertTo <msChapter>();
            break;

        case msSection.CLASS_NAME:
            targetSection = leaderOf.ConvertTo <msSection>();
            break;

        case msOrganizationalLayer.CLASS_NAME:
            targetOrganizationalLayer = leaderOf.ConvertTo <msOrganizationalLayer>();
            break;

        default:
            QueueBannerError(string.Format("Invalid leader object type specified '{0}'",
                                           leaderOf.ClassType));
            GoHome();
            return;
        }
    }
Пример #13
0
    /// <summary>
    /// Initializes the target object for the page
    /// </summary>
    /// <remarks>Many pages have "target" objects that the page operates on. For instance, when viewing
    /// an event, the target object is an event. When looking up a directory, that's the target
    /// object. This method is intended to be overriden to initialize the target object for
    /// each page that needs it.</remarks>
    protected override void InitializeTargetObject()
    {
        base.InitializeTargetObject();

        //Describe an event.  We will need this metadata to bind to the acceptable values for certain fields and for creating a new event
        using (IConciergeAPIService proxy = GetConciegeAPIProxy())
        {
            eventClassMetadata = proxy.DescribeObject(msEvent.CLASS_NAME).ResultValue;
            eventFieldMetadata = eventClassMetadata.GenerateFieldDictionary();
        }

        targetEvent = msEvent.FromClassMetadata(eventClassMetadata);

        if (!string.IsNullOrWhiteSpace(ContextID))
        {
            //Load the context object and determine the owner from the class type
            var contextobject = APIExtensions.LoadObjectFromAPI(ContextID);
            if (contextobject == null)
            {
                GoToMissingRecordPage();
                return;
            }


            switch (contextobject.ClassType)
            {
            case msChapter.CLASS_NAME:
                targetChapter       = contextobject.ConvertTo <msChapter>();
                targetEvent.Chapter = ContextID;
                break;

            case msSection.CLASS_NAME:
                targetSection       = contextobject.ConvertTo <msSection>();
                targetEvent.Section = ContextID;
                break;

            case msOrganizationalLayer.CLASS_NAME:
                targetOrganizationalLayer       = contextobject.ConvertTo <msOrganizationalLayer>();
                targetEvent.OrganizationalLayer = ContextID;
                break;

            case msEvent.CLASS_NAME:
                targetEvent  = LoadObjectFromAPI <msEvent>(ContextID);
                IsInEditMode = true;
                if (targetEvent == null)
                {
                    GoToMissingRecordPage();
                    return;
                }
                break;

            default:
                QueueBannerError(string.Format("Invalid context object type specified '{0}'",
                                               contextobject.ClassType));
                GoHome();
                return;
            }
        }

        if (!string.IsNullOrWhiteSpace(targetEvent.Chapter))
        {
            targetChapter = LoadObjectFromAPI <msChapter>(targetEvent.Chapter);
        }

        if (!string.IsNullOrWhiteSpace(targetEvent.Section))
        {
            targetSection = LoadObjectFromAPI <msSection>(targetEvent.Section);
        }

        if (!string.IsNullOrWhiteSpace(targetEvent.OrganizationalLayer))
        {
            targetOrganizationalLayer = LoadObjectFromAPI <msOrganizationalLayer>(targetEvent.OrganizationalLayer);
        }
    }