Пример #1
0
        public ActionResult Create(Guid productID)
        {
            var productVM = _productAppService.GetById(productID);

            var optionsBoxMassUnit = CtrlBoxUnits.CtrlBoxMassUnit
                                     .Select(unit => new SelectListItem
            {
                Value = unit,
                Text  = unit
            }).ToList();

            ViewData["OptionsBoxMassUnit"] = optionsBoxMassUnit;

            var optionsBoxVolumeUnit = CtrlBoxUnits.CtrlBoxVolumeUnit
                                       .Select(unit => new SelectListItem
            {
                Value = unit,
                Text  = unit
            }).ToList();

            ViewData["OptionsBoxVolumeUnit"] = optionsBoxVolumeUnit;

            var optionsBoxUnitType = CtrlBoxUnits.CtrlBoxUnitType
                                     .Select(unit => new SelectListItem
            {
                Value = unit,
                Text  = unit
            }).ToList();

            ViewData["OptionsBoxUnitType"] = optionsBoxUnitType;

            return(View(productVM));
        }
Пример #2
0
        public ProductVM GetProdutsItems(Guid id)
        {
            var prod = _productApplicationService.GetById(id);

            ProductVM productVM = _mapper.Map <ProductVM>(prod);

            return(productVM);
        }
Пример #3
0
 public ActionResult <string> Get(int id)
 {
     return(Ok(_applicationService.GetById(id)));
 }