/// <summary> /// Constructor por defecto /// </summary> public ActivitiesManagerProvider() { this.ListaExcepciones = new List <Exception>(); try { Byte Pasos = 0; // Inicializa una conexion: if (this.Conexion == null) { this.Conexion = BasesDeDatos.Connect("ActivitiesManagerDataBase"); Pasos += 1; } // Iniciliza una transaccion: if (this.Transaccion == null && this.Conexion != null) { this.Transaccion = Conexion.BeginTransaction(); Pasos += 2; } if (Pasos == 3) { Comandos = new Comandos(Transaccion); } } catch (Exception ex) { ListaExcepciones.Add(ex); throw new Exception("No se logró establecer la conexión con la base de datos.", ex); } }
/// <summary> /// Constructor por defecto /// </summary> public CGC_GM_Contexto() { this.ListaExcepciones = new List <Exception>(); try { Byte Pasos = 0; // Inicializa una conexion: if (this.Conexion == null) { this.Conexion = BaseDeDatos.Conectar_CGC_GM(); Pasos += 1; } // Iniciliza una transaccion: if (this.Transaccion == null && this.Conexion != null) { this.Transaccion = Conexion.BeginTransaction(); Pasos += 2; } if (Pasos == 3) { Comandos = new Comandos(Transaccion); } } catch (Exception ex) { ListaExcepciones.Add(ex); } finally { if (ListaExcepciones.Count > 0) { this.TimeOut = 0; } } }
public void Excepciones(Exception Ex) { if (ListaExcepciones != null) { if (Ex != null) { ListaExcepciones = new List <Exception>() { Ex }; } else { ListaExcepciones = new List <Exception>(); } } else { if (Ex != null) { ListaExcepciones.Add(Ex); } } }