/// <summary>
        /// 加载型号列表数据
        /// </summary>
        /// <param name="requestModel"></param>
        /// <returns></returns>
        public async Task <IActionResult> LoadData(PageModel requestModel)
        {
            Expression <Func <SectionBar, bool> > where = w => w.Code != "";
            var data = await sectionBarService.LoadDataAsync(where, requestModel.Page, requestModel.Limit);

            var count = await sectionBarService.CountAsync(where);

            TableDataModel tableDataModel = new TableDataModel()
            {
                count = count,
                data  = Mapper.Map <List <SectionBarDto> >(data)
            };

            return(Content(JsonHelper.ObjectToJSON(tableDataModel)));
        }
Example #2
0
        /// <summary>
        /// 订单列表数据
        /// </summary>
        /// <param name="requestModel"></param>
        /// <returns></returns>
        public async Task <string> LoadData([FromQuery] SalesOrderRequestModel requestModel)
        {
            Expression <Func <SalesOrder, bool> > exp = w => w.BillCode != "";
            var count = await salesOrderService.CountAsync(exp);

            var orders = await salesOrderService.LoadDataAsync(exp, requestModel.Page, requestModel.Limit);

            var            data      = mapper.Map <List <SalesOrderDto> >(orders);
            TableDataModel tableData = new TableDataModel()
            {
                count = count,
                data  = mapper.Map <List <SalesOrderDto> >(orders)
            };

            return(JsonHelper.ObjectToJSON(tableData));
        }
        /// <summary>
        /// 加载客户列表数据
        /// </summary>
        /// <param name="requestModel"></param>
        /// <returns></returns>
        public async Task <IActionResult> LoadData(PageModel requestModel)
        {
            Expression <Func <Customer, bool> > where = w => w.Code != "";
            if (!string.IsNullOrEmpty(requestModel.Key))
            {
                where = w => w.Code.Contains(requestModel.Key) || w.Name.Contains(requestModel.Key);
            }
            var data = await customerService.LoadDataAsync(where, requestModel.Page, requestModel.Limit, w => w.AutoID, false);

            var count = await customerService.CountAsync(where);

            TableDataModel tableDataModel = new TableDataModel()
            {
                count = count,
                data  = Mapper.Map <List <CustomerDto> >(data)
            };

            return(Content(JsonHelper.ObjectToJSON(tableDataModel)));
        }
Example #4
0
        public ActionResult LoadData([FromQuery] PageModel model)
        {
            List <NLogInfo> list       = new List <NLogInfo>();
            int             totalCount = 0;
            Expression <Func <NLogInfo, bool> > whereExpression = null;

            if (!string.IsNullOrWhiteSpace(model.Key))
            {
                whereExpression = a => a.Message.Contains(model.Key);
            }
            list = _nLogInfoServices.QueryPage(ref totalCount, whereExpression, model.Page, model.Limit, "Id Desc");
            var result = new TableDataModel
            {
                count = totalCount,
                data  = list
            };

            return(Json(result));
        }
Example #5
0
        public TableDataModel LoadData(MenuRequestModel model)
        {
            var menus = _dbContext.Menus.ToList();

            if (!string.IsNullOrEmpty(model.Key))
            {
                menus = menus.Where(t => t.Name.Contains(model.Key)).ToList();
            }
            List <MenuDTO> list = new List <MenuDTO>();

            foreach (var menu in menus)
            {
                list.Add(Todto(menu));
            }


            var table = new TableDataModel()
            {
                count = list.Count,
                data  = list
            };

            return(table);
        }
Example #6
0
        public TableDataModel LoadData(UserRequestModel model)
        {
            var users = _dbContext.AdminUsers.Include(t => t.Role).ToList();

            if (!string.IsNullOrEmpty(model.Key))
            {
                users = users.Where(t => t.Name.Contains(model.Key)).ToList();
            }
            List <UserDTO> list = new List <UserDTO>();

            foreach (var user in users)
            {
                list.Add(ToDTO(user));
            }


            var table = new TableDataModel()
            {
                count = list.Count,
                data  = list
            };

            return(table);
        }
Example #7
0
        public TableDataModel LoadData(UnitRequestModel model)
        {
            var units = _dbContext.Units.ToList();

            if (!string.IsNullOrEmpty(model.Key))
            {
                units = units.Where(t => t.Name.Contains(model.Key)).ToList();
            }
            List <UnitDTO> list = new List <UnitDTO>();

            foreach (var unit in units)
            {
                list.Add(ToDto(unit));
            }


            var table = new TableDataModel()
            {
                count = list.Count,
                data  = list
            };

            return(table);
        }
Example #8
0
        public TableDataModel LoadData(RoleRequestModel model)
        {
            var roles = _dbContext.Roles.ToList();

            if (!string.IsNullOrEmpty(model.Key))
            {
                roles = roles.Where(t => t.Name.Contains(model.Key)).ToList();
            }
            List <RoleDTO> list = new List <RoleDTO>();

            foreach (var role in roles)
            {
                list.Add(Todto(role));
            }


            var table = new TableDataModel()
            {
                count = list.Count,
                data  = list
            };

            return(table);
        }
        /// <summary>
        /// 加载列表数据
        /// </summary>
        /// <param name="requestModel"></param>
        /// <returns></returns>
        public IActionResult LoadData([FromQuery] ManagerRequestModel requestModel)
        {
            var table = new TableDataModel();

            return(Json(table));
        }