已阅读5页,还剩27页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
荣升驾校理论考试系统实训报告网上宠物店课 程:司法网络信息项目实训班 级:10级信息管理班指导教师:陈忠菊学生姓名:03069 周新秀32辽宁公安司法管理干部学院2010级计算机信息管理专业实训报告目录第一章 网站需求分析1.1开发目的51.2性能需求51.3开发环境5第二章 系统需求分析2.1系统功能设计6第三章 系统整体设计3.1总体设计目标73.2字段7第四章系统程序实现与测试4.1 管理员管理104.1.1登录界面设计104.1.2添加管理员界面设计114.1.3信息查询界面设计134.1.4修改密码界面设计144.2 宠物信息管理164.2.1查询界面设计174.2.2添加界面设计184.3 客户订单204.4 前台214.4.1宠物小常识界面设计214.4.2关于我们界面设计234.4.3留言界面设计234.4.4用户注册界面设计244.4.5主页界面设计254.4.6主页详细界面设计274.4.7最新宠物界面设计294.4.8最新宠物详细信息界面设计30小结32前言随着物质生活的富裕,人们越来越注重生活情趣的培养。传统家庭结构的变化,工作压力的增大,人际关系逐渐趋于淡化,使越来越多的人将感情投注于宠物身上。人与宠物间的依赖关系,将随时间的流逝而日益浓厚。网上宠物店是一个能使得繁忙的或者不喜欢出门的人,足不出户而又很方便的狗的自己喜欢的宠物,这样既满足了自己的心灵需要,也不会影响到工作或者浪费了自己的时间。如今现代信息技术的迅速发展使网上宠物店以方便快捷费用低的优点正慢慢地进入人们的生活,将传统的宠物买卖方式彻底的解脱出来,提高效率,减轻工人人员以往繁忙的工作,减小出错的概率,使宠物购买者可以花更多的时间在选择宠物上。从而使人们有更多时间来获取信息、了解信息、掌握信息。因此本人结合实际要求,主要完成对网上宠物购买的需求分析,系统实现了用户信息管理,宠物信息管理等功能。本系统主要由使用Microsoft Visual Studio.NET 20010 开发的页面,由SQL Server2005开发的数据库组成。第一章网站需求分析1.1开发目的可以使人们更方便快捷的买到自己喜爱的宠物,培养人们的生活情趣,提高工作效率。1.2性能需求为保证系统能够长期、安全、稳定、可靠、高效的运行,网上宠物店系统应该满足的性能需求是系统处理的准确性与及时性、系统的开放性和系统的可扩充性、系统的易用性和易维护性、系统的标准性、系统的先进性、系统的响应速度。1.3开发环境本系统是在windows XP操作系统下,使用Microsoft Visual Studio.NET 2010作为开发工具进行开发的。数据库使用的是SQL Server2005。第二章 系统需求分析2.1系统功能设计根据网上宠物店的逻辑划分,本系统可分为用户登录和注册,用户管理,宠物管理,宠物购买。其功能结构图如图2.1所示。用户管理宠物管理网上宠物店 图2.1 系统功能图 用户管理 添加用户,修改用户,删除用户,用户登录。 宠物管理:主要是实现宠物的添加、修改、删除、查询 管理员管理:添加管理员第三章 系统总体设计3.1总体设计目标网上宠物店根据人们对宠物的喜爱,人与宠物之间的依赖关系,为了满足人们的需求,使人们更方便的查询自己喜爱的宠物,了解宠物信息,养宠物的注意事项,实现在网上购买宠物,更方便快捷。3.2字段在Microsoft SQL Server的操作环境下,数据库名称为PET,包含6个数据表: 宠物类别表、宠物信息表、订单表、订单项目表、管理员表、留言表、用户表。其结构图如下:1宠物类别表2宠物信息表 3订单表4订单项目表5管理员表6.留言表7用户表第四章 系统程序实现与测试4.1 管理员管理4.1.1登录界面设计该页面主要实现了管理员的登录功能,与数据库进行连接来登录,进入管理员管理的界面。如下图:代码如下:using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data;using System.Data.SqlClient;public partial class 管理员理_denglu : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) protected void Button1_Click(object sender, EventArgs e) string sql = ; SqlDataReader dr = null; string user = TextBox1.Text; sql = select * from 管理表 where 管理员姓名= + user + ; dr = db.GetReader(sql); if (!dr.Read() Response.Write(alert(没有该管理员! );); return; if (TextBox2.Text != dr密码.ToString() Response.Write(alert(密码不符);); return; Response.Write(alert(登录成功!);); Session用户名 = user; Session密码 = dr密码; Response.Redirect(/管理员管理信息查询.aspx); 4.1.2添加管理员界面设计如下图:代码如下:using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data;using System.Data.SqlClient;public partial class 管理员管理_添加管理员: System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) Page.Title = 网上宠物店_添加管理员; if (Session用户名 = null | Session用户名.ToString() = ) Response.Redirect(denglu.aspx); return; protected void Button1_Click(object sender, EventArgs e) if (Page.IsValid) SqlConnection con = new SqlConnection(db.StrCon); string useName = TextBox1.Text; string sql = select count(*) from 管理员表where 管理员姓名= + useName + ; con.Open(); SqlCommand cmd = new SqlCommand(sql, con); int n = (int)cmd.ExecuteScalar(); if (n 0) Response.Write(alert(提示:此用户已存在);); return; cmd.CommandText = insert into 管理员表(管理员姓名密码); cmd.CommandText += values(管理员姓名密码); cmd.Parameters.Add(管理员姓名, SqlDbType.VarChar).Value = useName; cmd.Parameters.Add(密码, SqlDbType.VarChar).Value = TextBox2.Text; /加入?注册记?录? cmd.ExecuteNonQuery(); con.Close(); Response.Write(alert(添加成功 );); /Response.Redirect(后台管理.aspx); 4.1.3信息查询界面设计如下图:代码如下:using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data;using System.Data.SqlClient;public partial class 管理员管理_信息查询: System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) Page.Title = 网上宠物店_信息查询; if (Session用户名 = null | Session用户名.ToString() = ) Response.Redirect(denglu.aspx); return; protected void Button1_Click(object sender, EventArgs e) string sql = select * from 管理员表where (1=1); if (TextBox1.Text != ) sql += and 管理员姓名like % + TextBox1.Text + %; SqlDataSource1.SelectCommand = sql; protected void SqlDataSource1_Selected(object sender, SqlDataSourceStatusEventArgs e) Label1.Text = 共2找到 + e.AffectedRows.ToString() + 条记录!; 4.1.4修改密码界面设计如下图:代码如下:using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data;using System.Data.SqlClient;public partial class 管理员管理_修改密码 : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) Page.Title = 网上宠物店_修改密码; if (Session用户名 = null | Session用户名.ToString() = ) Response.Redirect(login.aspx); return; if (!Page.IsPostBack) ShowUserInfo(); public void ShowUserInfo()/显?示?用?户信?息 string user = Session用户名?.ToString(); TextBox5.Text = user; SqlConnection con = new SqlConnection(db.StrCon); SqlCommand cmd = new SqlCommand(, con); cmd.CommandText = select * from 管理员表 where 管理员姓名= + user + ; con.Open(); SqlDataReader dr = cmd.ExecuteReader(); if (dr.Read() TextBox2.Text = dr密码.ToString(); dr.Close(); con.Close(); protected void Button1_Click(object sender, EventArgs e) if (Page.IsValid) SqlConnection con = new SqlConnection(db.StrCon); string sql = update 管理员表set 密码=密码; SqlCommand cmd = new SqlCommand(sql, con); cmd.Parameters.Add(密码, SqlDbType.VarChar).Value = TextBox3.Text; con.Open(); /加入?注册记?录? cmd.ExecuteNonQuery(); con.Close(); Response.Write(alert(修改成功! );); /Response.Redirect(后台管理.aspx); protected void Button2_Click(object sender, EventArgs e) ShowUserInfo(); 4.2 宠物信息管理4.2.1查询界面设计如下图:代码如下:using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;public partial class 宠物?信?息管理_查询 : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) if (Session用户名 = null | Session用户名.ToString() = ) Response.Redirect(denglu.aspx); return; protected void Button2_Click(object sender, EventArgs e) string sql = select * from 宠物信息表where (1=1) ; if (TextBox1.Text != ) sql += and 宠物名称like % + TextBox1.Text + %; if (DropDownList1.Text != ) sql += and 宠物类别= + DropDownList1.Text + ; SqlDataSource1.SelectCommand = sql; protected void SqlDataSource1_Selected(object sender, SqlDataSourceStatusEventArgs e) Label1.Text = 共找到 + e.AffectedRows.ToString() + 条记录!; 4.2.2添加界面设计如下图:代码如下:using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data;using System.Data.SqlClient;using System.IO;public partial class 宠物?信?息管理_添加 : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) if (Session用?户名? = null | Session用户名.ToString() = ) Response.Redirect(宠物信息管理/denglu.aspx); return; protected void Button1_Click(object sender, EventArgs e) if (Page.IsValid) SqlConnection con = new SqlConnection(db.StrCon); string sql = select count(*) from 宠物信息表 where 宠物名称= + TextBox1.Text + ; con.Open(); SqlCommand cmd = new SqlCommand(sql, con); int n = (int)cmd.ExecuteScalar(); if (n 0) Response.Write(alert(提示:此用户已存在!);); return; string file = Server.MapPath(images/ + Path.GetFileName(FileUpload1.PostedFile.FileName); if (File.Exists(file) Response.Write(alert(上传文件重名,请改名后再继续上);); return; else if (FileUpload1.HasFile) FileUpload1.PostedFile.SaveAs(file); cmd.CommandText = insert into 宠物信息表(宠物名称,宠物颜色,宠物大小,宠物产地,宠物价钱,优惠价,宠物类别,图片); cmd.CommandText += values(宠物名称,宠物颜色,宠物大小 宠物产地,宠物价钱,优惠价,宠物类别,图片); cmd.Parameters.Add(宠物名称, SqlDbType.VarChar).Value = TextBox1.Text; cmd.Parameters.Add(宠物颜色, SqlDbType.VarChar).Value = TextBox2.Text; cmd.Parameters.Add(宠物大小, SqlDbType.VarChar).Value = TextBox3.Text; cmd.Parameters.Add(宠物产地, SqlDbType.VarChar).Value = TextBox4.Text; cmd.Parameters.Add(宠物价钱, SqlDbType.VarChar).Value = TextBox5.Text; cmd.Parameters.Add(优惠价, SqlDbType.VarChar).Value = TextBox7.Text; cmd.Parameters.Add(宠物类别, SqlDbType.VarChar).Value = DropDownList1.Text; cmd.Parameters.Add(图片, SqlDbType.VarChar).Value = Path.GetFileName(FileUpload1.PostedFile.FileName); cmd.ExecuteNonQuery(); con.Close(); Response.Write(alert(添加成功!);); /Response.Redirect(后台管理.aspx); protected void Button2_Click(object sender, EventArgs e) TextBox1.Text=; TextBox2.Text = ; TextBox3.Text = ; TextBox4.Text = ; TextBox5.Text = ; DropDownList1.Text = ; TextBox7.Text = ;4.3 客户订单如下图:4.4 前台4.4.1宠物小常识界面设计如下图:代码如下:using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data;using System.Data.SqlClient;public partial class 前台_主页: System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) Page.Title = 网上宠物店_主页; if (!Page.IsPostBack) DataList1.DataSource = db.getDataSet(select * from 宠物信息表); DataList1.DataBind(); protected void LinkButton3_Click(object sender, EventArgs e) Response.Write(alert(购买成功!);); protected void DataList1_ItemCommand(object source, DataListCommandEventArgs e) if (e.CommandName = detailSee) Sessionaddress = ; Sessionaddress = 主页.aspx; Response.Redirect(/前台主页详细信息.aspx?ID= + Convert.ToInt32(DataList1.DataKeyse.Item.ItemIndex.ToString(); if (SessionUserName = null | SessionUserName.ToString() = ) Response.Write(alert(请先登录,谢谢合作! );); return; Response.Write(alert(购买成功!);); 4.4.2关于我们界面设计如下图:4.4.3留言界面设计如下图:4.4.4用户注册界面设计如下图:代码如下:using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data;using System.Data.SqlClient;public partial class 前台_用户注册: System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) Page.Title = 网上宠物店_用户注册; protected void Button3_Click(object sender, EventArgs e) if (Page.IsValid) String sql1 = select * from 用户表where 用户编号= + TextBox1.Text + ; SqlConnection con = new SqlConnection(db.StrCon); SqlCommand cmd = new SqlCommand(sql1, con); cmd.CommandText = insert into 用户表 (用户名,密码,真实姓名,手机,密码提示,密码答案,Email) values(用户名,密码,真实姓名,手机,密码提示,密码答案,Eamil); /cmd.Parameters.Add(用户编号, SqlDbType.NVarChar).Value = Label6.Text; cmd.Parameters.Add(用户名?, SqlDbType.NVarChar).Value = TextBox1.Text; cmd.Parameters.Add(密码, SqlDbType.NVarChar).Value = TextBox2.Text; cmd.Parameters.Add(真实姓名, SqlDbType.NVarChar).Value = TextBox3.Text; cmd.Parameters.Add(手机, SqlDbType.NVarChar).Value = TextBox4.Text; / cmd.Parameters.Add(注册日期, SqlDbType.DateTime).Value = DateTime.Now; cmd.Parameters.Add(密码提示, SqlDbType.NVarChar).Value = DropDownList1.Text; cmd.Parameters.Add(密码答案, SqlDbType.NVarChar).Value = TextBox6.Text; cmd.Parameters.Add(Eamil, SqlDbType.NVarChar).Value = TextBox7.Text; con.Open(); cmd.ExecuteNonQuery(); con.Close(); Response.Write(alert(注册成功!);); return; else Response.Write(alert(您已经注册过了! );); protected void Button5_Click(object sender, EventArgs e) TextBox1.Text = ; TextBox2.Text = ; TextBox3.Text = ; TextBox4.Text = ; TextBox6.Text = ; TextBox7.Text = ; DropDownList1.Text = ; 4.4.5主页界面设计如下图:代码如下:using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data;using System.Data.SqlClient;public partial class 前台_主页3 : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) Page.Title = 网上宠物店_主页; if (!Page.IsPostBack) DataList1.DataSource = db.getDataSet(select * from 宠物信息表 ); DataList1.DataBind(); protected void LinkButton3_Click(object sender, EventArgs e) Response.Write(alert(购买成功!);); protected void DataList1_ItemCommand(object source, DataListCommandEventArgs e) if (e.CommandName = detailSee) Sessionaddress = ; Sessionaddress = 主页.aspx; Response.Redirect(/前台/主页详细信息.aspx?ID= + Convert.ToInt32(DataList1.DataKeyse.Item.ItemIndex.ToString(); if (SessionUserName = null | SessionUserName.ToString() = ) Response.Write(alert(请先登录,谢谢合作! );); return; Response.Write(alert(购买成功!););4.4.6主页详细界面设计如下图:代码如下:using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;public partial class 前台_主页3详细?信?息 : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) Page.Title = 网上宠物店_主页详细信息; if (Request.QueryStringID = null | Request.QueryStringID.ToString() = ) Response.Redirect(主页.aspx); return; string ID = RequestID.ToString(); db.ExecSql(update 宠物信息表set 已售出=已售出+1 where 编号= + ID); /string newsID = Request.QueryStringid.ToString(); DataList1.DataSource = db.GetDataset(select * from 宠物信息表where 编号= + ID); DataList1.DataBind(); 4.4.7最新宠物界面设计如下图:代码如下:using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data;using System.Data.SqlClient;public partial class 前台_最?新?宠物? : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) Page.Title = 网上宠物店_最新宠物; DataList1.DataSource = db.getDataSet(select top 8 * from 宠物信息表); DataList1.DataBind(); protected void DataList1_ItemCommand(object source, DataListCommandEvent
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 护理员情绪管理培训教学计划
- 施工现场高空坠落应急预案措施
- 2025年教育行业审核质量保障策略方案
- 2025年无人叉车在制造业物流自动化改造报告
- 2025年智能家居行业智能家居与人工智能家居系统可行性研究报告
- 投资风险识别方法-洞察与解读
- 跨区域合作平台-洞察与解读
- microRNA调控肌肉合成路径-洞察与解读
- 高效表面工程-洞察与解读
- 肾脏基因治疗挑战-洞察与解读
- 2026年凉山州人才引进考试试题及答案
- 浙江杭州市城市建设投资集团有限公司2026届春季校园招聘备考题库(含答案详解)
- 2026年四川省成都市八年级地理生物会考考试真题及答案
- 2025版压力性损伤指南解读与临床实践
- 医院耗材管理委员会职责及工作制度
- 科技馆展品维护保养技师(中级)考试试卷及答案
- 2026年专业翻译资格证书考试中英翻译实战练习题
- 热电偶培训教学课件
- 2025年医疗机构患者就诊流程手册
- 湖南省社保知识培训课件
- 员工行政规范培训课件
评论
0/150
提交评论