Ejemplo n.º 1
0
        public ActionResult GetArticleRecommend(string entId, string userId, int count, int type)
        {
            if (string.IsNullOrEmpty(entId))
            {
                entId = BaseConfiguration.EntId;
            }
            ///获取用户信息
            UserInfoDal     dal  = new UserInfoDal();
            List <UserInfo> user = new List <UserInfo>();

            if (!string.IsNullOrEmpty(userId))
            {
                user = dal.GetUserInfo(userId, entId);
            }
            string jgjb = "", clientlimit = "", KhType = "";
            bool   staleDated = false;

            //获取客户价格级别
            if (user.Count > 0)
            {
                entId       = user[0].EntId;
                jgjb        = user[0].Pricelevel;
                clientlimit = user[0].ClientLimit;
                KhType      = user[0].KhType;
                staleDated  = user[0].StaleDated;
            }
            GoodsInfoDal goodsInfoDal = new GoodsInfoDal();
            DataTable    dt           = goodsInfoDal.GetGetArticleRecommend(entId, jgjb, KhType, count, type);

            JsonSerializerSettings setting = new JsonSerializerSettings()
            {
                ReferenceLoopHandling = ReferenceLoopHandling.Ignore
            };

            var data = JsonConvert.SerializeObject(dt, setting);

            return(Json(data));
        }