Exemplo n.º 1
0
        public List <SubdivisionListModel> GetSubdivisionByDepartmentId(int departmentId)
        {
            List <SubdivisionListModel> subdivisionModels = new List <SubdivisionListModel>();
            List <Subdivision>          subdivisions      = RepositoryFactory.SubdivisionRepository.GetSubdivisionByDepartmentId(departmentId);

            foreach (Subdivision subdivision in subdivisions)
            {
                SubdivisionListModel positionModel = new SubdivisionListModel(subdivision);
                subdivisionModels.Add(positionModel);
            }
            return(subdivisionModels);
        }
Exemplo n.º 2
0
        // GET api/Subdivision
        public List <SubdivisionListModel> Get()
        {
            List <SubdivisionListModel> subdivisionModels = new List <SubdivisionListModel>();
            List <Subdivision>          subdivisions      = RepositoryFactory.SubdivisionRepository.GetAllSubdivision();

            foreach (Subdivision subdivision in subdivisions)
            {
                SubdivisionListModel subdivisionModel = new SubdivisionListModel(subdivision);
                subdivisionModels.Add(subdivisionModel);
            }
            return(subdivisionModels);
        }
Exemplo n.º 3
0
        // GET api/Subdivision/1
        public SubdivisionListModel Get(int id)
        {
            Subdivision subdivision = RepositoryFactory.SubdivisionRepository.GetSubdivisionById(id);

            if (subdivision != null)
            {
                SubdivisionListModel subdivisionModel = new SubdivisionListModel(subdivision);
                return(subdivisionModel);
            }
            else
            {
                return(null);
            }
        }