Пример #1
0
        public static void GetNews(HttpRequest.RequestResult <List <Rock.Client.ContentChannelItem> > resultHandler)
        {
            string oDataFilter = "";

            // if they're a developer, pull down pending and future start date items as well.
            if (RockLaunchData.Instance.Data.DeveloperModeEnabled == true)
            {
                oDataFilter = string.Format("?$filter=ContentChannel/Guid eq guid'EAE51F3E-C27B-4E7C-B9A0-16EB68129637' and " +
                                            "(Status eq '2' or Status eq '1') and " +
                                            "(ExpireDateTime ge DateTime'{0}' or ExpireDateTime eq null)&LoadAttributes=True",
                                            DateTime.Now.ToString("s"));
            }
            else
            {
                oDataFilter = string.Format("?$filter=ContentChannel/Guid eq guid'EAE51F3E-C27B-4E7C-B9A0-16EB68129637' and " +
                                            "Status eq '2' and (StartDateTime le DateTime'{0}' or StartDateTime eq null) and " +
                                            "(ExpireDateTime ge DateTime'{0}' or ExpireDateTime eq null)&LoadAttributes=True",
                                            DateTime.Now.ToString("s"));
            }

            RockApi.Get_ContentChannelItems(oDataFilter, resultHandler);
        }