示例#1
0
        //多个删除
        public void DelLikes()
        {
            string aa    = "取消收藏失败";
            string code  = Request["codes"];
            int    cusid = Convert.ToInt32(Session["cusId"]);
            var    codes = code.Split(';');
            var    cc    = 0;

            foreach (var i in codes)
            {
                var cod = i;
                if (cod == "")
                {
                    break;
                }
                if (cod.Length == 13)
                {
                    cod = "0" + cod;
                }
                var like = CusPodService.GetEntity(n => n.CusId == cusid && n.ProCode == cod);
                if (CusPodService.Remov(like))
                {
                    cc++;
                }
            }
            if (cc == codes.Length - 1)
            {
                aa = "删除成功";
            }
            Response.ContentType = "text/plain";
            Response.Write(aa);
            Response.End();
        }
示例#2
0
        //单个删除
        public void DelLike()
        {
            string code  = Request["codes"];
            int    cusid = Convert.ToInt32(Session["cusId"]);

            if (code.Length == 13)
            {
                code = "0" + code;
            }
            string aa   = "取消收藏失败";
            var    like = CusPodService.GetEntity(n => n.CusId == cusid && n.ProCode == code);

            if (CusPodService.Remov(like))
            {
                aa = "取消收藏成功";
            }
            Response.ContentType = "text/plain";
            Response.Write(aa);
            Response.End();
        }