DAL/shopcarthandle.cs
(开头部分) 4KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using mybook.DAL;
using System.Data.SqlClient;
using System.Data;
namespace BasketBallShop.DAL
{
public class shopcarthandle
{
//判断该图书信息是否存在于购物车中
public object IsAroundExists(int cid, int zid)
{
SQLHelper sh = new SQLHelper();
SqlParameter[] prams = { new SqlParameter("@cid",SqlDbType.Int,4),
new SqlParameter("@zid",SqlDbType.Int,4)};
prams[0].Value = cid;
prams[1].Value = zid;
return sh.ExecuteScalar("uspIsAroundExists", prams);
}
//增加这本书的数量+1
public int AddNumToShopCart(int cid, int zid)
{
SQLHelper sh = new SQLHelper();
SqlParameter[] prams = { new SqlParameter("@cid", SqlDbType.Int, 4),
new SqlParameter("@zid", SqlDbType.Int, 4) };
prams[0].Value = cid;
prams[1].Value = zid;
return sh.ExecuteNonQuery("uspAddNumToShopCart", prams);
}
//获得某本书的数量
public int GetNum(int cid, int zid)
{
SQLHelper sh = new SQLHelper();
SqlParameter[] prams = { new SqlParameter("@cid", SqlDbType.Int, 4),
new SqlParameter("@zid", SqlDbType.Int, 4) };
prams[0].Value = cid;
prams[1].Value = zid;
int count = Convert.ToInt32(sh.ExecuteScalar("uspGetNum", prams));
return count;
}
public int UpdateTotalPrice(int cid, int zid, double totalprice)
{
SQLHelper sh = new SQLHelper();
SqlParameter[] prams = { new SqlParameter("@cid", SqlDbType.Int, 4),
new SqlParameter("@zid", SqlDbType.Int, 4),
new SqlParameter("@totalprice",SqlDbType.Decimal,10)};
prams[0].Value = cid;
prams[1].Value = zid;
prams[2].Value = totalprice;
int count = Convert.ToInt32(sh.ExecuteScalar("uspUpdateTotalPrice", prams));
return count;
}
public bool CreateShopCart(int cid, int zid, int num, double totalprice)
后面还有 65 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
