Exemple #1
0
        public void CreateAllAuxiliaryTableIfNotExists()
        {
            //添加后台内容表
            if (!IsTableExists(EAuxiliaryTableType.BackgroundContent))
            {
                var tableName = EAuxiliaryTableTypeUtils.GetDefaultTableName(EAuxiliaryTableType.BackgroundContent);
                var tableInfo = new AuxiliaryTableInfo(tableName, "后台内容表", 0, EAuxiliaryTableType.BackgroundContent, false, false, true, string.Empty);
                BaiRongDataProvider.TableCollectionDao.Insert(tableInfo);
                BaiRongDataProvider.TableMetadataDao.CreateAuxiliaryTable(tableInfo.TableEnName);
            }

            //添加招聘内容表
            if (!IsTableExists(EAuxiliaryTableType.JobContent))
            {
                var tableName = EAuxiliaryTableTypeUtils.GetDefaultTableName(EAuxiliaryTableType.JobContent);
                var tableInfo = new AuxiliaryTableInfo(tableName, "招聘内容表", 0, EAuxiliaryTableType.JobContent, false, false, true, string.Empty);
                BaiRongDataProvider.TableCollectionDao.Insert(tableInfo);
                BaiRongDataProvider.TableMetadataDao.CreateAuxiliaryTable(tableInfo.TableEnName);
            }

            //添加投票内容表
            if (!IsTableExists(EAuxiliaryTableType.VoteContent))
            {
                var tableName = EAuxiliaryTableTypeUtils.GetDefaultTableName(EAuxiliaryTableType.VoteContent);
                var tableInfo = new AuxiliaryTableInfo(tableName, "投票内容表", 0, EAuxiliaryTableType.VoteContent, false, false, true, string.Empty);
                BaiRongDataProvider.TableCollectionDao.Insert(tableInfo);
                BaiRongDataProvider.TableMetadataDao.CreateAuxiliaryTable(tableInfo.TableEnName);
            }

            //添加信息公开内容表
            if (!IsTableExists(EAuxiliaryTableType.GovPublicContent))
            {
                var tableName = EAuxiliaryTableTypeUtils.GetDefaultTableName(EAuxiliaryTableType.GovPublicContent);
                var tableInfo = new AuxiliaryTableInfo(tableName, "信息公开内容表", 0, EAuxiliaryTableType.GovPublicContent, false, false, true, string.Empty);
                BaiRongDataProvider.TableCollectionDao.Insert(tableInfo);
                BaiRongDataProvider.TableMetadataDao.CreateAuxiliaryTable(tableInfo.TableEnName);
            }

            //添加互动交流内容表
            if (!IsTableExists(EAuxiliaryTableType.GovInteractContent))
            {
                var tableName = EAuxiliaryTableTypeUtils.GetDefaultTableName(EAuxiliaryTableType.GovInteractContent);
                var tableInfo = new AuxiliaryTableInfo(tableName, "互动交流内容表", 0, EAuxiliaryTableType.GovInteractContent, false, false, true, string.Empty);
                BaiRongDataProvider.TableCollectionDao.Insert(tableInfo);
                BaiRongDataProvider.TableMetadataDao.CreateAuxiliaryTable(tableInfo.TableEnName);
            }
        }