第5章 系统设计
txtNpwd.Text.ToString().Trim();
string pwd3 = txtReNPwd.Text.ToString().Trim();
try
{ SqlConnection con = DB.creatCon(); //链接数据库
SqlCommand cmd = new SqlCommand(\= '\ + pwd2 + \ + account + \, con); con.Open();
cmd.ExecuteNonQuery(); //返回受影响SQL语句 con.Close();
Response.Write(\密码修改成功!是否返回主页面?');window.location.href=Default.aspx?FromUrl=\ + HttpUtility.UrlEncode(Request.Url.AbsoluteUri) + \); }
catch (Exception ex)
{Response.Write(ex.Message); }
5.4 主页登陆
图5-7 系统首页截图
功能介绍:本系统的首页显示了本金融系统概要和操作流程,新用户可以在
27
首页点击注册按钮注册账号,老用户直接登录系统。
本系统采用OLEDB配置连接,主要采用了web.config配置文件: Web.config配置的源代码如下:
5.5支付管理
用户点击“结算”按钮时,同时产生订单。实现代码如下:
if (M_str_Count == \) {
Response.Write(\您的购物车中没有任何物品!');\); } else {
DataSet ds = DB.reDs(\money from bank where Id=\ + Session[\].ToString()); decimal P_str_Money = Convert.ToDecimal(ds.Tables[0].Rows[0][0].ToString()); //判断账户中的金额 余额不足则不能够买商品
if (P_str_Money < Convert.ToDecimal(M_str_Count)) {
Response.Write(\您的余额不足,请重新充值后再购买!');\); } else { //执行受影响行数
bool P_bool_reVal1 = DB.ExSql(\ + Session[\]); //执行受影响行数 付账
bool P_bool_reval2 = DB.ExSql(\
28
第5章 系统设计
+ M_str_Count + \ + Session[\]); if (!P_bool_reval2 & !P_bool_reVal1) {
Response.Write(\结账失败,请重试!\); } else {
Bind();
Response.Write(\恭喜你,结账成功!\); } }
5.6 系统维护
using System;
using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web;
using System.Web.Security; using System.Web.UI;
using System.Web.UI.HtmlControls; using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using System.Data.SqlClient;
public partial class Admin_GoodInfo : System.Web.UI.Page {protected void Page_Load(object sender, EventArgs e) {
if (!IsPostBack)
{if (Session[\
29
{ Response.Write(\请先登录!');\ Response.Redirect(\ } Else
图5-7 系统商品修改截图
30
第6章 系统功能实现
第6章 系统功能实现
6.1主页面
6-1 主页页面截图
6.2 菜单
图6-2 菜单模块页面截图
功能:这里的菜单模块采用用户控件.ascx,以下的日历,公告底部描述都是用户 控件,这样使得系统更整洁,减少了雍容代码。
31