Пример #1
0
        public static void CreateMappingReport(Zetbox.App.SchemaMigration.SourceTable obj)
        {
            var fileName = _mdlFactory.GetDestinationFileNameFromUser("Migration Report " + obj.Name + ".pdf", "PDF|*.pdf");

            if (!string.IsNullOrEmpty(fileName))
            {
                var r = new SourceTableMappingReport();
                r.CreateReport(obj);
                r.Save(fileName);
                _fileOpener.ShellExecute(fileName);
            }
        }
Пример #2
0
        public static void CreateObjectClass(Zetbox.App.SchemaMigration.SourceTable obj)
        {
            if (obj.StagingDatabase == null)
            {
                throw new InvalidOperationException("Not attached to a staging database");
            }
            if (obj.StagingDatabase.MigrationProject == null)
            {
                throw new InvalidOperationException("Not attached to a migration project");
            }
            if (obj.StagingDatabase.MigrationProject.DestinationModule == null)
            {
                throw new InvalidOperationException("No destination module provided");
            }
            if (obj.DestinationObjectClass != null)
            {
                throw new InvalidOperationException("there is already a destination object class");
            }

            obj.DestinationObjectClass             = obj.Context.Create <ObjectClass>();
            obj.DestinationObjectClass.Name        = obj.Name;
            obj.DestinationObjectClass.Module      = obj.StagingDatabase.MigrationProject.DestinationModule;
            obj.DestinationObjectClass.Description = obj.Description;
        }
Пример #3
0
 public static void ToString(Zetbox.App.SchemaMigration.SourceTable obj, MethodReturnEventArgs <System.String> e)
 {
     e.Result  = "[" + ((obj.StagingDatabase != null ? obj.StagingDatabase.Description : null) ?? string.Empty) + "]";
     e.Result += "." + (!string.IsNullOrEmpty(obj.Name) ? obj.Name : "new Source Table");
 }