コード例 #1
0
        /// <summary>
        /// Banner加载数据
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult Create(int?id)
        {
            FloorConfigModel model = new FloorConfigModel();

            if (id.HasValue)
            {
                SearchFloorConfigModel smodel = new SearchFloorConfigModel();
                smodel.FloorConfigId = id.Value;
                smodel.PagedIndex    = 0;
                smodel.PagedSize     = 100;
                //查询列表
                List <FloorConfigModel> List = this._floorConfigService.GetFloorConfigList(smodel).Data;
                string CateIds = string.Empty;

                if (List != null && List.Count > 0)
                {
                    model   = List[0];
                    CateIds = model.CateIdStr; //model.CateIdStr.Split(',');
                }
                ViewData["BannerPlaceCodeModel1"] = null;
                ViewData["BannerPlaceCodeModel1"] = con.GetBannerProducPlaceCodeNameList(ACultureHelper.GetLanguageID, 0, 2);

                ViewBag.CateIds = CateIds;
            }
            return(PartialView(model));
        }
コード例 #2
0
        /// <summary>
        /// 获取楼层配置表
        /// </summary>
        /// <param name="model">model</param>
        /// <returns>楼层配置表</returns>
        public ResultModel GetFloorConfigList(SearchFloorConfigModel model)
        {
            var tb = _database.Db.FloorConfig;

            var where = new SimpleExpression(1, 1, SimpleExpressionType.Equal); //
            if (model.FloorConfigId > 0)
            {
                where = new SimpleExpression(where, tb.FloorConfigId == model.FloorConfigId, SimpleExpressionType.And);
            }
            dynamic cy;


            var query = tb
                        .Query()
                        //.LeftJoin(_database.Db.Category, out cy)
                        //.On(_database.Db.Category.CategoryId == tb.ProductId)
                        .Select(
                tb.FloorConfigId,
                tb.FloorConfigName,
                tb.CateIdStr
                )
                        .Where(where)
                        .OrderByFloorConfigId();

            var result = new ResultModel
            {
                Data = new SimpleDataPagedList <FloorConfigModel>(query,
                                                                  model.PagedIndex, model.PagedSize)
            };

            return(result);
        }
コード例 #3
0
        /// <summary>
        /// 列表
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public JsonResult List(SearchFloorConfigModel model)
        {
            //SearchAC_OperateLogModel logmodel = new SearchAC_OperateLogModel();
            model.PagedIndex = model.PagedIndex == 0 ? 0 : model.PagedIndex;
            model.PagedSize  = model.PagedSize == 0 ? 10 : model.PagedSize;



            //查询列表
            var result = this._floorConfigService.GetFloorConfigList(model);
            List <FloorConfigModel> ds = CateIdStrName(result.Data);
            var data = new
            {
                rows  = ds,
                total = result.Data.TotalCount,
            };

            return(Json(data, JsonRequestBehavior.AllowGet));
        }