// GET: GoodsInfo public ActionResult Index(int id = 0) { GoodsBasicBll bll = new GoodsBasicBll(); int gcPid = 0; var goods = bll.GetModelByGBid(id,out gcPid); //累计评价总数 要正常状态的 要对应商品企业的 CommentsBll objCommentsBll = new CommentsBll(); ViewBag.FeedbackNum = objCommentsBll.GetQueryCount(x => x.GoodsBasicID == id && x.Status == 0 && x.EnterpriseID == goods.EnterpriseID); //老客户回访总数 要对应商品企业的 ReturnVisitBll objReturnVisitBll = new ReturnVisitBll(); ViewBag.ReturnVisitNum = objReturnVisitBll.GetCountForGoodsInfo(id, goods.EnterpriseID); //销售卖点总数 要对应商品企业的 SPJoinGBBll objSPJoinGBBll = new SPJoinGBBll(); ViewBag.SellPointNum = objSPJoinGBBll.GetCountForGoodsInfo(id, goods.EnterpriseID); return View(goods); }
/// <summary> /// 添加/编辑卖点 /// </summary> /// <param name="id">商品id</param> /// <returns></returns> public ActionResult Operate(long id = 0) { SellPoint list = new SellPoint(); ViewBag.sg = new List<Hashtable>(); if (id > 0) { SellPointBll bll = new SellPointBll(); list=bll.GetObjectById(w => w.ID == id && w.EnterpriseID==LoginUser.UserBasic.EnterpriseID); if (list == null) { Response.Redirect("/Login/Index"); return Content("此销售卖点不存在"); } SPJoinGBBll sg = new SPJoinGBBll(); ViewBag.sg = sg.GetSGList(id); } return View(list); }
/// <summary> /// 添加/编辑卖点 /// </summary> /// <param name="id">商品id</param> /// <returns></returns> public ActionResult Operate(long id = 0) { SellPoint list = new SellPoint(); ViewBag.sg = new List <Hashtable>(); if (id > 0) { SellPointBll bll = new SellPointBll(); list = bll.GetObjectById(w => w.ID == id && w.EnterpriseID == LoginUser.UserBasic.EnterpriseID); if (list == null) { Response.Redirect("/Login/Index"); return(Content("此销售卖点不存在")); } SPJoinGBBll sg = new SPJoinGBBll(); ViewBag.sg = sg.GetSGList(id); } return(View(list)); }
/// <summary> /// 销售卖点 /// 如果显示全部要显示当前商品的企业的销售卖点 /// </summary> /// <param name="goodsID"></param> /// <param name="pageIndex"></param> /// <returns></returns> public ActionResult GetSellPoint(int goodsID = 0, int pageIndex = 1, int pageSize = 10, string EnterpriseID = "") { SPJoinGBBll objSPJoinGBBll = new SPJoinGBBll(); //不管有没有都返回 前端去判断是否要重新绘制 return Content(JsonConvert.SerializeObject(objSPJoinGBBll.GetForGoodsInfo(goodsID, pageIndex, pageSize, EnterpriseID))); }