internal static IRepository<DbMessenger> GetRepo(string connectionString, string providerName){
     MessagingToolkit.SmartGateway.Core.Data.ActiveRecord.SmartGatewayDB db;
     if(String.IsNullOrEmpty(connectionString)){
         db=new MessagingToolkit.SmartGateway.Core.Data.ActiveRecord.SmartGatewayDB();
     }else{
         db=new MessagingToolkit.SmartGateway.Core.Data.ActiveRecord.SmartGatewayDB(connectionString, providerName);
     }
     IRepository<DbMessenger> _repo;
     
     if(db.TestMode){
         DbMessenger.SetTestRepo();
         _repo=_testRepo;
     }else{
         _repo = new SubSonicRepository<DbMessenger>(db);
     }
     return _repo;        
 }       
        public OutgoingCall(string connectionString, string providerName) {

            _db=new MessagingToolkit.SmartGateway.Core.Data.ActiveRecord.SmartGatewayDB(connectionString, providerName);
            Init();            
         }
 public OutgoingMessage(){
      _db=new MessagingToolkit.SmartGateway.Core.Data.ActiveRecord.SmartGatewayDB();
     Init();            
 }
 public DbMessenger(){
      _db=new MessagingToolkit.SmartGateway.Core.Data.ActiveRecord.SmartGatewayDB();
     Init();            
 }
 public TreeMenu(){
      _db=new MessagingToolkit.SmartGateway.Core.Data.ActiveRecord.SmartGatewayDB();
     Init();            
 }
 public GatewayConfig(){
      _db=new MessagingToolkit.SmartGateway.Core.Data.ActiveRecord.SmartGatewayDB();
     Init();            
 }
 public SQLITEADMIN_QUERY(){
      _db=new MessagingToolkit.SmartGateway.Core.Data.ActiveRecord.SmartGatewayDB();
     Init();            
 }
        public SQLITEADMIN_QUERY(string connectionString, string providerName) {

            _db=new MessagingToolkit.SmartGateway.Core.Data.ActiveRecord.SmartGatewayDB(connectionString, providerName);
            Init();            
         }
 public IncomingCall(){
      _db=new MessagingToolkit.SmartGateway.Core.Data.ActiveRecord.SmartGatewayDB();
     Init();            
 }
 public UserRoleMap(){
      _db=new MessagingToolkit.SmartGateway.Core.Data.ActiveRecord.SmartGatewayDB();
     Init();            
 }
        public RolePrivilegeMap(string connectionString, string providerName) {

            _db=new MessagingToolkit.SmartGateway.Core.Data.ActiveRecord.SmartGatewayDB(connectionString, providerName);
            Init();            
         }