/// <summary>
        /// 建立使用到的 UDT Table:主要檢查資料庫有沒有建立UDT,沒有建自動建立。
        /// </summary>
        public static void CreateConfigureUDTTable()
        {
            FISCA.UDT.SchemaManager Manager = new SchemaManager(new DSConnection(FISCA.Authentication.DSAServices.DefaultDataSource));

            // 設定
            Manager.SyncSchema(new ConfigureRecord());
        }
        /// <summary>
        /// 建立使用到的 UDT Table:主要檢查資料庫有沒有建立UDT,沒有建自動建立。
        /// </summary>
        public static void CreateFitnessUDTTable()
        {
            FISCA.UDT.SchemaManager Manager = new SchemaManager(new DSConnection(FISCA.Authentication.DSAServices.DefaultDataSource));

            // 學生體適能
            Manager.SyncSchema(new StudentFitnessRecord());
        }
Exemple #3
0
 public Service(RepositoryManager repositoryManager, SchemaManager schemaManager, TextFolderManager textFolderManager
     , IIncomeDataManager incomeDataManager)
 {
     _textFolderManager = textFolderManager;
     _repositoryManager = repositoryManager;
     _schemaManager = schemaManager;
     _incomeDataManager = incomeDataManager;
 }
Exemple #4
0
 /// <summary>
 /// 建立使用到的 UDT Table
 /// </summary>
 public static void CreateUDTTable()
 {            
     FISCA.UDT.SchemaManager Manager = new SchemaManager(new FISCA.DSAUtil.DSConnection(FISCA.Authentication.DSAServices.DefaultDataSource));
     Manager.SyncSchema(new udtNotice());
     Manager.SyncSchema(new udtNoticeApprove());
     Manager.SyncSchema(new udtNoticeLog());
     Manager.SyncSchema(new udtNoticeTarget());
 }
        public static void SyncDBSchema()
        {
            #region 模組啟用先同步Schema

            SchemaManager Manager = new SchemaManager(DSAServices.DefaultConnection);

            Manager.SyncSchema(new UDT.MailChimpAPIKey());

            #endregion
        }
Exemple #6
0
        /// <summary>
        /// Opens or creates an index at the specified location
        /// </summary>
        /// <param name="path">The index path</param>
        private Index(string path)
        {
            this.path = path;
            Utility.EnsureIndex(this.path);

            this.searcher = new Searcher(this);
            this.writer = new Writer(this);
            this.writer.Changed += FireChanged;
            this.schemaManager = new SchemaManager(this);
        }
Exemple #7
0
        private void exportAPIPackage(EA.Repository Repository, EA.Package apiPackage)
        {
            EA.Package samplePackage  = null;
            EA.Package schemasPackage = null;
            foreach (EA.Package p in apiPackage.Packages)
            {
                //logger.log("Package:" + p.Name);
                if (p.Name.Equals(APIAddinClass.API_PACKAGE_SAMPLES))
                {
                    samplePackage = p;
                }
                else if (p.Name.Equals(APIAddinClass.API_PACKAGE_SCHEMAS))
                {
                    schemasPackage = p;
                }
            }

            if (samplePackage == null || schemasPackage == null)
            {
                logger.log("Not an api/model package:" + apiPackage.Name);
                return;
            }

            logger.log("Found api/model package:" + apiPackage.Name);
            if (samplePackage != null)
            {
                List <EA.Package> pkgs = new List <EA.Package>();
                pkgs.Add(samplePackage);
                foreach (EA.Package child in samplePackage.Packages)
                {
                    pkgs.Add(child);
                }

                foreach (EA.Package sp in pkgs)
                {
                    logger.log("Exporting Samples:" + sp.Name);

                    foreach (object obj in sp.Diagrams)
                    {
                        EA.Diagram samplediagram = (EA.Diagram)obj;
                        logger.log("Exporting Schema Diagram:" + samplediagram.Name);
                        SampleManager.exportSample(Repository, samplediagram);
                    }
                }
            }
            if (schemasPackage != null)
            {
                logger.log("Exporting Schemas:" + schemasPackage.Name);
                foreach (EA.Diagram schemadiagram in schemasPackage.Diagrams)
                {
                    logger.log("Exporting Sample Diagram:" + schemadiagram.Name);
                    SchemaManager.exportSchema(Repository, schemadiagram);
                }
            }
        }
 public void CreateDatabase()
 {
     using (var con = ConnectionFactory.CreateConnection())
     {
         _dbName = "T" + Guid.NewGuid().ToString("N");
         con.ExecuteNonQuery("CREATE Database " + _dbName);
         con.ChangeDatabase(_dbName);
         var schemaTool = new SchemaManager(() => con);
         schemaTool.CreateInitialStructure();
     }
 }
Exemple #9
0
        public Service(RepositoryManager repositoryManager, SchemaManager schemaManager, TextFolderManager textFolderManager, SiteManager siteManager
                       , IIncomeDataManager incomeDataManager, ITextContentProvider textContentProvider)
        {
            _textFolderManager = textFolderManager;
            _repositoryManager = repositoryManager;
            _schemaManager     = schemaManager;
            _incomeDataManager = incomeDataManager;

            _siteManager         = siteManager;
            _textContentProvider = textContentProvider;
        }
Exemple #10
0
        public MainDecoderViewModel(SchemaManager schemaManager, /* MetaDataFile metaDataFile,*/ PackFileService pf, bool allTablesReadOnly = true)
        {
            _pf            = pf;
            _schemaManager = schemaManager;

            TableDefinitionEditor = new TableDefinitionEditor(schemaManager, ActiveMentaDataContent, ActiveTableDefinition);
            DataTable             = new MetaDataTable(ActiveTableDefinition, ActiveMentaDataContent, pf, allTablesReadOnly);
            FieldExplorer         = new FieldExplorer(TableDefinitionEditor, ActiveMentaDataContent, ActiveTableDefinition);

            //ActiveMentaDataContent.File = metaDataFile;
        }
