网上服装销售系统
} }
}
当输人正确的信息,单击“确定”按钮后,提交的数据将插入到user表(会员信息表)里, 如无错误就注册成功了。
会员觉得有必要修改密码或个人信息时,可以通过网站的更新信息来修改。 当输人正确的信息,单击“确定”按钮后,提交的数据将更新user表(会员信息表)里相对应的字段,如无错误就修改成功了。重要代码如下:
protected void btnUpdate_Click(object sender, EventArgs e) {
if (txtName.Text.Trim() == \ && txtPassword.Text.Trim() == \) {
Response.Write(\请输入完整信息!');location='javascript:history.go(-1)';\); } else {
if (IsValidPhone(txtPhone.Text.Trim()) == false) {
Response.Write(\您输入的电话号码有误,请重新输入')\); return; }
else if (IsValidEmail(txtEmail.Text.Trim()) == false) {
Response.Write(\您输入的E-mail地址格式不正确,请重新输入')\);
return; } else {
uiObj.UpdateUInfo(txtName.Text.Trim(), ddlSex.SelectedItem.Text.Trim(), txtPassword.Text.Trim(), Convert.ToInt32(txtAge.Text.Trim()), \, \, txtPhone.Text.Trim(), txtEmail.Text.Trim(), txtAddress.Text.Trim(), Convert.ToInt32(Session[\].ToString())); Session[\] = \;
Session[\] = txtName.Text.Trim(); Response.Write(\恭喜您,修改成功!');location='index.aspx';\); } }
}
13
网上服装销售系统
4.2.2 服装信息展示模块
(1)功能:向用户展示新品推荐、热销服装、特价服装信息以及根据导航查看自己想查看的。
(2)数据表的设计:
表4.2服装信息表(clothesinfo)
列名 clothesid 类型 int 允许空 * * * * * * * * * * * * * * 外键 主键或外键 主键 clothesname varchar(50) clothesmark varchar(50) introduce buyprice sellprice mprice amount stock typeid provider imagepath visit isdiscount predate (3)商品展示
nvarchar(50) float float float int int int varchar(50) varchar(50) int bit datetime 14
网上服装销售系统
图4.2服装展示模块效果图
(4)功能实现方法及代码设计
新品推荐是根据商品上市的时间排序,最新上市的商品为新品推荐商品;热销商品是根据商品卖出的数量,取卖出商品数量排序后前四位展示到前台;特价商品根据表clothesinfo中字段isdiscount的设置,取isdiscount值为true的商品展示。具体实现调用存储过程DeplayGInfo
ALTER proc [dbo].[DeplayGInfo] (
@Deplay int ) as
if(@Deplay=1) begin
select top 4 * from clothesinfo order by predate DESC
end
else if(@Deplay=2) begin
15
网上服装销售系统
select top 4 * from clothesinfo order by amount DESC
end
else if(@Deplay=3) begin
select top 4 * from clothesinfo where isdiscount=1
end
点击服装的种类淑女衬衫、甜美针织衫、韩版外套、可爱T恤、韩版美裙、杂七杂八分别显示每个种类的服装。主要是通过字段typeid实现。
Response.Redirect(\DLType.DataKeys[e.Item.ItemIndex].ToString());
4.2.3 购物车模块
(1)功能:购物车模块,提供了顾客已定的衣服信息的服务。 (2)组成构造: 这个模块由顾客订购衣服信息组成。 (3)数据表的设计如表所示:
表4.3;购物车信息表(tcart)
列名 cartid userid clotheid num sellprice sumprice 类型 int varchar(50) int int float float 允许空 * * * * * 主键或外键 主键 外键 外键 (4)界面设计与重点代码的设计:
16
网上服装销售系统
图4.3购物车模块效果图
该模块能够让顾客看到再看已选择的服装,然后根据自己的需要,进行删除或者是放入购物车和继续购物。
///
/// 获取购物车中的商品信息 ///
public void tcartBind() {
ucObj.SCIBind(\, gvtcart, Convert.ToInt32(Session[\].ToString())); }
///
/// 显示购物车中的商品合计金额和商品数量 /// public void TotalDs() {
DataSet ds = ucObj.ReturnTotalDs(Convert.ToInt32(Session[\].ToString()), \);
lbSumPrice.Text = ucObj.VarStr(ds.Tables[\].Rows[0][0].ToString(), 1); lbSumNum.Text = ucObj.VarStr(ds.Tables[\].Rows[0][1].ToString(), 1); }
4.2.4 生成订单模块
(1)功能:用户通过结账填写订单信息,完成购物过程。 (2)数据表的设计:
表4.4订单表(order)
列名 orderid userid
类型 int int 17
允许空 * 主键或外键 主键 外键