本文整理汇总了C#中Orders.All方法的典型用法代码示例。如果您正苦于以下问题:C# Orders.All方法的具体用法?C# Orders.All怎么用?C# Orders.All使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Orders
的用法示例。
在下文中一共展示了Orders.All方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadLogs
public static void LoadLogs() {
var vidlog = new VideoLog();
dynamic productions = new Productions();
dynamic episodes = new Episodes();
dynamic orderItems = new OrderItems();
dynamic channels = new Channels();
var orders = new Orders();
var rand = new Random();
Console.WriteLine("Deleting logs...");
vidlog.Delete();
foreach (var order in orders.All()) {
//pull the orderItems
var items = orderItems.Find(OrderID: order.ID);
//loop the items
foreach (var item in items) {
var slug = item.SKU;
if (slug == "yearly") {
Console.WriteLine("Loading Productions and Episodes for Annual...");
//create a download log for each production and episode
foreach (var p in productions.All()) {
var eps = episodes.Find(ProductionID: p.ID);
foreach (var e in eps) {
var log = new {
Slug = item.SKU,
EpisodeNumber = e.Number,
Email = order.Email,
//the download file for the episode
FileName = p.Slug + "_"+e.Number+".zip",
FileSize = e.HDFileSize,
//1 day lag
LogDate = order.CreatedAt.AddDays(1),
OrderItemID = item.ID
};
vidlog.Insert(log);
}
}
} else if (slug == "monthly") {
//create a stream log for each production and episode
Console.WriteLine("Loading Productions and Episodes for Monthly...");
foreach (var p in productions.All()) {
var eps = episodes.Find(ProductionID: p.ID);
foreach (var e in eps) {
var log = new {
Slug = item.SKU,
EpisodeNumber = e.Number,
Email = order.Email,
//the download file for the episode
FileName = p.Slug + "_" + e.Number + ".flv",
FileSize = e.StreamFileSize,
//1 day lag
LogDate = order.CreatedAt.AddDays(1),
OrderItemID = item.ID
};
vidlog.Insert(log);
}
}
} else {
var p = productions.First(Slug:item.SKU);
var eps = episodes.Find(ProductionID: p.ID);
Console.WriteLine("Loading log for {0}...",p.Slug);
foreach (var e in eps) {
var log = new {
Slug = item.SKU,
EpisodeNumber = e.Number,
Email = order.Email,
//the download file for the episode
FileName = p.Slug + "_" + e.Number + ".zip",
FileSize = e.HDFileSize,
//1 day lag
LogDate = order.CreatedAt.AddDays(1),
OrderItemID = item.ID
};
vidlog.Insert(log);
}
}
}
}
}