Exemple #11
0
        public Service(RepositoryManager repositoryManager, SchemaManager schemaManager, TextFolderManager textFolderManager, SiteManager siteManager
            , IIncomeDataManager incomeDataManager, ITextContentProvider textContentProvider)
        {
            _textFolderManager = textFolderManager;
            _repositoryManager = repositoryManager;
            _schemaManager = schemaManager;
            _incomeDataManager = incomeDataManager;

            _siteManager = siteManager;
            _textContentProvider = textContentProvider;
        }
        public MetaDataTagEditorViewModel(SchemaManager schemaManager, MetaDataViewModel data)
        {
            _schemaManager = schemaManager;
            _data          = data;

            MoveUpCommand   = new RelayCommand(MoveUp);
            MoveDownCommand = new RelayCommand(MoveDown);

            NewCommand    = new RelayCommand(New);
            DeleteCommand = new RelayCommand(Delete);
        }
        internal virtual void DetermineIfArtifactIsVersionSafe()
        {
            // make sure that the XML namespace of the EDMX, Csdl, ssdl & msl nodes match the expected XML namespaces for the schema version
            var rootNamespace = GetRootNamespace();

            _isVersionSafe = rootNamespace != null &&
                             rootNamespace == SchemaManager.GetEDMXNamespaceName(SchemaVersion) &&
                             CompareNamespaces(ConceptualModel, SchemaManager.GetCSDLNamespaceName(SchemaVersion)) &&
                             CompareNamespaces(StorageModel, SchemaManager.GetSSDLNamespaceName(SchemaVersion)) &&
                             CompareNamespaces(MappingModel, SchemaManager.GetMSLNamespaceName(SchemaVersion));
        }
        internal void CreateTables()
        {
            var connString = ConnectionString;

            using (MySqlDatabaseWrapper dbConn = new MySqlDatabaseWrapper(connString))
            {
                //create schema
                string schema = SchemaManager.GetSchema(11);
                dbConn.ExecuteNonQuery(schema);
            }
        }
Exemple #15
0
        public void CanCreateSchema()
        {
            var mapper        = new AutoMapper();
            var map           = mapper.GetMap(typeof(SomeClass));
            var properties    = map.Properties;
            var keyProperties = properties.Where(p => p.IsKey);

            var creator = new SchemaManager(new SqlConnectionFactory(ConnectionString), "testtable", "testdata", "testproc", keyProperties, properties, schema: "bimse");

            creator.DropSchema(true, true, true);
            creator.CreateSchema(true, true, true);
        }
Exemple #16
0
 protected static void AddSchemaColumn(SchemaManager schemaManager, string tableName, PropertyInfo property, DataTypes dataType)
 {
     if (!property.IsEnumerable() || property.PropertyType == typeof(string))
     {
         Column columnToAdd = new Column(property.Name.LettersOnly(), dataType);
         schemaManager.AddColumn(tableName, columnToAdd);
         if (property.HasCustomAttributeOfType <KeyAttribute>() || property.Name.Equals("Id"))
         {
             schemaManager.SetKeyColumn(tableName, columnToAdd.Name);
         }
     }
 }
Exemple #17
0
 protected virtual void AddSchemaTables(TypeSchema typeSchema, SchemaManager schemaManager, ITypeTableNameProvider tableNameProvider = null)
 {
     tableNameProvider = tableNameProvider ?? new EchoTypeTableNameProvider();
     foreach (Type tableType in typeSchema.Tables)
     {
         string tableName = GetTableNameForType(tableType, tableNameProvider);
         schemaManager.AddTable(tableName);
         schemaManager.ExecutePreColumnAugmentations(tableName);
         AddPropertyColumns(tableType, schemaManager, typeSchema.DefaultDataTypeBehavior);
         schemaManager.ExecutePostColumnAugmentations(tableName);
     }
 }
Exemple #18
0
        void BindList(SchemaManager mgr)
        {
            var om = mgr.GetObjectClassManager();

            _list = om.Data.Values.ToList();
            _list.Sort(SortObjectClassDTO);
            dataSourceList = new List <KeyValuePair <string, string> >();
            foreach (var obj in _list)
            {
                dataSourceList.Add(new KeyValuePair <string, string>(obj.Name, obj.Description));
            }
        }
        private void Load(XmlReader reader)
        {
            Schema schema;
            var    errors = SchemaManager.LoadProviderManifest(
                reader, reader.BaseURI.Length > 0 ? reader.BaseURI : null, true /*checkForSystemNamespace*/, out schema);

            if (errors.Count != 0)
            {
                throw new ProviderIncompatibleException(Strings.IncorrectProviderManifest + Helper.CombineErrorMessage(errors));
            }

            _namespaceName = schema.Namespace;

            var listOfPrimitiveTypes = new List <PrimitiveType>();

            foreach (var schemaType in schema.SchemaTypes)
            {
                var typeElement = schemaType as TypeElement;
                if (typeElement != null)
                {
                    var type = typeElement.PrimitiveType;
                    type.ProviderManifest = this;
                    type.DataSpace        = DataSpace.SSpace;
                    type.SetReadOnly();
                    listOfPrimitiveTypes.Add(type);

                    _storeTypeNameToStorePrimitiveType.Add(type.Name.ToLowerInvariant(), type);
                    _storeTypeNameToEdmPrimitiveType.Add(
                        type.Name.ToLowerInvariant(), EdmProviderManifest.Instance.GetPrimitiveType(type.PrimitiveTypeKind));

                    ReadOnlyCollection <FacetDescription> descriptions;
                    if (EnumerableToReadOnlyCollection(typeElement.FacetDescriptions, out descriptions))
                    {
                        _facetDescriptions.Add(type, descriptions);
                    }
                }
            }
            _primitiveTypes = new ReadOnlyCollection <PrimitiveType>(listOfPrimitiveTypes.ToArray());

            // load the functions
            ItemCollection collection = new EmptyItemCollection();
            var            items      = Converter.ConvertSchema(schema, this, collection);

            if (!EnumerableToReadOnlyCollection(items, out _functions))
            {
                _functions = Helper.EmptyEdmFunctionReadOnlyCollection;
            }
            //SetReadOnly on all the Functions
            foreach (var function in _functions)
            {
                function.SetReadOnly();
            }
        }
