Пример #1
0
 public string ActualizarCliente(string id, TR_cliente cliente)
 {
     try
     {
         var resultado = procedimiento.ExisteCliente(id);
         if (resultado == true)
         {
             procedimiento.ActualizarCliente(cliente);
             return("OK");
         }
         return("El run ingresado no se encuentra registrado");
     }
     catch (NullReferenceException)
     {
         return("Todos los campos deben estar completos");
     }
     catch (InvalidCastException)
     {
         return("El tipo de formato enviado no corresponde");
     }
     catch (DbUpdateException)
     {
         return("El run ingresado ya se encuentra registrado");
     }
     catch (Exception)
     {
         return("Ha ocurrido un error al momento de registrar");
     }
 }
Пример #2
0
 public string AgregarCliente(TR_cliente cliente)
 {
     try
     {
         procedimiento.AgregarCliente(cliente);
         return("OK");
     }
     catch (NullReferenceException)
     {
         return("Todos los campos deben estar completos");
     }
     catch (InvalidCastException)
     {
         return("El tipo de formato enviado no corresponde");
     }
     catch (DbUpdateException)
     {
         return("El run ingresado ya se encuentra registrado");
     }
     catch (Exception)
     {
         return("Ha ocurrido un error al momento de registrar");
     }
 }