Esempio n. 1
0
		public SuposDbProvider(DbSettings config)
		{
			string constr = "factory=";
			switch(config.DbType) {
			case "SQLite" :
				constr += "Sqlite;";
				constr += "Data Source=";
				constr += config.Database;
				break;
			case "PostgreSQL" :
				constr += "Npgsql;";
				constr += "Server=";
				constr += config.Server;
				constr += ";Port=";
				constr += config.Port;
				constr += ";User ID=";
				constr += config.User;
				constr += ";Password="******";Database=";
				constr += config.Database;
				break;
			default :
				break;
			}
			connection = ProviderFactory.CreateConnection(constr);
			CreateAdapters();
		}
Esempio n. 2
0
		public void LoadSettings( DbSettings config)
		{
			TypeComboSetActive( config.DbType );
			serverEntry.Text = config.Server;
			portSpinButton.Value = config.Port;
			userEntry.Text = config.User;
			passEntry.Text = config.Password;
			dbEntry.Text = config.Database;
			mediaButton.SetCurrentFolder( config.MediaPath );
		}
Esempio n. 3
0
		public void ApplySettings(DbSettings config)
		{
			config.DbType = typeCombo.ActiveText;
			config.Server = serverEntry.Text;
			config.Port = portSpinButton.ValueAsInt;
			config.User = userEntry.Text;
			config.Password = passEntry.Text;
			config.Database = dbEntry.Text;
			config.MediaPath = mediaButton.CurrentFolder;
		}
Esempio n. 4
0
		public void ApplyDatabaseSettings(DbSettings config)
		{
			dbForm.ApplySettings(config);
		}
Esempio n. 5
0
		public void LoadDatabaseSettings(DbSettings config)
		{
			dbForm.LoadSettings(config);
		}
Esempio n. 6
0
		public SuposDb( DbSettings config )
		{ 
			settings = config;
			ds = new SuposDataSet();
			provider = new SuposDbProvider(config);
		}