public List <TipoGarantia> TodosTiposGarantia() { try { TipoGarantiaRepositorio tgr = new TipoGarantiaRepositorio(); List <TipoGarantia> tg = tgr.Todos(); if (tg == null) { throw new Exception("Nenhum tipo garantia Selecionado"); } return(tg); } catch (Exception e) { throw e; } }
public TipoGarantia NovoTipoGarantia(TipoGarantia tg) { try { if (tg.Descricao == null) { throw new Exception("Ops! Preencha o campo tipo garantia"); } else { TipoGarantiaRepositorio tgr = new TipoGarantiaRepositorio(); tgr.Insert(tg); return(tg); } } catch (Exception e) { throw e; } }