public static SupportedDbType GetDbType(string dbType) { SupportedDbType dbModel = SupportedDbType.Spife4000; try { dbModel = (SupportedDbType)Enum.Parse(typeof(SupportedDbType), dbType); } catch { } return(dbModel); }
public static bool IsWellSetting(SupportedDbType dbType, string dbPath, string expPath) { if (!ValidateDbType(dbType)) { return(false); } if (!ValidateExportPath(expPath)) { return(false); } return(ValidateDbPath(dbType, dbPath)); }
private static bool ValidateDbPath(SupportedDbType dbType, string dbPath) { if (!ValidateEmptyPath(dbPath)) { return(false); } if (dbType != SupportedDbType.Platinum) { return(Directory.Exists(dbPath)); } return(File.Exists(dbPath + "\\platinum.mdb")); }
private static bool ValidateDbType(SupportedDbType dbType) { if (dbType == SupportedDbType.None) { MessageBox.Show( "请设置支持的数据库类型!", "软件设置无效", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } return(true); }
private static bool ValidateDbPath(SupportedDbType dbType, string dbPath) { if (!ValidateEmptyPath(dbPath)) { return false; } if (dbType != SupportedDbType.Platinum) { return Directory.Exists(dbPath); } return File.Exists(dbPath + "\\platinum.mdb"); }
private void SettingForm_Load(object sender, EventArgs e) { // 初始化数据库选项 this.DbType = GlobalConfigVars.GetDbType(Properties.Settings.Default.DbType); tbDbFolder.Text = Properties.Settings.Default.DbPath; tbExportPath.Text = Properties.Settings.Default.XmlPath; numBC0.Value = Properties.Settings.Default.Blp0; numBC1.Value = Properties.Settings.Default.Blp1; numBC2.Value = Properties.Settings.Default.Blp2; numBC3.Value = Properties.Settings.Default.Blp3; numBC4.Value = Properties.Settings.Default.Blp4; numBC5.Value = Properties.Settings.Default.Blp5; }
private static bool ValidateDbType(SupportedDbType dbType) { if (dbType == SupportedDbType.None) { MessageBox.Show( "请设置支持的数据库类型!", "软件设置无效", MessageBoxButtons.OK, MessageBoxIcon.Error); return false; } return true; }
public static bool IsWellSetting() { SupportedDbType dbType = GetDbType(Properties.Settings.Default.DbType); if (!ValidateDbType(dbType)) { return(false); } if (!ValidateExportPath(Properties.Settings.Default.XmlPath)) { return(false); } return(ValidateDbPath(dbType, Properties.Settings.Default.DbPath)); }
public static IExporter Create(SupportedDbType dbType) { switch (dbType) { case SupportedDbType.AggRAM: return new AggramExporter(); case SupportedDbType.Platinum: return new PlatinumExporter(); case SupportedDbType.Spife4000: return new Spife4000Exporter(); case SupportedDbType.QS2000: return new Qs2000Exporter(); } return null; }
public static IDbProvider Create(SupportedDbType dbType) { switch (dbType) { case SupportedDbType.AggRAM: return new AggramDbProvider(); case SupportedDbType.Platinum: return new PlatinumDbProvider(); case SupportedDbType.Spife4000: return new Spife4000DbProvider(); case SupportedDbType.QS2000: return new QS2000Provider(); } return null; }
public static IDbProvider Create(SupportedDbType dbType) { switch (dbType) { case SupportedDbType.AggRAM: return(new AggramDbProvider()); case SupportedDbType.Platinum: return(new PlatinumDbProvider()); case SupportedDbType.Spife4000: return(new Spife4000DbProvider()); case SupportedDbType.QS2000: return(new QS2000Provider()); } return(null); }
public static IExporter Create(SupportedDbType dbType) { switch (dbType) { case SupportedDbType.AggRAM: return(new AggramExporter()); case SupportedDbType.Platinum: return(new PlatinumExporter()); case SupportedDbType.Spife4000: return(new Spife4000Exporter()); case SupportedDbType.QS2000: return(new Qs2000Exporter()); } return(null); }
public static IExporter GetExporter() { SupportedDbType dbType = GetDbType(Properties.Settings.Default.DbType); return(ExporterFactory.Create(dbType)); }
public static bool IsWellSetting(SupportedDbType dbType, string dbPath, string expPath) { if (!ValidateDbType(dbType)) { return false; } if (!ValidateExportPath(expPath)) { return false; } return ValidateDbPath(dbType, dbPath); }