Exemple #20
0
        protected override void InitializeModelContents(Version targetSchemaVersion)
        {
            Debug.Assert(EntityFrameworkVersion.IsValidVersion(targetSchemaVersion));
            Debug.Assert(_model == null, "overwriting already initialized edmx???");

            _model = XDocument.Parse(
                _initialModelContentsFactory.GetInitialModelContents(targetSchemaVersion));

            Debug.Assert(
                SchemaManager.GetSchemaVersion(_model.Root.Name.Namespace) == targetSchemaVersion,
                "Schema version should not change or we should not cache the document");
        }
Exemple #21
0
        public static bool getAttributes(object item, List <XmlSchemaAttribute> attributes)
        {
            if (item is XmlSchemaComplexType)
            {
                XmlSchemaComplexType complexType = (XmlSchemaComplexType)item;
                foreach (object entry in complexType.AttributeUses)
                {
                    object o = null;
                    if (entry is System.Collections.DictionaryEntry)
                    {
                        System.Collections.DictionaryEntry de = (System.Collections.DictionaryEntry)entry;
                        object key   = de.Key;
                        object value = de.Value;
                        o = value;
                    }
                    if (o is XmlSchemaAttribute)
                    {
                        attributes.Add((XmlSchemaAttribute)o);
                    }
                    else if (o is XmlSchemaAttributeGroupRef)
                    {
                        XmlSchemaAttributeGroupRef groupRef = (XmlSchemaAttributeGroupRef)o;
                        XmlQualifiedName           qname    = groupRef.RefName;
                        if (qname != null)
                        {
                            XmlSchemaAttributeGroup group = null;
                            if (SchemaManager.GetAttributeGroup(qname.Namespace, qname.Name, out group))
                            {
                                foreach (object oo in group.Attributes)
                                {
                                    if (oo is XmlSchemaAttribute)
                                    {
                                        attributes.Add((XmlSchemaAttribute)oo);
                                    }
                                }
                            }
                        }
                    }
                }

                if (complexType.ContentModel != null && complexType.ContentModel.Content is XmlSchemaComplexContentExtension)
                {
                    XmlSchemaComplexContentExtension ext = (XmlSchemaComplexContentExtension)complexType.ContentModel.Content;
                    XmlSchemaComplexType             baseType;
                    if (ext.BaseTypeName != null && SchemaManager.GetComplexType(ext.BaseTypeName.Namespace, ext.BaseTypeName.Name, out baseType))
                    {
                        getAttributes(baseType, attributes);
                    }
                }
            }

            return(attributes.Count > 0);
        }
Exemple #22
0
        public void Setup()
        {
            var connection = ConnectionFactory.CreateStandardConnection();

            connection.Connect();

            company = connection.Company;

            var manager = new SchemaManager(company);

            manager.InitializeFromAssembly(GetType().Assembly);
        }
        private StorageMappingItemCollection ValidateMapping(
            EntityDesignArtifact designArtifact, EdmItemCollection edmItemCollection,
            StoreItemCollection storeItemCollection)
        {
            Debug.Assert(designArtifact != null, "designArtifact != null");
            Debug.Assert(edmItemCollection != null, "edmItemCollection != null");
            Debug.Assert(storeItemCollection != null, "storeItemCollection != null");

            var artifactSet = designArtifact.ArtifactSet;

            if (designArtifact.MappingModel == null)
            {
                artifactSet.AddError(
                    new ErrorInfo(
                        ErrorInfo.Severity.ERROR,
                        Resources.ErrorValidatingArtifact_MappingModelMissing,
                        designArtifact,
                        ErrorCodes.ErrorValidatingArtifact_MappingModelMissing,
                        ErrorClass.Runtime_MSL));

                return(null);
            }

            if (SchemaManager.GetSchemaVersion(designArtifact.MappingModel.XElement.Name.Namespace) >
                _targetEntityFrameworkRuntimeVersion)
            {
                // the xml namespace of the mapping node is for a later version of the runtime than we are validating against

                artifactSet.AddError(
                    new ErrorInfo(
                        ErrorInfo.Severity.ERROR,
                        Resources.ErrorValidatingArtifact_InvalidMSLNamespaceForTargetFrameworkVersion,
                        designArtifact.MappingModel,
                        ErrorCodes.ErrorValidatingArtifact_InvalidMSLNamespaceForTargetFrameworkVersion,
                        ErrorClass.Runtime_MSL));

                return(null);
            }

            using (var reader = CreateXmlReader(designArtifact, designArtifact.MappingModel.XElement))
            {
                IList <EdmSchemaError> mappingErrors;

                var mappingItemCollection =
                    StorageMappingItemCollection.Create(
                        edmItemCollection, storeItemCollection, new[] { reader }, null, out mappingErrors);

                Debug.Assert(mappingErrors != null);

                ProcessErrors(mappingErrors, designArtifact, ErrorClass.Runtime_MSL);
                return(mappingItemCollection);
            }
        }
        public void IsDataServicesEdmx_returns_true_for_known_data_services_edmx()
        {
            const string edmxTemplate = "<Edmx xmlns=\"{0}\"><DataServices /></Edmx>";

            foreach (var edmxNs in SchemaManager.GetEDMXNamespaceNames())
            {
                Assert.True(
                    EdmUtils.IsDataServicesEdmx(
                        XDocument.Parse(
                            string.Format(edmxTemplate, edmxNs))));
            }
        }
