freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

計(jì)算機(jī)網(wǎng)絡(luò)企業(yè)網(wǎng)站的設(shè)計(jì)與實(shí)現(xiàn)畢業(yè)設(shè)計(jì)論文(編輯修改稿)

2024-10-02 21:37 本頁(yè)面
 

【文章內(nèi)容簡(jiǎn)介】 (News) 字段名 說明 類型 長(zhǎng)度 可否為空 是否為主鍵 Id 自動(dòng)編號(hào) int 4 否 是 Title 標(biāo)題 nvarchar 200 否 Author 作者 nvarchar 50 是 PubDate 發(fā)布時(shí)間 datetime 50 是 Contents 內(nèi)容 ntext 10000 是 Clicks 點(diǎn)擊次數(shù) int 10 是 NewsCategoryId 新聞?lì)悇e int 4 否 表 留言信息 表 (LY_Info) 字段名 說明 類型 長(zhǎng)度 可否為空 是否為主鍵 LyId 自動(dòng)編號(hào) int 4 否 是 UserName 用戶名 nvarchar 50 否 LyTime 留言時(shí)間 datetime 50 否 溫州科技職業(yè)學(xué)院畢業(yè)設(shè)計(jì)(論文) 15 LyContent 留言內(nèi)容 ntext 1000 否 HF 回復(fù)名 nvarchar 50 否 HFtime 回復(fù)時(shí)間 datetime 50 否 表 管理員信息 表 (Admin_info) 字段名 說明 類型 長(zhǎng)度 可否為空 是否為主鍵 AdminId 自動(dòng)編號(hào) int 4 否 是 AdminName 管理員名 nvarchar 50 否 AdminPwd 密碼 nvarchar 50 否 AdminBZ 級(jí)別 nvarchar 50 否 第五章 三層架構(gòu)代碼實(shí)現(xiàn)及頁(yè)面展示 本網(wǎng)站的后臺(tái)實(shí)現(xiàn)應(yīng)用了三層架構(gòu):數(shù)據(jù)層、業(yè)務(wù)層( BLL 和 DAL)以及表現(xiàn) 層。下面我們分別介紹。 模型 層 該網(wǎng)站使用的數(shù)據(jù)庫(kù)是 sql server2020[7],在 模型 層將每個(gè)數(shù)據(jù)表封裝起來。下面以 新聞 數(shù)據(jù)表為例,進(jìn)行代碼分析。在 Visual Studio2020 中可以看到 模型層的展示,如圖 。 : //命名空間 using System。 using 。 using 。 using 。 溫州科技職業(yè)學(xué)院畢業(yè)設(shè)計(jì)(論文) 16 圖 namespace coffeeModel { [Serializable()] public class News {//對(duì)應(yīng)數(shù)據(jù)庫(kù)定義私有變量 private int id。 public int Id {//對(duì)變量進(jìn)行封裝 get { return id。 } set { id = value。 } } private string title = 。 public string Title { get { return title。 } set { title = value。 } } private string author = 。 public string Author { get { return author。 } set { author = value。 } } 模型 層 模型 層 溫州科技職業(yè)學(xué)院畢業(yè)設(shè)計(jì)(論文) 17 private DateTime pubDate。 public DateTime PubDate { get { return pubDate。 } set { pubDate = value。 } } private string contents = 。 public string Contents { get { return contents。 } set { contents = value。 } } private int clicks。 public int Clicks { get { return clicks。 } set { clicks = value。 } } private int newsCategoryId。 public int NewsCategoryId { get { return newsCategoryId。 } set { newsCategoryId = value。 } } private NewsCategory newsCategory。 public NewsCategory NewsCategory { get { return newsCategory。 } set { newsCategory = value。 } } public News() { }//定義構(gòu)造方法 } } 數(shù)據(jù)訪問層 溫州科技職業(yè)學(xué)院畢業(yè)設(shè)計(jì)(論文) 18 數(shù)據(jù)訪問層用于鏈接數(shù)據(jù)庫(kù)和各種方法的書寫。在 Visual 中可以看到數(shù)據(jù)訪問層和業(yè)務(wù)邏輯層的展示,如圖 。 圖 下面以 新聞 數(shù)據(jù)表為 例,進(jìn)行代碼分析。 頁(yè)面的源代碼: //命名空間 using System。 using 。 using 。 using 。 using coffeeModel。 using 。 using 。 namespace coffeeModel { public class NewsService { private static string connectionString = Data Source=.\\SQLEXPRESS。AttachDbFilename=|DataDirectory|\\。Integrated Security=True。User Instance=True。 /// summary /// 刪除新聞 /// /summary /// param name=news新聞對(duì)象 /param 數(shù)據(jù)訪問層( DAL) 溫州科技職業(yè)學(xué)院畢業(yè)設(shè)計(jì)(論文) 19 public static void DeleteNews(News news) { using (SqlConnection = new SqlConnection(connectionString)) { ()。 SqlCommand cm = new SqlCommand()。 = 。 string sql = delete from News where Id=@Id。 = sql。 (@Id, )。 ()。// } } /// summary /// 根據(jù) SQL 語句返回部分字段的新聞列表 /// /summary /// param name=sqlSQL 語句 /param /// returns新聞對(duì)象集合 /returns private static IListNews GetNewsBySql(string sql) { using (SqlConnection = new SqlConnection(connectionString)) { ()。 SqlCommand cm = new SqlCommand()。//建立 sql 命令對(duì)象實(shí)例 = 。 = sql。 SqlDataReader dr = ()。 ListNews list = new ListNews()。 while (()) { News news = new News()。 for (int i = 0。 i 。 i++) 溫州科技職業(yè)學(xué)院畢業(yè)設(shè)計(jì)(論文) 20 { string fildName = (i)。 if (fildName == Id) = (int)dr[Id]。 else if (fildName == Title) = (string)dr[Title]。 else if (fildName == Author) = (string)dr[Author]。 else if (fildName == PubDate) = (DateTime)dr[PubDate]。 else if (fildName == Contents) = (string)dr[Contents]。 else if (fildName == Clicks) = (int)dr[Clicks]。 else if (fildName == NewsCategoryId) { = (int)dr[NewsCategoryId]。 = ((int)dr[NewsCategoryId])。 } } (news)。 } ()。 return list。 } } /// summary /// 查詢最近的 10 條新聞 /// /summary /// returns/returns public static IListNews GetNewsTop10() { 溫州科技職業(yè)學(xué)院畢業(yè)設(shè)計(jì)(論文) 21 string sql = select top 10 Id,Title from News order by Id DESC。 return GetNewsBySql(sql)。 } /// summary /// 根據(jù)查詢條件,排 序字段,排序方向返回包含部分字段( Id,Title,Author,PubDate,Clicks,NewsCate
點(diǎn)擊復(fù)制文檔內(nèi)容
醫(yī)療健康相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖片鄂ICP備17016276號(hào)-1