Пример #1
0
        /// <summary>
        /// All Identity Fields
        /// </summary>
        private void GetIdentityFields()
        {
            DatabaseSchemaAccessLayer databaseInfo = new DatabaseSchemaAccessLayer(this.ConnectionParams);

            List <DatabaseIdentityFields> identityFields = databaseInfo.GetIdentityFields(this.DatabaseName);
            int count = identityFields.Count;

            if (identityFields.Count > 0)
            {
                this.DataGridViewSchema.DataSource = identityFields;
                int dataGridViewWidth = this.DataGridViewSchema.Width;

                this.DataGridViewSchema.Columns[0].DefaultCellStyle.Alignment = DataGridViewContentAlignment.TopLeft;
                this.DataGridViewSchema.Columns[1].DefaultCellStyle.Alignment = DataGridViewContentAlignment.TopLeft;
                this.DataGridViewSchema.Columns[2].DefaultCellStyle.Alignment = DataGridViewContentAlignment.TopLeft;
                this.DataGridViewSchema.Columns[3].DefaultCellStyle.Alignment = DataGridViewContentAlignment.TopLeft;
                this.DataGridViewSchema.Columns[4].DefaultCellStyle.Alignment = DataGridViewContentAlignment.TopRight;
                this.DataGridViewSchema.Columns[5].DefaultCellStyle.Alignment = DataGridViewContentAlignment.TopRight;
                this.DataGridViewSchema.Columns[6].DefaultCellStyle.Alignment = DataGridViewContentAlignment.TopRight;

                this.DataGridViewSchema.Columns[4].DefaultCellStyle.Format = "N0";
                this.DataGridViewSchema.Columns[5].DefaultCellStyle.Format = "N0";
                this.DataGridViewSchema.Columns[6].DefaultCellStyle.Format = "N0";
            }
        }
        public List <string> GetDatabaseList([PexAssumeUnderTest] DatabaseSchemaAccessLayer target)
        {
            List <string> result = target.GetDatabaseList();

            return(result);
            // TODO: add assertions to method DatabaseSchemaAccessLayerTest.GetDatabaseList(DatabaseSchemaAccessLayer)
        }