Exemple #25
0
 private void ClearStructures()
 {
     if (this.schemaManager != null)
     {
         this.schemaManager.ClearStructures();
     }
     this.granteeManager = null;
     this.userManager    = null;
     this.NameManager    = null;
     this.schemaManager  = null;
     this.DbInfo         = null;
 }
Exemple #26
0
        internal static HashSet <string> InitializeExistingNamespaces(Project project)
        {
            var existingNamespaces = new HashSet <string>();

            if (project != null)
            {
                // find the namespace used in the CSDL section of each existing edmx file in the project
                var vsHierarchy = VsUtils.GetVsHierarchy(project, Services.ServiceProvider);
                var fileFinder  = new VSFileFinder(EntityDesignArtifact.ExtensionEdmx);
                fileFinder.FindInProject(vsHierarchy);

                foreach (var fileInfo in fileFinder.MatchingFiles)
                {
                    try
                    {
                        var xmlDocument = EdmUtils.SafeLoadXmlFromPath(fileInfo.Path);
                        foreach (var schemaVersion in EntityFrameworkVersion.GetAllVersions())
                        {
                            var nsMgr = SchemaManager.GetEdmxNamespaceManager(xmlDocument.NameTable, schemaVersion);

                            foreach (
                                XmlElement e in xmlDocument.SelectNodes("/edmx:Edmx/edmx:Runtime/edmx:ConceptualModels/csdl:Schema", nsMgr))
                            {
                                var namespaceValue = e.GetAttribute("Namespace");
                                if (!string.IsNullOrEmpty(namespaceValue))
                                {
                                    existingNamespaces.Add(namespaceValue);
                                }
                            }
                        }
                    }
                    // swallow various exceptions that come from reading the file or parsing xml
                    // We just skip this document in the event of an exception.
                    catch (IOException)
                    {
                    }
                    catch (UnauthorizedAccessException)
                    {
                    }
                    catch (NotSupportedException)
                    {
                    }
                    catch (SecurityException)
                    {
                    }
                    catch (XmlException)
                    {
                    }
                }
            }
            return(existingNamespaces);
        }
Exemple #27
0
        /// <summary>
        ///     Obtains the StoreGeneratedPattern value of an EdmProperty, given a target version and DataSpace
        /// </summary>
        /// <param name="property">The EdmProperty.</param>
        /// <param name="targetVersion">Used to correctly look up the StoreGeneratedPattern value in the EdmProperty</param>
        /// <param name="dataSpace">DataSpace where the EdmProperty lives (either CSDL or SSDL)</param>
        /// <returns>One of the StoreGeneratedPattern values, or String.Empty if the attribute or value does not exist</returns>
        public static StoreGeneratedPattern GetStoreGeneratedPatternValue(
            this EdmMember property, Version targetVersion, DataSpace dataSpace)
        {
            if (targetVersion == null)
            {
                throw new ArgumentNullException("targetVersion");
            }

            if (dataSpace == DataSpace.CSSpace ||
                dataSpace == DataSpace.OCSpace ||
                dataSpace == DataSpace.OSpace)
            {
                throw new ArgumentException(
                          String.Format(CultureInfo.CurrentCulture, Resources.ErrorNonValidDataSpace, dataSpace.ToString()));
            }

            if (dataSpace == DataSpace.CSpace)
            {
                // In the CSDL, StoreGeneratedPattern exists as an annotation in the EntityStoreSchemaGeneratorNamespace
                var sgpNamespace = SchemaManager.GetAnnotationNamespaceName();
                if (String.IsNullOrEmpty(sgpNamespace))
                {
                    throw new ArgumentException(
                              String.Format(CultureInfo.CurrentCulture, Resources.ErrorNonValidTargetVersion, targetVersion));
                }

                MetadataProperty sgpMetadataProperty = null;
                if (property.MetadataProperties.TryGetValue(
                        sgpNamespace + ":" + EdmConstants.facetNameStoreGeneratedPattern, false, out sgpMetadataProperty))
                {
                    var sgpValue = sgpMetadataProperty.Value as string;
                    Debug.Assert(
                        false == String.IsNullOrEmpty(sgpValue),
                        "If we found the StoreGeneratedPattern annotation in the CSDL, why weren't we able to find a value?");
                    if (false == String.IsNullOrEmpty(sgpValue))
                    {
                        return((StoreGeneratedPattern)Enum.Parse(typeof(StoreGeneratedPattern), sgpValue, false));
                    }
                }
            }
            else if (dataSpace == DataSpace.SSpace)
            {
                // In the SSDL, StoreGeneratedPattern exists as a facet
                Facet item = null;
                if (property.TypeUsage.Facets.TryGetValue(EdmConstants.facetNameStoreGeneratedPattern, false, out item))
                {
                    return((StoreGeneratedPattern)item.Value);
                }
            }

            return(StoreGeneratedPattern.None);
        }
Exemple #28
0
        public async Task EmbeddedScripts()
        {
            // Verify that we can process scripts loaded from embedded resources.

            var keyspaceName = GetUniqueKeyspaceName();

            using (var schemaManager = new SchemaManager(cassandra, keyspaceName, Assembly.GetExecutingAssembly().GetResourceFileSystem("Test.Neon.Cassandra.Scripts")))
            {
                await schemaManager.CreateKeyspaceAsync();

                await schemaManager.UpgradeKeyspaceAsync();
            }
        }
Exemple #29
0
 public DAMiddleware()
 {
     try
     {
         this.Database      = DatabaseFactory.CreateDatabase();
         this.SchemaManager = new SchemaManager(this.Database);
     }
     catch (Exception ex)
     {
         Logger.getInstance().Error("Middleware", "DAMiddleware()", ex);
         throw ex;
     }
 }
        private void BindData()
        {
            SchemaMaster currentShemaMaster = SchemaManager.GetShemaMaster(instance.SchemaId);
            object       rootActivity       = McWorkflowSerializer.GetObject(instance.Xaml);

            WorkflowDescription wfDescription = new WorkflowDescription((Guid)instance.PrimaryKeyId.Value,
                                                                        instance.Name,
                                                                        currentShemaMaster,
                                                                        rootActivity);

            ActivityGrid.DataSource = WorkflowActivityWrapper.GetActivityList(wfDescription, rootActivity);
            ActivityGrid.DataBind();
        }
