Пример #1
0
        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;
            }
        }
Пример #2
0
 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;
     }
 }