コード例 #1
0
        public void Deletar()
        {
            Compra i = CompraDao.BuscarPorId(CompraDao.getLastId());

            Assert.IsTrue(CompraDao.Excluir(CompraDao.getLastId()));

            // Assert.IsTrue(InstituicaoDAO.Excluir(i));
        }
コード例 #2
0
 public ActionResult Delete(int id, FormCollection collection)
 {
     try
     {
         if (CompraDao.Excluir(id))
         {
             return(RedirectToAction("Index"));
         }
         else
         {
             return(View(CompraDao.BuscarPorId(id)));
         }
     }
     catch
     {
         return(View(CompraDao.BuscarPorId(id)));
     }
 }