Exemple #31
0
        public VfpConnection(string connectionString)
        {
            _vfpConnectionStringBuilder  = new VfpConnectionStringBuilder();
            OleDbConnection              = new OleDbConnection();
            OleDbConnection.StateChange += OleDbConnection_StateChange;

            SetConnectionString(connectionString);
            _schemaManager = new SchemaManager(this);

            CommandExecuting = details => VfpClientTracing.Tracer.TraceInformation(details.ToTraceString());
            CommandFailed    = details => VfpClientTracing.Tracer.TraceError(details.ToTraceString());
            CommandFinished  = details => VfpClientTracing.Tracer.TraceInformation(details.ToTraceString());
        }
Exemple #32
0
        public async Task EmbeddedScripts()
        {
            // Verify that we can process scripts loaded from embedded resources.

            var databaseName = GetUniqueDatabaseName();

            using (var schemaManager = new SchemaManager(postgres, databaseName, Assembly.GetExecutingAssembly().GetResourceFileSystem("Test.Neon.Postgres.Scripts")))
            {
                await schemaManager.CreateDatabaseAsync();

                await schemaManager.UpgradeDatabaseAsync();
            }
        }
Exemple #33
0
        protected internal override HashSet <string> GetNamespaces()
        {
            if (_namespaces == null)
            {
                _namespaces = new HashSet <string>();
                foreach (var n in SchemaManager.GetAllNamespacesForVersion(SchemaVersion))
                {
                    _namespaces.Add(n);
                }
            }

            return(_namespaces);
        }
        public void Should_be_able_to_upgrade_schema()
        {
            Thread.Sleep(1000);
            using (var dbMgr = new DatabaseManager())
            {
                dbMgr.UpdateToLatestVersion = false;
                dbMgr.CreateEmptyDatabase();
                dbMgr.InitSchema();

                var sut = new SchemaManager(() => dbMgr.OpenConnection());
                sut.UpgradeDatabaseSchema();
            }
        }
Exemple #35
0
        public static void AddTableShouldSetConnectionNameToNameOfSchema()
        {
            SchemaManager    mgr       = new SchemaManager();
            SchemaDefinition schema    = mgr.SetSchema("test");
            Table            testTable = new Table("".RandomString(5));

            Expect.IsNullOrEmpty(testTable.ConnectionName);

            schema.AddTable(testTable);

            Expect.IsNotNullOrEmpty(testTable.ConnectionName);
            Expect.AreEqual(schema.Name, testTable.ConnectionName);
        }
Exemple #36
0
        void BindList(SchemaManager mgr)
        {
            var om = mgr.GetObjectClassManager();

            //Only list structural object classes.
            _list = om.Data
                    .Where(x => x.Value.IsStructural)
                    .Select(x => x.Value)
                    .ToList();
            _list.Sort(SortObjectClassDTO);

            lstObjectClasses.VirtualListSize = _list.Count;
        }
        public override SchemaDefinition Extract()
        {
            NameFormatter = new SchemaNameMapNameFormatter(SetSchemaNameMap());
            SchemaManager schemaManager = new SchemaManager
            {
                AutoSave = false,
                SchemaTempPathProvider = SchemaTempPathProvider
            };

            SchemaDefinition result = Extract(schemaManager);

            return(result);
        }
        public static void Main()
        {
            Campus.Configuration.Config.Initialize(
                new Campus.Configuration.UserConfigManager(new Campus.Configuration.ConfigProvider_User(), FISCA.Authentication.DSAServices.UserAccount),
                new Campus.Configuration.ConfigurationManager(new Campus.Configuration.ConfigProvider_App()),
                new Campus.Configuration.ConfigurationManager(new Campus.Configuration.ConfigProvider_Global())
            );

            InitMainPanel();

            SchemaManager Manager = new SchemaManager(FISCA.Authentication.DSAServices.DefaultConnection);

            Manager.SyncSchema(new SchoolLog());
            Manager.SyncSchema(new Action());

            MainPanel.RibbonBarItems["自動編班"]["動作設定"].Image = Properties.Resources.achievement_config_128;
            MainPanel.RibbonBarItems["自動編班"]["動作設定"].Size = RibbonBarButton.MenuButtonSize.Medium;
            MainPanel.RibbonBarItems["自動編班"]["動作設定"].Click += (sender, e) => new frmActionList().ShowDialog();
            MainPanel.RibbonBarItems["自動編班"]["動作設定"].Enable = Permissions.動作設定權限;

            MainPanel.RibbonBarItems["自動編班"]["查詢紀錄"].Image = Properties.Resources.admissions_search_128;
            MainPanel.RibbonBarItems["自動編班"]["查詢紀錄"].Size = RibbonBarButton.MenuButtonSize.Medium;
            MainPanel.RibbonBarItems["自動編班"]["查詢紀錄"].Click += (sender, e) => new QueryLog().ShowDialog();
            MainPanel.RibbonBarItems["自動編班"]["查詢紀錄"].Enable = Permissions.查詢紀錄權限;

            MainPanel.RibbonBarItems["自動編班"]["查詢編班"].Click += (sender, e) => new frmClassOrder().ShowDialog();
            MainPanel.RibbonBarItems["自動編班"]["查詢編班"].Image = Properties.Resources.classmate_128;
            MainPanel.RibbonBarItems["自動編班"]["查詢編班"].Size = RibbonBarButton.MenuButtonSize.Medium;

            MainPanel.RibbonBarItems["自動編班"]["查詢高關懷學生"].Click += (sender, e) => new frmSpecial().ShowDialog();
            MainPanel.RibbonBarItems["自動編班"]["查詢高關懷學生"].Image = Properties.Resources.student_a_128;
            MainPanel.RibbonBarItems["自動編班"]["查詢高關懷學生"].Size = RibbonBarButton.MenuButtonSize.Medium;

            FISCA.Permission.Catalog AdminCatalog = FISCA.Permission.RoleAclSource.Instance["自動編班"]["功能按鈕"];
            AdminCatalog.Add(new RibbonFeature(Permissions.查詢紀錄, "查詢紀錄"));
            AdminCatalog.Add(new RibbonFeature(Permissions.動作設定, "動作設定"));
        }
