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