public Dictionary<string, string> GetAgendaSessionAsset(string queryString)
        {
            MobileAppsAgendaData_1Entities entities = new MobileAppsAgendaData_1Entities();

            NameValueCollection parameters = HttpUtility.ParseQueryString(queryString);

            IEnumerable<viewWebAgendaSessionAsset> webAgendaSessionAssets = entities.ExecuteStoreQuery<viewWebAgendaSessionAsset>("spr_WebAgendaSessionAsset_Select", "");

            int limit = 0;
            int offset = 0;

            bool sendResultsOnly = false;

            foreach (string key in parameters)
            {
                string value = parameters[key];

                if (key == "limit")
                {
                    limit = Convert.ToInt32(value);
                }
                else if (key == "offset")
                {
                    offset = Convert.ToInt32(value);
                }
                if (key == "conferenceID")
                {
                    if (!value.Contains("["))
                    {
                        int conferenceID = Convert.ToInt32(value);
                        webAgendaSessionAssets = webAgendaSessionAssets.Where(p => p.conferenceID == conferenceID);
                    }
                    else
                    {
                        List<Object> conferenceIDs = APITools.createList(value);
                        webAgendaSessionAssets = webAgendaSessionAssets.Where(p => conferenceIDs.Contains(p.conferenceID));
                    }
                }
                else if (key == "sessionAssetAuthor")
                {
                    if (!value.Contains("["))
                    {
                        webAgendaSessionAssets = webAgendaSessionAssets.Where(p => p.sessionAssetAuthor == value);
                    }
                    else
                    {
                        List<Object> sessionAssetAuthors = APITools.createList(value);
                        webAgendaSessionAssets = webAgendaSessionAssets.Where(p => sessionAssetAuthors.Contains(p.sessionAssetAuthor));
                    }
                }
                else if (key == "sessionAssetAuthorBio")
                {
                    if (!value.Contains("["))
                    {
                        webAgendaSessionAssets = webAgendaSessionAssets.Where(p => p.sessionAssetAuthorBio.Contains(value));
                    }
                    else
                    {
                        List<Object> sessionAssetAuthorBios = APITools.createList(value);
                        webAgendaSessionAssets = webAgendaSessionAssets.Where(p => sessionAssetAuthorBios.Contains(p.sessionAssetAuthorBio));
                    }
                }
                else if (key == "sessionAssetAuthorJobTitle")
                {
                    if (!value.Contains("["))
                    {
                        webAgendaSessionAssets = webAgendaSessionAssets.Where(p => p.sessionAssetAuthorJobTitle == value);
                    }
                    else
                    {
                        List<Object> sessionAssetAuthorJobTitles = APITools.createList(value);
                        webAgendaSessionAssets = webAgendaSessionAssets.Where(p => sessionAssetAuthorJobTitles.Contains(p.sessionAssetAuthorJobTitle));
                    }
                }
                else if (key == "sessionAssetAuthorOrganizationName")
                {
                    if (!value.Contains("["))
                    {
                        webAgendaSessionAssets = webAgendaSessionAssets.Where(p => p.sessionAssetAuthorOrganizationName == value);
                    }
                    else
                    {
                        List<Object> sessionAssetAuthorOrganizationNames = APITools.createList(value);
                        webAgendaSessionAssets = webAgendaSessionAssets.Where(p => sessionAssetAuthorOrganizationNames.Contains(p.sessionAssetAuthorOrganizationName));
                    }
                }
                else if (key == "sessionAssetDescription")
                {
                    if (!value.Contains("["))
                    {
                        webAgendaSessionAssets = webAgendaSessionAssets.Where(p => p.sessionAssetDescription.Contains(value));
                    }
                    else
                    {
                        List<Object> sessionAssetDescriptions = APITools.createList(value);
                        webAgendaSessionAssets = webAgendaSessionAssets.Where(p => sessionAssetDescriptions.Contains(p.sessionAssetDescription));
                    }
                }
                //else if (key == "sessionAssetID")
                //{
                //    webAgendaSessionAssets = webAgendaSessionAssets.Where(p => p..ToString() == intValue);
                //}
                else if (key == "sessionAssetTitle")
                {
                    if (!value.Contains("["))
                    {
                        webAgendaSessionAssets = webAgendaSessionAssets.Where(p => p.sessionAssetTitle == value);
                    }
                    else
                    {
                        List<Object> sessionAssetTitles = APITools.createList(value);
                        webAgendaSessionAssets = webAgendaSessionAssets.Where(p => sessionAssetTitles.Contains(p.sessionAssetTitle));
                    }
                }
                else if (key == "sessionID")
                {
                    if (!value.Contains("["))
                    {
                        int sessionID = Convert.ToInt32(value);
                        webAgendaSessionAssets = webAgendaSessionAssets.Where(p => p.sessionID == sessionID);
                    }
                    else
                    {
                        List<Object> sessionIDs = APITools.createList(value);
                        webAgendaSessionAssets = webAgendaSessionAssets.Where(p => sessionIDs.Contains(p.sessionID));
                    }
                }
                else if (key == "totalResults")
                {
                    if (value.ToLower() == "true")
                        sendResultsOnly = true;
                }
            }

            if (sendResultsOnly)
            {
                string count = webAgendaSessionAssets.Count().ToString();

                Dictionary<string, string> dTotalResults = new Dictionary<string, string>();
                dTotalResults.Add("totalResults", count);
                dTotalResults.Add("resultType", "SessionAsset");

                return dTotalResults;
            }

            if (offset != 0)
                webAgendaSessionAssets = webAgendaSessionAssets.Where(p => p.RowIdentity > offset);

            if (limit != 0)
                webAgendaSessionAssets = webAgendaSessionAssets.Take(limit);

            JavaScriptSerializer serializer = new JavaScriptSerializer();
            serializer.MaxJsonLength = Int32.MaxValue;

            string json = serializer.Serialize(webAgendaSessionAssets);

            string rowcount = APITools.countJSONRecords(json);

            Dictionary<string, string> ret = new Dictionary<string, string>();
            ret.Add("totalResults", rowcount);
            ret.Add("resultType", "SessionAsset");
            ret.Add("results", json);

            return ret;
        }
        public Dictionary<string, string> GetBoothsforWebAgenda(string queryString)
        {
            MobileAppsAgendaData_1Entities entities = new MobileAppsAgendaData_1Entities();

            NameValueCollection parameters = HttpUtility.ParseQueryString(queryString);

            IEnumerable<viewAllBoothsforWebAgenda> booths = entities.ExecuteStoreQuery<viewAllBoothsforWebAgenda>("spr_AllBoothsforWebAgenda_Select", "");

            int limit = 0;
            int offset = 0;

            bool sendResultsOnly = false;

            foreach (string key in parameters)
            {
                string value = parameters[key];

                if (key == "limit")
                {
                    limit = Convert.ToInt32(value);
                }
                else if (key == "offset")
                {
                    offset = Convert.ToInt32(value);
                }

                else if (key == "totalResults")
                {
                    if (value.ToLower() == "true")
                        sendResultsOnly = true;
                }
            }

            if (sendResultsOnly)
            {
                string count = booths.Count().ToString();

                Dictionary<string, string> dTotalResults = new Dictionary<string, string>();
                dTotalResults.Add("totalResults", count);
                dTotalResults.Add("resultType", "Exhibitor");

                return dTotalResults;
            }

            if (offset != 0)
                booths = booths.Where(p => p.RowIdentity > offset);

            if (limit != 0)
                booths = booths.Take(limit);

            JavaScriptSerializer serializer = new JavaScriptSerializer();
            serializer.MaxJsonLength = Int32.MaxValue;

            string json = serializer.Serialize(booths);

            string rowcount = APITools.countJSONRecords(json);

            Dictionary<string, string> ret = new Dictionary<string, string>();
            ret.Add("totalResults", rowcount);
            ret.Add("resultType", "Exhibitor");
            ret.Add("results", json);

            return ret;
        }
