示例#1
0
        public System.Web.Mvc.ContentResult GetByApi()
        {
            SetSite();
            switch (Site.ReferenceType)
            {
            case "Issues":
                if (SiteId == ReferenceId)
                {
                    return(IssueUtilities.GetByApi(
                               ss: Site.IssuesSiteSettings(ReferenceId)));
                }
                else
                {
                    return(IssueUtilities.GetByApi(
                               ss: Site.IssuesSiteSettings(ReferenceId),
                               issueId: ReferenceId));
                }

            case "Results":
                if (SiteId == ReferenceId)
                {
                    return(ResultUtilities.GetByApi(
                               ss: Site.ResultsSiteSettings(ReferenceId)));
                }
                else
                {
                    return(ResultUtilities.GetByApi(
                               ss: Site.ResultsSiteSettings(ReferenceId),
                               resultId: ReferenceId));
                }

            default: return(ApiResults.Get(ApiResponses.BadRequest()));
            }
        }