/// <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();

        targetJudgingTeam = LoadObjectFromAPI <msJudgingTeam>(ContextID);

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

        targetCompetition = LoadObjectFromAPI <msCompetition>(targetJudgingTeam.Competition);

        if (Request.QueryString["roundID"] != null)
        {
            targetRound = LoadObjectFromAPI <msJudgingRound>(Request.QueryString["roundID"]);
        }

        if (targetCompetition == null)
        {
            GoToMissingRecordPage();
            return;
        }
    }
    protected void loadDataFromConcierge(IConciergeAPIService serviceProxy)
    {
        targetCompetition = serviceProxy.LoadObjectFromAPI <msCompetition>(ContextID);

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

        targetEntryInfo = targetCompetition.GetCompetitionEntryInformation();

        // now check judging
        if (ConciergeAPI.CurrentEntity == null)
        {
            return;
        }

        Search s = new Search("JudgingTeamMember");

        s.AddOutputColumn("Team.ID");
        s.AddCriteria(Expr.Equals("Team.Competition.ID", targetCompetition.ID));
        s.AddCriteria(Expr.Equals("Member.ID", ConciergeAPI.CurrentEntity.ID));
        SearchResult sr = APIExtensions.GetSearchResult(s, 0, 1);

        if (sr.TotalRowCount > 0 && sr.Table != null && sr.Table.Rows.Count > 0)
        {
            judgingTeamID = sr.Table.Rows[0]["Team.ID"].ToString();
        }
    }
    /// <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();

        targetCompetitionEntry = LoadObjectFromAPI <msCompetitionEntry>(ContextID);

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


        targetCompetition = LoadObjectFromAPI <msCompetition>(targetCompetitionEntry.Competition);

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

        targetEntryStatus = LoadObjectFromAPI <msCompetitionEntryStatus>(targetCompetitionEntry.Status);

        using (IConciergeAPIService proxy = GetConciegeAPIProxy())
        {
            Search s = new Search(msCustomField.CLASS_NAME);
            s.AddCriteria(Expr.Equals(msCustomField.FIELDS.Competition, targetCompetition.ID));

            targetCompetitionQuestions =
                proxy.GetObjectsBySearch(s, null, 0, null).
                ResultValue.Objects.ConvertTo <msCustomField>();
        }
    }
Exemple #4
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();

        targetCompetitionEntry = LoadObjectFromAPI <msCompetitionEntry>(ContextID);
        targetJudgingRound     = LoadObjectFromAPI <msJudgingRound>(JudgingRoundId);

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

        targetCompetition = LoadObjectFromAPI <msCompetition>(targetCompetitionEntry.Competition);
        if (targetCompetition == null)
        {
            GoToMissingRecordPage();
            return;
        }

        targetEntrant = LoadObjectFromAPI <msIndividual>(targetCompetitionEntry.Entrant);

        if (targetEntrant == null)
        {
            GoToMissingRecordPage();
            return;
        }
    }
Exemple #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();

        if (ConciergeAPI.CurrentEntity == null)   // split screen sign up!
        {
            string url = string.Format("/profile/CreateAccount_BasicInfo.aspx?pageTitle={0}&completionUrl={1}",
                                       Server.UrlEncode("Competition Registration"),
                                       Server.UrlEncode(Request.Url.ToString()));
            GoTo(url);
        }

        MultiStepWizards.EnterCompetition.EntryFee = null;
        targetCompetition = LoadObjectFromAPI <msCompetition>(ContextID);
        if (targetCompetition == null)
        {
            GoToMissingRecordPage();
            return;
        }

        targetCompetitionInfo = targetCompetition.GetCompetitionEntryInformation();

        if (targetCompetitionInfo == null)
        {
            GoToMissingRecordPage();
            return;
        }
    }
    /// <summary>
    /// Pull the Competition Setup information through the SessionManager.
    /// </summary>
    /// <param name="target">Selected Competition.</param>
    /// <param name="entityId">Entity to evaluate settings based on. If null, use current entity.</param>
    /// <returns></returns>
    public static CompetitionEntryInformation GetCompetitionEntryInformation(this msCompetition target, string entityId = null)
    {
        if (target == null)
        {
            return(null);
        }

        return(GetCompetitionEntryInformation(target.ID, entityId));
    }
    /// <summary>
    /// Clear Competition Setup information from the SessionManager.
    /// </summary>
    /// <param name="target">Selected Competition.</param>
    /// <param name="entityId">Entity to evaluate settings based on. If null, use current entity.</param>
    /// <returns></returns>
    public static void ClearCompetitionEntryInformation(this msCompetition target, string entityId = null)
    {
        if (target == null)
        {
            return;
        }

        ClearCompetitionEntryInformation(target.ID, entityId);
    }
