商品购物流程

来源:互联网 发布:怎么成功开淘宝网店 编辑:程序博客网 时间:2024/04/30 18:26
create procedure spProductsTop
(
   @top nvarchar(
50),
   @OrderBy nvarchar(
50),
   @CategoryId nvarchar(
50)
)
as
declare @sSql varchar(
100)
select @sSQl 
='select top'+@top+'a.* , b.Name as categoryName ,c.Name as vendor'
select @sSql
=@sSql+'from products a inner join categories b on a.CategoryId = b.Id '
select @sSql
=@sSql+'inner join customers c inner join a.vendorId=c.Id'

if @categoryId>=0
begin 
select @sSql
=@sSql + 'where a.CategoryId=' + @CategoryId
end
if @orderby <> 'datetimed'

select @sSql 
= @sSql + 'orderby a.'+ @orderby + 'desc, a.datetimed desc'
else
select @sSql 
= @sSql + 'orderby a.' + @orderby+ 'desc'

print 
' @sSql'
exec (@sSql)

 

exec (@sSql)不能写成exec'@sSql'

declare '@sSql' nvarchar(100)
select .....
exec
'@sSql'不对

declare '@sSql' nvarchar(100)
select .....
exec (@SSQl)对的

exec Procedure_Name 用于执行一个存储过程
Exec(@SQL_Script) 用于执行一个小于8000字符的脚本

 

 

 

商品购物流程


一.注册成为会员 (我现在就去注册!)
 
二.挑选商品,product.aspx点击购买按钮放入购物车shoppingCart.aspx

   1. Products.aspx商品的详细信息时DataBind()----spProductDetail()-----database procedure {spProductDetail}
      诚意推荐的商品:commend.ascx.cs private void BindData()---------SQL  spProductsWhereCommend()


   2.挑选商品ProductsTop.aspx 中的DATABIND()-----spProductsAllOrderBy()存储商品的所有列表的函数
   ,用到的SQL为spProductsTop()
   3.把当前商品加入指定的购物车里 :spShoppingCartAddItem(string sCartID, int iProductID, int iQuantity) -----SQL spShoppingCartAddItem()

 

 

三.检查购物车里面的商品信息,核实商品数量
   1.当前用户的购物车
  shoppingCart.aspx查看返回当前用户的购物车ID -----GetShoppingCartID()
   2.购物车中有那些商品了
   spShoppingCartList()------SQL   spShoppingCartList():
   3.更新购物车中的数据
   ShoppingCartUpdate()----购物车中不想买的商品spShoppingCartRemoveItem()-----SQL  spShoppingCartRemoveItem()
                       -----购物车中商品的现在数目 SpShoppingCartUpdateQty()  ---------SQL  pShoppingCartUpdateQty()
 
 
 
四.购完所需商品,点击“购物车"内的“收银台”进行结算
   CheckOut.aspx
   1.显示当前用户的购物清单ShoppingCartList()-----GetShoppingCartID()
   2. -------------------- spShoppingCartList(CartID);----SQL spShoppingCartList()
   3.将购物车转入客户订单之中 spOrdersInsert(Int32.Parse(CustomerId), CartID, TextBox1.Text.Trim())-----SQL  spOrdersInsert()
   4.转移客户购买的物品  ImageButton1_Click()-----spShoppingCartTotal(CartID)----SQL
    ------spShoppingCartTotal()


 
 
五.输入收货人信息
 
六.选择支付方式 
 
七.选择收货方式

八.最后确认

九.按您选择的支付方式支付货款

十.支付确认!(请在家里或办公室里等候您的商品吧)


**********************************************
**********************************************

用户登陆时的情况:
   1.用户登陆时的身份认证:spCustomersLogin(string sEmail, string sPassword) -----SQL  spCustomersLogin()
   2.获取当前用户的购物车ID: GetShoppingCartID()
   3.将当前临时的购物车清单转换到登录用户名下:spShoppingCartMigrate(tempCartID, ID)----SQL
     spShoppingCartMigrate()
**********************************************
**********************************************


----------------------------------
----------------------------------
安全方面的情况:
  1.
  private void Button1_Click(object sender, System.EventArgs e)
spCustomersUpdatePassword(sStr, sStr1, sStr2)-----SQL  更新密码 spCustomersUpdatePassword()

 

---------------------------------------
-------------------------------------


联结方面的知识:
  link.ascx    private void BindData()----- spCustomersTop(string sTop, string sORDERBY) -----SQL spCustomersTop()


------------------------------------------------
------------------------------------------------
PayAttentity to

另外spProductsSearch()-----SQL spProductsSearch()  is not found here .
----------------------------------------------
----------------------------------------------

 


 

 

 

 

原创粉丝点击