ImageVerifierCode 换一换
格式:DOCX , 页数:15 ,大小:25.03KB ,
资源ID:8258345      下载积分:12 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/8258345.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(软件开发工具美食网公共模块设计.docx)为本站会员(b****6)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

软件开发工具美食网公共模块设计.docx

1、软件开发工具美食网公共模块设计淮海工学院计算机工程学院实验报告书课 程 名: 软件开发工具 题 目: 公共模块设计 (基于vs2010) 班 级: 学 号: 姓 名: 一、目的与要求 根据自己的网站需求设计所需的公共类。二、实验内容或题目 在编码阶段,首先要做的事就是要进行基础类和公共模块的设计。一般情况下,我们把一些数据库操作的代码封装到公共类中,同时把共同的操作放到公共类中。根据自己的网站的需求设计自己所需的公共类。三、实验步骤与源程序DAL中存放跟数据有关的操作:AdsDAO类(广告操作):/ / 更新广告(有更新存储路径) / public bool Update_image(adve

2、rtise ads, int id) bool flag = false; string sql = update advertise set Avlocation= + ads.Avlocation + ,Avdescription= + ads.Avdescription + ,Avadduser= + ads.Avadduser + ,Avlinkurl= + ads.Avlinkurl + ,Avimageurl= + ads.Avimageurl + where Avid= + id + ; int res = sqlhelper.ExecuteNonQuery(sql, Comma

3、ndType.Text); if (res 0) flag = true; return flag; / / 更新广告(没有更新存储路径) / public bool Update_noimage(advertise ads, int id) bool flag = false; string sql = update advertise set Avlocation= + ads.Avlocation + ,Avdescription= + ads.Avdescription + ,Avadduser= + ads.Avadduser + ,Avlinkurl= + ads.Avlinkur

4、l + where Avid= + id + ; int res = sqlhelper.ExecuteNonQuery(sql, CommandType.Text); if (res 0) flag = true; return flag; / / 取出当前所有广告 / public DataTable SelectAll(int id) DataTable dt = new DataTable(); string sql = select * from advertise where Avid=+id+ ; dt = sqlhelper.ExecuteQuery(sql, CommandT

5、ype.Text); return dt; / / 取出广告的存储路径 / public DataTable Selectimage(int id) DataTable dt = new DataTable(); string sql = select Avimageurl from advertise where Avid= + id+; dt = sqlhelper.ExecuteQuery(sql, CommandType.Text); return dt; / / 删除广告 / public bool Delete(int id) bool flag = false; string s

6、ql = delete from advertise where Avid= + id + ;int res = sqlhelper.ExecuteNonQuery(sql, CommandType.Text); if (res 0) flag = true; return flag; ArcticleDAO类(资讯操作):/ / 取出当前所有资讯 / public DataTable SelectAll() DataTable dt = new DataTable(); string sql = select m.arc_id,m.arc_title,n.artcate_name,m.arc

7、_publishtime,m.arc_publisher from arcticle m , artcate n where m.arc_caId=n.artcate_id; dt = sqlhelper.ExecuteQuery(sql, CommandType.Text); return dt; / / 返回特定资讯 / public SqlDataReader ExecuteReader(int arc_id) SqlDataReader reader; string sql = select * from arcticle where arc_id= + arc_id + ; read

8、er = sqlhelper.ExecuteReader(sql, CommandType.Text); return reader; / / 增加资讯 / public bool Insert(arcticle aticle) bool flag = false; string sql = insert into arcticle(arc_title,arc_caid,arc_publishtime,arc_publisher,arc_content) values( + + aticle.Arc_title + + , + + aticle.Arc_caid + + , + + aticl

9、e.Arc_publishtime + + , + + aticle.Arc_publisher + + , + + aticle.Arc_content + + ); int res = sqlhelper.ExecuteNonQuery(sql, CommandType.Text); if (res 0) flag = true; return flag; / / 更新资讯 / public bool Update(arcticle aticle, int id) bool flag = false; string sql = update arcticle set arc_title=

10、+ aticle.Arc_title + ,arc_caid= + aticle.Arc_caid + ,arc_publishtime= + aticle.Arc_publishtime + ,arc_publisher= + aticle.Arc_publisher + ,arc_content= + aticle.Arc_content + where arc_id= + id + ; int res = sqlhelper.ExecuteNonQuery(sql, CommandType.Text); if (res 0) flag = true; return flag; / / 删

11、除资讯 / public bool Delete(string arc_title) bool flag = false; string sql = delete from arcticle where arc_title= + arc_title + ;int res = sqlhelper.ExecuteNonQuery(sql, CommandType.Text); if (res 0) flag = true; return flag; public bool Delete(int arc_id) bool flag = false; string sql = delete from

12、arcticle where arc_id= + arc_id + ;int res = sqlhelper.ExecuteNonQuery(sql, CommandType.Text); if (res 0) flag = true; return flag; ArtcateDAO类(资讯类别操作):/ / 取出当前所有资讯类别 / public DataTable SelectAll() DataTable dt = new DataTable(); string sql = select * from artcate; dt = sqlhelper.ExecuteQuery(sql, C

13、ommandType.Text); return dt; / / 返回特定资讯类别名 / public SqlDataReader ExecuteReader(int artcate_id) SqlDataReader reader; string sql = select * from artcate where artcate_id= + artcate_id + ; reader = sqlhelper.ExecuteReader(sql, CommandType.Text); return reader; / / 增加资讯类别 / public bool Insert(artcate

14、acate) bool flag = false; string sql = insert into artcate(artcate_name)values( + + acate.Artcate_name + + ); int res = sqlhelper.ExecuteNonQuery(sql, CommandType.Text); if (res 0) flag = true; return flag; / / 更新资讯类别 / public bool Update(artcate acate, int id) bool flag = false; string sql = update

