Example #1
0
        public static SupportedDbType GetDbType(string dbType)
        {
            SupportedDbType dbModel = SupportedDbType.Spife4000;

            try
            {
                dbModel = (SupportedDbType)Enum.Parse(typeof(SupportedDbType), dbType);
            }
            catch
            { }
            return(dbModel);
        }
Example #2
0
 public static bool IsWellSetting(SupportedDbType dbType, string dbPath, string expPath)
 {
     if (!ValidateDbType(dbType))
     {
         return(false);
     }
     if (!ValidateExportPath(expPath))
     {
         return(false);
     }
     return(ValidateDbPath(dbType, dbPath));
 }
Example #3
0
        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"));
        }
Example #4
0
 private static bool ValidateDbType(SupportedDbType dbType)
 {
     if (dbType == SupportedDbType.None)
     {
         MessageBox.Show(
             "请设置支持的数据库类型!",
             "软件设置无效",
             MessageBoxButtons.OK,
             MessageBoxIcon.Error);
         return(false);
     }
     return(true);
 }
Example #5
0
        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");
        }
Example #6
0
 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;
 }
Example #7
0
 private static bool ValidateDbType(SupportedDbType dbType)
 {
     if (dbType == SupportedDbType.None)
     {
         MessageBox.Show(
                     "请设置支持的数据库类型!",
                     "软件设置无效",
                     MessageBoxButtons.OK,
                     MessageBoxIcon.Error);
         return false;
     }
     return true;
 }
Example #8
0
 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;
 }
Example #9
0
        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));
        }
Example #10
0
 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;
 }
Example #11
0
 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;
 }
Example #12
0
        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);
        }
Example #13
0
        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);
        }
Example #14
0
        public static IExporter GetExporter()
        {
            SupportedDbType dbType = GetDbType(Properties.Settings.Default.DbType);

            return(ExporterFactory.Create(dbType));
        }
Example #15
0
 public static bool IsWellSetting(SupportedDbType dbType, string dbPath, string expPath)
 {
     if (!ValidateDbType(dbType))
     {
         return false;
     }
     if (!ValidateExportPath(expPath))
     {
         return false;
     }
     return ValidateDbPath(dbType, dbPath);
 }