Esempio n. 1
0
        public ActionResult AddCar(string openid, string classId)
        {
            //判断是否注册
            //var userInfo = new WxUserBC().GetWxUserByOpenid(openid);
            //if (userInfo==null ||string.IsNullOrEmpty(userInfo.Phone))
            //{
            //    Response.Redirect(CommonHelper.GetRedirect("WxMy%2fRegistered"));
            //}

            ShopCarEntity entity = new ShopCarEntity()
            {
                Openid  = openid,
                ClassId = classId
            };

            var model = new ShopCarBC().GetMyShopByopenIdAndclassId(openid, classId);

            if (model != null)
            {
                return(Json("已加入购物车", JsonRequestBehavior.AllowGet));
            }

            var result = new ShopCarBC().AddShopCar(entity, openid);

            if (result > 0)
            {
                return(Json("更新成功", JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json(string.Empty, JsonRequestBehavior.AllowGet));
            }
        }
Esempio n. 2
0
 public ActionResult EnableShopCar(string shopCarId, int status)
 {
     try
     {
         if (string.IsNullOrEmpty(shopCarId))
         {
             return(Json(string.Empty));
         }
         var result = new ShopCarBC().EnableShopCar(shopCarId, status);
         if (result > 0)
         {
             return(Json("更新成功", JsonRequestBehavior.AllowGet));
         }
         else
         {
             return(Json(string.Empty, JsonRequestBehavior.AllowGet));
         }
     }
     catch (Exception ex)
     {
         return(Json(string.Empty, JsonRequestBehavior.AllowGet));
     }
 }