예제 #1
0
        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);
            }
        }
예제 #2
0
        public BusinessSectorDTO GetSector(int id)
        {
            BusinessSector sector = sectorRepository.GetById(id);

            if (sector != null)
            {
                return(sector.getDTO());
            }
            else
            {
                return(null);
            }
        }