public BusinessSectorDTO SaveSector(BusinessSectorDTO sector) { if (sector == null) { return(null); } BusinessSector savedSector = null; if (sector.Id.HasValue) { savedSector = sectorRepository.Update(BusinessSector.Hydrate(sector)); } else { savedSector = sectorRepository.Insert(BusinessSector.Hydrate(sector)); } if (savedSector != null) { return(savedSector.getDTO()); } else { return(null); } }
public BusinessSectorDTO GetSector(int id) { BusinessSector sector = sectorRepository.GetById(id); if (sector != null) { return(sector.getDTO()); } else { return(null); } }