日期:2014-05-20 浏览次数:20794 次
magaView.Magazine = db.Library.Where(a => (dt.AddMonths(1) > a.TimeBook) && (dt < a.TimeBook)).Where(a => a.CategoryID==categoryId).ToList();
/// <summary>
/// 返回指定类型,某月的杂志
/// 被引用:LibController
/// </summary>
/// <param name="categoryId">类型ID</param>
/// <param name="dt">月份</param>
/// <returns></returns>
public static LibMagData GetMagazine(int categoryId,DateTime dt)
{
using (var db = new WEBVODEntities())
{
LibMagData magaView = null;
magaView.Magazine = db.Library.Where(a => (dt.AddMonths(1) > a.TimeBook) && (dt < a.TimeBook)).Where(a => a.CategoryID==categoryId).ToList();
return magaView;
}
}
magaView.Magazine = db.Library.Where(a => dt.Month == a.TimeBook.Month && dt.Year == a.TimeBook.Year && a.CategoryID == categoryId).ToList();