Ejemplo n.º 1
0
        public IHttpActionResult GetUserShopCar(int UID)
        {
            WebApi_BLL.T_User_ShopCar shopCar_bll = new WebApi_BLL.T_User_ShopCar();
            List <T_User_ShopCar>     shopCarList = shopCar_bll.GetModelList("UID = " + UID);

            return(Ok(ReturnJsonResult.GetJsonResult(1, "OK", JsonConvert.SerializeObject(shopCarList))));
        }
Ejemplo n.º 2
0
        public IHttpActionResult AddShopCar(dynamic model)
        {
            WebApi_BLL.T_User_ShopCar shopCar_bll = new WebApi_BLL.T_User_ShopCar();
            T_User_ShopCar            shopCar     = (T_User_ShopCar)Newtonsoft.Json.JsonConvert.DeserializeObject(model, typeof(T_User_ShopCar));

            shopCar_bll.Add(shopCar);
            return(Ok(ReturnJsonResult.GetJsonResult(1, "OK", true)));
        }
Ejemplo n.º 3
0
        public IHttpActionResult DeleteShopCar()
        {
            //int UID = int.Parse(requestHelper.GetRequsetForm("UID", ""));
            string ShopCarID = requestHelper.GetRequsetForm("ShopCarID", "");

            WebApi_BLL.T_User_ShopCar shopCar_bll = new WebApi_BLL.T_User_ShopCar();
            //shopCar_bll.Delete(ShopCarID);
            //List<T_User_ShopCar> shopCarList = shopCar_bll.GetModelList("UID = " + UID);
            DBHelper.ExecuteSql("delete FROM T_User_ShopCar where ShopCarID in (" + ShopCarID + ")");
            return(Ok(ReturnJsonResult.GetJsonResult(1, "OK", true)));
        }
Ejemplo n.º 4
0
        public IHttpActionResult CleanShopCar()
        {
            int UID = int.Parse(requestHelper.GetRequsetForm("UID", ""));

            WebApi_BLL.T_User_ShopCar shopCar_bll = new WebApi_BLL.T_User_ShopCar();

            List <T_User_ShopCar> shopCarList = shopCar_bll.GetModelList("UID = " + UID);

            for (int i = 0; i < shopCarList.Count; i++)
            {
                shopCar_bll.Delete(shopCarList[i].ShopCarID);
            }
            return(Ok(ReturnJsonResult.GetJsonResult(1, "OK", JsonConvert.SerializeObject(shopCarList))));
        }