Exemple #8
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();

        targetCompetitionEntry = LoadObjectFromAPI <msCompetitionEntry>(ContextID);
        targetJudgingRound     = LoadObjectFromAPI <msJudgingRound>(JudgingRoundId);

        if (targetCompetitionEntry == null || targetJudgingRound == null)
        {
            GoToMissingRecordPage();
            return;
        }

        targetCompetition = LoadObjectFromAPI <msCompetition>(targetCompetitionEntry.Competition);
        if (targetCompetition == null)
        {
            GoToMissingRecordPage();
            return;
        }

        targetEntrant = LoadObjectFromAPI <msIndividual>(targetCompetitionEntry.Entrant);
        if (targetEntrant == null)
        {
            GoToMissingRecordPage();
            return;
        }

        //Search for an existing score card for this judge/competition entry/round and if not found create a new one
        Search sScoreCard = new Search {
            Type = msScoreCard.CLASS_NAME, Context = targetCompetitionEntry.ID
        };

        sScoreCard.AddOutputColumn("ID");
        sScoreCard.AddCriteria(Expr.Equals("Judge", ConciergeAPI.CurrentEntity.ID));
        sScoreCard.AddCriteria(Expr.Equals("Entry", targetCompetitionEntry.ID));
        sScoreCard.AddCriteria(Expr.Equals("Round", targetJudgingRound.ID));

        SearchResult srScoreCard = APIExtensions.GetSearchResult(sScoreCard, 0, 1);

        targetScoreCard = srScoreCard.Table != null && srScoreCard.Table.Rows.Count > 0
                              ? LoadObjectFromAPI <msScoreCard>(srScoreCard.Table.Rows[0]["ID"].ToString())
                              : new msScoreCard
        {
            Entry  = targetCompetitionEntry.ID,
            Judge  = ConciergeAPI.CurrentEntity.ID,
            Round  = targetJudgingRound.ID,
            Scores = new List <msScoreCardScore>(),
            Name   =
                string.Format("{0} Scores for {1} {2} Round", targetCompetition.Name,
                              targetEntrant.Name, targetJudgingRound.Name)
        };
    }
Exemple #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();

        var contextObject = APIExtensions.LoadObjectFromAPI(ContextID);

        switch (contextObject.ClassType)
        {
        case "CompetitionEntry":
            targetCompetitionEntry = contextObject.ConvertTo <msCompetitionEntry>();
            targetCompetition      = LoadObjectFromAPI <msCompetition>(targetCompetitionEntry.Competition);
            targetCompetitionInfo  = targetCompetition.GetCompetitionEntryInformation();
            MultiStepWizards.EnterCompetition.EntryFee = LoadObjectFromAPI <msCompetitionEntryFee>(targetCompetitionEntry.EntryFee);
            break;

        case "Competition":
            targetCompetition      = contextObject.ConvertTo <msCompetition>();
            targetCompetitionInfo  = targetCompetition.GetCompetitionEntryInformation();
            targetCompetitionEntry = new msCompetitionEntry
            {
                Competition = targetCompetition.ID,
                Entrant     = ConciergeAPI.CurrentEntity.ID,
                Status      = targetCompetitionInfo.PendingPaymentStatusId
            };

            // If the fee is null make sure it is allowed to be. If a session expires in the middle of the form, the user will be
            // redirected here without the proper Fee in session state.
            if (MultiStepWizards.EnterCompetition.EntryFee == null &&
                targetCompetitionInfo.CompetitionEntryFees.Count > 0)
            {
                if (targetCompetitionInfo.CompetitionEntryFees.Count > 1)
                {
                    Response.Redirect("~/competitions/ApplyToCompetition.aspx?contextID=" + ContextID);
                }

                MultiStepWizards.EnterCompetition.EntryFee = LoadObjectFromAPI <msCompetitionEntryFee>(targetCompetitionInfo.CompetitionEntryFees[0].ProductID);
            }

            break;

        default:
            QueueBannerError("Unknown context object supplied.");
            GoHome();
            return;
        }

        if (targetCompetition == null || targetCompetitionEntry == null || targetCompetitionInfo == null)
        {
            GoToMissingRecordPage();
            return;
        }

        using (IConciergeAPIService proxy = GetConciegeAPIProxy())
        {
            var s = new Search(msCustomField.CLASS_NAME);
            s.AddCriteria(Expr.Equals(msCustomField.FIELDS.Competition, targetCompetition.ID));

            targetCompetitionQuestions =
                proxy.GetObjectsBySearch(s, null, 0, null).
                ResultValue.Objects.ConvertTo <msCustomField>();

            // sort the competition questions - MS-2648
            targetCompetitionQuestions.Sort((x, y) => x.DisplayOrder.CompareTo(y.DisplayOrder));
        }
    }