Пример #1
0
        public IActionResult Create()
        {
            var boxesType = _boxApplicationService.GetAllBoxesType()
                            .Select(boxType => new SelectListItem
            {
                Value = boxType.DT_RowId,
                Text  = $"{boxType.Name} - {boxType.Description}"
            }).ToList();

            ViewData["BoxesType"] = boxesType;

            var products = _productApplicationService.GetAll()
                           .Select(prod => new SelectListItem
            {
                Value = prod.DT_RowId,
                Text  = $"{prod.Name} - {prod.Description} - {prod.Package} - {prod.Capacity}{prod.UnitMeasure}"
            }).ToList();

            ViewData["Products"] = products;

            var boxes = _boxApplicationService.GetBoxesParentsWithBoxTypeEndProduct()
                        .Select(box => new SelectListItem
            {
                Value = box.DT_RowId,
                Text  = $"{box.BoxBarcode.BarcodeEAN13} {box.Description}"
            }).ToList();

            ViewData["Boxes"] = boxes;

            return(View());
        }
Пример #2
0
        public ActionResult AjaxHandlerGet()
        {
            var productVMs = _productAppService.GetAll();

            return(Json(new
            {
                aaData = productVMs,
                success = true
            }));
        }
Пример #3
0
        public IActionResult BoxCreate()
        {
            var boxesType = _boxAppService.GetAllBoxesType()
                            .Select(boxType => new SelectListItem
            {
                Value = boxType.DT_RowId,
                Text  = $"{boxType.Name} - {boxType.Description}"
            }).ToList();

            ViewData["BoxesType"] = boxesType;

            var clients = _clientService.GetAll()
                          .Select(client => new SelectListItem
            {
                Value = client.DT_RowId,
                Text  = client.Name
            }).ToList();

            ViewData["Clients"] = clients;


            var products = _productApplicationService.GetAll()
                           .Select(prod => new SelectListItem
            {
                Value = prod.DT_RowId,
                Text  = $"{prod.Name} - {prod.Description} - {prod.Package} - {prod.Capacity}{prod.UnitMeasure}"
            }).ToList();

            ViewData["Products"] = products;
            return(View());
        }
Пример #4
0
        public IEnumerable <ProductVM> GetProdutsItems()
        {
            var prod = _productApplicationService.GetAll();

            IList <ProductVM> productVMs = _mapper.Map <List <ProductVM> >(prod);

            return(productVMs);
        }
Пример #5
0
        public void LoadViewDataProducts(IProductApplicationService productAppService)
        {
            var products = productAppService.GetAll()
                           .Select(prod => new SelectListItem
            {
                Value = prod.DT_RowId,
                Text  = $"{prod.Name} - {prod.Description} - {prod.Package} - {prod.Capacity}{prod.UnitMeasure}"
            }).ToList();

            ViewData["Products"] = products;
        }
Пример #6
0
 public IActionResult GetAll()
 {
     return(Ok(_productApplicationService.GetAll()));
 }
Пример #7
0
 public IActionResult GetAll(int page = 1, int pageSize = 10, string sortBy = "product_id", string sortDirection = "asc")
 {
     _logger.LogInformation("Product GetAll!");
     return(Ok(_productApplicationService.GetAll(page, pageSize, sortBy, sortDirection)));
 }
Пример #8
0
 public ActionResult <IEnumerable <string> > Get()
 {
     return(Ok(_applicationService.GetAll()));
 }