public void UpdateProductSiteMapping(ProductSiteMappingDTO productSiteMappingDTO) { ProductSiteMapping productSiteMapping = new ProductSiteMapping(); ProductSiteMappingConvertor.ConvertToProductSiteMappingEntity(ref productSiteMapping, productSiteMappingDTO, true); unitOfWork.ProductSiteMappingRepository.Update(productSiteMapping); }
public void AddProductSiteMapping(ProductSiteMappingDTO productSiteMappingDTO) { ProductSiteMapping productSiteMapping = new ProductSiteMapping(); ProductSiteMappingConvertor.ConvertToProductSiteMappingEntity(ref productSiteMapping, productSiteMappingDTO, false); unitOfWork.ProductSiteMappingRepository.Add(productSiteMapping); }
public void Update(ProductSiteMapping productSiteMapping) { if (productSiteMapping != null) { _repository.Entry <Sql.ProductSiteMapping>(productSiteMapping).State = System.Data.Entity.EntityState.Modified; // _repository.SaveChanges(); } }
public void Add(ProductSiteMapping productSiteMapping) { if (productSiteMapping != null) { _repository.ProductSiteMappings.Add(productSiteMapping); // _repository.SaveChanges(); } }
public ProductSiteMapping GetById(int productSiteMappingId) { ProductSiteMapping site = new ProductSiteMapping(); site = _repository.ProductSiteMappings.FirstOrDefault(x => x.SiteId == productSiteMappingId); return(site); }
public static void ConvertToProductSiteMappingEntity(ref ProductSiteMapping productSiteMapping, ProductSiteMappingDTO productSiteMappingDTO, bool isUpdate) { if (isUpdate) { productSiteMapping.ProductMappingId = productSiteMappingDTO.ProductMappingId; } productSiteMapping.SiteId = productSiteMappingDTO.SiteId; productSiteMapping.ItemId = productSiteMappingDTO.ItemId; productSiteMapping.ProductId = productSiteMappingDTO.ProductId; }
public static ProductSiteMappingDTO ConvertToProductSiteMappingDto(ProductSiteMapping productSiteMapping) { ProductSiteMappingDTO productSiteMappingDTO = new ProductSiteMappingDTO(); productSiteMappingDTO.ProductMappingId = productSiteMapping.ProductMappingId; productSiteMappingDTO.SiteId = productSiteMapping.SiteId; productSiteMappingDTO.ItemId = productSiteMapping.ItemId; productSiteMappingDTO.ProductId = productSiteMapping.ProductId; return(productSiteMappingDTO); }