public ActionResult GetTotal(string keywords, int CommentsStatus = -1) { //Bll要在这里实例化 不要在action外面 避免生成很多废代码 CommentsBll bll = new CommentsBll(); var data = bll.GetTotal(keywords, CommentsStatus, LoginUser.UserBasic.EnterpriseID); return Content(data.ToString()); }
/// <summary> /// 累计评价 /// </summary> /// <param name="goodsID"></param> /// <param name="PageSize"></param> /// <returns></returns> public ActionResult GetFeedback(int goodsID, int ctype = 0, int pageIndex = 1, int pageSize = 10, string EnterpriseID = "") { CommentsBll objCommentsBll = new CommentsBll(); var data = objCommentsBll.GetForGoodsInfo(goodsID, ctype, pageIndex, pageSize, EnterpriseID); //不管有没有都返回 前端去判断是否要重新绘制 return Content(JsonConvert.SerializeObject(data)); }
public ActionResult Edit(int id = 0) { CommentsBll bll = new CommentsBll(); //控制器不要写业务逻辑 只需调用Bll写好的业务方法 //方便以后业务改了就不需要改控制器 var model = bll.GetByID(id, LoginUser.UserBasic.EnterpriseID); return View(model); }
public ActionResult GetDataPager(string keywords, int CommentsStatus = -1, int orderby = -1, int pageIndex = 1, int pageSize = 10) { pageIndex = pageIndex == 0 ? 1 : pageIndex; //Bll要在这里实例化 不要在action外面 避免生成很多废代码 CommentsBll bll = new CommentsBll(); var data = bll.GetPage(keywords, CommentsStatus, orderby, pageIndex, pageSize, LoginUser.UserBasic.EnterpriseID); return Content(JsonConvert.SerializeObject(data)); }
public ActionResult GetTotal(string keywords, int CommentsStatus = -1) { //Bll要在这里实例化 不要在action外面 避免生成很多废代码 CommentsBll bll = new CommentsBll(); var data = bll.GetTotal(keywords, CommentsStatus, LoginUser.UserBasic.EnterpriseID); return(Content(data.ToString())); }
public string Create(Comments Model) { //Bll实例化放action里面 为了不让每次都实例化 产生废代码 CommentsBll bll = new CommentsBll(); //控制器里直接返回Bll里的返回结果 不写任何逻辑代码 //保存的企业ID从登录信息里面取 所以必须要在这里赋值 因为登录信息是在BaseController里的 Model.EnterpriseID = LoginUser.UserBasic.EnterpriseID; return bll.AddOrUpdate(Model); }
public ActionResult Edit(int id = 0) { CommentsBll bll = new CommentsBll(); //控制器不要写业务逻辑 只需调用Bll写好的业务方法 //方便以后业务改了就不需要改控制器 var model = bll.GetByID(id, LoginUser.UserBasic.EnterpriseID); return(View(model)); }
public ActionResult GetDataPager(string keywords, int CommentsStatus = -1, int orderby = -1, int pageIndex = 1, int pageSize = 10) { pageIndex = pageIndex == 0 ? 1 : pageIndex; //Bll要在这里实例化 不要在action外面 避免生成很多废代码 CommentsBll bll = new CommentsBll(); var data = bll.GetPage(keywords, CommentsStatus, orderby, pageIndex, pageSize, LoginUser.UserBasic.EnterpriseID); return(Content(JsonConvert.SerializeObject(data))); }
public ActionResult Shield(int id) { //返回结果用标准的ReturnData ReturnData <string> returnData = new ReturnData <string>(); //Bll要在这里实例化 不要在action外面 避免生成很多废代码 CommentsBll bll = new CommentsBll(); return(Content(bll.UpdateStatus(id, LoginUser.UserBasic.EnterpriseID))); }
public string Create(Comments Model) { //Bll实例化放action里面 为了不让每次都实例化 产生废代码 CommentsBll bll = new CommentsBll(); //控制器里直接返回Bll里的返回结果 不写任何逻辑代码 //保存的企业ID从登录信息里面取 所以必须要在这里赋值 因为登录信息是在BaseController里的 Model.EnterpriseID = LoginUser.UserBasic.EnterpriseID; return(bll.AddOrUpdate(Model)); }
public ActionResult Edit(Comments Model) { //Bll要在这里实例化 不要在action外面 避免生成很多废代码 CommentsBll bll = new CommentsBll(); //当前的企业信息是保存在登录Userlid //赋值当前的企业ID Model.EnterpriseID = LoginUser.UserBasic.EnterpriseID; return(Content(bll.AddOrUpdate(Model))); }
// 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); }
public ActionResult Edit(Comments Model) { //Bll要在这里实例化 不要在action外面 避免生成很多废代码 CommentsBll bll = new CommentsBll(); //当前的企业信息是保存在登录Userlid //赋值当前的企业ID Model.EnterpriseID = LoginUser.UserBasic.EnterpriseID; return Content(bll.AddOrUpdate(Model)); }
public ActionResult Shield(int id) { //返回结果用标准的ReturnData ReturnData<string> returnData = new ReturnData<string>(); //Bll要在这里实例化 不要在action外面 避免生成很多废代码 CommentsBll bll = new CommentsBll(); return Content(bll.UpdateStatus(id, LoginUser.UserBasic.EnterpriseID)); }