Exemplo n.º 1
0
        public static SupportedDbType GetDbType(string dbType)
        {
            SupportedDbType dbModel = SupportedDbType.Spife4000;

            try
            {
                dbModel = (SupportedDbType)Enum.Parse(typeof(SupportedDbType), dbType);
            }
            catch
            { }
            return(dbModel);
        }
Exemplo n.º 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));
 }
Exemplo n.º 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"));
        }
Exemplo n.º 4
0
 private static bool ValidateDbType(SupportedDbType dbType)
 {
     if (dbType == SupportedDbType.None)
     {
         MessageBox.Show(
             "请设置支持的数据库类型!",
             "软件设置无效",
             MessageBoxButtons.OK,
             MessageBoxIcon.Error);
         return(false);
     }
     return(true);
 }
Exemplo n.º 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");
        }
Exemplo n.º 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;
 }
Exemplo n.º 7
0
 private static bool ValidateDbType(SupportedDbType dbType)
 {
     if (dbType == SupportedDbType.None)
     {
         MessageBox.Show(
                     "请设置支持的数据库类型!",
                     "软件设置无效",
                     MessageBoxButtons.OK,
                     MessageBoxIcon.Error);
         return false;
     }
     return true;
 }
Exemplo n.º 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;
 }
Exemplo n.º 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));
        }
Exemplo n.º 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;
 }
Exemplo n.º 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;
 }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 14
0
        public static IExporter GetExporter()
        {
            SupportedDbType dbType = GetDbType(Properties.Settings.Default.DbType);

            return(ExporterFactory.Create(dbType));
        }
Exemplo n.º 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);
 }