·订单管理系统: 订单维护,修改订单,删除订单; ·留言管理系统: 留言维护、删除、回复;
4.2系统功能结构图
第五章 系统功能实现
根据软件开发的基本流程,在完成了系统需求、系统分析、系统设计后,就进入系统实现阶段了,本系统使用三层架构进行开发,以下是整个系统的功能实现,包括前台的页面展示和后台的代码剖析。
5.1数据访问层
public class DB {
private SqlConnection con; public DB() {
con = new SqlConnection(); con.ConnectionString =
ConfigurationManager.AppSettings[\].ToString(); }
public void open() {
if (con.State == ConnectionState.Closed) {
con.Open(); }
}
public void close() {
if (con.State == ConnectionState.Open) {
con.Close(); } }
public DataTable DT(string sqlStr) {
SqlDataAdapter sda = new SqlDataAdapter(sqlStr, con); DataSet ds = new DataSet(); sda.Fill(ds); return ds.Tables[0]; }
public DataSet DS(string sqlStr) {
SqlDataAdapter sda = new SqlDataAdapter(sqlStr, con); DataSet ds = new DataSet(); sda.Fill(ds); return ds; }
public bool ExeSql(string sqlStr) {
open();
SqlCommand cmd = new SqlCommand(sqlStr, con); int i = cmd.ExecuteNonQuery(); close(); if (i > 0) {
return true; }
return false;
}
public bool ExeCount(string sqlStr) {
open();
SqlCommand cmd = new SqlCommand(sqlStr, con); int i = Convert.ToInt32(cmd.ExecuteScalar()); close(); if (i > 0) {
return true; }
return false; }
public string FirstStr(string sqlStr) {
open();
SqlCommand cmd = new SqlCommand(sqlStr, con); string Str = Convert.ToString(cmd.ExecuteScalar()); close(); return Str; }
public DataTable DT(string SqlStr, SqlParameter[] prm, CommandType type) {
SqlCommand cmd = new SqlCommand(SqlStr, con); cmdmandType = type;
cmd.Parameters.AddRange(prm);
SqlDataAdapter sda = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); sda.Fill(ds);
return ds.Tables[0];}
5.2前台功能
5.2.1登录模块
系统将会根据登录用户的类型进入不同的操作页面。(普通会员登陆进
入购物网首页;管理员登陆进入网站后台管理)
相关推荐: