Exemplo n.º 1
0
        /// <summary>
        ///  Create basic tables of PersistentObjects
        /// </summary>
        private static Type[] CreateBasicTable()
        {
            Type[] basicTypes = new Type[] {
                //typeof(dictDatabaseDpo),
                //typeof(dictDataTableDpo),
                //typeof(dictDataColumnDpo),
                //typeof(dictEnumTypeDpo),
                //typeof(logDataSetDpo),
                //typeof(logDataTableDpo),
                //typeof(logDataColumnDpo),
                //typeof(RecordLockDpo),
                //typeof(DataProviderDpo),
                //typeof(logDpoClassDpo)
            };

            foreach (Type type in basicTypes)
            {
                DPObject dpo = (DPObject)Activator.CreateInstance(type);
                dpo.CreateTable();
            }

            foreach (Type type in basicTypes)
            {
                DPObject dpo = (DPObject)Activator.CreateInstance(type);
                //dpo.RegisterEntireTable();
            }

            return(basicTypes);
        }
Exemplo n.º 2
0
        private static MessageBuilder CreateTable(Type dpoType)
        {
            MessageBuilder messages = new MessageBuilder();

            DPObject dpo = (DPObject)Activator.CreateInstance(dpoType);

            int tableId = dpo.TableName.Id;

            if (dpo.CreateTable())
            {
                messages.Add(Message.Information(string.Format("Table {0} created.", dpo.TableName)));

                //if (tableId == -1)  //register new table to dictionary
                //tableId = dpo.RegisterEntireTable();
            }
            else
            {
                messages.Add(Message.Information(string.Format("Table {0} exists, cannot be created.", dpo.TableName)));
            }

            return(messages);
        }