コード例 #1
0
 private List<GoodComment> initGoodComentList(List<Model.hp_goodcomment> list)
 {
     List<GoodComment> newlist = new List<GoodComment>();
     for (int i = 0; i < list.Count(); i++)
     {
         GoodComment goodcomment = new GoodComment(list[i]);
         newlist.Add(goodcomment);
     }
     return newlist;
 }
コード例 #2
0
        public GoodComment GetCommentFirst(int goodid)
        {
            GoodComment result = null;
            try
            {
                var model = entity.hp_goodcomment.OrderByDescending(o => o.create_time).First(o => o.goodid == goodid);
                result = new GoodComment(model);
            }
            catch (Exception e)
            {

            }

            return result;
        }
コード例 #3
0
        public HpartyForDetail(Model.hp_goodinfo model)
        {
            var bussinfoModel = entity.hp_businessinfo.First(o => o.countid == model.countid);
            var busscountModel = entity.hp_count.First(o => o.id == model.countid);
            var hpartyModel = entity.hp_hparty.First(o => o.goodid == model.id);

            id = model.id;
            title = model.title;
            images = ImageCut(model.images);
            summary = hpartyModel.summary;
            oldprice = model.oldprice.ToString();
            tel = busscountModel.tel;
            address = model.adddetail;
            lng = model.lng.ToString();
            lat = model.lat.ToString();
            favorite = "0";
            score = "4.5";//评分
            allnum =commentManager.GetNumOfGoodById(model.id).ToString();//总评论人数
            beforebuy = "整个数据库都没有这个字段,林耀鑫就喜欢做梦";
            //最新评论
            comment = commentManager.GetCommentFirst(model.id);
            //价格信息
            pricelist = dateManager.GetDateByGoodInfo(model.id);
        }