便利店订购网站的实现与开发毕业论文.doc

上传人:本田雅阁 文档编号:2165972 上传时间:2019-02-24 格式:DOC 页数:43 大小:505.52KB
返回 下载 相关 举报
便利店订购网站的实现与开发毕业论文.doc_第1页
第1页 / 共43页
便利店订购网站的实现与开发毕业论文.doc_第2页
第2页 / 共43页
便利店订购网站的实现与开发毕业论文.doc_第3页
第3页 / 共43页
亲,该文档总共43页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述

《便利店订购网站的实现与开发毕业论文.doc》由会员分享,可在线阅读,更多相关《便利店订购网站的实现与开发毕业论文.doc(43页珍藏版)》请在三一文库上搜索。

1、核准通过,归档资料。 未经允许,请勿外传! 核准通过,归档资料。 未经允许,请勿外传! 毕毕 业业 论论 文文 论文(设计)题目: 便利店订购网站的实现与开发便利店订购网站的实现与开发 9JWKffwvG#tYM*Jg using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.U

2、I.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Data.SqlClient; public partial class LookArcticle : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) if (!this.IsPostBack) this.bindArcticleinfo(); if (Session“UserName“ =null) this.btn_to_logon.Visible = t

3、rue; labname.Text = “您还未登录 “; this.btnexit.Visible = false; else this.btn_to_logon.Visible = false; /显示登录者的用户名 labname.Text = “欢迎您: “ + Session“UserName“.ToString(); public object bindArcticleinfo() SqlConnection con = DBAccess.createsqlcon(); con.Open(); SqlDataAdapter sda = new SqlDataAdapter(); s

4、da.SelectCommand = new SqlCommand(“select * from ArcticleInfo“, con); DataSet ds = new DataSet(); sda.Fill(ds, “BI“); this.GvListArcticle.DataSource = ds.Tables“BI“; this.GvListArcticle.DataBind(); return ds; protected void GvListArcticle_RowDataBound(object sender, GridViewRowEventArgs e) /修改选中行的背景

5、颜色 if (e.Row.RowType = DataControlRowType.DataRow) e.Row.Attributes.Add(“onmouseover“, “c=this.style.backgroundColor;this.style.backgro undColor=#00A9FF“); e.Row.Attributes.Add(“onmouseout“, “this.style.backgroundColor=c“); protected void btnexit_Click(object sender, EventArgs e) /清空session并修改相应的导航按

6、钮的可见性。 Session“UserName“ = “; labname.Text = “请您登录!“; btn_to_logon.Visible=true; btnexit.Visible = false; protected void btn_to_logon_Click(object sender, EventArgs e) Response.Redirect(“Logon.aspx“); protected void GvListArcticle_PageIndexChanging(object sender, GridViewPageEventArgs e) this.GvList

7、Arcticle.PageIndex = e.NewPageIndex; this.GvListArcticle.DataSource = bindArcticleinfo(); this.GvListArcticle.DataBind(); 4.3.24.3.2 数据库及注册模块数据库及注册模块 下面这用 Admin 访问 SQL SERVER 数据库的 BBS 表来说明。 下面的代码是管理员管理留言板的页面的后台代码: using System; using System.Data; using System.Configuration; using System.Collections;

8、 using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Data.SqlClient; public partial class Admin_LinkAdmin : System.Web.UI.Page protected void Page_Load(object sende

9、r, EventArgs e) if (!this.IsPostBack) if (Session“UserName“ = null) Response.Redirect(“erro_Amin.aspx“); else this.lb_to_name.Text = “欢 迎您:“ + Session“UserName“. ToString(); this.bindgridview(); /定义一个绑定到gridview的方法,实现分页功能! public object bindgridview() SqlConnection con = DBAccess.createsqlcon(); con

10、.Open(); /试用sqldataadapter+set来实现数据源的绑定,实现 gridview分页功能。 SqlDataAdapter sda = new SqlDataAdapter(); sda.SelectCommand = new SqlCommand(“select * from BBS“, con); DataSet ds = new DataSet(); sda.Fill(ds, “BBBS“); this.GridView1.DataSource = ds.Tables“BBBS“; / 对应行的主键标识! GridView1.DataKeyNames = new st

11、ring “ID“; this.GridView1.DataBind(); return ds; protected void lbt_exit_Click(object sender, EventArgs e) / Response.Write(“window.close();“); protected void GridView1_PageIndexChanging1(object sender, GridViewPageEventArgs e) this.GridView1.PageIndex = e.NewPageIndex; this.GridView1.DataSource = b

12、indgridview(); this.GridView1.DataBind(); protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) if (e.Row.RowType = DataControlRowType.DataRow) e.Row.Attributes.Add(“onmouseover“, “c=this.style.backgroundColor;this.style.backgro undColor=#58baf0“); e.Row.Attributes.Add(“onmous

13、eout“,“this.style.backgroundColor=c “); protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e) string sindex =Convert.ToString ( GridView1.DataKeyse.RowIndex.Value); SqlConnection con = DBAccess.createsqlcon(); SqlCommand cmd = new SqlCommand(“delete from BBS where ID=“+sinde

14、x+“, con); con.Open(); cmd.ExecuteNonQuery(); this.bindgridview(); protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e) this.GridView1.EditIndex = e.NewEditIndex; this.bindgridview(); protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e) this.

15、GridView1.EditIndex = -1; this.bindgridview(); protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e) SqlConnection con = DBAccess.createsqlcon(); con.Open(); SqlCommand cmd = new SqlCommand(“update BBS set Adminre=“ + (TextBox)(this.GridView1.Rowse.RowIndex.Cells3. Controls0

16、).Text.ToString().Trim() + “where ID=“+ GridView1.DataKeyse.RowIndex.Value.ToString() + “, con); cmd.ExecuteNonQuery(); con.Close(); GridView1.EditIndex = -1; this.bindgridview(); 4.3.34.3.3 数据库结构数据库结构 根据系统功能设计要求和模块划分,本站的数据库主要存储个人用 户信息、企业用户信息、求职信息和招聘信息。 数据库需求分析-数据项和和数据结构如下: 各表单如下: 1) 用户表(users) 此数据表

17、用来存储用户信息: 2)商品表 此数据表用来存储商品信息: 3)新品表 此数据用来存储新上架商品信息: 4)商品分类: 此数据表用来存储商品类别的信息: 5)购物车表(ShopCart) 此数据表用来存储购物车的信息: 4.4 本章小结 本章主要简单介绍网站的首页,按照方便用户的原则试用了浏览商 品的页面。各个版块的管理、各个页面之间的连接跳转等,均采用了导 航条来实现。为了能够清楚地表达所要描述的问题,列出了 LookArcticle.aspx 页面的前台、后台代码。 参考文献 1)中国互联网络信息中心 CNIC 2).NET 平台和 C#编程 北京阿博泰克北大青鸟信息技术有限公司 3)WinForms 高级应用开发 北京阿博泰克北大青鸟信息技术有限公 司 4)SQL Server 数据库设计和实现 北京阿博泰克北大青鸟信息技术 有限公司 5)百度论坛 6)百度知道

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 其他


经营许可证编号:宁ICP备18001539号-1