Exemplo n.º 1
0
 public ActionResult Create(ReturnVisit Model)
 {
     //Bll要在这里实例化 不要在action外面 避免生成很多废代码
     ReturnVisitBll bll = new ReturnVisitBll();
     Model.EnterpriseID = LoginUser.UserBasic.EnterpriseID;
     return Content(bll.AddOrUpdateReturnVisit(Model));
 }
Exemplo n.º 2
0
        public ActionResult Delete(int id)
        {
            //Bll要在这里实例化 不要在action外面 避免生成很多废代码
            ReturnVisitBll bll = new ReturnVisitBll();

            return(Content(bll.Delete(id, LoginUser.UserBasic.EnterpriseID)));
        }
Exemplo n.º 3
0
        public ActionResult Create(ReturnVisit Model)
        {
            //Bll要在这里实例化 不要在action外面 避免生成很多废代码
            ReturnVisitBll bll = new ReturnVisitBll();

            Model.EnterpriseID = LoginUser.UserBasic.EnterpriseID;
            return(Content(bll.AddOrUpdateReturnVisit(Model)));
        }
Exemplo n.º 4
0
 public ActionResult GetDataPager(string keywords, int orderby = -1, int pageIndex = 1, int pageSize = 10)
 {
     pageIndex = pageIndex == 0 ? 1 : pageIndex;
     //Bll要在这里实例化 不要在action外面 避免生成很多废代码
     ReturnVisitBll bll = new ReturnVisitBll();
     var data = bll.GetPage(keywords, orderby, pageIndex, pageSize, LoginUser.UserBasic.EnterpriseID);
     return Content(JsonConvert.SerializeObject(data));
 }
Exemplo n.º 5
0
 public ActionResult GetTotal(string keywords)
 {
     //Bll要在这里实例化 不要在action外面 避免生成很多废代码
     ReturnVisitBll bll = new ReturnVisitBll();
     var data = bll.GetQueryCount(whereExp: x => (string.IsNullOrWhiteSpace(keywords)
         || (x.GoodsName.Contains(keywords) || x.Consumer.Contains(keywords))) && x.EnterpriseID == LoginUser.UserBasic.EnterpriseID);
     return Content(data.ToString());
 }
Exemplo n.º 6
0
        public ActionResult GetDataPager(string keywords, int orderby = -1, int pageIndex = 1, int pageSize = 10)
        {
            pageIndex = pageIndex == 0 ? 1 : pageIndex;
            //Bll要在这里实例化 不要在action外面 避免生成很多废代码
            ReturnVisitBll bll  = new ReturnVisitBll();
            var            data = bll.GetPage(keywords, orderby, pageIndex, pageSize, LoginUser.UserBasic.EnterpriseID);

            return(Content(JsonConvert.SerializeObject(data)));
        }
Exemplo n.º 7
0
        public ActionResult GetTotal(string keywords)
        {
            //Bll要在这里实例化 不要在action外面 避免生成很多废代码
            ReturnVisitBll bll  = new ReturnVisitBll();
            var            data = bll.GetQueryCount(whereExp: x => (string.IsNullOrWhiteSpace(keywords) ||
                                                                    (x.GoodsName.Contains(keywords) || x.Consumer.Contains(keywords))) && x.EnterpriseID == LoginUser.UserBasic.EnterpriseID);

            return(Content(data.ToString()));
        }
Exemplo n.º 8
0
 public ActionResult Edit(int id = 0)
 {
     ReturnVisitBll bll = new ReturnVisitBll();
     //控制器不要写业务逻辑 只需调用Bll写好的业务方法 
     //方便以后业务改了就不需要改控制器
     //查询数据时必须要带企业ID的参数
     var model = bll.GetByID(id, LoginUser.UserBasic.EnterpriseID);
     ViewBag.VistType = new SelectList(new SelectLists().GetVistType(), "Value", "Text", model.VistType);
     VistJoinGoodsBll objVistJoinGoodsBll = new VistJoinGoodsBll();
     ViewBag.VistJoinGoods = objVistJoinGoodsBll.GetListByReturnVisitID(id);
     return View(model);
 }
Exemplo n.º 9
0
        public ActionResult Edit(int id = 0)
        {
            ReturnVisitBll bll = new ReturnVisitBll();
            //控制器不要写业务逻辑 只需调用Bll写好的业务方法
            //方便以后业务改了就不需要改控制器
            //查询数据时必须要带企业ID的参数
            var model = bll.GetByID(id, LoginUser.UserBasic.EnterpriseID);

            ViewBag.VistType = new SelectList(new SelectLists().GetVistType(), "Value", "Text", model.VistType);
            VistJoinGoodsBll objVistJoinGoodsBll = new VistJoinGoodsBll();

            ViewBag.VistJoinGoods = objVistJoinGoodsBll.GetListByReturnVisitID(id);
            return(View(model));
        }
Exemplo n.º 10
0
        // 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);
        }
Exemplo n.º 11
0
 public ActionResult Delete(int id)
 {
     //Bll要在这里实例化 不要在action外面 避免生成很多废代码
     ReturnVisitBll bll = new ReturnVisitBll();
     return Content(bll.Delete(id, LoginUser.UserBasic.EnterpriseID));
 }