Exemple #39
0
        public static void Init()
        {
            #region 模組啟用先同步Schmea

            SchemaManager Manager = new SchemaManager(FISCA.Authentication.DSAServices.DefaultConnection);

            Manager.SyncSchema(new EMBACore.UDT.Absence());
            Manager.SyncSchema(new EMBACore.UDT.AddDropCourse());
            Manager.SyncSchema(new EMBACore.UDT.CourseExt());
            Manager.SyncSchema(new EMBACore.UDT.CourseInstructor());
            Manager.SyncSchema(new EMBACore.UDT.CourseTypeDataSource());
            Manager.SyncSchema(new EMBACore.UDT.DepartmentGroup());
            Manager.SyncSchema(new EMBACore.UDT.DoNotTakeCourseInSummer());
            Manager.SyncSchema(new EMBACore.UDT.EducationBackground());
            Manager.SyncSchema(new EMBACore.UDT.Experience());
            Manager.SyncSchema(new EMBACore.UDT.ExperienceDataSource());
            Manager.SyncSchema(new EMBACore.UDT.GradeScoreMappingTable());
            Manager.SyncSchema(new EMBACore.UDT.GraduationRequirement());
            Manager.SyncSchema(new EMBACore.UDT.GraduationSubjectGroupRequirement());
            Manager.SyncSchema(new EMBACore.UDT.GraduationSubjectList());
            Manager.SyncSchema(new EMBACore.UDT.MailLog());
            Manager.SyncSchema(new EMBACore.UDT.Paper());
            Manager.SyncSchema(new EMBACore.UDT.PaymentHistory());
            Manager.SyncSchema(new EMBACore.UDT.SCAttendExt());
            Manager.SyncSchema(new EMBACore.UDT.ScoreInputSemester());
            Manager.SyncSchema(new EMBACore.UDT.StudentBrief2());
            Manager.SyncSchema(new EMBACore.UDT.StudentRemark());
            Manager.SyncSchema(new EMBACore.UDT.Subject());
            Manager.SyncSchema(new EMBACore.UDT.SubjectScoreLock());
            Manager.SyncSchema(new EMBACore.UDT.SubjectSemesterScore());
            Manager.SyncSchema(new EMBACore.UDT.SyncStudentLock());
            Manager.SyncSchema(new EMBACore.UDT.TeacherExtVO());
            Manager.SyncSchema(new EMBACore.UDT.SubjectSemesterScoreInputRule());

            #endregion
        }
        public static void Main()
        {
            #region 模組啟用先同步Schmea
            //K12.Data.Configuration.ConfigData cd = K12.Data.School.Configuration["調代課UDT載入設定"];

            //bool checkClubUDT = false;
            //string name = "調代課UDT_20131008";

            ////如果尚無設定值,預設為
            //if (string.IsNullOrEmpty(cd[name]))
            //{
            //    cd[name] = "false";
            //}
            ////檢查是否為布林
            //bool.TryParse(cd[name], out checkClubUDT);

            //if (!checkClubUDT)
            //{

            //ServerModule.AutoManaged("http://module.ischool.com.tw/module/89/KHCentralOffice/udm.xml");

            SchemaManager Manager = new SchemaManager(FISCA.Authentication.DSAServices.DefaultConnection);

            Manager.SyncSchema(new School());
            Manager.SyncSchema(new ApproachStatistics());
            Manager.SyncSchema(new VagrantStatistics());
            Manager.SyncSchema(new SchoolLog());

                //cd[name] = "true";
                //cd.Save();
            //}
            #endregion

            FISCA.Presentation.MotherForm.StartMenu["安全性"]["權限管理"].Click += (sender, e) => new FISCA.Permission.UI.RoleManager().ShowDialog();

            DSAServices.AutoDisplayLoadingMessageOnMotherForm();

            GlobalSchoolCache = new DynamicCache(); //建立一個空的快取。

            InitAsposeLicense();
            InitStartMenu();
            InitConfigurationStorage();
            InitMainPanel();

            //MainPanel.ListPaneContexMenu["執行 SQL 並匯出"].Click += delegate
            //{
            //    new ExportQueryData().Export();
            //};

            new FieldManager();
            new DetailItems();
            //new RibbonButtons();
            //new ImportExport();//匯入學校資料

            Program.MainPanel.RibbonBarItems["畢業學生進路調查"]["開放時間"].Image = Properties.Resources.school_events_config_128;
            Program.MainPanel.RibbonBarItems["畢業學生進路調查"]["開放時間"].Size = RibbonBarButton.MenuButtonSize.Medium;
            Program.MainPanel.RibbonBarItems["畢業學生進路調查"]["開放時間"].Click += (sender, e) => new OpenTime().ShowDialog();
            Program.MainPanel.RibbonBarItems["畢業學生進路調查"]["開放時間"].Enable = Permissions.開放時間權限;

            Program.MainPanel.RibbonBarItems["畢業學生進路調查"]["報表"].Image = Properties.Resources.paste_64;
            Program.MainPanel.RibbonBarItems["畢業學生進路調查"]["報表"].Size = RibbonBarButton.MenuButtonSize.Medium;

            #region 匯出畢業學生進路統計分析資料
            Program.MainPanel.RibbonBarItems["畢業學生進路調查"]["匯出"].Image = Properties.Resources.Export_Image;
            Program.MainPanel.RibbonBarItems["畢業學生進路調查"]["匯出"].Size = RibbonBarButton.MenuButtonSize.Medium;
            Catalog button_Approach_Export = RoleAclSource.Instance["學校"]["功能按鈕"];
            button_Approach_Export.Add(new RibbonFeature("button_Approach_Export", "匯出畢業學生進路統計分析資料"));
            Program.MainPanel.RibbonBarItems["畢業學生進路調查"]["匯出"]["畢業學生進路統計分析資料"].Enable = UserAcl.Current["button_Approach_Export"].Executable;
            Program.MainPanel.RibbonBarItems["畢業學生進路調查"]["匯出"]["畢業學生進路統計分析資料"].Click += delegate
            {
                (new Approach_Export()).ShowDialog();
            };
            #endregion

            Program.MainPanel.RibbonBarItems["畢業學生進路調查"]["報表"]["畢業學生進路統計表"].Click += (sender, e) => new Approach_Report("國中畢業學生進路調查填報表格", Accessor.ApproachReportTemplate.ReportType.統計表).ShowDialog();
            Program.MainPanel.RibbonBarItems["畢業學生進路調查"]["報表"]["畢業學生進路統計表"].Enable = Permissions.畢業學生進路統計表權限;

            Program.MainPanel.RibbonBarItems["畢業學生進路調查"]["報表"]["畢業學生進路複核表"].Click += (sender, e) => new Approach_Report("國中畢業學生進路調查填報複核表", Accessor.ApproachReportTemplate.ReportType.複核表).ShowDialog();
            Program.MainPanel.RibbonBarItems["畢業學生進路調查"]["報表"]["畢業學生進路複核表"].Enable = Permissions.畢業學生進路複核表權限;

            Program.MainPanel.RibbonBarItems["畢業學生進路調查"]["報表"]["畢業未升學未就業學生動向"].Click += (sender, e) => new UnApproach_Report("國中畢業未升學未就業學生動向", Properties.Resources.國中畢業未升學未就業學生動向).ShowDialog();
            Program.MainPanel.RibbonBarItems["畢業學生進路調查"]["報表"]["畢業未升學未就業學生動向"].Enable = Permissions.畢業未升學未就業學生動向權限;

            Program.MainPanel.RibbonBarItems["畢業學生進路調查"]["未上傳學校"].Size = RibbonBarButton.MenuButtonSize.Medium;
            Program.MainPanel.RibbonBarItems["畢業學生進路調查"]["未上傳學校"].Image = Properties.Resources.school_search_128;
            Program.MainPanel.RibbonBarItems["畢業學生進路調查"]["未上傳學校"].Click += (sender, e) => new UnApproach_Check().ShowDialog();
            Program.MainPanel.RibbonBarItems["畢業學生進路調查"]["未上傳學校"].Enable = Permissions.未上傳學校權限;

            FISCA.Permission.Catalog AdminCatalog = FISCA.Permission.RoleAclSource.Instance["畢業學生進路調查"]["功能按鈕"];
            AdminCatalog.Add(new RibbonFeature(Permissions.未上傳學校, "未上傳學校"));
            AdminCatalog.Add(new RibbonFeature(Permissions.畢業未升學未就業學生動向, "畢業未升學未就業學生動向"));
            AdminCatalog.Add(new RibbonFeature(Permissions.畢業學生進路統計表, "畢業學生進路統計表"));
            AdminCatalog.Add(new RibbonFeature(Permissions.畢業學生進路複核表, "畢業學生進路複核表"));
            AdminCatalog.Add(new RibbonFeature(Permissions.開放時間, "開放時間"));

            FISCA.Permission.Catalog DetailCatalog = FISCA.Permission.RoleAclSource.Instance["畢業學生進路調查"]["資料項目"];
            DetailCatalog.Add(new DetailItemFeature(Permissions.學校基本資料, "學校基本資料"));
            DetailCatalog.Add(new DetailItemFeature(Permissions.學校進路統計, "學校進路統計"));

            RefreshFilteredSource();

            FISCA.Presentation.MotherForm.Form.Text = GetTitleText();
        }
