public ProductType AddProductType(Guid storeId, ProductType productType) { _uow.BeginTransaction(); productType.Id = Guid.NewGuid(); productType.StoreId = storeId; var result = _productTypeRepository.Insert(productType); _uow.Commit(); return(result); }
public int AddOrUpdateType(ProductType type) { if (type == null) { throw new ArgumentNullException(nameof(type)); } return(ExecuteFaultHandledOperation(() => { return _report_prod_type.Insert(_prod_es.Map(type)); })); }
public void SubmitProductType(BI_ProductTypeEntity entity, string keyValue) { if (string.IsNullOrWhiteSpace(keyValue)) { entity.F_OrganizeId = OperatorProvider.Provider.GetCurrent().CompanyId; entity.Create(); typeApp.Insert(entity); } else { entity.Modify(keyValue); typeApp.Update(entity); } }
[HttpPost("agregar")] // metodo POST para agregar elementos public IActionResult Insert([FromBody] ProductTypeDto productTypeDto) { var productType = _mapper.Map <ProductType>(productTypeDto); // Mapear dto a entitidad try { productType = _productTypeRepository.Insert(productType); // Guardamos el elemento productTypeDto = _mapper.Map <ProductTypeDto>(productType); // Mapear entitidad a dto return(Ok(productTypeDto)); } catch (AppException ex) // Si ocurre un error... { return(BadRequest(new { message = ex.Message })); // Retornar mensaje de error } }
public void Insert(ProductType item) { _repository.Insert(item); }
public ProductType Insert(ProductType productType) { return(_productTypeRepository.Insert(productType)); }