温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:Asp.net2.0电子商务网源码
当前文件路径:AspNetDianZiShangWu/BLL/book/Book.cs

1using System; 2
using System.Collections.Generic; 3
using System.Text; 4
using System.ComponentModel; 5
using Jiaen.Components; 6
using Jiaen.Components.IDAL; 7
using Jiaen.SQLServerDAL; 8
9
namespace Jiaen.BLL 10
{ 11
[DataObjectAttribute] 12
public class Book 13
{ 14
private static readonly IBook books = DataAccess.CreateBook(); 15
16
/// <summary> 17
/// 获取首页图书信息 18
/// </summary> 19
/// <returns></returns> 20
public static IList<BookInfo> GetIndexBook(ViewBookType type) 21
{ 22
return books.GetIndexBook(type); 23
} 24
25
/// <summary> 26
/// 获取特价图书信息 27
/// </summary> 28
/// <returns></returns> 29
public static IList<BookInfo> GetCheapBook(int type) 30
{ 31
return books.GetCheapBook(type); 32
} 33
34
/// <summary> 35
/// 获取可团购图书 36
/// </summary> 37
/// <returns></returns> 38
public static IList<BookInfo> GetTgBook() 39
{ 40
return books.GetTgBook(); 41
} 42
43
/// <summary> 44
/// 45
/// </summary> 46
/// <returns></returns> 47
public static IList<BookInfo> GetCheapTopBook() 48
{ 49
return books.GetCheapTopBook(); 50
} 51
52
/// <summary> 53
/// 获取图书信息 54
/// </summary> 55
/// <returns></returns> 56
public static IList<BookInfo> GetBook(BookType type) 57
{ 58
return books.GetBook(type); 59
} 60
61
/// <summary> 62
/// 新增图书信息 63
/// </summary> 64
/// <returns></returns> 65
public static void InsertBook(BookInfo book) 66
{ 67
books.InsertBook(book); 68
} 69
70
public static BookInfo GetBookByID(int bookID) 71
{ 72
return books.GetBookByID(bookID); 73
} 74
75
public static IList<BookInfo> GetCatBookByID(string bookName) 76
{ 77
return books.GetCatBookByID(bookName); 78
} 79
80
/// <summary> 81
/// 获取分类图书排行 82
/// </summary> 83
/// <returns></returns> 84
public static IList<BookInfo> GetTopBook(int year, int month, int catID, CatType type) 85
{ 86
return books.GetTopBook(year, month,catID,type); 87
} 88
89
/// <summary> 90
/// 获取图书排行 91
/// </summary> 92
/// <returns></returns> 93
public static IList<BookInfo> GetTopBook(int year, int month) 94
{ 95
return books.GetTopBook(year, month); 96
} 97
98
public static int UpdateBook(BookInfo book) 99
{ 100
return books.UpdateBook(book); 101
} 102
103
/// <summary> 104
/// 删除图书信息 105
/// </summary> 106
/// <param name="bookID"></param> 107
/// <returns></returns> 108
public static int DeleteBook(int bookID) 109
{ 110
return books.DeleteBook(bookID); 111
} 112
113
/// <summary> 114
/// 更新图书价格 115
/// </summary> 116
/// <param name="book"></param> 117
/// <returns></returns> 118
public static int UpdatePrice(BookInfo book) 119
{ 120
return books.UpdatePrice(book); 121
} 122
123
public static int UpdateCount(CountType type, int ID) 124
{ 125
126
return books.UpdateCount(type, ID); 127
} 128
129
public static int UpdateRebate(float rebate, int ID) 130
{ 131
return books.UpdateRebate(rebate, ID); 132
} 133
134
/// <summary> 135
/// 获取分类图书 136
/// </summary> 137
/// <param name="type"></param> 138
/// <param name="catID"></param> 139
/// <returns></returns> 140
public static IList<BookInfo> GetBookByCatID(int type, int catID) 141
{ 142
return books.GetBookByCatID(type, catID); 143
} 144
145
/// <summary> 146
/// 获取最新图书 147
/// </summary> 148
/// <param name="type"></param> 149
/// <returns></returns> 150
public static IList<BookInfo> GetNewBook(int type) 151
{ 152
return books.GetNewBook(type); 153
} 154
155
public static IList<BookInfo> GetBookByParentID(int type, int catID) 156
{ 157
return books.GetBookByParentID(type, catID); 158
} 159
160
public static IList<BookInfo> GetSearchBook(int type, string key) 161
{ 162
return books.GetSearchBook(type, key); 163
} 164
165
public static IList<BookInfo> GetTeacherBook(int type, int teacherID) 166
{ 167
return books.GetTeacherBook(type,teacherID); 168
} 169
170
public static IList<BookInfo> GetAdvanceSearchBook(string[] key) 171
{ 172
return books.GetAdvanceSearchBook(key); 173
} 174
175
public static int UpdateStockCount(int ID, int count) 176
{ 177
return books.UpdateStockCount(ID, count); 178
} 179
} 180
} 181




[DataObjectAttribute]

}