Пример #3
0
        /// <summary>
        /// Gets the table row counts.
        /// </summary>
        private void GetTableRowCounts()
        {
            try
            {
                DatabaseSchemaAccessLayer     databaseInfo  = new DatabaseSchemaAccessLayer(this.ConnectionParams);
                List <DatabaseTableRowCounts> tbleRowCounts = databaseInfo.GetTableRowCounts(this.DatabaseName);

                if (tbleRowCounts.Count > 0)
                {
                    this.DataGridViewSchema.DataSource = tbleRowCounts;
                    int dataGridViewWidth = this.DataGridViewSchema.Width;

                    this.DataGridViewSchema.Columns[0].MinimumWidth = Convert.ToInt32(dataGridViewWidth * .3);

                    this.DataGridViewSchema.Columns[0].DefaultCellStyle.Alignment = DataGridViewContentAlignment.TopLeft;
                    this.DataGridViewSchema.Columns[1].DefaultCellStyle.Alignment = DataGridViewContentAlignment.TopRight;

                    this.DataGridViewSchema.Columns[1].DefaultCellStyle.Format = "N0";
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #4
0
        /// <summary>
        /// Gets the size of the database files information.
        /// </summary>
        private void GetDatabaseFilesInformation()
        {
            try
            {
                DatabaseSchemaAccessLayer databaseInfo     = new DatabaseSchemaAccessLayer(this.ConnectionParams);
                List <DatabaseNameSize>   databaseNameSize = databaseInfo.GetDatabaseNameSize(this.DatabaseName);

                if (databaseNameSize.Count > 0)
                {
                    this.DataGridViewSchema.DataSource = databaseNameSize;
                    int dataGridViewWidth = this.DataGridViewSchema.Width;

                    this.DataGridViewSchema.Columns[0].DefaultCellStyle.Alignment = DataGridViewContentAlignment.TopLeft;
                    this.DataGridViewSchema.Columns[1].DefaultCellStyle.Alignment = DataGridViewContentAlignment.TopLeft;
                    this.DataGridViewSchema.Columns[2].DefaultCellStyle.Alignment = DataGridViewContentAlignment.TopLeft;
                    this.DataGridViewSchema.Columns[3].DefaultCellStyle.Alignment = DataGridViewContentAlignment.TopRight;

                    this.DataGridViewSchema.Columns[3].DefaultCellStyle.Format = "N0";
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        public DatabaseSchemaAccessLayer Constructor(ConnectionParameters connectionParameters)
        {
            DatabaseSchemaAccessLayer target
                = new DatabaseSchemaAccessLayer(connectionParameters);

            return(target);
            // TODO: add assertions to method DatabaseSchemaAccessLayerTest.Constructor(ConnectionParameters)
        }
        public List <DatabaseNoPrimaryKey> GetDatabaseNoPrimaryKey(
            [PexAssumeUnderTest] DatabaseSchemaAccessLayer target,
            string database
            )
        {
            List <DatabaseNoPrimaryKey> result = target.GetDatabaseNoPrimaryKey(database);

            return(result);
            // TODO: add assertions to method DatabaseSchemaAccessLayerTest.GetDatabaseNoPrimaryKey(DatabaseSchemaAccessLayer, String)
        }
        public List <DatabaseTableRowCounts> GetTableRowCounts(
            [PexAssumeUnderTest] DatabaseSchemaAccessLayer target,
            string database
            )
        {
            List <DatabaseTableRowCounts> result = target.GetTableRowCounts(database);

            return(result);
            // TODO: add assertions to method DatabaseSchemaAccessLayerTest.GetTableRowCounts(DatabaseSchemaAccessLayer, String)
        }
        public List <DatabaseIdentityFields> GetIdentityFields(
            [PexAssumeUnderTest] DatabaseSchemaAccessLayer target,
            string database
            )
        {
            List <DatabaseIdentityFields> result = target.GetIdentityFields(database);

            return(result);
            // TODO: add assertions to method DatabaseSchemaAccessLayerTest.GetIdentityFields(DatabaseSchemaAccessLayer, String)
        }
        public List <DatabaseChangesLast90Days> GetDatabaseChangesLast90Days(
            [PexAssumeUnderTest] DatabaseSchemaAccessLayer target,
            string database
            )
        {
            List <DatabaseChangesLast90Days> result
                = target.GetDatabaseChangesLast90Days(database);

            return(result);
            // TODO: add assertions to method DatabaseSchemaAccessLayerTest.GetDatabaseChangesLast90Days(DatabaseSchemaAccessLayer, String)
        }
        public List <DatabaseNonClusteredIndexes> GetDatabaseNonClusteredIndexes(
            [PexAssumeUnderTest] DatabaseSchemaAccessLayer target,
            string database
            )
        {
            List <DatabaseNonClusteredIndexes> result
                = target.GetDatabaseNonClusteredIndexes(database);

            return(result);
            // TODO: add assertions to method DatabaseSchemaAccessLayerTest.GetDatabaseNonClusteredIndexes(DatabaseSchemaAccessLayer, String)
        }
Пример #11
0
        /// <summary>
        /// Populates the database.
        /// </summary>
        private void PopulateDatabaseComboBox()
        {
            DatabaseSchemaAccessLayer databaseInfo = new DatabaseSchemaAccessLayer(this.ConnectionParams);

            List <string> databases = databaseInfo.GetDatabaseList();

            this.ToolStripComboBoxDatabase.Items.AddRange(databases.ToArray());
            if (string.IsNullOrEmpty(this.DatabaseName))
            {
                this.ToolStripComboBoxDatabase.SelectedIndex = 0;
            }
            else
            {
                this.ToolStripComboBoxDatabase.Text = this.DatabaseName;
            }
        }
Пример #12
0
        /// <summary>
        /// Gets the database primary keys.
        /// </summary>
        private void GetDatabasePrimaryKeys()
        {
            DatabaseSchemaAccessLayer databaseInfo = new DatabaseSchemaAccessLayer(this.ConnectionParams);

            List <DatabasePrimaryKeys> primaryKeys = databaseInfo.GetDatabasePrimaryKeys(this.DatabaseName);
            int count = primaryKeys.Count;

            if (primaryKeys.Count > 0)
            {
                this.DataGridViewSchema.DataSource = primaryKeys;
                int dataGridViewWidth = this.DataGridViewSchema.Width;

                this.DataGridViewSchema.Columns[0].DefaultCellStyle.Alignment = DataGridViewContentAlignment.TopLeft;
                this.DataGridViewSchema.Columns[1].DefaultCellStyle.Alignment = DataGridViewContentAlignment.TopLeft;
                this.DataGridViewSchema.Columns[2].DefaultCellStyle.Alignment = DataGridViewContentAlignment.TopLeft;
            }
        }
Пример #13
0
        /// <summary>
        /// Gets the database no primary key.
        /// </summary>
        private void GetDatabaseNoPrimaryKey()
        {
            DatabaseSchemaAccessLayer databaseInfo = new DatabaseSchemaAccessLayer(this.ConnectionParams);

            List <DatabaseNoPrimaryKey> indexFragmentation = databaseInfo.GetDatabaseNoPrimaryKey(this.DatabaseName);
            int count = indexFragmentation.Count;

            if (indexFragmentation.Count > 0)
            {
                this.DataGridViewSchema.DataSource = indexFragmentation;
                int dataGridViewWidth = this.DataGridViewSchema.Width;

                this.DataGridViewSchema.Columns[0].DefaultCellStyle.Alignment = DataGridViewContentAlignment.TopLeft;
                this.DataGridViewSchema.Columns[1].DefaultCellStyle.Alignment = DataGridViewContentAlignment.TopLeft;
                this.DataGridViewSchema.Columns[2].DefaultCellStyle.Alignment = DataGridViewContentAlignment.TopRight;

                this.DataGridViewSchema.Columns[2].DefaultCellStyle.Format = "N0";
            }
        }
Пример #14
0
        /// <summary>
        /// Gets the database non clustered indexes.
        /// </summary>
        private void GetDatabaseNonClusteredIndexes()
        {
            DatabaseSchemaAccessLayer databaseInfo = new DatabaseSchemaAccessLayer(this.ConnectionParams);

            List <DatabaseNonClusteredIndexes> indexFragmentation = databaseInfo.GetDatabaseNonClusteredIndexes(this.DatabaseName);
            int count = indexFragmentation.Count;

            if (indexFragmentation.Count > 0)
            {
                this.DataGridViewSchema.DataSource = indexFragmentation;
                int dataGridViewWidth = this.DataGridViewSchema.Width;

                this.DataGridViewSchema.Columns[0].DefaultCellStyle.Alignment = DataGridViewContentAlignment.TopLeft;
                this.DataGridViewSchema.Columns[1].DefaultCellStyle.Alignment = DataGridViewContentAlignment.TopLeft;
                this.DataGridViewSchema.Columns[2].DefaultCellStyle.Alignment = DataGridViewContentAlignment.TopLeft;
                this.DataGridViewSchema.Columns[3].DefaultCellStyle.Alignment = DataGridViewContentAlignment.TopLeft;
                this.DataGridViewSchema.Columns[4].DefaultCellStyle.Alignment = DataGridViewContentAlignment.TopCenter;
            }
        }