예제 #1
0
파일: Unpacking.cs 프로젝트: fjiang2/sqlcon
        /// <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);
        }
예제 #2
0
파일: Unpacking.cs 프로젝트: fjiang2/sqlcon
        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);
        }