Пример #1
0
        private SqlAccess GetSqlAccess(Durados.SqlProduct sqlProduct)
        {
            SqlAccess sqlAccess = null;

            if (sqlAccess == null)
            {
                switch (sqlProduct)
                {
                case SqlProduct.MySql:
                    sqlAccess = new MySqlAccess();
                    break;

                case SqlProduct.Postgre:
                    sqlAccess = new PostgreAccess();
                    break;

                case SqlProduct.Oracle:
                    sqlAccess = new OracleAccess();
                    break;

                default:
                    sqlAccess = new SqlAccess();
                    break;
                }
            }

            return(sqlAccess);
        }
Пример #2
0
 private IDataTableAccess GetDataTableAccess(Durados.View view)
 {
     if (view is Durados.Config.IConfigView)
     {
         return(new ConfigAccess());
     }
     else
     if (OracleAccess.IsOracleConnectionString(view.ConnectionString))
     {
         return(new OracleAccess());
     }
     if (PostgreAccess.IsPostgreConnectionString(view.ConnectionString))
     {
         return(new PostgreAccess());
     }
     else if (MySqlAccess.IsMySqlConnectionString(view.ConnectionString))
     {
         return(new MySqlAccess());
     }
     else
     {
         return(new SqlAccess());
     }
 }