public void SalvarPerfilCargo(TPerfilVO tperfilvo) { try { if (ValidarPerfilCargo(tperfilvo).Count > 0) { throw new CABTECException("Este Cargo já esta relacionado a um Perfil."); } if (tperfilvo.IDPerfilCargo > 0) { TPerfilBLL.AlterarPerfilCargo(tperfilvo); } else { TPerfilBLL.InserirPerfilCargo(tperfilvo); } TUsuarioBLL.AlterarPerfilCargo(tperfilvo.NomeCargo, tperfilvo.IDPerfil); } catch (CABTECException ex) { throw new CABTECException(ex.Message); } catch (Exception) { throw new CABTECException("Erro ao Salvar Perfil - Cargo."); } }
public void ExcluirPerfilCargo(int IDPerfilCargo) { try { TPerfilBLL.ExcluirPerfilCargo(IDPerfilCargo); } catch (CABTECException) { throw new CABTECException("Erro ao Excluir Perfil."); } catch (Exception) { throw new CABTECException("Erro ao Excluir Perfil."); } }
public List <TPerfilVO> ValidarPerfilCargo(TPerfilVO filtro) { try { return(TPerfilBLL.ValidarPerfilCargo(filtro).ToList()); } catch (CABTECException) { throw new CABTECException("Erro ao Validar Perfil - Cargo."); } catch (Exception) { throw new CABTECException("Erro ao Validar Perfil - Cargo."); } }
public void Salvar(TPerfilVO tperfilvo) { try { if (tperfilvo.IDPerfil > 0) { TPerfilBLL.Alterar(tperfilvo); } else { TPerfilBLL.Inserir(tperfilvo); } } catch (CABTECException) { throw new CABTECException("Erro ao Salvar Perfil."); } catch (Exception) { throw new CABTECException("Erro ao Salvar Perfil."); } }
public List <TPerfilVO> Listar(TPerfilVO filtro) { try { if (filtro.IDPerfil > 0) { List <TPerfilVO> listaRetorno = new List <TPerfilVO>(); listaRetorno.Add(TPerfilBLL.Obter(filtro.IDPerfil)); return(listaRetorno); } else { return(TPerfilBLL.Listar(filtro).ToList()); } } catch (CABTECException) { throw new CABTECException("Erro ao Listar Perfil."); } catch (Exception) { throw new CABTECException("Erro ao Listar Perfil."); } }