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); }
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); }