public async Task <ActionResult> Modify(int _subgroupId, [FromBody] ProductSubgroupModel _model)
        {
            string link = URI_API.PRODUCT_SUBGROUP_MODIFY.Replace("{id}", $"{_subgroupId}");
            ResponseConsult <bool> response = await PutAsJsonAsync <bool>(link, _model);

            return(Ok(response));
        }
        public async Task <ActionResult> Add([FromBody] ProductSubgroupModel _model)
        {
            string link = URI_API.PRODUCT_SUBGROUP_ADD;
            ResponseConsult <int> response = await PostAsJsonAsync <int>(link, _model);

            return(Ok(response));
        }
        public async Task <bool> Modify(int _id, ProductSubgroupModel _model)
        {
            ProductSubgroup entity = await svcProductSubgroup.GetDetail(_id);

            if (entity == null)
            {
                return(false);
            }
            entity = iMapper.Map(_model, entity);
            return(await svcProductSubgroup.Modify(entity));
        }
        public async Task <int> Add(ProductSubgroupModel _model)
        {
            ProductSubgroup entity = iMapper.Map <ProductSubgroup>(_model);

            return(await svcProductSubgroup.Add(entity));
        }
Esempio n. 5
0
        public async Task <IActionResult> Modify(int _id, [FromBody] ProductSubgroupModel _model)
        {
            var result = await busProductSubgroup.Modify(_id, _model);

            return(Ok(context.WrapResponse(result)));
        }
Esempio n. 6
0
        public async Task <IActionResult> Add([FromBody] ProductSubgroupModel _model)
        {
            var result = await busProductSubgroup.Add(_model);

            return(Ok(context.WrapResponse(result)));
        }