Exemple #41
0
 /// <summary>
 /// 建立使用到的 UDT Table
 /// </summary>
 public static void CreateUDTTable()
 {
     FISCA.UDT.SchemaManager Manager = new SchemaManager(new FISCA.DSAUtil.DSConnection(FISCA.Authentication.DSAServices.DefaultDataSource));
     Manager.SyncSchema(new DAO.udt_ConfigData());
 }
 public ContentTypeController(SchemaManager manager)
 {
     Manager = manager;
 }
        public static void SyncDBSchema()
        {
            #region 模組啟用先同步Schema

            SchemaManager Manager = new SchemaManager(FISCA.Authentication.DSAServices.DefaultConnection);

            Manager.SyncSchema(new UDT.Case());
            Manager.SyncSchema(new UDT.CaseUsage());
            Manager.SyncSchema(new UDT.oAuthAccount());
            Manager.SyncSchema(new UDT.Reply());

            #endregion
        }
           /// <summary>
        /// 建立使用到的 UDT Table
        /// </summary>
        public static void CreateRetakeUDTTable()
        {
            // 重補修
            FISCA.UDT.SchemaManager Manager = new SchemaManager(new DSConnection(FISCA.Authentication.DSAServices.DefaultDataSource));

            Manager.SyncSchema(new UDTAttendanceDef());
            Manager.SyncSchema(new UDTCdselectDef());
            Manager.SyncSchema(new UDTCourseDef());
            Manager.SyncSchema(new UDTCourseTimetableDef());
            Manager.SyncSchema(new UDTExamDef());
            Manager.SyncSchema(new UDTFailSubjectListDef());

            Manager.SyncSchema(new UDTScselectDef());
            Manager.SyncSchema(new UDTSsselectDef());
            Manager.SyncSchema(new UDTSubjectDef());
            Manager.SyncSchema(new UDTSuggestListDef());
            Manager.SyncSchema(new UDTTimeListDef());
            Manager.SyncSchema(new UDTTimeSectionDef());
            Manager.SyncSchema(new UDTWeightProportionDef());            
        }
        /// <summary>
        /// 建立使用到的 UDT Table
        /// </summary>
        public static void CreateCounselUDTTable()
        {
            //AccessHelper accHelper = new AccessHelper();
            //string query = "UID='1'";
            // 輔導與認輔學生
            FISCA.UDT.SchemaManager Manager = new SchemaManager(new DSConnection(FISCA.Authentication.DSAServices.DefaultDataSource));

            Manager.SyncSchema(new UDT_CounselStudent_ListDef());
            Manager.SyncSchema(new UDT_QuizDef());
            Manager.SyncSchema(new UDT_StudQuizDataDef());
            Manager.SyncSchema(new UDT_CounselStudentInterviewRecordDef());
            Manager.SyncSchema(new UDT_CounselCaseMeetingRecordDef());
            Manager.SyncSchema(new UDT_CounselCareRecordDef());

            Manager.SyncSchema(new UDTQuestionsDataDef());
            Manager.SyncSchema(new UDTYearlyDataDef());
            Manager.SyncSchema(new UDTSemesterDataDef());
            Manager.SyncSchema(new UDTSingleRecordDef());
            Manager.SyncSchema(new UDTMultipleRecordDef());
            Manager.SyncSchema(new UDTRelativeDef());
            Manager.SyncSchema(new UDTSiblingDef());
            Manager.SyncSchema(new UDTPriorityDataDef());

            //accHelper.Select<UDT_CounselStudent_ListDef>(query);
            // 心理測驗題目
            //accHelper.Select<UDT_QuizDef>(query);
            // 心理測驗答案
            //accHelper.Select<UDT_StudQuizDataDef>(query);
            // 晤談
            //accHelper.Select<UDT_CounselStudentInterviewRecordDef>(query);
            // 個案會議
            //accHelper.Select<UDT_CounselCaseMeetingRecordDef>(query);
            // 優先關懷
            //accHelper.Select<UDT_CounselCareRecordDef>(query);

            // 學年(綜合紀錄表)
            //accHelper.Select<UDTYearlyDataDef>(query);
            // 學期(綜合紀錄表)
            //accHelper.Select<UDTSemesterDataDef>(query);
            // 單一(綜合紀錄表)
            //accHelper.Select<UDTSingleRecordDef>(query);
            // 多選(綜合紀錄表)
            //accHelper.Select<UDTMultipleRecordDef>(query);
            // 直系血親(綜合紀錄表)
            //accHelper.Select<UDTRelativeDef>(query);
            // 兄弟姊妹(綜合紀錄表)
            //accHelper.Select<UDTSiblingDef>(query);
            // 優先順序(綜合紀錄表)
            //accHelper.Select<UDTPriorityDataDef>(query);
        }
        public static void SyncDBSchema()
        {
            #region 模組啟用先同步Schmea

            SchemaManager Manager = new SchemaManager(FISCA.Authentication.DSAServices.DefaultConnection);

            Manager.SyncSchema(new UDT.AssignedSurvey());
            Manager.SyncSchema(new UDT.Case());
            Manager.SyncSchema(new UDT.Question());
            Manager.SyncSchema(new UDT.QuestionOption());
            Manager.SyncSchema(new UDT.Reply());
            Manager.SyncSchema(new UDT.Section());
            Manager.SyncSchema(new UDT.Survey());
            Manager.SyncSchema(new UDT.CaseUsage());
            Manager.SyncSchema(new UDT.MandrillSendLog());
            Manager.SyncSchema(new UDT.AchievingRate());
            Manager.SyncSchema(new UDT.ReportTemplate());

            if (!FISCA.RTContext.IsDiagMode)
                ServerModule.AutoManaged("https://module.ischool.com.tw/module/140/NTU_EMBA_TeachingEvaluation/udm.xml");

            #endregion
        }
