public void Excluir(string Id) { if (string.IsNullOrEmpty(Id)) { throw new Exception("O id deve ser informado"); } dal.Excluir(Id); }
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)); } }