Exemple #1
0
 public string ActualizarSucursal(decimal id, TR_sucursal sucursal)
 {
     try
     {
         var resultado = procedimiento.ExisteSucursal(id);
         if (resultado == true)
         {
             procedimiento.ActualizarSucural(id, sucursal);
             return("OK");
         }
         return("El número de la sucursal ya 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 número de la sucursal ingresado ya se encuentra registrado");
     }
     catch (Exception)
     {
         return("Ha ocurrido un error al momento de registrar");
     }
 }
Exemple #2
0
 public string AgregarSucursal(TR_sucursal sucursal)
 {
     try
     {
         procedimiento.AgregarSucursal(sucursal);
         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 numero de sucursal ingresado ya se encuentra registrado");
     }
     catch (Exception)
     {
         return("Ha ocurrido un error al momento de registrar");
     }
 }