Exemple #47
0
 public ModuleEvents(SchemaManager schemaManager, TextFolderManager textFolderManager)
 {
     this._schemaManager = schemaManager;
     this._textFolderManager = textFolderManager;
 }
        public static void SyncDBSchema()
        {
            #region 模組啟用先同步Schmea

            SchemaManager Manager = new SchemaManager(FISCA.Authentication.DSAServices.DefaultConnection);

            Manager.SyncSchema(new UDT.CSAttend());
            Manager.SyncSchema(new UDT.CSAttendLog());
            Manager.SyncSchema(new UDT.CSAttendSnapshot());
            Manager.SyncSchema(new UDT.CSCourseExt());
            Manager.SyncSchema(new UDT.CSFaq());
            Manager.SyncSchema(new UDT.CSOpeningInfo());
            Manager.SyncSchema(new UDT.RegistrationConfirm());
            Manager.SyncSchema(new UDT.CSConfiguration());
            Manager.SyncSchema(new UDT.TeacherExtVO());
            Manager.SyncSchema(new UDT.WebEMailAccount());
            Manager.SyncSchema(new UDT.ConflictCourse());
            Manager.SyncSchema(new UDT.SCAttendExt());
            Manager.SyncSchema(new UDT.WebUrls());

            if (!FISCA.RTContext.IsDiagMode)
                ServerModule.AutoManaged("https://module.ischool.com.tw/module/140/NTU_EMBA_CourseSelection/udm.xml");

            #endregion
        }
        private static void SyncUDTSchema()
        {
            SchemaManager Manager = new SchemaManager(FISCA.Authentication.DSAServices.DefaultConnection);

            //Manager.SyncSchema(new UDT.Vagrant());
            Manager.SyncSchema(new UDT.Approach());
        }