Пример #1
0
        public ActionResult EditOptionValue(OptionValueManagerVM optionValue)
        {
            Mapper.Initialize(c => c.CreateMap <OptionValueManagerVM, OptionValueManagerDTO>());

            OptionValueManagerDTO optionValueDto = Mapper.Map <OptionValueManagerVM, OptionValueManagerDTO>(optionValue);

            OperationDetails op = _productManagerService.EditOptionValue(optionValueDto);

            return(Json(new { Succedeed = op.Succedeed, message = op.Message, prop = op.Property }));
        }
Пример #2
0
        public ActionResult AddOptionValue(OptionValueManagerVM optionValue)
        {
            Mapper.Initialize(c => c.CreateMap <OptionValueManagerVM, OptionValueManagerDTO>());
            OptionValueManagerDTO optionValueDto = Mapper.Map <OptionValueManagerVM, OptionValueManagerDTO>(optionValue);

            OperationDetails op = _productManagerService.AddOptionValue(optionValueDto);

            List <OptionValueManagerDTO> resultDtos = _productManagerService.GetOptionValuesByOptionId(optionValue.OptionId);

            Mapper.Initialize(c => c.CreateMap <OptionValueManagerDTO, OptionValueManagerVM>());

            List <OptionValueManagerVM> optionValueVMs = Mapper.Map <List <OptionValueManagerDTO>, List <OptionValueManagerVM> >(resultDtos);

            return(PartialView("_AddOptionValue", optionValueVMs));
        }