本文整理汇总了C#中Events.GetEventsForLocation方法的典型用法代码示例。如果您正苦于以下问题:C# Events.GetEventsForLocation方法的具体用法?C# Events.GetEventsForLocation怎么用?C# Events.GetEventsForLocation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Events
的用法示例。
在下文中一共展示了Events.GetEventsForLocation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessRequest
//.........这里部分代码省略.........
context.Response.Write(
PlaylistVideo.GetFirstVideo(Convert.ToInt32(context.Request.QueryString[SiteEnums.QueryStringNames.playlist.ToString()])));
}
else
{
context.Response.Write(
PlaylistVideo.CurrentVideoInPlaylist(
Convert.ToInt32(context.Request.QueryString[SiteEnums.QueryStringNames.playlist.ToString()])
));
}
#endregion
break;
case SiteEnums.QueryStringNames.video:
#region video
Video vid = new Video("YT", context.Request.QueryString[SiteEnums.QueryStringNames.vid.ToString()]);
VideoLog.AddVideoLog(vid.VideoID, context.Request.UserHostAddress);
context.Response.Write(Video.GetVideoJSON(context.Request.QueryString[SiteEnums.QueryStringNames.vid.ToString()]));
#endregion
break;
case SiteEnums.QueryStringNames.begindate:
#region begindate
//string[] dates = HttpUtility.UrlDecode(
// context.Request.QueryString[SiteEnums.QueryStringNames.begindate.ToString()]
// ).Split('G');
DateTime dtBegin = Convert.ToDateTime(context.Request.QueryString[SiteEnums.QueryStringNames.begindate.ToString()]);
dtBegin = new DateTime(dtBegin.Year, dtBegin.Month, 1);
DateTime dtEnd = dtBegin.AddMonths(1).AddDays(-1);
Events tds = new Events();
tds.GetEventsForLocation(
dtBegin, dtEnd,
context.Request.QueryString[SiteEnums.QueryStringNames.country_iso.ToString()],
context.Request.QueryString[SiteEnums.QueryStringNames.region.ToString()],
context.Request.QueryString[SiteEnums.QueryStringNames.city.ToString()]);
CalendarItems citms = GetCitms(tds, dtBegin, dtEnd, true);
//[ 100, 500, 300, 200, 400 ]
sb = new StringBuilder();
sb.Append("[");
int processed = 1;
foreach (CalendarItem ci1 in citms)
{
if (processed == citms.Count)
{
sb.Append(ci1.StartDate.Day);
}
else
{
sb.Append(ci1.StartDate.Day);
sb.Append(", ");
}
processed++;
}
sb.Append("]");
context.Response.Write(sb.ToString());
#endregion
break;
case SiteEnums.QueryStringNames.playlist:
#region playlist
if (!string.IsNullOrEmpty(
context.Request.QueryString[SiteEnums.QueryStringNames.currentvidid.ToString()]))
{
context.Response.Write(
PlaylistVideo.GetNextVideo(Convert.ToInt32(context.Request.QueryString[SiteEnums.QueryStringNames.playlist.ToString()]),
context.Request.QueryString[SiteEnums.QueryStringNames.currentvidid.ToString()]));
}
else if (!string.IsNullOrEmpty(context.Request.QueryString[SiteEnums.QueryStringNames.begin_playlist.ToString()]))
{
context.Response.Write(
PlaylistVideo.GetFirstVideo(Convert.ToInt32(context.Request.QueryString[SiteEnums.QueryStringNames.playlist.ToString()])));
}
else
{
context.Response.Write(
PlaylistVideo.CurrentVideoInPlaylist(
Convert.ToInt32(context.Request.QueryString[SiteEnums.QueryStringNames.playlist.ToString()])
));
}
#endregion
break;
default:
// ?
break;
}
}