Пример #1
0
 public string ActualizarTour(decimal id, TR_tour tour)
 {
     try
     {
         var resultado = procedimiento.ExisteTour(id);
         if (resultado == true)
         {
             procedimiento.ActualizarTour(id, tour);
         }
         return("El código ingresado no arrojó resultado");
     }
     catch (NullReferenceException)
     {
         return("Todos los campos deben estar completos");
     }
     catch (InvalidCastException)
     {
         return("El tipo de formato enviado no corresponde");
     }
     catch (DbUpdateException)
     {
         return("El código del tour ingresado ya se encuentra registrado");
     }
     catch (Exception)
     {
         return("Ha ocurrido un error al momento de registrar");
     }
 }
Пример #2
0
 public string AgregarTour(TR_tour tour)
 {
     try
     {
         procedimiento.AgregarTour(tour);
         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 código del tour ingresado ya se encuentra registrado");
     }
     catch (Exception)
     {
         return("Ha ocurrido un error al momento de registrar");
     }
 }