Beispiel #1
0
        public JsonResult GetGoodsById(int goodsId)
        {
            T_GoodsDAO goodsDao = new T_GoodsDAO();
            T_Goods    goods    = goodsDao.GetById(goodsId);

            if (goods == null)
            {
                goods = new T_Goods();
            }

            return(Json(goods));
        }
Beispiel #2
0
        public JsonResult EditGoods(T_Goods goods)
        {
            T_GoodsDAO dao = new T_GoodsDAO();

            if (dao.GetById(goods.id) == null)
            {
                dao.Add(goods);
            }
            else
            {
                dao.Update(goods);
            }

            return(Json("success"));
        }
Beispiel #3
0
        public ActionResult Show(int goodsId)
        {
            T_CommentDAO dao      = new T_CommentDAO();
            T_GoodsDAO   goodsDao = new T_GoodsDAO();

            List <T_Comment> list  = dao.getByGoodsId(goodsId).ToList();
            T_Goods          goods = goodsDao.GetById(goodsId);

            ViewBag.commentList  = list;
            ViewBag.goods        = goods;
            ViewData["Title"]    = "查看商品";
            ViewData["username"] = HttpContext.Session.GetString("username");

            return(View());
        }