Ejemplo n.º 1
0
 public DatabaseObjectItem(string name, string schemaName, string databaseName, DatabaseObjectTypeCode type)
 {
     Name                = name;
     SchemaName          = schemaName;
     DatabaseName        = databaseName;
     ItemType            = type;
     HasUnclaimedChanges = false;
     HasPendingCheckin   = false;
     NeedsCodeReview     = false;
 }
Ejemplo n.º 2
0
        public List <DatabaseObjectStatus> GetObjectsWithUnclimainedChangesByDatabaseAndType(string databaseName, DatabaseObjectTypeCode type, DateTime startDate, string userName)
        {
            List <DatabaseObjectStatus> statusList = new List <DatabaseObjectStatus>();

            using (var ctx = new smbimAuditEntities())
            {
                var unclaimedChanges = ctx.GetUnclaimedDatabaseObjects(startDate, userName).
                                       Where(u => string.Compare(u.Category, UtilityRepository.DatabaseReadableTypeCodesLookup[type], StringComparison.OrdinalIgnoreCase) == 0).ToList();
                statusList.AddRange(unclaimedChanges.Select(change => new DatabaseObjectStatus
                {
                    ObjectInformation = new DatabaseObjectBasicInformation
                    {
                        DatabaseName = databaseName, ObjectName = change.ObjectName, ObjectSchema = change.ObjectSchema
                    },
                    HasUnclaimedChanges = true
                }));
                return(statusList);
            }
        }
Ejemplo n.º 3
0
        public List <DatabaseObjectBasicInformation> GetObjectBasicInformationFromDatabaseAndType(string databaseName, DatabaseObjectTypeCode typeCode)
        {
            //using (var ctx = new StoneEdgeRogueEntities())
            //{

            //    string sql = string.Format(@"USE [{0}];
            //        SELECT  DatabaseName        =   '{0}'
            //                ,ObjectName         =   ao.name
            //                ,ObjectSchema       =   s.name
            //                ,LastDdlChange      =   ao.modify_date
            //        FROM    sys.all_objects ao JOIN sys.schemas s ON ao.schema_id = s.schema_id
            //        WHERE   [type] = '{1}' AND ao.is_ms_shipped = 0
            //        ORDER   BY s.name, ao.name ASC",
            //        databaseName,
            //        DatabaseTypeCodes[typeCode]);
            //    List<DatabaseObjectBasicInformation> results =
            //        ctx.Database.SqlQuery<DatabaseObjectBasicInformation>(sql).ToList();

            //    return results;
            //}
            throw new NotImplementedException();
        }
Ejemplo n.º 4
0
 public DatabaseCategoryItem(string name, string databaseName, DatabaseObjectTypeCode type)
 {
     Name         = name;
     DatabaseName = databaseName;
     Type         = type;
 }
Ejemplo n.º 5
0
        public List <DatabaseObjectBasicInformation> GetObjectBasicInformationFromDatabaseAndType(string databaseName, DatabaseObjectTypeCode typeCode)
        {
            using (var ctx = new StoneEdgeRogueEntities())
            {
                string sql = string.Format(@"USE [{0}];
                    SELECT  DatabaseName        =   '{0}'
                            ,ObjectName         =   ao.name
                            ,ObjectSchema       =   s.name
                            ,LastDdlChange      =   ao.modify_date
                    FROM    sys.all_objects ao JOIN sys.schemas s ON ao.schema_id = s.schema_id
                    WHERE   [type] = '{1}' AND ao.is_ms_shipped = 0
                    ORDER   BY s.name, ao.name ASC",
                                           databaseName,
                                           DatabaseTypeCodes[typeCode]);
                List <DatabaseObjectBasicInformation> results =
                    ctx.Database.SqlQuery <DatabaseObjectBasicInformation>(sql).ToList();

                return(results);
            }
        }