Esempio n. 1
0
        public ICabecalhoRodape ObterEnderecoSetor(ICabecalhoRodape cabecalhoRodape, int setorId)
        {
            CabecalhoRodapeDa da  = new CabecalhoRodapeDa();
            SetorEndereco     end = da.ObterEndSetor(setorId);

            cabecalhoRodape = FormatarEndereco(cabecalhoRodape, end);

            cabecalhoRodape.SetorNome = _configFunc.Obter <List <Setor> >(ConfiguracaoFuncionario.KeySetores).Single(x => x.Id == setorId).Nome;

            return(cabecalhoRodape);
        }
Esempio n. 2
0
        public ICabecalhoRodape ObterEnderecoFuncLogado(ICabecalhoRodape cabecalhoRodape)
        {
            CabecalhoRodapeDa da = new CabecalhoRodapeDa();

            if ((HttpContext.Current.User.Identity as EtramiteIdentity) == null ||
                (HttpContext.Current.User.Identity as EtramiteIdentity).FuncionarioId <= 0 ||
                (HttpContext.Current.User.Identity as EtramiteIdentity).ExecutorTipo != (int)eExecutorTipo.Interno)
            {
                return(cabecalhoRodape);
            }

            int setorId = da.ObterFuncSetor((HttpContext.Current.User.Identity as EtramiteIdentity).FuncionarioId);

            SetorEndereco end = da.ObterEndSetor(setorId);

            cabecalhoRodape = FormatarEndereco(cabecalhoRodape, end);

            var setor = _configFunc.Obter <List <Setor> >(ConfiguracaoFuncionario.KeySetores).SingleOrDefault(x => x.Id == setorId);

            setor = setor ?? new Setor();
            cabecalhoRodape.SetorNome = setor.Nome;

            return(cabecalhoRodape);
        }