91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 37.88MB
    文件類型: .7z
    金幣: 1
    下載: 0 次
    發(fā)布日期: 2023-06-28
  • 語言: 其他
  • 標(biāo)簽: 微信??開發(fā)??

資源簡介

微信公眾平臺,微信商城系統(tǒng)源碼,.NET平臺

資源截圖

代碼片段和文件信息

using?System;
using?System.Collections.Generic;
using?System.Linq;
using?System.Web;
using?MxWeiXinPF.Common;
using?System.Text;

namespace?MxWeiXinPF.Web.shop
{
????///?
????///?shopmgr?的摘要說明
????///?

????public?class?shopmgr?:?IHttpHandler
????{

????????public?void?ProcessRequest(HttpContext?context)
????????{
????????????context.Response.ContentType?=?“text/json“;
????????????BLL.wx_shop_cart?cartBll?=?new?BLL.wx_shop_cart();
????????????string?_action?=?MyCommFun.QueryString(“myact“);???????
????????????string?openid?=?MyCommFun.RequestOpenid();??//得到微信用戶的openid
????????????Dictionary?jsonDict?=?new?Dictionary();
????????????if?(_action?==?“addCart“)
????????????{
????????????????#region?添加購物車
????????????????try
????????????????{
????????????????????int?wid?=?MyCommFun.RequestInt(“wid“);
????????????????????int?productId?=?MyCommFun.RequestInt(“productid“);
????????????????????int?skuId?=?MyCommFun.RequestInt(“mid“);
????????????????????string?skuInfo?=?MyCommFun.QueryString(“attr“);
????????????????????int?productNum?=?MyCommFun.RequestInt(“bc“);
????????????????????decimal?totalPrice?=?(decimal)MyCommFun.RequestFloat(“totprice“?0);
????????????????
????????????????????Model.wx_shop_cart?cart?=?new?Model.wx_shop_cart();

????????????????????IList?cartList?=?cartBll.GetModelList(“productId=“?+?productId?+?“?and?openid=‘“?+?openid?+?“‘?and?skuId=“+skuId);
????????????????????bool?isAdd?=?true;
????????????????????if?(cartList?!=?null?&&?cartList.Count?>?0)
????????????????????{
????????????????????????isAdd?=?false;
????????????????????????cart?=?cartList[0];
????????????????????}
????????????????????if?(isAdd)
????????????????????{
????????????????????????cart.createDate?=?DateTime.Now;
????????????????????????cart.openid?=?openid;
????????????????????????cart.productId?=?productId;
????????????????????????cart.productNum?=?productNum;
????????????????????????cart.skuId?=?skuId;
????????????????????????cart.skuInfo?=?skuInfo;
????????????????????????cart.totPrice?=?totalPrice?*?productNum;
????????????????????????cart.wid?=?wid;
????????????????????????int?ret?=?cartBll.Add(cart);
????????????????????????if?(ret?>?0)
????????????????????????{
????????????????????????????jsonDict.Add(“errCode“?“false“);
????????????????????????}
????????????????????????else
????????????????????????{
????????????????????????????jsonDict.Add(“errCode“?“true“);
????????????????????????}
????????????????????}
????????????????????else
????????????????????{

????????????????????????cart.openid?=?openid;

????????????????????????cart.productNum?+=?productNum;
????????????????????????cart.skuId?=?skuId;
????????????????????????cart.skuInfo?=?skuInfo;
????????????????????????cart.totPrice?+=?totalPrice?*?productNum;
????????????????????????cart.wid?=?wid;
????????????????????????bool?ret?=?cartBll.Update(cart);
??????????

評論

共有 條評論

相關(guān)資源