コード例 #1
0
 public void Excluir(string Id)
 {
     if (string.IsNullOrEmpty(Id))
     {
         throw new Exception("O id deve ser informado");
     }
     dal.Excluir(Id);
 }
コード例 #2
0
 public ActionResult Excluir(string id, FormCollection form)
 {
     try
     {
         bll.Excluir(id);
         return(RedirectToAction("Index"));
     }
     catch (Exception ex)
     {
         ModelState.AddModelError(string.Empty, ex.Message);
         var cliente = bll.ObterPorId(id);
         return(View(cliente));
     }
 }