15、 artcate set artcate_name= + acate.Artcate_name + where artcate_id= + id + ; int res = sqlhelper.ExecuteNonQuery(sql, CommandType.Text); if (res 0) flag = true; return flag; / / 删除资讯类别 / public bool Delete(string artcate_name) bool flag = false; string sql = delete from artcate where artcate_name= +

16、 artcate_name + ;int res = sqlhelper.ExecuteNonQuery(sql, CommandType.Text); if (res 0) flag = true; return flag; / / 判断类别名称是否已存在 / public bool IsExists(string artcate_name) bool flag = false; string sql = select * from artcate where artcate_name= + artcate_name + ; DataTable dt = sqlhelper.ExecuteQ

17、uery(sql, CommandType.Text); if (dt.Rows.Count 0) flag = true; return flag; ArtInfoDAO类(有关资讯美食内容操作): / / 取出最新五条美食 / public DataTable SelectNewNews() return sqlhelper.ExecuteQuery(dbo.arcNewsSelectNewcook, CommandType.StoredProcedure); / / 取出五条热点美食 / public DataTable SelectHotNews() DataTable dt = ne

18、w DataTable(); dt = sqlhelper.ExecuteQuery(dbo.arcSelectHotcook, CommandType.StoredProcedure); return dt; / 找出最新的一篇文章 public string SelectNewArc() DataTable dt = new DataTable(); dt=sqlhelper.ExecuteQuery(dbo.arcNewcontent, CommandType.StoredProcedure); string s = dt.Rows0arc_content.ToString(); ret

19、urn s; / 显示资讯中伊人美食中2条 public DataTable SelectArc_1() return sqlhelper.ExecuteQuery(dbo.arc_content1, CommandType.StoredProcedure); / 显示资讯中美容保健中2条 public DataTable SelectArc_2() return sqlhelper.ExecuteQuery(dbo.arc_content2, CommandType.StoredProcedure); / 显示资讯中饮食养性中2条 public DataTable SelectArc_3()

20、 return sqlhelper.ExecuteQuery(dbo.arc_content3, CommandType.StoredProcedure); / 显示资讯中食色男女中2条 public DataTable SelectArc_4() return sqlhelper.ExecuteQuery(dbo.arc_content4, CommandType.StoredProcedure); / 显示资讯中伊人美食 public DataTable Selectyiren() return sqlhelper.ExecuteQuery(dbo.arc_yiren, CommandTy

21、pe.StoredProcedure); / 显示资讯中美容保健 public DataTable Selectmeirong() return sqlhelper.ExecuteQuery(dbo.arc_meirong, CommandType.StoredProcedure); / 显示资讯中饮食养性 public DataTable Selectyinshi() return sqlhelper.ExecuteQuery(dbo.arc_yinshi, CommandType.StoredProcedure); / 显示资讯中食色男女 public DataTable Selectsh

22、ise() return sqlhelper.ExecuteQuery(dbo.arc_shise, CommandType.StoredProcedure); /根据类别ID取出该类别下的所有美食 public DataTable SelectByCaId(string caid) DataTable dt = new DataTable(); string cmdText = dbo.arcSelectByCaId; SqlParameter paras = new SqlParameter new SqlParameter(caid,caid) ; dt = sqlhelper.Exec

23、uteQuery(cmdText, paras, CommandType.StoredProcedure); return dt; / / 根据类别ID取出该条美食主题内容 / public arcticle SelectById(string id) arcticle c = new arcticle(); DataTable dt = new DataTable(); string cmdText = dbo.arcSelectById; SqlParameter paras = new SqlParameter new SqlParameter(id,id) ; dt = sqlhelp

24、er.ExecuteQuery(cmdText, paras, CommandType.StoredProcedure); c.Arc_caid= Convert.ToInt32(id); c.Arc_title= dt.Rows0arc_title.ToString(); c.Arc_content= dt.Rows0arc_content.ToString(); c.Arc_caid= (Int32)dt.Rows0arc_caId; return c; / 增加美食 public bool Insert(arcticle c) bool flag = false; DataTable d

25、t = new DataTable(); string cmdText = dbo.arcInsert; SqlParameter paras = new SqlParameter new SqlParameter(title,c.Arc_title), new SqlParameter(content,c.Arc_content), new SqlParameter(caid,c.Arc_caid) ; int res = sqlhelper.ExecuteNonQuery(cmdText, paras, CommandType.StoredProcedure); if (res 0) fl

26、ag = true; return flag; / 修改美食 public bool Update(arcticle c) bool flag = false; DataTable dt = new DataTable(); string cmdText = dbo.arcUpdate; SqlParameter paras = new SqlParameter new SqlParameter(id,c.Arc_id), new SqlParameter(title,c.Arc_title), new SqlParameter(content,c.Arc_content), new SqlP

27、arameter(caid,c.Arc_caid) ; int res = sqlhelper.ExecuteNonQuery(cmdText, paras, CommandType.StoredProcedure); if (res 0) flag = true; return flag; / 删除美食 public bool Delete(string id) bool flag = false; DataTable dt = new DataTable(); string cmdText = dbo.arcDelete; SqlParameter paras = new SqlParameter new SqlParameter(id,id) ; int res = sqlhelper.ExecuteNonQuery(cmdText, paras, CommandType.StoredProcedure); if (res 0) flag = true; return flag; CommentDAO类(评论操作): / 根据新闻ID取出该新闻的所有评论 public DataTable SelectByNewsId(string m_newsid) DataTable dt = new DataTable(); string sq

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1