Пример #3
0
        public Dictionary<string, string> GetWebExhibitor(string queryString)
        {
            MobileAppsAgendaData_1Entities entities = new MobileAppsAgendaData_1Entities();

            NameValueCollection parameters = HttpUtility.ParseQueryString(queryString);

            IEnumerable<viewWebExhibitor> webExhibitor = entities.ExecuteStoreQuery<viewWebExhibitor>("spr_WebExhibitor_Select", "");

            int limit = 0;
            int offset = 0;

            bool sendResultsOnly = false;

            foreach (string key in parameters)
            {
                string value = parameters[key];

                if (key == "limit")
                {
                    limit = Convert.ToInt32(value);
                }
                else if (key == "offset")
                {
                    offset = Convert.ToInt32(value);
                }
                if (key == "conferenceID")
                {
                    if (!value.Contains("["))
                    {
                        int conferenceID = Convert.ToInt32(value);
                        webExhibitor = webExhibitor.Where(p => p.conferenceID == conferenceID);
                    }
                    else
                    {
                        List<Object> ids = APITools.createList(value);
                        webExhibitor = webExhibitor.Where(p => ids.Contains(p.conferenceID));
                    }
                }
                else if (key == "exhibitorName")
                {
                    if (!value.Contains("["))
                        webExhibitor = webExhibitor.Where(p => p.exhibitorName == value);
                    else
                    {
                        List<Object> exhibitorNames = APITools.createList(value);
                        webExhibitor = webExhibitor.Where(p => exhibitorNames.Contains(p.exhibitorName));
                    }
                }
                else if (key == "exhibitorDescription")
                {
                    if (!value.Contains("["))
                        webExhibitor = webExhibitor.Where(p => p.exhibitorDescription.Contains(value));
                    else
                    {
                        List<Object> exhibitorDescriptions = APITools.createList(value);
                        webExhibitor = webExhibitor.Where(p => exhibitorDescriptions.Contains(p.exhibitorDescription));
                    }
                }
                else if (key == "exhibitorUrl")
                {
                    if (!value.Contains("["))
                        webExhibitor = webExhibitor.Where(p => p.exhibitorURL == value);
                    else
                    {
                        List<Object> exhibitorUrls = APITools.createList(value);
                        webExhibitor = webExhibitor.Where(p => exhibitorUrls.Contains(p.exhibitorURL));
                    }
                }
                else if (key == "sponsorLogo")
                {
                    if (!value.Contains("["))
                        webExhibitor = webExhibitor.Where(p => p.sponsorLogo == value);
                    else
                    {
                        List<Object> sponsorLogos = APITools.createList(value);
                        webExhibitor = webExhibitor.Where(p => sponsorLogos.Contains(p.sponsorLogo));
                    }
                }
                else if (key == "sponsorTypeID")
                {
                    if (!value.Contains("["))
                    {
                        int sponsorTypeID = Convert.ToInt32(value);
                        webExhibitor = webExhibitor.Where(p => p.sponsorTypeID == sponsorTypeID);
                    }
                    else
                    {
                        List<Object> sponsorTypeIDs = APITools.createList(value);
                        webExhibitor = webExhibitor.Where(p => sponsorTypeIDs.Contains(p.sponsorTypeID));
                    }
                }
                else if (key == "sponsorTypeDescription")
                {
                    if (!value.Contains("["))
                        webExhibitor = webExhibitor.Where(p => p.sponsorTypeName == value);
                    else
                    {
                        List<Object> sponsorTypeDescription = APITools.createList(value);
                        webExhibitor = webExhibitor.Where(p => sponsorTypeDescription.Contains(p.sponsorTypeName));
                    }
                }
                else if (key == "exhibitorBooth")
                {
                    if (!value.Contains("["))
                        webExhibitor = webExhibitor.Where(p => p.exhibitorBooth == value);
                    else
                    {
                        List<Object> exhibitorBooths = APITools.createList(value);
                        webExhibitor = webExhibitor.Where(p => exhibitorBooths.Contains(p.exhibitorBooth));
                    }
                }
                else if (key == "pointx")
                {
                    if (!value.Contains("["))
                    {
                        double? xp = Convert.ToDouble(value);
                        webExhibitor = webExhibitor.Where(p => p.xPoint == xp);
                    }
                    else
                    {
                        List<Object> pointxs = APITools.createList(value);
                        webExhibitor = webExhibitor.Where(p => pointxs.Contains(p.xPoint));
                    }
                }
                else if (key == "pointy")
                {
                    if (!value.Contains("["))
                    {
                        double? yp = Convert.ToDouble(value);
                        webExhibitor = webExhibitor.Where(p => p.yPoint == yp);
                    }
                    else
                    {
                        List<Object> pointys = APITools.createList(value);
                        webExhibitor = webExhibitor.Where(p => pointys.Contains(p.yPoint));
                    }
                }
                else if (key == "totalResults")
                {
                    if (value.ToLower() == "true")
                        sendResultsOnly = true;
                }
            }

            if (sendResultsOnly)
            {
                string count = webExhibitor.Count().ToString();

                Dictionary<string, string> dTotalResults = new Dictionary<string, string>();
                dTotalResults.Add("totalResults", count);
                dTotalResults.Add("resultType", "Exhibitor");

                return dTotalResults;
            }

            if (offset != 0)
                webExhibitor = webExhibitor.Where(p => p.RowIdentity > offset);

            if (limit != 0 )
                webExhibitor = webExhibitor.Take(limit);

            JavaScriptSerializer serializer = new JavaScriptSerializer();
            serializer.MaxJsonLength = Int32.MaxValue;

            string json = serializer.Serialize(webExhibitor);

            string rowcount = APITools.countJSONRecords(json);

            Dictionary<string, string> ret = new Dictionary<string, string>();
            ret.Add("totalResults", rowcount);
            ret.Add("resultType", "Exhibitor");
            ret.Add("results", json);

            return ret;
        }
        public Dictionary<string, string> GetAgendaSession(string queryString)
        {
            MobileAppsAgendaData_1Entities entities = new MobileAppsAgendaData_1Entities();

            NameValueCollection parameters = HttpUtility.ParseQueryString(queryString);

            IEnumerable<viewWebAgendaSession> webAgendaSession = entities.ExecuteStoreQuery<viewWebAgendaSession>("spr_WebAgendaSession_Select", "");

            int limit = 0;
            int offset = 0;

            bool sendResultsOnly = false;

            foreach (string key in parameters)
            {
                string value = parameters[key];

                if (key == "limit")
                {
                    limit = Convert.ToInt32(value);
                }
                else if (key == "offset")
                {
                    offset = Convert.ToInt32(value);
                }
                if (key == "conferenceID")
                {
                    if (!value.Contains("["))
                    {
                        int conferenceID = Convert.ToInt32(value);
                        webAgendaSession = webAgendaSession.Where(p => p.conferenceID == conferenceID);
                    }
                    else
                    {
                        List<Object> conferenceIDs = APITools.createList(value);
                        webAgendaSession = webAgendaSession.Where(p => conferenceIDs.Contains(p.conferenceID));
                    }
                }
                //else if (key == "endTimeStamp")
                //{
                //    DateTime endTimeStamp = Convert.ToDateTime(value);
                //    webAgendaSession = webAgendaSession.Where(p => p.endTimeStamp == endTimeStamp);
                //}
                else if (key == "endDay")
                {
                    if (!value.Contains("["))
                    {
                        int endDay = Convert.ToInt32(value);
                        webAgendaSession = webAgendaSession.Where(p => p.endDay == endDay);
                    }
                    else
                    {
                        List<Object> endDays = APITools.createList(value);
                        webAgendaSession = webAgendaSession.Where(p => endDays.Contains(p.endDay));
                    }
                }
                else if (key == "endHour")
                {
                    if (!value.Contains("["))
                    {
                        int endHour = Convert.ToInt32(value);
                        webAgendaSession = webAgendaSession.Where(p => p.endHour == endHour);
                    }
                    else
                    {
                        List<Object> endHours = APITools.createList(value);
                        webAgendaSession = webAgendaSession.Where(p => endHours.Contains(p.endHour));
                    }
                }
                else if (key == "endMinute")
                {
                    if (!value.Contains("["))
                    {
                        int endMinute = Convert.ToInt32(value);
                        webAgendaSession = webAgendaSession.Where(p => p.endMinute == endMinute);
                    }
                    else
                    {
                        List<Object> endMinutes = APITools.createList(value);
                        webAgendaSession = webAgendaSession.Where(p => endMinutes.Contains(p.endMinute));
                    }
                }
                else if (key == "endMonth")
                {
                    if (!value.Contains("["))
                    {
                        int endMonth = Convert.ToInt32(value);
                        webAgendaSession = webAgendaSession.Where(p => p.endMonth == endMonth);
                    }
                    else
                    {
                        List<Object> endMonths = APITools.createList(value);
                        webAgendaSession = webAgendaSession.Where(p => endMonths.Contains(p.endMonth));
                    }
                }
                else if (key == "endYear")
                {
                    if (!value.Contains("["))
                    {
                        int endYear = Convert.ToInt32(value);
                        webAgendaSession = webAgendaSession.Where(p => p.endYear == endYear);
                    }
                    else
                    {
                        List<Object> endYears = APITools.createList(value);
                        webAgendaSession = webAgendaSession.Where(p => endYears.Contains(p.endYear));
                    }
                }
                else if (key == "eventTypeDescription")
                {
                    if (!value.Contains("["))
                    {
                        webAgendaSession = webAgendaSession.Where(p => p.eventTypeDescription == value);
                    }
                    else
                    {
                        List<Object> eventTypeDescriptions = APITools.createList(value);
                        webAgendaSession = webAgendaSession.Where(p => eventTypeDescriptions.Contains(p.eventTypeDescription));
                    }
                }
                else if (key == "eventTypeID")
                {
                    if (!value.Contains("["))
                    {
                        int eventTypeID = Convert.ToInt32(value);
                        webAgendaSession = webAgendaSession.Where(p => p.eventTypeID == eventTypeID);
                    }
                    else
                    {
                        List<Object> eventTypeIDs = APITools.createList(value);
                        webAgendaSession = webAgendaSession.Where(p => eventTypeIDs.Contains(p.eventTypeID));
                    }
                }
                else if (key == "floor")
                {
                    if (!value.Contains("["))
                    {
                        int floor = Convert.ToInt32(value);
                        webAgendaSession = webAgendaSession.Where(p => p.floor == floor);
                    }
                    else
                    {
                        List<Object> floors = APITools.createList(value);
                        webAgendaSession = webAgendaSession.Where(p => floors.Contains(p.floor));
                    }
                }
                else if (key == "room")
                {
                    if (!value.Contains("["))
                    {
                        webAgendaSession = webAgendaSession.Where(p => p.room == value);
                    }
                    else
                    {
                        List<Object> rooms = APITools.createList(value);
                        webAgendaSession = webAgendaSession.Where(p => rooms.Contains(p.room));
                    }
                }
                else if (key == "sessionID")
                {
                    if (!value.Contains("["))
                    {
                        int sessionID = Convert.ToInt32(value);
                        webAgendaSession = webAgendaSession.Where(p => p.sessionID == sessionID);
                    }
                    else
                    {
                        List<Object> sessionIDs = APITools.createList(value);
                        webAgendaSession = webAgendaSession.Where(p => sessionIDs.Contains(p.sessionID));
                    }
                }
                else if (key == "sessionTitle")
                {
                    if (!value.Contains("["))
                    {
                        webAgendaSession = webAgendaSession.Where(p => p.sessionTitle == value);
                    }
                    else
                    {
                        List<Object> sessionTitles = APITools.createList(value);
                        webAgendaSession = webAgendaSession.Where(p => sessionTitles.Contains(p.sessionTitle));
                    }
                }
                //else if (key == "startTimeStamp")
                //{
                //    DateTime startTimeStamp = Convert.ToDateTime(value);
                //    webAgendaSession = webAgendaSession.Where(p => p.startTimeStamp == startTimeStamp);
                //}
                else if (key == "startDay")
                {
                    if (!value.Contains("["))
                    {
                        int startDay = Convert.ToInt32(value);
                        webAgendaSession = webAgendaSession.Where(p => p.startDay == startDay);
                    }
                    else
                    {
                        List<Object> startDays = APITools.createList(value);
                        webAgendaSession = webAgendaSession.Where(p => startDays.Contains(p.startDay));
                    }
                }
                else if (key == "startHour")
                {
                    if (!value.Contains("["))
                    {
                        int startHour = Convert.ToInt32(value);
                        webAgendaSession = webAgendaSession.Where(p => p.startHour == startHour);
                    }
                    else
                    {
                        List<Object> startHours = APITools.createList(value);
                        webAgendaSession = webAgendaSession.Where(p => startHours.Contains(p.startHour));
                    }
                }
                else if (key == "startMinute")
                {
                    if (!value.Contains("["))
                    {
                        int startMinute = Convert.ToInt32(value);
                        webAgendaSession = webAgendaSession.Where(p => p.startMinute == startMinute);
                    }
                    else
                    {
                        List<Object> startMinutes = APITools.createList(value);
                        webAgendaSession = webAgendaSession.Where(p => startMinutes.Contains(p.startMinute));
                    }
                }
                else if (key == "startMonth")
                {
                    if (!value.Contains("["))
                    {
                        int startMonth = Convert.ToInt32(value);
                        webAgendaSession = webAgendaSession.Where(p => p.startMonth == startMonth);
                    }
                    else
                    {
                        List<Object> startMonths = APITools.createList(value);
                        webAgendaSession = webAgendaSession.Where(p => startMonths.Contains(p.startMonth));
                    }
                }
                else if (key == "startYear")
                {
                    if (!value.Contains("["))
                    {
                        int startYear = Convert.ToInt32(value);
                        webAgendaSession = webAgendaSession.Where(p => p.startYear == startYear);
                    }
                    else
                    {
                        List<Object> startYears = APITools.createList(value);
                        webAgendaSession = webAgendaSession.Where(p => startYears.Contains(p.startYear));
                    }
                }
                else if (key == "sessionLevelDescription")
                {
                    if (!value.Contains("["))
                    {
                        webAgendaSession = webAgendaSession.Where(p => p.sessionDescription.Contains(value));
                    }
                    else
                    {
                        List<Object> sessionLevelDescriptions = APITools.createList(value);
                        webAgendaSession = webAgendaSession.Where(p => sessionLevelDescriptions.Contains(p.sessionDescription));
                    }
                }
                //else if (key == "sessionKeyWords")
                //    webAgendaSession = webAgendaSession.Where(p => p.sessionKeyWords.Contains(value));
                else if (key == "superTrackTitle")
                {
                    if (!value.Contains("["))
                    {
                        webAgendaSession = webAgendaSession.Where(p => p.supertracks.Contains(value));
                    }
                    else
                    {
                        List<Object> superTrackTitles = APITools.createList(value);
                        webAgendaSession = webAgendaSession.Where(p => superTrackTitles.Contains(p.supertracks));
                    }
                }
                else if (key == "trackTitle")
                {
                    if (!value.Contains("["))
                    {
                        webAgendaSession = webAgendaSession.Where(p => p.tracks.Contains(value));
                    }
                    else
                    {
                        List<Object> trackTitles = APITools.createList(value);
                        webAgendaSession = webAgendaSession.Where(p => trackTitles.Contains(p.tracks));
                    }
                }
                else if (key == "pointx")
                {
                    if (!value.Contains("["))
                    {
                        double? xp = Convert.ToDouble(value);
                        webAgendaSession = webAgendaSession.Where(p => p.xPoint == xp);
                    }
                    else
                    {
                        List<Object> pointxs = APITools.createList(value);
                        webAgendaSession = webAgendaSession.Where(p => pointxs.Contains(p.xPoint));
                    }
                }
                else if (key == "pointy")
                {
                    if (!value.Contains("["))
                    {
                        double? yp = Convert.ToDouble(value);
                        webAgendaSession = webAgendaSession.Where(p => p.yPoint == yp);
                    }
                    else
                    {
                        List<Object> pointys = APITools.createList(value);
                        webAgendaSession = webAgendaSession.Where(p => pointys.Contains(p.yPoint));
                    }
                }
                else if (key == "totalResults")
                {
                    if (value.ToLower() == "true")
                        sendResultsOnly = true;
                }
            }

            if (sendResultsOnly)
            {
                string count = webAgendaSession.Count().ToString();

                Dictionary<string, string> dTotalResults = new Dictionary<string, string>();
                dTotalResults.Add("totalResults", count);
                dTotalResults.Add("resultType", "Session");

                return dTotalResults;
            }

            if (offset != 0)
                webAgendaSession = webAgendaSession.Where(p => p.RowIdentity > offset);

            if (limit != 0)
                webAgendaSession = webAgendaSession.Take(limit);

            JavaScriptSerializer serializer = new JavaScriptSerializer();
            serializer.MaxJsonLength = Int32.MaxValue;

            string json = serializer.Serialize(webAgendaSession);

            string rowcount = APITools.countJSONRecords(json);

            Dictionary<string, string> ret = new Dictionary<string, string>();
            ret.Add("totalResults", rowcount);
            ret.Add("resultType", "Session");
            ret.Add("results", json);

            return ret;
        }