Example #1
0
        public ActionResult Index(PageInfo pageInfo, WarehouseListModel model)
        {
            IPagedList <Warehouse> WarehouseList = _warehouseService.GetList(model.Name, pageInfo.PageIndex, pageInfo.PageSize, pageInfo.sortExpression);

            model.Warehouse = WarehouseList.MapTo <IList <Warehouse>, IList <WarehouseModel> >();

            var results = new DataTable <WarehouseModel>()
            {
                Draw            = pageInfo.Draw + 1,
                RecordsTotal    = WarehouseList.TotalCount,
                RecordsFiltered = WarehouseList.TotalCount,
                Data            = model.Warehouse
            };

            return(Json(new PlainJsonResponse(results)));
        }
        /// <summary>
        /// Prepare paged warehouse list model
        /// </summary>
        /// <param name="searchModel">Warehouse search model</param>
        /// <returns>Warehouse list model</returns>
        public virtual WarehouseListModel PrepareWarehouseListModel(WarehouseSearchModel searchModel)
        {
            if (searchModel == null)
            {
                throw new ArgumentNullException(nameof(searchModel));
            }

            //get warehouses
            var warehouses = _shippingService.GetAllWarehouses().ToPagedList(searchModel);

            //prepare list model
            var model = new WarehouseListModel().PrepareToGrid(searchModel, warehouses, () =>
            {
                //fill in model values from the entity
                return(warehouses.Select(warehouse => warehouse.ToModel <WarehouseModel>()));
            });

            return(model);
        }
Example #3
0
        /// <summary>
        /// Prepare paged warehouse list model
        /// </summary>
        /// <param name="searchModel">Warehouse search model</param>
        /// <returns>Warehouse list model</returns>
        public virtual WarehouseListModel PrepareWarehouseListModel(WarehouseSearchModel searchModel)
        {
            if (searchModel == null)
            {
                throw new ArgumentNullException(nameof(searchModel));
            }

            //get warehouses
            var warehouses = _shippingService.GetAllWarehouses();

            //prepare list model
            var model = new WarehouseListModel
            {
                //fill in model values from the entity
                Data  = warehouses.PaginationByRequestModel(searchModel).Select(warehouse => warehouse.ToModel <WarehouseModel>()),
                Total = warehouses.Count
            };

            return(model);
        }
Example #4
0
        public ActionResult Index()
        {
            WarehouseListModel model = new WarehouseListModel();

            return(View(model));
        }
 public ActionResult Index(WarehouseListModel model)
 {
     model.SOBId = SessionHelper.SOBId;
     return(View(model));
 }