Exemplo n.º 1
0
        public async Task <RetornoInfoPerfilDTO> GetProfileEmployeeInformation(string codeRF, string codeOccupations, string schoolYear, Guid?Perfil, string roleName = null)
        {
            try
            {
                var endPoint   = new EndpointsAPI();
                var profileApi = new PerfilSgpAPI(endPoint);
                var parseado   = int.TryParse(codeOccupations, out int result);

                var profileInformation = new RetornoInfoPerfilDTO();

                // Para coordenador pedagógico, assitente de diretor, diretor busca a abrangência no SGP
                if (!string.IsNullOrWhiteSpace(roleName) && (roleName.Equals("CP") || roleName.Equals("AD") || roleName.Equals("Diretor")))
                {
                    profileInformation = await ObterAbrangencia(codeRF, null, profileInformation);
                }
                else
                {
                    profileInformation = await profileApi
                                         .getInformacoesPerfil(codeRF, parseado?result : 0, int.Parse(schoolYear), _token, Perfil);
                }

                if (profileInformation != null)
                {
                    return(profileInformation);
                }
                else
                {
                    return(null);
                }
            }
            catch (System.Exception ex)
            {
                return(null);
            }
        }
Exemplo n.º 2
0
        public async Task <RetornoInfoPerfilDTO> GetProfileEmployeeInformation(string codeRF, string codeOccupations, string schoolYear)
        {
            try
            {
                var endPoint           = new EndpointsAPI();
                var profileApi         = new PerfilSgpAPI(endPoint);
                var profileInformation = await profileApi.getInformacoesPerfil(codeRF, int.Parse(codeOccupations), int.Parse(schoolYear), _token);

                if (profileInformation != null)
                {
                    return(profileInformation);
                }

                else
                {
                    return(null);
                }
            }
            catch (System.Exception ex)
            {
                return(null);
            }
        }