private static void GetTableSchema() { if (!IsSchemaInitialized) { //Schema declaration TableSchema.Table schema = new TableSchema.Table("tblReview", TableType.Table, DataService.GetInstance("SignificantTradeSS")); schema.Columns = new TableSchema.TableColumnCollection(); schema.SchemaName = @"dbo"; //columns TableSchema.TableColumn colvarId = new TableSchema.TableColumn(schema); colvarId.ColumnName = "ID"; colvarId.DataType = DbType.Int32; colvarId.MaxLength = 0; colvarId.AutoIncrement = true; colvarId.IsNullable = false; colvarId.IsPrimaryKey = true; colvarId.IsForeignKey = false; colvarId.IsReadOnly = false; colvarId.DefaultSetting = @""; colvarId.ForeignKeyTableName = ""; schema.Columns.Add(colvarId); TableSchema.TableColumn colvarPhaseID = new TableSchema.TableColumn(schema); colvarPhaseID.ColumnName = "PhaseID"; colvarPhaseID.DataType = DbType.Int32; colvarPhaseID.MaxLength = 0; colvarPhaseID.AutoIncrement = false; colvarPhaseID.IsNullable = true; colvarPhaseID.IsPrimaryKey = false; colvarPhaseID.IsForeignKey = false; colvarPhaseID.IsReadOnly = false; colvarPhaseID.DefaultSetting = @""; colvarPhaseID.ForeignKeyTableName = ""; schema.Columns.Add(colvarPhaseID); TableSchema.TableColumn colvarCountryID = new TableSchema.TableColumn(schema); colvarCountryID.ColumnName = "CountryID"; colvarCountryID.DataType = DbType.Int32; colvarCountryID.MaxLength = 0; colvarCountryID.AutoIncrement = false; colvarCountryID.IsNullable = true; colvarCountryID.IsPrimaryKey = false; colvarCountryID.IsForeignKey = false; colvarCountryID.IsReadOnly = false; colvarCountryID.DefaultSetting = @""; colvarCountryID.ForeignKeyTableName = ""; schema.Columns.Add(colvarCountryID); TableSchema.TableColumn colvarTaxonID = new TableSchema.TableColumn(schema); colvarTaxonID.ColumnName = "TaxonID"; colvarTaxonID.DataType = DbType.Int32; colvarTaxonID.MaxLength = 0; colvarTaxonID.AutoIncrement = false; colvarTaxonID.IsNullable = true; colvarTaxonID.IsPrimaryKey = false; colvarTaxonID.IsForeignKey = false; colvarTaxonID.IsReadOnly = false; colvarTaxonID.DefaultSetting = @""; colvarTaxonID.ForeignKeyTableName = ""; schema.Columns.Add(colvarTaxonID); TableSchema.TableColumn colvarTaxonLevel = new TableSchema.TableColumn(schema); colvarTaxonLevel.ColumnName = "TaxonLevel"; colvarTaxonLevel.DataType = DbType.Int32; colvarTaxonLevel.MaxLength = 0; colvarTaxonLevel.AutoIncrement = false; colvarTaxonLevel.IsNullable = true; colvarTaxonLevel.IsPrimaryKey = false; colvarTaxonLevel.IsForeignKey = false; colvarTaxonLevel.IsReadOnly = false; colvarTaxonLevel.DefaultSetting = @""; colvarTaxonLevel.ForeignKeyTableName = ""; schema.Columns.Add(colvarTaxonLevel); TableSchema.TableColumn colvarDateAdded = new TableSchema.TableColumn(schema); colvarDateAdded.ColumnName = "DateAdded"; colvarDateAdded.DataType = DbType.DateTime; colvarDateAdded.MaxLength = 0; colvarDateAdded.AutoIncrement = false; colvarDateAdded.IsNullable = true; colvarDateAdded.IsPrimaryKey = false; colvarDateAdded.IsForeignKey = false; colvarDateAdded.IsReadOnly = false; colvarDateAdded.DefaultSetting = @""; colvarDateAdded.ForeignKeyTableName = ""; schema.Columns.Add(colvarDateAdded); TableSchema.TableColumn colvarAddedBy = new TableSchema.TableColumn(schema); colvarAddedBy.ColumnName = "AddedBy"; colvarAddedBy.DataType = DbType.Int32; colvarAddedBy.MaxLength = 0; colvarAddedBy.AutoIncrement = false; colvarAddedBy.IsNullable = true; colvarAddedBy.IsPrimaryKey = false; colvarAddedBy.IsForeignKey = false; colvarAddedBy.IsReadOnly = false; colvarAddedBy.DefaultSetting = @""; colvarAddedBy.ForeignKeyTableName = ""; schema.Columns.Add(colvarAddedBy); TableSchema.TableColumn colvarKingdomID = new TableSchema.TableColumn(schema); colvarKingdomID.ColumnName = "KingdomID"; colvarKingdomID.DataType = DbType.Int32; colvarKingdomID.MaxLength = 0; colvarKingdomID.AutoIncrement = false; colvarKingdomID.IsNullable = true; colvarKingdomID.IsPrimaryKey = false; colvarKingdomID.IsForeignKey = false; colvarKingdomID.IsReadOnly = false; colvarKingdomID.DefaultSetting = @""; colvarKingdomID.ForeignKeyTableName = ""; schema.Columns.Add(colvarKingdomID); TableSchema.TableColumn colvarDeleted = new TableSchema.TableColumn(schema); colvarDeleted.ColumnName = "Deleted"; colvarDeleted.DataType = DbType.Boolean; colvarDeleted.MaxLength = 0; colvarDeleted.AutoIncrement = false; colvarDeleted.IsNullable = false; colvarDeleted.IsPrimaryKey = false; colvarDeleted.IsForeignKey = false; colvarDeleted.IsReadOnly = false; colvarDeleted.DefaultSetting = @"((0))"; colvarDeleted.ForeignKeyTableName = ""; schema.Columns.Add(colvarDeleted); TableSchema.TableColumn colvarDeletedDate = new TableSchema.TableColumn(schema); colvarDeletedDate.ColumnName = "DeletedDate"; colvarDeletedDate.DataType = DbType.DateTime; colvarDeletedDate.MaxLength = 0; colvarDeletedDate.AutoIncrement = false; colvarDeletedDate.IsNullable = true; colvarDeletedDate.IsPrimaryKey = false; colvarDeletedDate.IsForeignKey = false; colvarDeletedDate.IsReadOnly = false; colvarDeletedDate.DefaultSetting = @""; colvarDeletedDate.ForeignKeyTableName = ""; schema.Columns.Add(colvarDeletedDate); TableSchema.TableColumn colvarCommitteeID = new TableSchema.TableColumn(schema); colvarCommitteeID.ColumnName = "CommitteeID"; colvarCommitteeID.DataType = DbType.Int32; colvarCommitteeID.MaxLength = 0; colvarCommitteeID.AutoIncrement = false; colvarCommitteeID.IsNullable = true; colvarCommitteeID.IsPrimaryKey = false; colvarCommitteeID.IsForeignKey = false; colvarCommitteeID.IsReadOnly = false; colvarCommitteeID.DefaultSetting = @""; colvarCommitteeID.ForeignKeyTableName = ""; schema.Columns.Add(colvarCommitteeID); TableSchema.TableColumn colvarReviewDate = new TableSchema.TableColumn(schema); colvarReviewDate.ColumnName = "ReviewDate"; colvarReviewDate.DataType = DbType.DateTime; colvarReviewDate.MaxLength = 0; colvarReviewDate.AutoIncrement = false; colvarReviewDate.IsNullable = true; colvarReviewDate.IsPrimaryKey = false; colvarReviewDate.IsForeignKey = false; colvarReviewDate.IsReadOnly = false; colvarReviewDate.DefaultSetting = @""; colvarReviewDate.ForeignKeyTableName = ""; schema.Columns.Add(colvarReviewDate); TableSchema.TableColumn colvarReviewType = new TableSchema.TableColumn(schema); colvarReviewType.ColumnName = "ReviewType"; colvarReviewType.DataType = DbType.Int32; colvarReviewType.MaxLength = 0; colvarReviewType.AutoIncrement = false; colvarReviewType.IsNullable = true; colvarReviewType.IsPrimaryKey = false; colvarReviewType.IsForeignKey = false; colvarReviewType.IsReadOnly = false; colvarReviewType.DefaultSetting = @""; colvarReviewType.ForeignKeyTableName = ""; schema.Columns.Add(colvarReviewType); TableSchema.TableColumn colvarConcernID = new TableSchema.TableColumn(schema); colvarConcernID.ColumnName = "ConcernID"; colvarConcernID.DataType = DbType.Int32; colvarConcernID.MaxLength = 0; colvarConcernID.AutoIncrement = false; colvarConcernID.IsNullable = true; colvarConcernID.IsPrimaryKey = false; colvarConcernID.IsForeignKey = false; colvarConcernID.IsReadOnly = false; colvarConcernID.DefaultSetting = @""; colvarConcernID.ForeignKeyTableName = ""; schema.Columns.Add(colvarConcernID); TableSchema.TableColumn colvarOldSigMainID = new TableSchema.TableColumn(schema); colvarOldSigMainID.ColumnName = "OldSigMainID"; colvarOldSigMainID.DataType = DbType.Int32; colvarOldSigMainID.MaxLength = 0; colvarOldSigMainID.AutoIncrement = false; colvarOldSigMainID.IsNullable = true; colvarOldSigMainID.IsPrimaryKey = false; colvarOldSigMainID.IsForeignKey = false; colvarOldSigMainID.IsReadOnly = false; colvarOldSigMainID.DefaultSetting = @""; colvarOldSigMainID.ForeignKeyTableName = ""; schema.Columns.Add(colvarOldSigMainID); BaseSchema = schema; //add this schema to the provider //so we can query it later DataService.Providers["SignificantTradeSS"].AddSchema("tblReview", schema); } }
private static void GetTableSchema() { if (!IsSchemaInitialized) { //Schema declaration TableSchema.Table schema = new TableSchema.Table("Customers", TableType.Table, DataService.GetInstance("Northwind")); schema.Columns = new TableSchema.TableColumnCollection(); schema.SchemaName = @"dbo"; //columns TableSchema.TableColumn colvarCustomerID = new TableSchema.TableColumn(schema); colvarCustomerID.ColumnName = "CustomerID"; colvarCustomerID.DataType = DbType.String; colvarCustomerID.MaxLength = 5; colvarCustomerID.AutoIncrement = false; colvarCustomerID.IsNullable = false; colvarCustomerID.IsPrimaryKey = true; colvarCustomerID.IsForeignKey = false; colvarCustomerID.IsReadOnly = false; colvarCustomerID.DefaultSetting = @""; colvarCustomerID.ForeignKeyTableName = ""; schema.Columns.Add(colvarCustomerID); TableSchema.TableColumn colvarCompanyName = new TableSchema.TableColumn(schema); colvarCompanyName.ColumnName = "CompanyName"; colvarCompanyName.DataType = DbType.String; colvarCompanyName.MaxLength = 40; colvarCompanyName.AutoIncrement = false; colvarCompanyName.IsNullable = false; colvarCompanyName.IsPrimaryKey = false; colvarCompanyName.IsForeignKey = false; colvarCompanyName.IsReadOnly = false; colvarCompanyName.DefaultSetting = @""; colvarCompanyName.ForeignKeyTableName = ""; schema.Columns.Add(colvarCompanyName); TableSchema.TableColumn colvarContactName = new TableSchema.TableColumn(schema); colvarContactName.ColumnName = "ContactName"; colvarContactName.DataType = DbType.String; colvarContactName.MaxLength = 30; colvarContactName.AutoIncrement = false; colvarContactName.IsNullable = true; colvarContactName.IsPrimaryKey = false; colvarContactName.IsForeignKey = false; colvarContactName.IsReadOnly = false; colvarContactName.DefaultSetting = @""; colvarContactName.ForeignKeyTableName = ""; schema.Columns.Add(colvarContactName); TableSchema.TableColumn colvarContactTitle = new TableSchema.TableColumn(schema); colvarContactTitle.ColumnName = "ContactTitle"; colvarContactTitle.DataType = DbType.String; colvarContactTitle.MaxLength = 30; colvarContactTitle.AutoIncrement = false; colvarContactTitle.IsNullable = true; colvarContactTitle.IsPrimaryKey = false; colvarContactTitle.IsForeignKey = false; colvarContactTitle.IsReadOnly = false; colvarContactTitle.DefaultSetting = @""; colvarContactTitle.ForeignKeyTableName = ""; schema.Columns.Add(colvarContactTitle); TableSchema.TableColumn colvarAddress = new TableSchema.TableColumn(schema); colvarAddress.ColumnName = "Address"; colvarAddress.DataType = DbType.String; colvarAddress.MaxLength = 60; colvarAddress.AutoIncrement = false; colvarAddress.IsNullable = true; colvarAddress.IsPrimaryKey = false; colvarAddress.IsForeignKey = false; colvarAddress.IsReadOnly = false; colvarAddress.DefaultSetting = @""; colvarAddress.ForeignKeyTableName = ""; schema.Columns.Add(colvarAddress); TableSchema.TableColumn colvarCity = new TableSchema.TableColumn(schema); colvarCity.ColumnName = "City"; colvarCity.DataType = DbType.String; colvarCity.MaxLength = 15; colvarCity.AutoIncrement = false; colvarCity.IsNullable = true; colvarCity.IsPrimaryKey = false; colvarCity.IsForeignKey = false; colvarCity.IsReadOnly = false; colvarCity.DefaultSetting = @""; colvarCity.ForeignKeyTableName = ""; schema.Columns.Add(colvarCity); TableSchema.TableColumn colvarRegion = new TableSchema.TableColumn(schema); colvarRegion.ColumnName = "Region"; colvarRegion.DataType = DbType.String; colvarRegion.MaxLength = 15; colvarRegion.AutoIncrement = false; colvarRegion.IsNullable = true; colvarRegion.IsPrimaryKey = false; colvarRegion.IsForeignKey = false; colvarRegion.IsReadOnly = false; colvarRegion.DefaultSetting = @""; colvarRegion.ForeignKeyTableName = ""; schema.Columns.Add(colvarRegion); TableSchema.TableColumn colvarPostalCode = new TableSchema.TableColumn(schema); colvarPostalCode.ColumnName = "PostalCode"; colvarPostalCode.DataType = DbType.String; colvarPostalCode.MaxLength = 10; colvarPostalCode.AutoIncrement = false; colvarPostalCode.IsNullable = true; colvarPostalCode.IsPrimaryKey = false; colvarPostalCode.IsForeignKey = false; colvarPostalCode.IsReadOnly = false; colvarPostalCode.DefaultSetting = @""; colvarPostalCode.ForeignKeyTableName = ""; schema.Columns.Add(colvarPostalCode); TableSchema.TableColumn colvarCountry = new TableSchema.TableColumn(schema); colvarCountry.ColumnName = "Country"; colvarCountry.DataType = DbType.String; colvarCountry.MaxLength = 15; colvarCountry.AutoIncrement = false; colvarCountry.IsNullable = true; colvarCountry.IsPrimaryKey = false; colvarCountry.IsForeignKey = false; colvarCountry.IsReadOnly = false; colvarCountry.DefaultSetting = @""; colvarCountry.ForeignKeyTableName = ""; schema.Columns.Add(colvarCountry); TableSchema.TableColumn colvarPhone = new TableSchema.TableColumn(schema); colvarPhone.ColumnName = "Phone"; colvarPhone.DataType = DbType.String; colvarPhone.MaxLength = 24; colvarPhone.AutoIncrement = false; colvarPhone.IsNullable = true; colvarPhone.IsPrimaryKey = false; colvarPhone.IsForeignKey = false; colvarPhone.IsReadOnly = false; colvarPhone.DefaultSetting = @""; colvarPhone.ForeignKeyTableName = ""; schema.Columns.Add(colvarPhone); TableSchema.TableColumn colvarFax = new TableSchema.TableColumn(schema); colvarFax.ColumnName = "Fax"; colvarFax.DataType = DbType.String; colvarFax.MaxLength = 24; colvarFax.AutoIncrement = false; colvarFax.IsNullable = true; colvarFax.IsPrimaryKey = false; colvarFax.IsForeignKey = false; colvarFax.IsReadOnly = false; colvarFax.DefaultSetting = @""; colvarFax.ForeignKeyTableName = ""; schema.Columns.Add(colvarFax); BaseSchema = schema; //add this schema to the provider //so we can query it later DataService.Providers["Northwind"].AddSchema("Customers", schema); } }
private static void GetTableSchema() { if (!IsSchemaInitialized) { //Schema declaration TableSchema.Table schema = new TableSchema.Table("ClientNameView", TableType.View, DataService.GetInstance("WWIprov")); schema.Columns = new TableSchema.TableColumnCollection(); schema.SchemaName = @"dbo"; //columns TableSchema.TableColumn colvarCompanyID = new TableSchema.TableColumn(schema); colvarCompanyID.ColumnName = "CompanyID"; colvarCompanyID.DataType = DbType.Int32; colvarCompanyID.MaxLength = 0; colvarCompanyID.AutoIncrement = false; colvarCompanyID.IsNullable = false; colvarCompanyID.IsPrimaryKey = false; colvarCompanyID.IsForeignKey = false; colvarCompanyID.IsReadOnly = false; schema.Columns.Add(colvarCompanyID); TableSchema.TableColumn colvarCompanyName = new TableSchema.TableColumn(schema); colvarCompanyName.ColumnName = "CompanyName"; colvarCompanyName.DataType = DbType.String; colvarCompanyName.MaxLength = 50; colvarCompanyName.AutoIncrement = false; colvarCompanyName.IsNullable = true; colvarCompanyName.IsPrimaryKey = false; colvarCompanyName.IsForeignKey = false; colvarCompanyName.IsReadOnly = false; schema.Columns.Add(colvarCompanyName); TableSchema.TableColumn colvarAddress1 = new TableSchema.TableColumn(schema); colvarAddress1.ColumnName = "Address1"; colvarAddress1.DataType = DbType.String; colvarAddress1.MaxLength = 40; colvarAddress1.AutoIncrement = false; colvarAddress1.IsNullable = true; colvarAddress1.IsPrimaryKey = false; colvarAddress1.IsForeignKey = false; colvarAddress1.IsReadOnly = false; schema.Columns.Add(colvarAddress1); TableSchema.TableColumn colvarAddress2 = new TableSchema.TableColumn(schema); colvarAddress2.ColumnName = "Address2"; colvarAddress2.DataType = DbType.String; colvarAddress2.MaxLength = 40; colvarAddress2.AutoIncrement = false; colvarAddress2.IsNullable = true; colvarAddress2.IsPrimaryKey = false; colvarAddress2.IsForeignKey = false; colvarAddress2.IsReadOnly = false; schema.Columns.Add(colvarAddress2); TableSchema.TableColumn colvarAddress3 = new TableSchema.TableColumn(schema); colvarAddress3.ColumnName = "Address3"; colvarAddress3.DataType = DbType.String; colvarAddress3.MaxLength = 40; colvarAddress3.AutoIncrement = false; colvarAddress3.IsNullable = true; colvarAddress3.IsPrimaryKey = false; colvarAddress3.IsForeignKey = false; colvarAddress3.IsReadOnly = false; schema.Columns.Add(colvarAddress3); TableSchema.TableColumn colvarCountryName = new TableSchema.TableColumn(schema); colvarCountryName.ColumnName = "CountryName"; colvarCountryName.DataType = DbType.String; colvarCountryName.MaxLength = 50; colvarCountryName.AutoIncrement = false; colvarCountryName.IsNullable = true; colvarCountryName.IsPrimaryKey = false; colvarCountryName.IsForeignKey = false; colvarCountryName.IsReadOnly = false; schema.Columns.Add(colvarCountryName); TableSchema.TableColumn colvarTelNo = new TableSchema.TableColumn(schema); colvarTelNo.ColumnName = "TelNo"; colvarTelNo.DataType = DbType.String; colvarTelNo.MaxLength = 20; colvarTelNo.AutoIncrement = false; colvarTelNo.IsNullable = true; colvarTelNo.IsPrimaryKey = false; colvarTelNo.IsForeignKey = false; colvarTelNo.IsReadOnly = false; schema.Columns.Add(colvarTelNo); TableSchema.TableColumn colvarCustomer = new TableSchema.TableColumn(schema); colvarCustomer.ColumnName = "Customer"; colvarCustomer.DataType = DbType.Boolean; colvarCustomer.MaxLength = 0; colvarCustomer.AutoIncrement = false; colvarCustomer.IsNullable = true; colvarCustomer.IsPrimaryKey = false; colvarCustomer.IsForeignKey = false; colvarCustomer.IsReadOnly = false; schema.Columns.Add(colvarCustomer); BaseSchema = schema; //add this schema to the provider //so we can query it later DataService.Providers["WWIprov"].AddSchema("ClientNameView", schema); } }
private static void GetTableSchema() { if (!IsSchemaInitialized) { //Schema declaration TableSchema.Table schema = new TableSchema.Table("Documents", TableType.Table, DataService.GetInstance("SignificantTradeSS")); schema.Columns = new TableSchema.TableColumnCollection(); schema.SchemaName = @"dbo"; //columns TableSchema.TableColumn colvarId = new TableSchema.TableColumn(schema); colvarId.ColumnName = "ID"; colvarId.DataType = DbType.Int32; colvarId.MaxLength = 0; colvarId.AutoIncrement = true; colvarId.IsNullable = false; colvarId.IsPrimaryKey = true; colvarId.IsForeignKey = false; colvarId.IsReadOnly = false; colvarId.DefaultSetting = @""; colvarId.ForeignKeyTableName = ""; schema.Columns.Add(colvarId); TableSchema.TableColumn colvarDocumentType = new TableSchema.TableColumn(schema); colvarDocumentType.ColumnName = "DocumentType"; colvarDocumentType.DataType = DbType.Int32; colvarDocumentType.MaxLength = 0; colvarDocumentType.AutoIncrement = false; colvarDocumentType.IsNullable = true; colvarDocumentType.IsPrimaryKey = false; colvarDocumentType.IsForeignKey = false; colvarDocumentType.IsReadOnly = false; colvarDocumentType.DefaultSetting = @""; colvarDocumentType.ForeignKeyTableName = ""; schema.Columns.Add(colvarDocumentType); TableSchema.TableColumn colvarDocName = new TableSchema.TableColumn(schema); colvarDocName.ColumnName = "DocName"; colvarDocName.DataType = DbType.AnsiString; colvarDocName.MaxLength = 50; colvarDocName.AutoIncrement = false; colvarDocName.IsNullable = true; colvarDocName.IsPrimaryKey = false; colvarDocName.IsForeignKey = false; colvarDocName.IsReadOnly = false; colvarDocName.DefaultSetting = @""; colvarDocName.ForeignKeyTableName = ""; schema.Columns.Add(colvarDocName); TableSchema.TableColumn colvarDateAdded = new TableSchema.TableColumn(schema); colvarDateAdded.ColumnName = "DateAdded"; colvarDateAdded.DataType = DbType.DateTime; colvarDateAdded.MaxLength = 0; colvarDateAdded.AutoIncrement = false; colvarDateAdded.IsNullable = true; colvarDateAdded.IsPrimaryKey = false; colvarDateAdded.IsForeignKey = false; colvarDateAdded.IsReadOnly = false; colvarDateAdded.DefaultSetting = @""; colvarDateAdded.ForeignKeyTableName = ""; schema.Columns.Add(colvarDateAdded); TableSchema.TableColumn colvarRoleAccess = new TableSchema.TableColumn(schema); colvarRoleAccess.ColumnName = "RoleAccess"; colvarRoleAccess.DataType = DbType.AnsiString; colvarRoleAccess.MaxLength = 50; colvarRoleAccess.AutoIncrement = false; colvarRoleAccess.IsNullable = true; colvarRoleAccess.IsPrimaryKey = false; colvarRoleAccess.IsForeignKey = false; colvarRoleAccess.IsReadOnly = false; colvarRoleAccess.DefaultSetting = @""; colvarRoleAccess.ForeignKeyTableName = ""; schema.Columns.Add(colvarRoleAccess); TableSchema.TableColumn colvarUserID = new TableSchema.TableColumn(schema); colvarUserID.ColumnName = "UserID"; colvarUserID.DataType = DbType.AnsiString; colvarUserID.MaxLength = 100; colvarUserID.AutoIncrement = false; colvarUserID.IsNullable = true; colvarUserID.IsPrimaryKey = false; colvarUserID.IsForeignKey = false; colvarUserID.IsReadOnly = false; colvarUserID.DefaultSetting = @""; colvarUserID.ForeignKeyTableName = ""; schema.Columns.Add(colvarUserID); TableSchema.TableColumn colvarSourceType = new TableSchema.TableColumn(schema); colvarSourceType.ColumnName = "SourceType"; colvarSourceType.DataType = DbType.Int32; colvarSourceType.MaxLength = 0; colvarSourceType.AutoIncrement = false; colvarSourceType.IsNullable = true; colvarSourceType.IsPrimaryKey = false; colvarSourceType.IsForeignKey = false; colvarSourceType.IsReadOnly = false; colvarSourceType.DefaultSetting = @""; colvarSourceType.ForeignKeyTableName = ""; schema.Columns.Add(colvarSourceType); TableSchema.TableColumn colvarSourceID = new TableSchema.TableColumn(schema); colvarSourceID.ColumnName = "SourceID"; colvarSourceID.DataType = DbType.Int32; colvarSourceID.MaxLength = 0; colvarSourceID.AutoIncrement = false; colvarSourceID.IsNullable = true; colvarSourceID.IsPrimaryKey = false; colvarSourceID.IsForeignKey = false; colvarSourceID.IsReadOnly = false; colvarSourceID.DefaultSetting = @""; colvarSourceID.ForeignKeyTableName = ""; schema.Columns.Add(colvarSourceID); TableSchema.TableColumn colvarDeleted = new TableSchema.TableColumn(schema); colvarDeleted.ColumnName = "Deleted"; colvarDeleted.DataType = DbType.Boolean; colvarDeleted.MaxLength = 0; colvarDeleted.AutoIncrement = false; colvarDeleted.IsNullable = false; colvarDeleted.IsPrimaryKey = false; colvarDeleted.IsForeignKey = false; colvarDeleted.IsReadOnly = false; colvarDeleted.DefaultSetting = @"((0))"; colvarDeleted.ForeignKeyTableName = ""; schema.Columns.Add(colvarDeleted); TableSchema.TableColumn colvarDocPath = new TableSchema.TableColumn(schema); colvarDocPath.ColumnName = "DocPath"; colvarDocPath.DataType = DbType.AnsiString; colvarDocPath.MaxLength = 100; colvarDocPath.AutoIncrement = false; colvarDocPath.IsNullable = true; colvarDocPath.IsPrimaryKey = false; colvarDocPath.IsForeignKey = false; colvarDocPath.IsReadOnly = false; colvarDocPath.DefaultSetting = @""; colvarDocPath.ForeignKeyTableName = ""; schema.Columns.Add(colvarDocPath); TableSchema.TableColumn colvarDeletedDate = new TableSchema.TableColumn(schema); colvarDeletedDate.ColumnName = "DeletedDate"; colvarDeletedDate.DataType = DbType.DateTime; colvarDeletedDate.MaxLength = 0; colvarDeletedDate.AutoIncrement = false; colvarDeletedDate.IsNullable = true; colvarDeletedDate.IsPrimaryKey = false; colvarDeletedDate.IsForeignKey = false; colvarDeletedDate.IsReadOnly = false; colvarDeletedDate.DefaultSetting = @""; colvarDeletedDate.ForeignKeyTableName = ""; schema.Columns.Add(colvarDeletedDate); TableSchema.TableColumn colvarCommentsID = new TableSchema.TableColumn(schema); colvarCommentsID.ColumnName = "CommentsID"; colvarCommentsID.DataType = DbType.Int32; colvarCommentsID.MaxLength = 0; colvarCommentsID.AutoIncrement = false; colvarCommentsID.IsNullable = true; colvarCommentsID.IsPrimaryKey = false; colvarCommentsID.IsForeignKey = false; colvarCommentsID.IsReadOnly = false; colvarCommentsID.DefaultSetting = @""; colvarCommentsID.ForeignKeyTableName = ""; schema.Columns.Add(colvarCommentsID); TableSchema.TableColumn colvarDocLegend = new TableSchema.TableColumn(schema); colvarDocLegend.ColumnName = "DocLegend"; colvarDocLegend.DataType = DbType.AnsiString; colvarDocLegend.MaxLength = 300; colvarDocLegend.AutoIncrement = false; colvarDocLegend.IsNullable = true; colvarDocLegend.IsPrimaryKey = false; colvarDocLegend.IsForeignKey = false; colvarDocLegend.IsReadOnly = false; colvarDocLegend.DefaultSetting = @""; colvarDocLegend.ForeignKeyTableName = ""; schema.Columns.Add(colvarDocLegend); BaseSchema = schema; //add this schema to the provider //so we can query it later DataService.Providers["SignificantTradeSS"].AddSchema("Documents", schema); } }
private static void GetTableSchema() { if (!IsSchemaInitialized) { //Schema declaration var schema = new TableSchema.Table("tblYeucauXetnghiem_VNIO", TableType.Table, DataService.GetInstance("ORM")); schema.Columns = new TableSchema.TableColumnCollection(); schema.SchemaName = @"dbo"; //columns var colvarIdXetnghiem = new TableSchema.TableColumn(schema); colvarIdXetnghiem.ColumnName = "Id_Xetnghiem"; colvarIdXetnghiem.DataType = DbType.Int64; colvarIdXetnghiem.MaxLength = 0; colvarIdXetnghiem.AutoIncrement = true; colvarIdXetnghiem.IsNullable = false; colvarIdXetnghiem.IsPrimaryKey = true; colvarIdXetnghiem.IsForeignKey = false; colvarIdXetnghiem.IsReadOnly = false; colvarIdXetnghiem.DefaultSetting = @""; colvarIdXetnghiem.ForeignKeyTableName = ""; schema.Columns.Add(colvarIdXetnghiem); var colvarIdCanLamSangThucHien = new TableSchema.TableColumn(schema); colvarIdCanLamSangThucHien.ColumnName = "idCanLamSangThucHien"; colvarIdCanLamSangThucHien.DataType = DbType.Int16; colvarIdCanLamSangThucHien.MaxLength = 0; colvarIdCanLamSangThucHien.AutoIncrement = false; colvarIdCanLamSangThucHien.IsNullable = true; colvarIdCanLamSangThucHien.IsPrimaryKey = false; colvarIdCanLamSangThucHien.IsForeignKey = false; colvarIdCanLamSangThucHien.IsReadOnly = false; colvarIdCanLamSangThucHien.DefaultSetting = @""; colvarIdCanLamSangThucHien.ForeignKeyTableName = ""; schema.Columns.Add(colvarIdCanLamSangThucHien); var colvarThucHienCho = new TableSchema.TableColumn(schema); colvarThucHienCho.ColumnName = "thucHienCho"; colvarThucHienCho.DataType = DbType.Int16; colvarThucHienCho.MaxLength = 0; colvarThucHienCho.AutoIncrement = false; colvarThucHienCho.IsNullable = true; colvarThucHienCho.IsPrimaryKey = false; colvarThucHienCho.IsForeignKey = false; colvarThucHienCho.IsReadOnly = false; colvarThucHienCho.DefaultSetting = @""; colvarThucHienCho.ForeignKeyTableName = ""; schema.Columns.Add(colvarThucHienCho); var colvarTrangThaiThucHien = new TableSchema.TableColumn(schema); colvarTrangThaiThucHien.ColumnName = "trangThaiThucHien"; colvarTrangThaiThucHien.DataType = DbType.Int16; colvarTrangThaiThucHien.MaxLength = 0; colvarTrangThaiThucHien.AutoIncrement = false; colvarTrangThaiThucHien.IsNullable = true; colvarTrangThaiThucHien.IsPrimaryKey = false; colvarTrangThaiThucHien.IsForeignKey = false; colvarTrangThaiThucHien.IsReadOnly = false; colvarTrangThaiThucHien.DefaultSetting = @""; colvarTrangThaiThucHien.ForeignKeyTableName = ""; schema.Columns.Add(colvarTrangThaiThucHien); var colvarYeuCauXetNghiemId = new TableSchema.TableColumn(schema); colvarYeuCauXetNghiemId.ColumnName = "yeuCauXetNghiem_Id"; colvarYeuCauXetNghiemId.DataType = DbType.Int16; colvarYeuCauXetNghiemId.MaxLength = 0; colvarYeuCauXetNghiemId.AutoIncrement = false; colvarYeuCauXetNghiemId.IsNullable = true; colvarYeuCauXetNghiemId.IsPrimaryKey = false; colvarYeuCauXetNghiemId.IsForeignKey = false; colvarYeuCauXetNghiemId.IsReadOnly = false; colvarYeuCauXetNghiemId.DefaultSetting = @""; colvarYeuCauXetNghiemId.ForeignKeyTableName = ""; schema.Columns.Add(colvarYeuCauXetNghiemId); var colvarId = new TableSchema.TableColumn(schema); colvarId.ColumnName = "Id"; colvarId.DataType = DbType.Int64; colvarId.MaxLength = 0; colvarId.AutoIncrement = false; colvarId.IsNullable = true; colvarId.IsPrimaryKey = false; colvarId.IsForeignKey = false; colvarId.IsReadOnly = false; colvarId.DefaultSetting = @""; colvarId.ForeignKeyTableName = ""; schema.Columns.Add(colvarId); var colvarMaBenhNhan = new TableSchema.TableColumn(schema); colvarMaBenhNhan.ColumnName = "maBenhNhan"; colvarMaBenhNhan.DataType = DbType.String; colvarMaBenhNhan.MaxLength = 150; colvarMaBenhNhan.AutoIncrement = false; colvarMaBenhNhan.IsNullable = true; colvarMaBenhNhan.IsPrimaryKey = false; colvarMaBenhNhan.IsForeignKey = false; colvarMaBenhNhan.IsReadOnly = false; colvarMaBenhNhan.DefaultSetting = @""; colvarMaBenhNhan.ForeignKeyTableName = ""; schema.Columns.Add(colvarMaBenhNhan); var colvarBarcode = new TableSchema.TableColumn(schema); colvarBarcode.ColumnName = "Barcode"; colvarBarcode.DataType = DbType.String; colvarBarcode.MaxLength = 50; colvarBarcode.AutoIncrement = false; colvarBarcode.IsNullable = true; colvarBarcode.IsPrimaryKey = false; colvarBarcode.IsForeignKey = false; colvarBarcode.IsReadOnly = false; colvarBarcode.DefaultSetting = @""; colvarBarcode.ForeignKeyTableName = ""; schema.Columns.Add(colvarBarcode); var colvarTestTypeId = new TableSchema.TableColumn(schema); colvarTestTypeId.ColumnName = "TestType_ID"; colvarTestTypeId.DataType = DbType.Int32; colvarTestTypeId.MaxLength = 0; colvarTestTypeId.AutoIncrement = false; colvarTestTypeId.IsNullable = true; colvarTestTypeId.IsPrimaryKey = false; colvarTestTypeId.IsForeignKey = false; colvarTestTypeId.IsReadOnly = false; colvarTestTypeId.DefaultSetting = @""; colvarTestTypeId.ForeignKeyTableName = ""; schema.Columns.Add(colvarTestTypeId); var colvarSophieu = new TableSchema.TableColumn(schema); colvarSophieu.ColumnName = "sophieu"; colvarSophieu.DataType = DbType.String; colvarSophieu.MaxLength = 50; colvarSophieu.AutoIncrement = false; colvarSophieu.IsNullable = true; colvarSophieu.IsPrimaryKey = false; colvarSophieu.IsForeignKey = false; colvarSophieu.IsReadOnly = false; colvarSophieu.DefaultSetting = @""; colvarSophieu.ForeignKeyTableName = ""; schema.Columns.Add(colvarSophieu); var colvarTestDate = new TableSchema.TableColumn(schema); colvarTestDate.ColumnName = "test_date"; colvarTestDate.DataType = DbType.DateTime; colvarTestDate.MaxLength = 0; colvarTestDate.AutoIncrement = false; colvarTestDate.IsNullable = true; colvarTestDate.IsPrimaryKey = false; colvarTestDate.IsForeignKey = false; colvarTestDate.IsReadOnly = false; colvarTestDate.DefaultSetting = @""; colvarTestDate.ForeignKeyTableName = ""; schema.Columns.Add(colvarTestDate); var colvarIsTestName = new TableSchema.TableColumn(schema); colvarIsTestName.ColumnName = "IsTestName"; colvarIsTestName.DataType = DbType.Boolean; colvarIsTestName.MaxLength = 0; colvarIsTestName.AutoIncrement = false; colvarIsTestName.IsNullable = true; colvarIsTestName.IsPrimaryKey = false; colvarIsTestName.IsForeignKey = false; colvarIsTestName.IsReadOnly = false; colvarIsTestName.DefaultSetting = @""; colvarIsTestName.ForeignKeyTableName = ""; schema.Columns.Add(colvarIsTestName); var colvarSendStatus = new TableSchema.TableColumn(schema); colvarSendStatus.ColumnName = "SendStatus"; colvarSendStatus.DataType = DbType.Boolean; colvarSendStatus.MaxLength = 0; colvarSendStatus.AutoIncrement = false; colvarSendStatus.IsNullable = true; colvarSendStatus.IsPrimaryKey = false; colvarSendStatus.IsForeignKey = false; colvarSendStatus.IsReadOnly = false; colvarSendStatus.DefaultSetting = @"((0))"; colvarSendStatus.ForeignKeyTableName = ""; schema.Columns.Add(colvarSendStatus); BaseSchema = schema; //add this schema to the provider //so we can query it later DataService.Providers["ORM"].AddSchema("tblYeucauXetnghiem_VNIO", schema); } }
private static void GetTableSchema() { if (!IsSchemaInitialized) { //Schema declaration TableSchema.Table schema = new TableSchema.Table("vw_HolidayApplyOfManager", TableType.View, DataService.GetInstance("SubsonicProvider")); schema.Columns = new TableSchema.TableColumnCollection(); schema.SchemaName = @"dbo"; //columns TableSchema.TableColumn colvarHolidayApplyId = new TableSchema.TableColumn(schema); colvarHolidayApplyId.ColumnName = "HolidayApplyId"; colvarHolidayApplyId.DataType = DbType.Int32; colvarHolidayApplyId.MaxLength = 0; colvarHolidayApplyId.AutoIncrement = false; colvarHolidayApplyId.IsNullable = false; colvarHolidayApplyId.IsPrimaryKey = false; colvarHolidayApplyId.IsForeignKey = false; colvarHolidayApplyId.IsReadOnly = false; schema.Columns.Add(colvarHolidayApplyId); TableSchema.TableColumn colvarCompany1 = new TableSchema.TableColumn(schema); colvarCompany1.ColumnName = "Company1"; colvarCompany1.DataType = DbType.String; colvarCompany1.MaxLength = 50; colvarCompany1.AutoIncrement = false; colvarCompany1.IsNullable = true; colvarCompany1.IsPrimaryKey = false; colvarCompany1.IsForeignKey = false; colvarCompany1.IsReadOnly = false; schema.Columns.Add(colvarCompany1); TableSchema.TableColumn colvarPositonName = new TableSchema.TableColumn(schema); colvarPositonName.ColumnName = "PositonName"; colvarPositonName.DataType = DbType.String; colvarPositonName.MaxLength = 50; colvarPositonName.AutoIncrement = false; colvarPositonName.IsNullable = true; colvarPositonName.IsPrimaryKey = false; colvarPositonName.IsForeignKey = false; colvarPositonName.IsReadOnly = false; schema.Columns.Add(colvarPositonName); TableSchema.TableColumn colvarCompany2 = new TableSchema.TableColumn(schema); colvarCompany2.ColumnName = "Company2"; colvarCompany2.DataType = DbType.String; colvarCompany2.MaxLength = 50; colvarCompany2.AutoIncrement = false; colvarCompany2.IsNullable = true; colvarCompany2.IsPrimaryKey = false; colvarCompany2.IsForeignKey = false; colvarCompany2.IsReadOnly = false; schema.Columns.Add(colvarCompany2); TableSchema.TableColumn colvarCompany2Name = new TableSchema.TableColumn(schema); colvarCompany2Name.ColumnName = "Company2Name"; colvarCompany2Name.DataType = DbType.String; colvarCompany2Name.MaxLength = 50; colvarCompany2Name.AutoIncrement = false; colvarCompany2Name.IsNullable = true; colvarCompany2Name.IsPrimaryKey = false; colvarCompany2Name.IsForeignKey = false; colvarCompany2Name.IsReadOnly = false; schema.Columns.Add(colvarCompany2Name); TableSchema.TableColumn colvarHolidayTypeId = new TableSchema.TableColumn(schema); colvarHolidayTypeId.ColumnName = "HolidayTypeId"; colvarHolidayTypeId.DataType = DbType.Int32; colvarHolidayTypeId.MaxLength = 0; colvarHolidayTypeId.AutoIncrement = false; colvarHolidayTypeId.IsNullable = true; colvarHolidayTypeId.IsPrimaryKey = false; colvarHolidayTypeId.IsForeignKey = false; colvarHolidayTypeId.IsReadOnly = false; schema.Columns.Add(colvarHolidayTypeId); TableSchema.TableColumn colvarBeginTime = new TableSchema.TableColumn(schema); colvarBeginTime.ColumnName = "BeginTime"; colvarBeginTime.DataType = DbType.String; colvarBeginTime.MaxLength = 50; colvarBeginTime.AutoIncrement = false; colvarBeginTime.IsNullable = true; colvarBeginTime.IsPrimaryKey = false; colvarBeginTime.IsForeignKey = false; colvarBeginTime.IsReadOnly = false; schema.Columns.Add(colvarBeginTime); TableSchema.TableColumn colvarEndTime = new TableSchema.TableColumn(schema); colvarEndTime.ColumnName = "EndTime"; colvarEndTime.DataType = DbType.String; colvarEndTime.MaxLength = 50; colvarEndTime.AutoIncrement = false; colvarEndTime.IsNullable = true; colvarEndTime.IsPrimaryKey = false; colvarEndTime.IsForeignKey = false; colvarEndTime.IsReadOnly = false; schema.Columns.Add(colvarEndTime); TableSchema.TableColumn colvarTimeSum = new TableSchema.TableColumn(schema); colvarTimeSum.ColumnName = "TimeSum"; colvarTimeSum.DataType = DbType.String; colvarTimeSum.MaxLength = 50; colvarTimeSum.AutoIncrement = false; colvarTimeSum.IsNullable = true; colvarTimeSum.IsPrimaryKey = false; colvarTimeSum.IsForeignKey = false; colvarTimeSum.IsReadOnly = false; schema.Columns.Add(colvarTimeSum); TableSchema.TableColumn colvarReason = new TableSchema.TableColumn(schema); colvarReason.ColumnName = "Reason"; colvarReason.DataType = DbType.String; colvarReason.MaxLength = 50; colvarReason.AutoIncrement = false; colvarReason.IsNullable = true; colvarReason.IsPrimaryKey = false; colvarReason.IsForeignKey = false; colvarReason.IsReadOnly = false; schema.Columns.Add(colvarReason); TableSchema.TableColumn colvarSectionView = new TableSchema.TableColumn(schema); colvarSectionView.ColumnName = "SectionView"; colvarSectionView.DataType = DbType.String; colvarSectionView.MaxLength = 50; colvarSectionView.AutoIncrement = false; colvarSectionView.IsNullable = true; colvarSectionView.IsPrimaryKey = false; colvarSectionView.IsForeignKey = false; colvarSectionView.IsReadOnly = false; schema.Columns.Add(colvarSectionView); TableSchema.TableColumn colvarHrView = new TableSchema.TableColumn(schema); colvarHrView.ColumnName = "HrView"; colvarHrView.DataType = DbType.String; colvarHrView.MaxLength = 50; colvarHrView.AutoIncrement = false; colvarHrView.IsNullable = true; colvarHrView.IsPrimaryKey = false; colvarHrView.IsForeignKey = false; colvarHrView.IsReadOnly = false; schema.Columns.Add(colvarHrView); TableSchema.TableColumn colvarManagerView = new TableSchema.TableColumn(schema); colvarManagerView.ColumnName = "ManagerView"; colvarManagerView.DataType = DbType.String; colvarManagerView.MaxLength = 50; colvarManagerView.AutoIncrement = false; colvarManagerView.IsNullable = true; colvarManagerView.IsPrimaryKey = false; colvarManagerView.IsForeignKey = false; colvarManagerView.IsReadOnly = false; schema.Columns.Add(colvarManagerView); TableSchema.TableColumn colvarMemo = new TableSchema.TableColumn(schema); colvarMemo.ColumnName = "Memo"; colvarMemo.DataType = DbType.String; colvarMemo.MaxLength = 50; colvarMemo.AutoIncrement = false; colvarMemo.IsNullable = true; colvarMemo.IsPrimaryKey = false; colvarMemo.IsForeignKey = false; colvarMemo.IsReadOnly = false; schema.Columns.Add(colvarMemo); TableSchema.TableColumn colvarApplyDate = new TableSchema.TableColumn(schema); colvarApplyDate.ColumnName = "ApplyDate"; colvarApplyDate.DataType = DbType.String; colvarApplyDate.MaxLength = 50; colvarApplyDate.AutoIncrement = false; colvarApplyDate.IsNullable = true; colvarApplyDate.IsPrimaryKey = false; colvarApplyDate.IsForeignKey = false; colvarApplyDate.IsReadOnly = false; schema.Columns.Add(colvarApplyDate); TableSchema.TableColumn colvarApplyTime = new TableSchema.TableColumn(schema); colvarApplyTime.ColumnName = "ApplyTime"; colvarApplyTime.DataType = DbType.String; colvarApplyTime.MaxLength = 50; colvarApplyTime.AutoIncrement = false; colvarApplyTime.IsNullable = true; colvarApplyTime.IsPrimaryKey = false; colvarApplyTime.IsForeignKey = false; colvarApplyTime.IsReadOnly = false; schema.Columns.Add(colvarApplyTime); TableSchema.TableColumn colvarApplyName = new TableSchema.TableColumn(schema); colvarApplyName.ColumnName = "ApplyName"; colvarApplyName.DataType = DbType.String; colvarApplyName.MaxLength = 50; colvarApplyName.AutoIncrement = false; colvarApplyName.IsNullable = true; colvarApplyName.IsPrimaryKey = false; colvarApplyName.IsForeignKey = false; colvarApplyName.IsReadOnly = false; schema.Columns.Add(colvarApplyName); TableSchema.TableColumn colvarDepartName = new TableSchema.TableColumn(schema); colvarDepartName.ColumnName = "DepartName"; colvarDepartName.DataType = DbType.String; colvarDepartName.MaxLength = 50; colvarDepartName.AutoIncrement = false; colvarDepartName.IsNullable = true; colvarDepartName.IsPrimaryKey = false; colvarDepartName.IsForeignKey = false; colvarDepartName.IsReadOnly = false; schema.Columns.Add(colvarDepartName); TableSchema.TableColumn colvarState = new TableSchema.TableColumn(schema); colvarState.ColumnName = "State"; colvarState.DataType = DbType.Int32; colvarState.MaxLength = 0; colvarState.AutoIncrement = false; colvarState.IsNullable = true; colvarState.IsPrimaryKey = false; colvarState.IsForeignKey = false; colvarState.IsReadOnly = false; schema.Columns.Add(colvarState); TableSchema.TableColumn colvarHolidayTypeName = new TableSchema.TableColumn(schema); colvarHolidayTypeName.ColumnName = "HolidayTypeName"; colvarHolidayTypeName.DataType = DbType.String; colvarHolidayTypeName.MaxLength = 50; colvarHolidayTypeName.AutoIncrement = false; colvarHolidayTypeName.IsNullable = false; colvarHolidayTypeName.IsPrimaryKey = false; colvarHolidayTypeName.IsForeignKey = false; colvarHolidayTypeName.IsReadOnly = false; schema.Columns.Add(colvarHolidayTypeName); BaseSchema = schema; //add this schema to the provider //so we can query it later DataService.Providers["SubsonicProvider"].AddSchema("vw_HolidayApplyOfManager", schema); } }
private static void GetTableSchema() { if (!IsSchemaInitialized) { //Schema declaration TableSchema.Table schema = new TableSchema.Table("vVendor", TableType.View, DataService.GetInstance("Default")); schema.Columns = new TableSchema.TableColumnCollection(); schema.SchemaName = "Purchasing"; //columns TableSchema.TableColumn colvarVendorID = new TableSchema.TableColumn(schema); colvarVendorID.ColumnName = "VendorID"; colvarVendorID.DataType = DbType.Int32; colvarVendorID.MaxLength = 0; colvarVendorID.AutoIncrement = false; colvarVendorID.IsNullable = false; colvarVendorID.IsPrimaryKey = false; colvarVendorID.IsForeignKey = false; colvarVendorID.IsReadOnly = false; schema.Columns.Add(colvarVendorID); TableSchema.TableColumn colvarName = new TableSchema.TableColumn(schema); colvarName.ColumnName = "Name"; colvarName.DataType = DbType.String; colvarName.MaxLength = 50; colvarName.AutoIncrement = false; colvarName.IsNullable = false; colvarName.IsPrimaryKey = false; colvarName.IsForeignKey = false; colvarName.IsReadOnly = false; schema.Columns.Add(colvarName); TableSchema.TableColumn colvarContactType = new TableSchema.TableColumn(schema); colvarContactType.ColumnName = "ContactType"; colvarContactType.DataType = DbType.String; colvarContactType.MaxLength = 50; colvarContactType.AutoIncrement = false; colvarContactType.IsNullable = false; colvarContactType.IsPrimaryKey = false; colvarContactType.IsForeignKey = false; colvarContactType.IsReadOnly = false; schema.Columns.Add(colvarContactType); TableSchema.TableColumn colvarTitle = new TableSchema.TableColumn(schema); colvarTitle.ColumnName = "Title"; colvarTitle.DataType = DbType.String; colvarTitle.MaxLength = 8; colvarTitle.AutoIncrement = false; colvarTitle.IsNullable = true; colvarTitle.IsPrimaryKey = false; colvarTitle.IsForeignKey = false; colvarTitle.IsReadOnly = false; schema.Columns.Add(colvarTitle); TableSchema.TableColumn colvarFirstName = new TableSchema.TableColumn(schema); colvarFirstName.ColumnName = "FirstName"; colvarFirstName.DataType = DbType.String; colvarFirstName.MaxLength = 50; colvarFirstName.AutoIncrement = false; colvarFirstName.IsNullable = false; colvarFirstName.IsPrimaryKey = false; colvarFirstName.IsForeignKey = false; colvarFirstName.IsReadOnly = false; schema.Columns.Add(colvarFirstName); TableSchema.TableColumn colvarMiddleName = new TableSchema.TableColumn(schema); colvarMiddleName.ColumnName = "MiddleName"; colvarMiddleName.DataType = DbType.String; colvarMiddleName.MaxLength = 50; colvarMiddleName.AutoIncrement = false; colvarMiddleName.IsNullable = true; colvarMiddleName.IsPrimaryKey = false; colvarMiddleName.IsForeignKey = false; colvarMiddleName.IsReadOnly = false; schema.Columns.Add(colvarMiddleName); TableSchema.TableColumn colvarLastName = new TableSchema.TableColumn(schema); colvarLastName.ColumnName = "LastName"; colvarLastName.DataType = DbType.String; colvarLastName.MaxLength = 50; colvarLastName.AutoIncrement = false; colvarLastName.IsNullable = false; colvarLastName.IsPrimaryKey = false; colvarLastName.IsForeignKey = false; colvarLastName.IsReadOnly = false; schema.Columns.Add(colvarLastName); TableSchema.TableColumn colvarSuffix = new TableSchema.TableColumn(schema); colvarSuffix.ColumnName = "Suffix"; colvarSuffix.DataType = DbType.String; colvarSuffix.MaxLength = 10; colvarSuffix.AutoIncrement = false; colvarSuffix.IsNullable = true; colvarSuffix.IsPrimaryKey = false; colvarSuffix.IsForeignKey = false; colvarSuffix.IsReadOnly = false; schema.Columns.Add(colvarSuffix); TableSchema.TableColumn colvarPhone = new TableSchema.TableColumn(schema); colvarPhone.ColumnName = "Phone"; colvarPhone.DataType = DbType.String; colvarPhone.MaxLength = 25; colvarPhone.AutoIncrement = false; colvarPhone.IsNullable = true; colvarPhone.IsPrimaryKey = false; colvarPhone.IsForeignKey = false; colvarPhone.IsReadOnly = false; schema.Columns.Add(colvarPhone); TableSchema.TableColumn colvarEmailAddress = new TableSchema.TableColumn(schema); colvarEmailAddress.ColumnName = "EmailAddress"; colvarEmailAddress.DataType = DbType.String; colvarEmailAddress.MaxLength = 50; colvarEmailAddress.AutoIncrement = false; colvarEmailAddress.IsNullable = true; colvarEmailAddress.IsPrimaryKey = false; colvarEmailAddress.IsForeignKey = false; colvarEmailAddress.IsReadOnly = false; schema.Columns.Add(colvarEmailAddress); TableSchema.TableColumn colvarEmailPromotion = new TableSchema.TableColumn(schema); colvarEmailPromotion.ColumnName = "EmailPromotion"; colvarEmailPromotion.DataType = DbType.Int32; colvarEmailPromotion.MaxLength = 0; colvarEmailPromotion.AutoIncrement = false; colvarEmailPromotion.IsNullable = false; colvarEmailPromotion.IsPrimaryKey = false; colvarEmailPromotion.IsForeignKey = false; colvarEmailPromotion.IsReadOnly = false; schema.Columns.Add(colvarEmailPromotion); TableSchema.TableColumn colvarAddressLine1 = new TableSchema.TableColumn(schema); colvarAddressLine1.ColumnName = "AddressLine1"; colvarAddressLine1.DataType = DbType.String; colvarAddressLine1.MaxLength = 60; colvarAddressLine1.AutoIncrement = false; colvarAddressLine1.IsNullable = false; colvarAddressLine1.IsPrimaryKey = false; colvarAddressLine1.IsForeignKey = false; colvarAddressLine1.IsReadOnly = false; schema.Columns.Add(colvarAddressLine1); TableSchema.TableColumn colvarAddressLine2 = new TableSchema.TableColumn(schema); colvarAddressLine2.ColumnName = "AddressLine2"; colvarAddressLine2.DataType = DbType.String; colvarAddressLine2.MaxLength = 60; colvarAddressLine2.AutoIncrement = false; colvarAddressLine2.IsNullable = true; colvarAddressLine2.IsPrimaryKey = false; colvarAddressLine2.IsForeignKey = false; colvarAddressLine2.IsReadOnly = false; schema.Columns.Add(colvarAddressLine2); TableSchema.TableColumn colvarCity = new TableSchema.TableColumn(schema); colvarCity.ColumnName = "City"; colvarCity.DataType = DbType.String; colvarCity.MaxLength = 30; colvarCity.AutoIncrement = false; colvarCity.IsNullable = false; colvarCity.IsPrimaryKey = false; colvarCity.IsForeignKey = false; colvarCity.IsReadOnly = false; schema.Columns.Add(colvarCity); TableSchema.TableColumn colvarStateProvinceName = new TableSchema.TableColumn(schema); colvarStateProvinceName.ColumnName = "StateProvinceName"; colvarStateProvinceName.DataType = DbType.String; colvarStateProvinceName.MaxLength = 50; colvarStateProvinceName.AutoIncrement = false; colvarStateProvinceName.IsNullable = false; colvarStateProvinceName.IsPrimaryKey = false; colvarStateProvinceName.IsForeignKey = false; colvarStateProvinceName.IsReadOnly = false; schema.Columns.Add(colvarStateProvinceName); TableSchema.TableColumn colvarPostalCode = new TableSchema.TableColumn(schema); colvarPostalCode.ColumnName = "PostalCode"; colvarPostalCode.DataType = DbType.String; colvarPostalCode.MaxLength = 15; colvarPostalCode.AutoIncrement = false; colvarPostalCode.IsNullable = false; colvarPostalCode.IsPrimaryKey = false; colvarPostalCode.IsForeignKey = false; colvarPostalCode.IsReadOnly = false; schema.Columns.Add(colvarPostalCode); TableSchema.TableColumn colvarCountryRegionName = new TableSchema.TableColumn(schema); colvarCountryRegionName.ColumnName = "CountryRegionName"; colvarCountryRegionName.DataType = DbType.String; colvarCountryRegionName.MaxLength = 50; colvarCountryRegionName.AutoIncrement = false; colvarCountryRegionName.IsNullable = false; colvarCountryRegionName.IsPrimaryKey = false; colvarCountryRegionName.IsForeignKey = false; colvarCountryRegionName.IsReadOnly = false; schema.Columns.Add(colvarCountryRegionName); BaseSchema = schema; //add this schema to the provider //so we can query it later DataService.Providers["Default"].AddSchema("vVendor", schema); } }
private static void GetTableSchema() { if (!IsSchemaInitialized) { //Schema declaration TableSchema.Table schema = new TableSchema.Table("MAM_Cirugia", TableType.Table, DataService.GetInstance("sicProvider")); schema.Columns = new TableSchema.TableColumnCollection(); schema.SchemaName = @"dbo"; //columns TableSchema.TableColumn colvarIdCirugia = new TableSchema.TableColumn(schema); colvarIdCirugia.ColumnName = "idCirugia"; colvarIdCirugia.DataType = DbType.Int32; colvarIdCirugia.MaxLength = 0; colvarIdCirugia.AutoIncrement = true; colvarIdCirugia.IsNullable = false; colvarIdCirugia.IsPrimaryKey = true; colvarIdCirugia.IsForeignKey = false; colvarIdCirugia.IsReadOnly = false; colvarIdCirugia.DefaultSetting = @""; colvarIdCirugia.ForeignKeyTableName = ""; schema.Columns.Add(colvarIdCirugia); TableSchema.TableColumn colvarIdPaciente = new TableSchema.TableColumn(schema); colvarIdPaciente.ColumnName = "idPaciente"; colvarIdPaciente.DataType = DbType.Int32; colvarIdPaciente.MaxLength = 0; colvarIdPaciente.AutoIncrement = false; colvarIdPaciente.IsNullable = false; colvarIdPaciente.IsPrimaryKey = false; colvarIdPaciente.IsForeignKey = false; colvarIdPaciente.IsReadOnly = false; colvarIdPaciente.DefaultSetting = @"((0))"; colvarIdPaciente.ForeignKeyTableName = ""; schema.Columns.Add(colvarIdPaciente); TableSchema.TableColumn colvarFecha = new TableSchema.TableColumn(schema); colvarFecha.ColumnName = "fecha"; colvarFecha.DataType = DbType.DateTime; colvarFecha.MaxLength = 0; colvarFecha.AutoIncrement = false; colvarFecha.IsNullable = false; colvarFecha.IsPrimaryKey = false; colvarFecha.IsForeignKey = false; colvarFecha.IsReadOnly = false; colvarFecha.DefaultSetting = @""; colvarFecha.ForeignKeyTableName = ""; schema.Columns.Add(colvarFecha); TableSchema.TableColumn colvarEdad = new TableSchema.TableColumn(schema); colvarEdad.ColumnName = "edad"; colvarEdad.DataType = DbType.Int32; colvarEdad.MaxLength = 0; colvarEdad.AutoIncrement = false; colvarEdad.IsNullable = false; colvarEdad.IsPrimaryKey = false; colvarEdad.IsForeignKey = false; colvarEdad.IsReadOnly = false; colvarEdad.DefaultSetting = @"((0))"; colvarEdad.ForeignKeyTableName = ""; schema.Columns.Add(colvarEdad); TableSchema.TableColumn colvarIndicadorT = new TableSchema.TableColumn(schema); colvarIndicadorT.ColumnName = "indicadorT"; colvarIndicadorT.DataType = DbType.AnsiString; colvarIndicadorT.MaxLength = 10; colvarIndicadorT.AutoIncrement = false; colvarIndicadorT.IsNullable = false; colvarIndicadorT.IsPrimaryKey = false; colvarIndicadorT.IsForeignKey = false; colvarIndicadorT.IsReadOnly = false; colvarIndicadorT.DefaultSetting = @"('')"; colvarIndicadorT.ForeignKeyTableName = ""; schema.Columns.Add(colvarIndicadorT); TableSchema.TableColumn colvarIndicadorN = new TableSchema.TableColumn(schema); colvarIndicadorN.ColumnName = "indicadorN"; colvarIndicadorN.DataType = DbType.AnsiString; colvarIndicadorN.MaxLength = 10; colvarIndicadorN.AutoIncrement = false; colvarIndicadorN.IsNullable = false; colvarIndicadorN.IsPrimaryKey = false; colvarIndicadorN.IsForeignKey = false; colvarIndicadorN.IsReadOnly = false; colvarIndicadorN.DefaultSetting = @"('')"; colvarIndicadorN.ForeignKeyTableName = ""; schema.Columns.Add(colvarIndicadorN); TableSchema.TableColumn colvarIndicadorM = new TableSchema.TableColumn(schema); colvarIndicadorM.ColumnName = "indicadorM"; colvarIndicadorM.DataType = DbType.AnsiString; colvarIndicadorM.MaxLength = 10; colvarIndicadorM.AutoIncrement = false; colvarIndicadorM.IsNullable = false; colvarIndicadorM.IsPrimaryKey = false; colvarIndicadorM.IsForeignKey = false; colvarIndicadorM.IsReadOnly = false; colvarIndicadorM.DefaultSetting = @"('')"; colvarIndicadorM.ForeignKeyTableName = ""; schema.Columns.Add(colvarIndicadorM); TableSchema.TableColumn colvarIdMaterialIzq = new TableSchema.TableColumn(schema); colvarIdMaterialIzq.ColumnName = "idMaterialIzq"; colvarIdMaterialIzq.DataType = DbType.Int32; colvarIdMaterialIzq.MaxLength = 0; colvarIdMaterialIzq.AutoIncrement = false; colvarIdMaterialIzq.IsNullable = false; colvarIdMaterialIzq.IsPrimaryKey = false; colvarIdMaterialIzq.IsForeignKey = true; colvarIdMaterialIzq.IsReadOnly = false; colvarIdMaterialIzq.DefaultSetting = @"((0))"; colvarIdMaterialIzq.ForeignKeyTableName = "MAM_Material"; schema.Columns.Add(colvarIdMaterialIzq); TableSchema.TableColumn colvarIdMaterialDer = new TableSchema.TableColumn(schema); colvarIdMaterialDer.ColumnName = "idMaterialDer"; colvarIdMaterialDer.DataType = DbType.Int32; colvarIdMaterialDer.MaxLength = 0; colvarIdMaterialDer.AutoIncrement = false; colvarIdMaterialDer.IsNullable = false; colvarIdMaterialDer.IsPrimaryKey = false; colvarIdMaterialDer.IsForeignKey = true; colvarIdMaterialDer.IsReadOnly = false; colvarIdMaterialDer.DefaultSetting = @"((0))"; colvarIdMaterialDer.ForeignKeyTableName = "MAM_Material"; schema.Columns.Add(colvarIdMaterialDer); TableSchema.TableColumn colvarIdTipoCirugiaIzq = new TableSchema.TableColumn(schema); colvarIdTipoCirugiaIzq.ColumnName = "idTipoCirugiaIzq"; colvarIdTipoCirugiaIzq.DataType = DbType.Int32; colvarIdTipoCirugiaIzq.MaxLength = 0; colvarIdTipoCirugiaIzq.AutoIncrement = false; colvarIdTipoCirugiaIzq.IsNullable = false; colvarIdTipoCirugiaIzq.IsPrimaryKey = false; colvarIdTipoCirugiaIzq.IsForeignKey = true; colvarIdTipoCirugiaIzq.IsReadOnly = false; colvarIdTipoCirugiaIzq.DefaultSetting = @"((0))"; colvarIdTipoCirugiaIzq.ForeignKeyTableName = "MAM_TipoCirugia"; schema.Columns.Add(colvarIdTipoCirugiaIzq); TableSchema.TableColumn colvarIdTipoCirugiaDer = new TableSchema.TableColumn(schema); colvarIdTipoCirugiaDer.ColumnName = "idTipoCirugiaDer"; colvarIdTipoCirugiaDer.DataType = DbType.Int32; colvarIdTipoCirugiaDer.MaxLength = 0; colvarIdTipoCirugiaDer.AutoIncrement = false; colvarIdTipoCirugiaDer.IsNullable = false; colvarIdTipoCirugiaDer.IsPrimaryKey = false; colvarIdTipoCirugiaDer.IsForeignKey = true; colvarIdTipoCirugiaDer.IsReadOnly = false; colvarIdTipoCirugiaDer.DefaultSetting = @"((0))"; colvarIdTipoCirugiaDer.ForeignKeyTableName = "MAM_TipoCirugia"; schema.Columns.Add(colvarIdTipoCirugiaDer); TableSchema.TableColumn colvarIdCentroSalud = new TableSchema.TableColumn(schema); colvarIdCentroSalud.ColumnName = "idCentroSalud"; colvarIdCentroSalud.DataType = DbType.Int32; colvarIdCentroSalud.MaxLength = 0; colvarIdCentroSalud.AutoIncrement = false; colvarIdCentroSalud.IsNullable = false; colvarIdCentroSalud.IsPrimaryKey = false; colvarIdCentroSalud.IsForeignKey = true; colvarIdCentroSalud.IsReadOnly = false; colvarIdCentroSalud.DefaultSetting = @"((0))"; colvarIdCentroSalud.ForeignKeyTableName = "Sys_Efector"; schema.Columns.Add(colvarIdCentroSalud); TableSchema.TableColumn colvarIdProfesionalResponsable = new TableSchema.TableColumn(schema); colvarIdProfesionalResponsable.ColumnName = "idProfesionalResponsable"; colvarIdProfesionalResponsable.DataType = DbType.Int32; colvarIdProfesionalResponsable.MaxLength = 0; colvarIdProfesionalResponsable.AutoIncrement = false; colvarIdProfesionalResponsable.IsNullable = false; colvarIdProfesionalResponsable.IsPrimaryKey = false; colvarIdProfesionalResponsable.IsForeignKey = true; colvarIdProfesionalResponsable.IsReadOnly = false; colvarIdProfesionalResponsable.DefaultSetting = @"((0))"; colvarIdProfesionalResponsable.ForeignKeyTableName = "Sys_Profesional"; schema.Columns.Add(colvarIdProfesionalResponsable); TableSchema.TableColumn colvarObservacion = new TableSchema.TableColumn(schema); colvarObservacion.ColumnName = "observacion"; colvarObservacion.DataType = DbType.AnsiString; colvarObservacion.MaxLength = 200; colvarObservacion.AutoIncrement = false; colvarObservacion.IsNullable = false; colvarObservacion.IsPrimaryKey = false; colvarObservacion.IsForeignKey = false; colvarObservacion.IsReadOnly = false; colvarObservacion.DefaultSetting = @"('')"; colvarObservacion.ForeignKeyTableName = ""; schema.Columns.Add(colvarObservacion); TableSchema.TableColumn colvarActivo = new TableSchema.TableColumn(schema); colvarActivo.ColumnName = "activo"; colvarActivo.DataType = DbType.Boolean; colvarActivo.MaxLength = 0; colvarActivo.AutoIncrement = false; colvarActivo.IsNullable = false; colvarActivo.IsPrimaryKey = false; colvarActivo.IsForeignKey = false; colvarActivo.IsReadOnly = false; colvarActivo.DefaultSetting = @"((1))"; colvarActivo.ForeignKeyTableName = ""; schema.Columns.Add(colvarActivo); TableSchema.TableColumn colvarCreatedBy = new TableSchema.TableColumn(schema); colvarCreatedBy.ColumnName = "CreatedBy"; colvarCreatedBy.DataType = DbType.String; colvarCreatedBy.MaxLength = 50; colvarCreatedBy.AutoIncrement = false; colvarCreatedBy.IsNullable = false; colvarCreatedBy.IsPrimaryKey = false; colvarCreatedBy.IsForeignKey = false; colvarCreatedBy.IsReadOnly = false; colvarCreatedBy.DefaultSetting = @"('')"; colvarCreatedBy.ForeignKeyTableName = ""; schema.Columns.Add(colvarCreatedBy); TableSchema.TableColumn colvarCreatedOn = new TableSchema.TableColumn(schema); colvarCreatedOn.ColumnName = "CreatedOn"; colvarCreatedOn.DataType = DbType.DateTime; colvarCreatedOn.MaxLength = 0; colvarCreatedOn.AutoIncrement = false; colvarCreatedOn.IsNullable = false; colvarCreatedOn.IsPrimaryKey = false; colvarCreatedOn.IsForeignKey = false; colvarCreatedOn.IsReadOnly = false; colvarCreatedOn.DefaultSetting = @"(((1)/(1))/(1900))"; colvarCreatedOn.ForeignKeyTableName = ""; schema.Columns.Add(colvarCreatedOn); TableSchema.TableColumn colvarModifiedBy = new TableSchema.TableColumn(schema); colvarModifiedBy.ColumnName = "ModifiedBy"; colvarModifiedBy.DataType = DbType.String; colvarModifiedBy.MaxLength = 50; colvarModifiedBy.AutoIncrement = false; colvarModifiedBy.IsNullable = false; colvarModifiedBy.IsPrimaryKey = false; colvarModifiedBy.IsForeignKey = false; colvarModifiedBy.IsReadOnly = false; colvarModifiedBy.DefaultSetting = @"('')"; colvarModifiedBy.ForeignKeyTableName = ""; schema.Columns.Add(colvarModifiedBy); TableSchema.TableColumn colvarModifiedOn = new TableSchema.TableColumn(schema); colvarModifiedOn.ColumnName = "ModifiedOn"; colvarModifiedOn.DataType = DbType.DateTime; colvarModifiedOn.MaxLength = 0; colvarModifiedOn.AutoIncrement = false; colvarModifiedOn.IsNullable = false; colvarModifiedOn.IsPrimaryKey = false; colvarModifiedOn.IsForeignKey = false; colvarModifiedOn.IsReadOnly = false; colvarModifiedOn.DefaultSetting = @"(((1)/(1))/(1900))"; colvarModifiedOn.ForeignKeyTableName = ""; schema.Columns.Add(colvarModifiedOn); BaseSchema = schema; //add this schema to the provider //so we can query it later DataService.Providers["sicProvider"].AddSchema("MAM_Cirugia", schema); } }
private static void GetTableSchema() { if (!IsSchemaInitialized) { //Schema declaration TableSchema.Table schema = new TableSchema.Table("TblNguoiDung", TableType.Table, DataService.GetInstance("ViewWeb")); schema.Columns = new TableSchema.TableColumnCollection(); schema.SchemaName = @"dbo"; //columns TableSchema.TableColumn colvarId = new TableSchema.TableColumn(schema); colvarId.ColumnName = "Id"; colvarId.DataType = DbType.Guid; colvarId.MaxLength = 0; colvarId.AutoIncrement = false; colvarId.IsNullable = false; colvarId.IsPrimaryKey = true; colvarId.IsForeignKey = false; colvarId.IsReadOnly = false; colvarId.DefaultSetting = @""; colvarId.ForeignKeyTableName = ""; schema.Columns.Add(colvarId); TableSchema.TableColumn colvarIdNhanVien = new TableSchema.TableColumn(schema); colvarIdNhanVien.ColumnName = "IdNhanVien"; colvarIdNhanVien.DataType = DbType.Guid; colvarIdNhanVien.MaxLength = 0; colvarIdNhanVien.AutoIncrement = false; colvarIdNhanVien.IsNullable = false; colvarIdNhanVien.IsPrimaryKey = false; colvarIdNhanVien.IsForeignKey = true; colvarIdNhanVien.IsReadOnly = false; colvarIdNhanVien.DefaultSetting = @""; colvarIdNhanVien.ForeignKeyTableName = "TblNhanVien"; schema.Columns.Add(colvarIdNhanVien); TableSchema.TableColumn colvarTenDangNhap = new TableSchema.TableColumn(schema); colvarTenDangNhap.ColumnName = "TenDangNhap"; colvarTenDangNhap.DataType = DbType.AnsiString; colvarTenDangNhap.MaxLength = 20; colvarTenDangNhap.AutoIncrement = false; colvarTenDangNhap.IsNullable = false; colvarTenDangNhap.IsPrimaryKey = false; colvarTenDangNhap.IsForeignKey = false; colvarTenDangNhap.IsReadOnly = false; colvarTenDangNhap.DefaultSetting = @""; colvarTenDangNhap.ForeignKeyTableName = ""; schema.Columns.Add(colvarTenDangNhap); TableSchema.TableColumn colvarPass = new TableSchema.TableColumn(schema); colvarPass.ColumnName = "Pass"; colvarPass.DataType = DbType.AnsiString; colvarPass.MaxLength = 20; colvarPass.AutoIncrement = false; colvarPass.IsNullable = false; colvarPass.IsPrimaryKey = false; colvarPass.IsForeignKey = false; colvarPass.IsReadOnly = false; colvarPass.DefaultSetting = @""; colvarPass.ForeignKeyTableName = ""; schema.Columns.Add(colvarPass); TableSchema.TableColumn colvarKichHoat = new TableSchema.TableColumn(schema); colvarKichHoat.ColumnName = "KichHoat"; colvarKichHoat.DataType = DbType.Boolean; colvarKichHoat.MaxLength = 0; colvarKichHoat.AutoIncrement = false; colvarKichHoat.IsNullable = false; colvarKichHoat.IsPrimaryKey = false; colvarKichHoat.IsForeignKey = false; colvarKichHoat.IsReadOnly = false; colvarKichHoat.DefaultSetting = @""; colvarKichHoat.ForeignKeyTableName = ""; schema.Columns.Add(colvarKichHoat); TableSchema.TableColumn colvarIdVaiTro = new TableSchema.TableColumn(schema); colvarIdVaiTro.ColumnName = "IdVaiTro"; colvarIdVaiTro.DataType = DbType.Guid; colvarIdVaiTro.MaxLength = 0; colvarIdVaiTro.AutoIncrement = false; colvarIdVaiTro.IsNullable = false; colvarIdVaiTro.IsPrimaryKey = false; colvarIdVaiTro.IsForeignKey = true; colvarIdVaiTro.IsReadOnly = false; colvarIdVaiTro.DefaultSetting = @""; colvarIdVaiTro.ForeignKeyTableName = "TblVaiTro"; schema.Columns.Add(colvarIdVaiTro); TableSchema.TableColumn colvarTrangThai = new TableSchema.TableColumn(schema); colvarTrangThai.ColumnName = "TrangThai"; colvarTrangThai.DataType = DbType.Boolean; colvarTrangThai.MaxLength = 0; colvarTrangThai.AutoIncrement = false; colvarTrangThai.IsNullable = false; colvarTrangThai.IsPrimaryKey = false; colvarTrangThai.IsForeignKey = false; colvarTrangThai.IsReadOnly = false; colvarTrangThai.DefaultSetting = @""; colvarTrangThai.ForeignKeyTableName = ""; schema.Columns.Add(colvarTrangThai); TableSchema.TableColumn colvarNgayTao = new TableSchema.TableColumn(schema); colvarNgayTao.ColumnName = "NgayTao"; colvarNgayTao.DataType = DbType.DateTime; colvarNgayTao.MaxLength = 0; colvarNgayTao.AutoIncrement = false; colvarNgayTao.IsNullable = false; colvarNgayTao.IsPrimaryKey = false; colvarNgayTao.IsForeignKey = false; colvarNgayTao.IsReadOnly = false; colvarNgayTao.DefaultSetting = @""; colvarNgayTao.ForeignKeyTableName = ""; schema.Columns.Add(colvarNgayTao); TableSchema.TableColumn colvarNguoiTao = new TableSchema.TableColumn(schema); colvarNguoiTao.ColumnName = "NguoiTao"; colvarNguoiTao.DataType = DbType.String; colvarNguoiTao.MaxLength = 50; colvarNguoiTao.AutoIncrement = false; colvarNguoiTao.IsNullable = false; colvarNguoiTao.IsPrimaryKey = false; colvarNguoiTao.IsForeignKey = false; colvarNguoiTao.IsReadOnly = false; colvarNguoiTao.DefaultSetting = @""; colvarNguoiTao.ForeignKeyTableName = ""; schema.Columns.Add(colvarNguoiTao); TableSchema.TableColumn colvarNgayCapNhat = new TableSchema.TableColumn(schema); colvarNgayCapNhat.ColumnName = "NgayCapNhat"; colvarNgayCapNhat.DataType = DbType.DateTime; colvarNgayCapNhat.MaxLength = 0; colvarNgayCapNhat.AutoIncrement = false; colvarNgayCapNhat.IsNullable = true; colvarNgayCapNhat.IsPrimaryKey = false; colvarNgayCapNhat.IsForeignKey = false; colvarNgayCapNhat.IsReadOnly = false; colvarNgayCapNhat.DefaultSetting = @""; colvarNgayCapNhat.ForeignKeyTableName = ""; schema.Columns.Add(colvarNgayCapNhat); TableSchema.TableColumn colvarNguoiCapNhat = new TableSchema.TableColumn(schema); colvarNguoiCapNhat.ColumnName = "NguoiCapNhat"; colvarNguoiCapNhat.DataType = DbType.String; colvarNguoiCapNhat.MaxLength = 50; colvarNguoiCapNhat.AutoIncrement = false; colvarNguoiCapNhat.IsNullable = true; colvarNguoiCapNhat.IsPrimaryKey = false; colvarNguoiCapNhat.IsForeignKey = false; colvarNguoiCapNhat.IsReadOnly = false; colvarNguoiCapNhat.DefaultSetting = @""; colvarNguoiCapNhat.ForeignKeyTableName = ""; schema.Columns.Add(colvarNguoiCapNhat); BaseSchema = schema; //add this schema to the provider //so we can query it later DataService.Providers["ViewWeb"].AddSchema("TblNguoiDung", schema); } }
private static void GetTableSchema() { if (!IsSchemaInitialized) { //Schema declaration TableSchema.Table schema = new TableSchema.Table("dashCommerce_Store_OrderStatusDescriptor", TableType.Table, DataService.GetInstance("dashCommerceProvider")); schema.Columns = new TableSchema.TableColumnCollection(); schema.SchemaName = @"dbo"; //columns TableSchema.TableColumn colvarOrderStatusDescriptorId = new TableSchema.TableColumn(schema); colvarOrderStatusDescriptorId.ColumnName = "OrderStatusDescriptorId"; colvarOrderStatusDescriptorId.DataType = DbType.Int32; colvarOrderStatusDescriptorId.MaxLength = 0; colvarOrderStatusDescriptorId.AutoIncrement = false; colvarOrderStatusDescriptorId.IsNullable = false; colvarOrderStatusDescriptorId.IsPrimaryKey = true; colvarOrderStatusDescriptorId.IsForeignKey = false; colvarOrderStatusDescriptorId.IsReadOnly = false; colvarOrderStatusDescriptorId.DefaultSetting = @""; colvarOrderStatusDescriptorId.ForeignKeyTableName = ""; schema.Columns.Add(colvarOrderStatusDescriptorId); TableSchema.TableColumn colvarName = new TableSchema.TableColumn(schema); colvarName.ColumnName = "Name"; colvarName.DataType = DbType.String; colvarName.MaxLength = 100; colvarName.AutoIncrement = false; colvarName.IsNullable = false; colvarName.IsPrimaryKey = false; colvarName.IsForeignKey = false; colvarName.IsReadOnly = false; colvarName.DefaultSetting = @""; colvarName.ForeignKeyTableName = ""; schema.Columns.Add(colvarName); TableSchema.TableColumn colvarCreatedBy = new TableSchema.TableColumn(schema); colvarCreatedBy.ColumnName = "CreatedBy"; colvarCreatedBy.DataType = DbType.String; colvarCreatedBy.MaxLength = 50; colvarCreatedBy.AutoIncrement = false; colvarCreatedBy.IsNullable = true; colvarCreatedBy.IsPrimaryKey = false; colvarCreatedBy.IsForeignKey = false; colvarCreatedBy.IsReadOnly = false; colvarCreatedBy.DefaultSetting = @""; colvarCreatedBy.ForeignKeyTableName = ""; schema.Columns.Add(colvarCreatedBy); TableSchema.TableColumn colvarCreatedOn = new TableSchema.TableColumn(schema); colvarCreatedOn.ColumnName = "CreatedOn"; colvarCreatedOn.DataType = DbType.DateTime; colvarCreatedOn.MaxLength = 0; colvarCreatedOn.AutoIncrement = false; colvarCreatedOn.IsNullable = false; colvarCreatedOn.IsPrimaryKey = false; colvarCreatedOn.IsForeignKey = false; colvarCreatedOn.IsReadOnly = false; colvarCreatedOn.DefaultSetting = @"(getutcdate())"; colvarCreatedOn.ForeignKeyTableName = ""; schema.Columns.Add(colvarCreatedOn); TableSchema.TableColumn colvarModifiedBy = new TableSchema.TableColumn(schema); colvarModifiedBy.ColumnName = "ModifiedBy"; colvarModifiedBy.DataType = DbType.String; colvarModifiedBy.MaxLength = 50; colvarModifiedBy.AutoIncrement = false; colvarModifiedBy.IsNullable = true; colvarModifiedBy.IsPrimaryKey = false; colvarModifiedBy.IsForeignKey = false; colvarModifiedBy.IsReadOnly = false; colvarModifiedBy.DefaultSetting = @""; colvarModifiedBy.ForeignKeyTableName = ""; schema.Columns.Add(colvarModifiedBy); TableSchema.TableColumn colvarModifiedOn = new TableSchema.TableColumn(schema); colvarModifiedOn.ColumnName = "ModifiedOn"; colvarModifiedOn.DataType = DbType.DateTime; colvarModifiedOn.MaxLength = 0; colvarModifiedOn.AutoIncrement = false; colvarModifiedOn.IsNullable = false; colvarModifiedOn.IsPrimaryKey = false; colvarModifiedOn.IsForeignKey = false; colvarModifiedOn.IsReadOnly = false; colvarModifiedOn.DefaultSetting = @"(getutcdate())"; colvarModifiedOn.ForeignKeyTableName = ""; schema.Columns.Add(colvarModifiedOn); BaseSchema = schema; //add this schema to the provider //so we can query it later DataService.Providers["dashCommerceProvider"].AddSchema("dashCommerce_Store_OrderStatusDescriptor", schema); } }
private static void GetTableSchema() { if (!IsSchemaInitialized) { //Schema declaration TableSchema.Table schema = new TableSchema.Table("Sys_ObraSocial", TableType.Table, DataService.GetInstance("sicProvider")); schema.Columns = new TableSchema.TableColumnCollection(); schema.SchemaName = @"dbo"; //columns TableSchema.TableColumn colvarIdObraSocial = new TableSchema.TableColumn(schema); colvarIdObraSocial.ColumnName = "idObraSocial"; colvarIdObraSocial.DataType = DbType.Int32; colvarIdObraSocial.MaxLength = 0; colvarIdObraSocial.AutoIncrement = true; colvarIdObraSocial.IsNullable = false; colvarIdObraSocial.IsPrimaryKey = true; colvarIdObraSocial.IsForeignKey = false; colvarIdObraSocial.IsReadOnly = false; colvarIdObraSocial.DefaultSetting = @""; colvarIdObraSocial.ForeignKeyTableName = ""; schema.Columns.Add(colvarIdObraSocial); TableSchema.TableColumn colvarNombre = new TableSchema.TableColumn(schema); colvarNombre.ColumnName = "nombre"; colvarNombre.DataType = DbType.String; colvarNombre.MaxLength = 200; colvarNombre.AutoIncrement = false; colvarNombre.IsNullable = false; colvarNombre.IsPrimaryKey = false; colvarNombre.IsForeignKey = false; colvarNombre.IsReadOnly = false; colvarNombre.DefaultSetting = @""; colvarNombre.ForeignKeyTableName = ""; schema.Columns.Add(colvarNombre); TableSchema.TableColumn colvarSigla = new TableSchema.TableColumn(schema); colvarSigla.ColumnName = "sigla"; colvarSigla.DataType = DbType.String; colvarSigla.MaxLength = 50; colvarSigla.AutoIncrement = false; colvarSigla.IsNullable = false; colvarSigla.IsPrimaryKey = false; colvarSigla.IsForeignKey = false; colvarSigla.IsReadOnly = false; colvarSigla.DefaultSetting = @"('')"; colvarSigla.ForeignKeyTableName = ""; schema.Columns.Add(colvarSigla); TableSchema.TableColumn colvarCodigoNacion = new TableSchema.TableColumn(schema); colvarCodigoNacion.ColumnName = "codigoNacion"; colvarCodigoNacion.DataType = DbType.AnsiString; colvarCodigoNacion.MaxLength = 200; colvarCodigoNacion.AutoIncrement = false; colvarCodigoNacion.IsNullable = false; colvarCodigoNacion.IsPrimaryKey = false; colvarCodigoNacion.IsForeignKey = false; colvarCodigoNacion.IsReadOnly = false; colvarCodigoNacion.DefaultSetting = @"('')"; colvarCodigoNacion.ForeignKeyTableName = ""; schema.Columns.Add(colvarCodigoNacion); TableSchema.TableColumn colvarCuenta = new TableSchema.TableColumn(schema); colvarCuenta.ColumnName = "cuenta"; colvarCuenta.DataType = DbType.AnsiString; colvarCuenta.MaxLength = 50; colvarCuenta.AutoIncrement = false; colvarCuenta.IsNullable = false; colvarCuenta.IsPrimaryKey = false; colvarCuenta.IsForeignKey = false; colvarCuenta.IsReadOnly = false; colvarCuenta.DefaultSetting = @"('')"; colvarCuenta.ForeignKeyTableName = ""; schema.Columns.Add(colvarCuenta); TableSchema.TableColumn colvarDomicilio = new TableSchema.TableColumn(schema); colvarDomicilio.ColumnName = "domicilio"; colvarDomicilio.DataType = DbType.AnsiString; colvarDomicilio.MaxLength = 500; colvarDomicilio.AutoIncrement = false; colvarDomicilio.IsNullable = false; colvarDomicilio.IsPrimaryKey = false; colvarDomicilio.IsForeignKey = false; colvarDomicilio.IsReadOnly = false; colvarDomicilio.DefaultSetting = @"('')"; colvarDomicilio.ForeignKeyTableName = ""; schema.Columns.Add(colvarDomicilio); TableSchema.TableColumn colvarIdTipoIva = new TableSchema.TableColumn(schema); colvarIdTipoIva.ColumnName = "idTipoIva"; colvarIdTipoIva.DataType = DbType.Int32; colvarIdTipoIva.MaxLength = 0; colvarIdTipoIva.AutoIncrement = false; colvarIdTipoIva.IsNullable = false; colvarIdTipoIva.IsPrimaryKey = false; colvarIdTipoIva.IsForeignKey = false; colvarIdTipoIva.IsReadOnly = false; colvarIdTipoIva.DefaultSetting = @"((0))"; colvarIdTipoIva.ForeignKeyTableName = ""; schema.Columns.Add(colvarIdTipoIva); TableSchema.TableColumn colvarCuit = new TableSchema.TableColumn(schema); colvarCuit.ColumnName = "cuit"; colvarCuit.DataType = DbType.AnsiString; colvarCuit.MaxLength = 50; colvarCuit.AutoIncrement = false; colvarCuit.IsNullable = false; colvarCuit.IsPrimaryKey = false; colvarCuit.IsForeignKey = false; colvarCuit.IsReadOnly = false; colvarCuit.DefaultSetting = @"('')"; colvarCuit.ForeignKeyTableName = ""; schema.Columns.Add(colvarCuit); TableSchema.TableColumn colvarContacto = new TableSchema.TableColumn(schema); colvarContacto.ColumnName = "contacto"; colvarContacto.DataType = DbType.AnsiString; colvarContacto.MaxLength = 500; colvarContacto.AutoIncrement = false; colvarContacto.IsNullable = false; colvarContacto.IsPrimaryKey = false; colvarContacto.IsForeignKey = false; colvarContacto.IsReadOnly = false; colvarContacto.DefaultSetting = @"('')"; colvarContacto.ForeignKeyTableName = ""; schema.Columns.Add(colvarContacto); TableSchema.TableColumn colvarTelefono = new TableSchema.TableColumn(schema); colvarTelefono.ColumnName = "telefono"; colvarTelefono.DataType = DbType.AnsiString; colvarTelefono.MaxLength = 50; colvarTelefono.AutoIncrement = false; colvarTelefono.IsNullable = false; colvarTelefono.IsPrimaryKey = false; colvarTelefono.IsForeignKey = false; colvarTelefono.IsReadOnly = false; colvarTelefono.DefaultSetting = @"('')"; colvarTelefono.ForeignKeyTableName = ""; schema.Columns.Add(colvarTelefono); TableSchema.TableColumn colvarIdTipoObraSocial = new TableSchema.TableColumn(schema); colvarIdTipoObraSocial.ColumnName = "idTipoObraSocial"; colvarIdTipoObraSocial.DataType = DbType.Int32; colvarIdTipoObraSocial.MaxLength = 0; colvarIdTipoObraSocial.AutoIncrement = false; colvarIdTipoObraSocial.IsNullable = false; colvarIdTipoObraSocial.IsPrimaryKey = false; colvarIdTipoObraSocial.IsForeignKey = true; colvarIdTipoObraSocial.IsReadOnly = false; colvarIdTipoObraSocial.DefaultSetting = @"((0))"; colvarIdTipoObraSocial.ForeignKeyTableName = "Sys_TipoObraSocial"; schema.Columns.Add(colvarIdTipoObraSocial); TableSchema.TableColumn colvarIdObraSocialDepende = new TableSchema.TableColumn(schema); colvarIdObraSocialDepende.ColumnName = "idObraSocialDepende"; colvarIdObraSocialDepende.DataType = DbType.Int32; colvarIdObraSocialDepende.MaxLength = 0; colvarIdObraSocialDepende.AutoIncrement = false; colvarIdObraSocialDepende.IsNullable = false; colvarIdObraSocialDepende.IsPrimaryKey = false; colvarIdObraSocialDepende.IsForeignKey = false; colvarIdObraSocialDepende.IsReadOnly = false; colvarIdObraSocialDepende.DefaultSetting = @"((0))"; colvarIdObraSocialDepende.ForeignKeyTableName = ""; schema.Columns.Add(colvarIdObraSocialDepende); TableSchema.TableColumn colvarFacturaPerCapita = new TableSchema.TableColumn(schema); colvarFacturaPerCapita.ColumnName = "facturaPerCapita"; colvarFacturaPerCapita.DataType = DbType.Boolean; colvarFacturaPerCapita.MaxLength = 0; colvarFacturaPerCapita.AutoIncrement = false; colvarFacturaPerCapita.IsNullable = false; colvarFacturaPerCapita.IsPrimaryKey = false; colvarFacturaPerCapita.IsForeignKey = false; colvarFacturaPerCapita.IsReadOnly = false; colvarFacturaPerCapita.DefaultSetting = @"((0))"; colvarFacturaPerCapita.ForeignKeyTableName = ""; schema.Columns.Add(colvarFacturaPerCapita); TableSchema.TableColumn colvarFacturaCarteraFija = new TableSchema.TableColumn(schema); colvarFacturaCarteraFija.ColumnName = "facturaCarteraFija"; colvarFacturaCarteraFija.DataType = DbType.Boolean; colvarFacturaCarteraFija.MaxLength = 0; colvarFacturaCarteraFija.AutoIncrement = false; colvarFacturaCarteraFija.IsNullable = false; colvarFacturaCarteraFija.IsPrimaryKey = false; colvarFacturaCarteraFija.IsForeignKey = false; colvarFacturaCarteraFija.IsReadOnly = false; colvarFacturaCarteraFija.DefaultSetting = @"((0))"; colvarFacturaCarteraFija.ForeignKeyTableName = ""; schema.Columns.Add(colvarFacturaCarteraFija); TableSchema.TableColumn colvarFacturaAjuste = new TableSchema.TableColumn(schema); colvarFacturaAjuste.ColumnName = "facturaAjuste"; colvarFacturaAjuste.DataType = DbType.Boolean; colvarFacturaAjuste.MaxLength = 0; colvarFacturaAjuste.AutoIncrement = false; colvarFacturaAjuste.IsNullable = false; colvarFacturaAjuste.IsPrimaryKey = false; colvarFacturaAjuste.IsForeignKey = false; colvarFacturaAjuste.IsReadOnly = false; colvarFacturaAjuste.DefaultSetting = @"((0))"; colvarFacturaAjuste.ForeignKeyTableName = ""; schema.Columns.Add(colvarFacturaAjuste); TableSchema.TableColumn colvarFacturaPorcentajeAjuste = new TableSchema.TableColumn(schema); colvarFacturaPorcentajeAjuste.ColumnName = "facturaPorcentajeAjuste"; colvarFacturaPorcentajeAjuste.DataType = DbType.Decimal; colvarFacturaPorcentajeAjuste.MaxLength = 0; colvarFacturaPorcentajeAjuste.AutoIncrement = false; colvarFacturaPorcentajeAjuste.IsNullable = false; colvarFacturaPorcentajeAjuste.IsPrimaryKey = false; colvarFacturaPorcentajeAjuste.IsForeignKey = false; colvarFacturaPorcentajeAjuste.IsReadOnly = false; colvarFacturaPorcentajeAjuste.DefaultSetting = @"((0))"; colvarFacturaPorcentajeAjuste.ForeignKeyTableName = ""; schema.Columns.Add(colvarFacturaPorcentajeAjuste); TableSchema.TableColumn colvarNroOrden = new TableSchema.TableColumn(schema); colvarNroOrden.ColumnName = "nroOrden"; colvarNroOrden.DataType = DbType.Int32; colvarNroOrden.MaxLength = 0; colvarNroOrden.AutoIncrement = false; colvarNroOrden.IsNullable = false; colvarNroOrden.IsPrimaryKey = false; colvarNroOrden.IsForeignKey = false; colvarNroOrden.IsReadOnly = false; colvarNroOrden.DefaultSetting = @"((10000))"; colvarNroOrden.ForeignKeyTableName = ""; schema.Columns.Add(colvarNroOrden); TableSchema.TableColumn colvarPermiteFacturaFueraConvenio = new TableSchema.TableColumn(schema); colvarPermiteFacturaFueraConvenio.ColumnName = "permiteFacturaFueraConvenio"; colvarPermiteFacturaFueraConvenio.DataType = DbType.Boolean; colvarPermiteFacturaFueraConvenio.MaxLength = 0; colvarPermiteFacturaFueraConvenio.AutoIncrement = false; colvarPermiteFacturaFueraConvenio.IsNullable = false; colvarPermiteFacturaFueraConvenio.IsPrimaryKey = false; colvarPermiteFacturaFueraConvenio.IsForeignKey = false; colvarPermiteFacturaFueraConvenio.IsReadOnly = false; colvarPermiteFacturaFueraConvenio.DefaultSetting = @"((0))"; colvarPermiteFacturaFueraConvenio.ForeignKeyTableName = ""; schema.Columns.Add(colvarPermiteFacturaFueraConvenio); BaseSchema = schema; //add this schema to the provider //so we can query it later DataService.Providers["sicProvider"].AddSchema("Sys_ObraSocial", schema); } }
private static void GetTableSchema() { if (!IsSchemaInitialized) { //Schema declaration TableSchema.Table schema = new TableSchema.Table("Sys_Permiso", TableType.Table, DataService.GetInstance("sicProvider")); schema.Columns = new TableSchema.TableColumnCollection(); schema.SchemaName = @"dbo"; //columns TableSchema.TableColumn colvarIdPermiso = new TableSchema.TableColumn(schema); colvarIdPermiso.ColumnName = "idPermiso"; colvarIdPermiso.DataType = DbType.Int32; colvarIdPermiso.MaxLength = 0; colvarIdPermiso.AutoIncrement = true; colvarIdPermiso.IsNullable = false; colvarIdPermiso.IsPrimaryKey = true; colvarIdPermiso.IsForeignKey = false; colvarIdPermiso.IsReadOnly = false; colvarIdPermiso.DefaultSetting = @""; colvarIdPermiso.ForeignKeyTableName = ""; schema.Columns.Add(colvarIdPermiso); TableSchema.TableColumn colvarIdEfector = new TableSchema.TableColumn(schema); colvarIdEfector.ColumnName = "idEfector"; colvarIdEfector.DataType = DbType.Int32; colvarIdEfector.MaxLength = 0; colvarIdEfector.AutoIncrement = false; colvarIdEfector.IsNullable = false; colvarIdEfector.IsPrimaryKey = false; colvarIdEfector.IsForeignKey = false; colvarIdEfector.IsReadOnly = false; colvarIdEfector.DefaultSetting = @"((0))"; colvarIdEfector.ForeignKeyTableName = ""; schema.Columns.Add(colvarIdEfector); TableSchema.TableColumn colvarIdPerfil = new TableSchema.TableColumn(schema); colvarIdPerfil.ColumnName = "idPerfil"; colvarIdPerfil.DataType = DbType.Int32; colvarIdPerfil.MaxLength = 0; colvarIdPerfil.AutoIncrement = false; colvarIdPerfil.IsNullable = false; colvarIdPerfil.IsPrimaryKey = false; colvarIdPerfil.IsForeignKey = true; colvarIdPerfil.IsReadOnly = false; colvarIdPerfil.DefaultSetting = @"((0))"; colvarIdPerfil.ForeignKeyTableName = "Sys_Perfil"; schema.Columns.Add(colvarIdPerfil); TableSchema.TableColumn colvarIdMenu = new TableSchema.TableColumn(schema); colvarIdMenu.ColumnName = "idMenu"; colvarIdMenu.DataType = DbType.Int32; colvarIdMenu.MaxLength = 0; colvarIdMenu.AutoIncrement = false; colvarIdMenu.IsNullable = false; colvarIdMenu.IsPrimaryKey = false; colvarIdMenu.IsForeignKey = true; colvarIdMenu.IsReadOnly = false; colvarIdMenu.DefaultSetting = @"((0))"; colvarIdMenu.ForeignKeyTableName = "Sys_Menu"; schema.Columns.Add(colvarIdMenu); TableSchema.TableColumn colvarPermiso = new TableSchema.TableColumn(schema); colvarPermiso.ColumnName = "permiso"; colvarPermiso.DataType = DbType.String; colvarPermiso.MaxLength = 1; colvarPermiso.AutoIncrement = false; colvarPermiso.IsNullable = false; colvarPermiso.IsPrimaryKey = false; colvarPermiso.IsForeignKey = false; colvarPermiso.IsReadOnly = false; colvarPermiso.DefaultSetting = @"((0))"; colvarPermiso.ForeignKeyTableName = ""; schema.Columns.Add(colvarPermiso); BaseSchema = schema; //add this schema to the provider //so we can query it later DataService.Providers["sicProvider"].AddSchema("Sys_Permiso", schema); } }
private static void GetTableSchema() { if (!IsSchemaInitialized) { //Schema declaration TableSchema.Table schema = new TableSchema.Table("PN_tipo_permiso", TableType.Table, DataService.GetInstance("sicProvider")); schema.Columns = new TableSchema.TableColumnCollection(); schema.SchemaName = @"dbo"; //columns TableSchema.TableColumn colvarIdTipo = new TableSchema.TableColumn(schema); colvarIdTipo.ColumnName = "id_tipo"; colvarIdTipo.DataType = DbType.Int32; colvarIdTipo.MaxLength = 0; colvarIdTipo.AutoIncrement = true; colvarIdTipo.IsNullable = false; colvarIdTipo.IsPrimaryKey = true; colvarIdTipo.IsForeignKey = false; colvarIdTipo.IsReadOnly = false; colvarIdTipo.DefaultSetting = @""; colvarIdTipo.ForeignKeyTableName = ""; schema.Columns.Add(colvarIdTipo); TableSchema.TableColumn colvarTipoNombre = new TableSchema.TableColumn(schema); colvarTipoNombre.ColumnName = "tipo_nombre"; colvarTipoNombre.DataType = DbType.AnsiString; colvarTipoNombre.MaxLength = -1; colvarTipoNombre.AutoIncrement = false; colvarTipoNombre.IsNullable = true; colvarTipoNombre.IsPrimaryKey = false; colvarTipoNombre.IsForeignKey = false; colvarTipoNombre.IsReadOnly = false; colvarTipoNombre.DefaultSetting = @""; colvarTipoNombre.ForeignKeyTableName = ""; schema.Columns.Add(colvarTipoNombre); TableSchema.TableColumn colvarImg1Src = new TableSchema.TableColumn(schema); colvarImg1Src.ColumnName = "img1_src"; colvarImg1Src.DataType = DbType.AnsiString; colvarImg1Src.MaxLength = -1; colvarImg1Src.AutoIncrement = false; colvarImg1Src.IsNullable = true; colvarImg1Src.IsPrimaryKey = false; colvarImg1Src.IsForeignKey = false; colvarImg1Src.IsReadOnly = false; colvarImg1Src.DefaultSetting = @""; colvarImg1Src.ForeignKeyTableName = ""; schema.Columns.Add(colvarImg1Src); TableSchema.TableColumn colvarImg2Src = new TableSchema.TableColumn(schema); colvarImg2Src.ColumnName = "img2_src"; colvarImg2Src.DataType = DbType.AnsiString; colvarImg2Src.MaxLength = -1; colvarImg2Src.AutoIncrement = false; colvarImg2Src.IsNullable = true; colvarImg2Src.IsPrimaryKey = false; colvarImg2Src.IsForeignKey = false; colvarImg2Src.IsReadOnly = false; colvarImg2Src.DefaultSetting = @""; colvarImg2Src.ForeignKeyTableName = ""; schema.Columns.Add(colvarImg2Src); TableSchema.TableColumn colvarImg3Src = new TableSchema.TableColumn(schema); colvarImg3Src.ColumnName = "img3_src"; colvarImg3Src.DataType = DbType.AnsiString; colvarImg3Src.MaxLength = -1; colvarImg3Src.AutoIncrement = false; colvarImg3Src.IsNullable = true; colvarImg3Src.IsPrimaryKey = false; colvarImg3Src.IsForeignKey = false; colvarImg3Src.IsReadOnly = false; colvarImg3Src.DefaultSetting = @""; colvarImg3Src.ForeignKeyTableName = ""; schema.Columns.Add(colvarImg3Src); BaseSchema = schema; //add this schema to the provider //so we can query it later DataService.Providers["sicProvider"].AddSchema("PN_tipo_permiso", schema); } }
/// <summary> /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering. /// </summary> protected override void CreateChildControls() { surroundingPanel.ID = "pnlSurround"; Controls.Add(surroundingPanel); surroundingPanel.Controls.Clear(); Label lblTitle = new Label {ID = "lblTitle"}; surroundingPanel.Controls.Add(lblTitle); lblTitle.Visible = true; if(String.IsNullOrEmpty(TableName) && ScaffoldType == ScaffoldTypeEnum.Normal) { lblTitle.Text = NO_TABLE_NAME; return; } if(ScaffoldType == ScaffoldTypeEnum.Normal) activeTableSchema = DataService.GetSchema(TableName, ProviderName, TableType.Table); if(ScaffoldType == ScaffoldTypeEnum.Normal && (activeTableSchema == null || activeTableSchema.PrimaryKey == null)) { lblTitle.Text = activeTableSchema == null ? NO_TABLE_SCHEMA : NO_PRIMARY_KEY; return; } lblTitle.Visible = ShowScaffoldCaption; //add in the button row Panel pnlButtons = new Panel {ID = "pnlButtons"}; surroundingPanel.Controls.Add(pnlButtons); btnAdd.ID = "btnAdd"; pnlButtons.Controls.Add(btnAdd); btnSave.ID = "btnSave"; pnlButtons.Controls.Add(btnSave); btnCancel.ID = "btnCancel"; pnlButtons.Controls.Add(btnCancel); btnDelete.ID = "btnDelete"; pnlButtons.Controls.Add(btnDelete); foreach(Button button in pnlButtons.Controls) ApplyCssClass(button, ButtonCssClass); btnDelete.OnClientClick = "return CheckDelete();"; btnSave.Text = "Save"; btnDelete.Text = "Delete"; btnCancel.Text = "Return"; btnAdd.Text = "Add"; btnAdd.Click += btnAdd_Click; btnSave.Click += btnSave_Click; btnCancel.Click += btnCancel_Click; btnDelete.Click += btnDelete_Click; btnDelete.Visible = CanDelete; bool isAdd = (Mode == ScaffoldMode.Add); bool isEdit = (Mode == ScaffoldMode.Edit); bool isGrid = (Mode == ScaffoldMode.List); if(ScaffoldType == ScaffoldTypeEnum.Auto) { Panel pnlNavigator = new Panel {ID = "pnlNavigator"}; surroundingPanel.Controls.Add(pnlNavigator); pnlNavigator.Controls.Clear(); if(DataService.Providers != null) { pnlNavigator.Attributes.Add("style", "float:left"); pnlNavigator.Controls.Add(new LiteralControl("<div style=\"margin-top:10px\">Provider</div><div>")); ddlProviders.ID = "ddlProviders"; pnlNavigator.Controls.Add(ddlProviders); ApplyCssClass(ddlProviders, DropDownCssClass); PopulateProviderList(); ddlProviders.AutoPostBack = true; ddlProviders.SelectedIndexChanged += ddlProviders_SelectedIndexChanged; ProviderName = ddlProviders.SelectedValue; pnlNavigator.Controls.Add(new LiteralControl("</div><div style=\"margin-top:10px\">Table</div><div>")); ddlTables.ID = "ddlTables"; pnlNavigator.Controls.Add(ddlTables); ApplyCssClass(ddlTables, DropDownCssClass); PopulateTableList(); ddlTables.AutoPostBack = true; ddlTables.SelectedIndexChanged += ddlTables_SelectedIndexChanged; pnlNavigator.Controls.Add(new LiteralControl("</div>")); //if (TableSchema == null && ddlTables.SelectedIndex > -1) activeTableSchema = DataService.GetSchema(ddlTables.SelectedValue, ProviderName); } pnlNavigator.Visible = isGrid; } Panel pnlEditor = new Panel {ID = "pnlEditor"}; surroundingPanel.Controls.Add(pnlEditor); CreateEditor(pnlEditor, isEdit); Panel pnlGrid = new Panel {ID = "pnlGrid"}; surroundingPanel.Controls.Add(pnlGrid); grid.ID = "grid"; pnlGrid.Controls.Add(grid); grid.Sorting += grid_Sorting; grid.RowEditing += grid_RowEditing; grid.AllowSorting = true; btnAdd.Visible = false; if(isGrid) { btnAdd.Visible = CanCreate; pnlEditor.Visible = false; pnlGrid.Visible = true; btnSave.Visible = false; btnCancel.Visible = false; btnDelete.Visible = false; BindGrid(String.Empty); } if(isEdit) { pnlEditor.Visible = true; pnlGrid.Visible = false; BindEditor(TableSchema, PrimaryKeyValue); btnSave.Visible = true; btnCancel.Visible = true; btnDelete.Visible = CanDelete; } if(isAdd) { pnlEditor.Visible = true; pnlGrid.Visible = false; btnSave.Visible = true; btnCancel.Visible = true; btnDelete.Visible = false; lblTitle.Visible = !ShowScaffoldCaption; } lblTitle.Text = String.Format("<h2>{0} Admin</h2>", TableSchema.DisplayName); Label lblMessage = new Label {ID = "lblMessage"}; surroundingPanel.Controls.Add(lblMessage); lblSorter.Text = String.Empty; surroundingPanel.Controls.Add(lblSorter); ViewState[SCAFFOLD_MODE] = Mode; if(Mode != ScaffoldMode.Edit) PrimaryKeyValue = String.Empty; }
private static void GetTableSchema() { if (!IsSchemaInitialized) { //Schema declaration TableSchema.Table schema = new TableSchema.Table("MAM_AnatomiaPatologica", TableType.Table, DataService.GetInstance("sicProvider")); schema.Columns = new TableSchema.TableColumnCollection(); schema.SchemaName = @"dbo"; //columns TableSchema.TableColumn colvarIdAnatomiaPatologica = new TableSchema.TableColumn(schema); colvarIdAnatomiaPatologica.ColumnName = "idAnatomiaPatologica"; colvarIdAnatomiaPatologica.DataType = DbType.Int32; colvarIdAnatomiaPatologica.MaxLength = 0; colvarIdAnatomiaPatologica.AutoIncrement = true; colvarIdAnatomiaPatologica.IsNullable = false; colvarIdAnatomiaPatologica.IsPrimaryKey = true; colvarIdAnatomiaPatologica.IsForeignKey = false; colvarIdAnatomiaPatologica.IsReadOnly = false; colvarIdAnatomiaPatologica.DefaultSetting = @""; colvarIdAnatomiaPatologica.ForeignKeyTableName = ""; schema.Columns.Add(colvarIdAnatomiaPatologica); TableSchema.TableColumn colvarIdPaciente = new TableSchema.TableColumn(schema); colvarIdPaciente.ColumnName = "idPaciente"; colvarIdPaciente.DataType = DbType.Int32; colvarIdPaciente.MaxLength = 0; colvarIdPaciente.AutoIncrement = false; colvarIdPaciente.IsNullable = false; colvarIdPaciente.IsPrimaryKey = false; colvarIdPaciente.IsForeignKey = false; colvarIdPaciente.IsReadOnly = false; colvarIdPaciente.DefaultSetting = @"((0))"; colvarIdPaciente.ForeignKeyTableName = ""; schema.Columns.Add(colvarIdPaciente); TableSchema.TableColumn colvarEdad = new TableSchema.TableColumn(schema); colvarEdad.ColumnName = "edad"; colvarEdad.DataType = DbType.Int32; colvarEdad.MaxLength = 0; colvarEdad.AutoIncrement = false; colvarEdad.IsNullable = false; colvarEdad.IsPrimaryKey = false; colvarEdad.IsForeignKey = false; colvarEdad.IsReadOnly = false; colvarEdad.DefaultSetting = @"((0))"; colvarEdad.ForeignKeyTableName = ""; schema.Columns.Add(colvarEdad); TableSchema.TableColumn colvarGanglioAxilar = new TableSchema.TableColumn(schema); colvarGanglioAxilar.ColumnName = "ganglioAxilar"; colvarGanglioAxilar.DataType = DbType.Int32; colvarGanglioAxilar.MaxLength = 0; colvarGanglioAxilar.AutoIncrement = false; colvarGanglioAxilar.IsNullable = false; colvarGanglioAxilar.IsPrimaryKey = false; colvarGanglioAxilar.IsForeignKey = false; colvarGanglioAxilar.IsReadOnly = false; colvarGanglioAxilar.DefaultSetting = @""; colvarGanglioAxilar.ForeignKeyTableName = ""; schema.Columns.Add(colvarGanglioAxilar); TableSchema.TableColumn colvarNoduloMama = new TableSchema.TableColumn(schema); colvarNoduloMama.ColumnName = "noduloMama"; colvarNoduloMama.DataType = DbType.Int32; colvarNoduloMama.MaxLength = 0; colvarNoduloMama.AutoIncrement = false; colvarNoduloMama.IsNullable = false; colvarNoduloMama.IsPrimaryKey = false; colvarNoduloMama.IsForeignKey = false; colvarNoduloMama.IsReadOnly = false; colvarNoduloMama.DefaultSetting = @"('')"; colvarNoduloMama.ForeignKeyTableName = ""; schema.Columns.Add(colvarNoduloMama); TableSchema.TableColumn colvarMicrocalcificaciones = new TableSchema.TableColumn(schema); colvarMicrocalcificaciones.ColumnName = "microcalcificaciones"; colvarMicrocalcificaciones.DataType = DbType.Int32; colvarMicrocalcificaciones.MaxLength = 0; colvarMicrocalcificaciones.AutoIncrement = false; colvarMicrocalcificaciones.IsNullable = false; colvarMicrocalcificaciones.IsPrimaryKey = false; colvarMicrocalcificaciones.IsForeignKey = false; colvarMicrocalcificaciones.IsReadOnly = false; colvarMicrocalcificaciones.DefaultSetting = @"((0))"; colvarMicrocalcificaciones.ForeignKeyTableName = ""; schema.Columns.Add(colvarMicrocalcificaciones); TableSchema.TableColumn colvarPiel = new TableSchema.TableColumn(schema); colvarPiel.ColumnName = "piel"; colvarPiel.DataType = DbType.Int32; colvarPiel.MaxLength = 0; colvarPiel.AutoIncrement = false; colvarPiel.IsNullable = false; colvarPiel.IsPrimaryKey = false; colvarPiel.IsForeignKey = false; colvarPiel.IsReadOnly = false; colvarPiel.DefaultSetting = @"((0))"; colvarPiel.ForeignKeyTableName = ""; schema.Columns.Add(colvarPiel); TableSchema.TableColumn colvarDerrame = new TableSchema.TableColumn(schema); colvarDerrame.ColumnName = "derrame"; colvarDerrame.DataType = DbType.Int32; colvarDerrame.MaxLength = 0; colvarDerrame.AutoIncrement = false; colvarDerrame.IsNullable = false; colvarDerrame.IsPrimaryKey = false; colvarDerrame.IsForeignKey = false; colvarDerrame.IsReadOnly = false; colvarDerrame.DefaultSetting = @"((0))"; colvarDerrame.ForeignKeyTableName = ""; schema.Columns.Add(colvarDerrame); TableSchema.TableColumn colvarFechaTomaMuestra = new TableSchema.TableColumn(schema); colvarFechaTomaMuestra.ColumnName = "fechaTomaMuestra"; colvarFechaTomaMuestra.DataType = DbType.DateTime; colvarFechaTomaMuestra.MaxLength = 0; colvarFechaTomaMuestra.AutoIncrement = false; colvarFechaTomaMuestra.IsNullable = false; colvarFechaTomaMuestra.IsPrimaryKey = false; colvarFechaTomaMuestra.IsForeignKey = false; colvarFechaTomaMuestra.IsReadOnly = false; colvarFechaTomaMuestra.DefaultSetting = @"((0))"; colvarFechaTomaMuestra.ForeignKeyTableName = ""; schema.Columns.Add(colvarFechaTomaMuestra); TableSchema.TableColumn colvarFechaRecepcionMuestra = new TableSchema.TableColumn(schema); colvarFechaRecepcionMuestra.ColumnName = "fechaRecepcionMuestra"; colvarFechaRecepcionMuestra.DataType = DbType.DateTime; colvarFechaRecepcionMuestra.MaxLength = 0; colvarFechaRecepcionMuestra.AutoIncrement = false; colvarFechaRecepcionMuestra.IsNullable = false; colvarFechaRecepcionMuestra.IsPrimaryKey = false; colvarFechaRecepcionMuestra.IsForeignKey = false; colvarFechaRecepcionMuestra.IsReadOnly = false; colvarFechaRecepcionMuestra.DefaultSetting = @""; colvarFechaRecepcionMuestra.ForeignKeyTableName = ""; schema.Columns.Add(colvarFechaRecepcionMuestra); TableSchema.TableColumn colvarFechaInformeMuestra = new TableSchema.TableColumn(schema); colvarFechaInformeMuestra.ColumnName = "fechaInformeMuestra"; colvarFechaInformeMuestra.DataType = DbType.DateTime; colvarFechaInformeMuestra.MaxLength = 0; colvarFechaInformeMuestra.AutoIncrement = false; colvarFechaInformeMuestra.IsNullable = false; colvarFechaInformeMuestra.IsPrimaryKey = false; colvarFechaInformeMuestra.IsForeignKey = false; colvarFechaInformeMuestra.IsReadOnly = false; colvarFechaInformeMuestra.DefaultSetting = @""; colvarFechaInformeMuestra.ForeignKeyTableName = ""; schema.Columns.Add(colvarFechaInformeMuestra); TableSchema.TableColumn colvarNumeroIngreso = new TableSchema.TableColumn(schema); colvarNumeroIngreso.ColumnName = "numeroIngreso"; colvarNumeroIngreso.DataType = DbType.AnsiString; colvarNumeroIngreso.MaxLength = 20; colvarNumeroIngreso.AutoIncrement = false; colvarNumeroIngreso.IsNullable = false; colvarNumeroIngreso.IsPrimaryKey = false; colvarNumeroIngreso.IsForeignKey = false; colvarNumeroIngreso.IsReadOnly = false; colvarNumeroIngreso.DefaultSetting = @"('')"; colvarNumeroIngreso.ForeignKeyTableName = ""; schema.Columns.Add(colvarNumeroIngreso); TableSchema.TableColumn colvarIdResponsableMuestra = new TableSchema.TableColumn(schema); colvarIdResponsableMuestra.ColumnName = "idResponsableMuestra"; colvarIdResponsableMuestra.DataType = DbType.Int32; colvarIdResponsableMuestra.MaxLength = 0; colvarIdResponsableMuestra.AutoIncrement = false; colvarIdResponsableMuestra.IsNullable = false; colvarIdResponsableMuestra.IsPrimaryKey = false; colvarIdResponsableMuestra.IsForeignKey = true; colvarIdResponsableMuestra.IsReadOnly = false; colvarIdResponsableMuestra.DefaultSetting = @"((0))"; colvarIdResponsableMuestra.ForeignKeyTableName = "Sys_Profesional"; schema.Columns.Add(colvarIdResponsableMuestra); TableSchema.TableColumn colvarIdCentroSaludMuestra = new TableSchema.TableColumn(schema); colvarIdCentroSaludMuestra.ColumnName = "idCentroSaludMuestra"; colvarIdCentroSaludMuestra.DataType = DbType.Int32; colvarIdCentroSaludMuestra.MaxLength = 0; colvarIdCentroSaludMuestra.AutoIncrement = false; colvarIdCentroSaludMuestra.IsNullable = false; colvarIdCentroSaludMuestra.IsPrimaryKey = false; colvarIdCentroSaludMuestra.IsForeignKey = true; colvarIdCentroSaludMuestra.IsReadOnly = false; colvarIdCentroSaludMuestra.DefaultSetting = @"((0))"; colvarIdCentroSaludMuestra.ForeignKeyTableName = "Sys_Efector"; schema.Columns.Add(colvarIdCentroSaludMuestra); TableSchema.TableColumn colvarIdDiagnosticoCitologico = new TableSchema.TableColumn(schema); colvarIdDiagnosticoCitologico.ColumnName = "idDiagnosticoCitologico"; colvarIdDiagnosticoCitologico.DataType = DbType.Int32; colvarIdDiagnosticoCitologico.MaxLength = 0; colvarIdDiagnosticoCitologico.AutoIncrement = false; colvarIdDiagnosticoCitologico.IsNullable = false; colvarIdDiagnosticoCitologico.IsPrimaryKey = false; colvarIdDiagnosticoCitologico.IsForeignKey = true; colvarIdDiagnosticoCitologico.IsReadOnly = false; colvarIdDiagnosticoCitologico.DefaultSetting = @"((0))"; colvarIdDiagnosticoCitologico.ForeignKeyTableName = "MAM_DiagnosticoCitologico"; schema.Columns.Add(colvarIdDiagnosticoCitologico); TableSchema.TableColumn colvarIdDiagnosticoHistologico = new TableSchema.TableColumn(schema); colvarIdDiagnosticoHistologico.ColumnName = "idDiagnosticoHistologico"; colvarIdDiagnosticoHistologico.DataType = DbType.Int32; colvarIdDiagnosticoHistologico.MaxLength = 0; colvarIdDiagnosticoHistologico.AutoIncrement = false; colvarIdDiagnosticoHistologico.IsNullable = false; colvarIdDiagnosticoHistologico.IsPrimaryKey = false; colvarIdDiagnosticoHistologico.IsForeignKey = true; colvarIdDiagnosticoHistologico.IsReadOnly = false; colvarIdDiagnosticoHistologico.DefaultSetting = @"((0))"; colvarIdDiagnosticoHistologico.ForeignKeyTableName = "MAM_DiagnoticoHistologico"; schema.Columns.Add(colvarIdDiagnosticoHistologico); TableSchema.TableColumn colvarFechaInforme = new TableSchema.TableColumn(schema); colvarFechaInforme.ColumnName = "fechaInforme"; colvarFechaInforme.DataType = DbType.DateTime; colvarFechaInforme.MaxLength = 0; colvarFechaInforme.AutoIncrement = false; colvarFechaInforme.IsNullable = false; colvarFechaInforme.IsPrimaryKey = false; colvarFechaInforme.IsForeignKey = false; colvarFechaInforme.IsReadOnly = false; colvarFechaInforme.DefaultSetting = @"('')"; colvarFechaInforme.ForeignKeyTableName = ""; schema.Columns.Add(colvarFechaInforme); TableSchema.TableColumn colvarIdResponsableInforme = new TableSchema.TableColumn(schema); colvarIdResponsableInforme.ColumnName = "idResponsableInforme"; colvarIdResponsableInforme.DataType = DbType.Int32; colvarIdResponsableInforme.MaxLength = 0; colvarIdResponsableInforme.AutoIncrement = false; colvarIdResponsableInforme.IsNullable = false; colvarIdResponsableInforme.IsPrimaryKey = false; colvarIdResponsableInforme.IsForeignKey = true; colvarIdResponsableInforme.IsReadOnly = false; colvarIdResponsableInforme.DefaultSetting = @"((0))"; colvarIdResponsableInforme.ForeignKeyTableName = "Sys_Profesional"; schema.Columns.Add(colvarIdResponsableInforme); TableSchema.TableColumn colvarIdCentroSaludInforme = new TableSchema.TableColumn(schema); colvarIdCentroSaludInforme.ColumnName = "idCentroSaludInforme"; colvarIdCentroSaludInforme.DataType = DbType.Int32; colvarIdCentroSaludInforme.MaxLength = 0; colvarIdCentroSaludInforme.AutoIncrement = false; colvarIdCentroSaludInforme.IsNullable = false; colvarIdCentroSaludInforme.IsPrimaryKey = false; colvarIdCentroSaludInforme.IsForeignKey = true; colvarIdCentroSaludInforme.IsReadOnly = false; colvarIdCentroSaludInforme.DefaultSetting = @"((0))"; colvarIdCentroSaludInforme.ForeignKeyTableName = "Sys_Efector"; schema.Columns.Add(colvarIdCentroSaludInforme); TableSchema.TableColumn colvarObservaciones = new TableSchema.TableColumn(schema); colvarObservaciones.ColumnName = "observaciones"; colvarObservaciones.DataType = DbType.AnsiString; colvarObservaciones.MaxLength = 1000; colvarObservaciones.AutoIncrement = false; colvarObservaciones.IsNullable = false; colvarObservaciones.IsPrimaryKey = false; colvarObservaciones.IsForeignKey = false; colvarObservaciones.IsReadOnly = false; colvarObservaciones.DefaultSetting = @"('')"; colvarObservaciones.ForeignKeyTableName = ""; schema.Columns.Add(colvarObservaciones); TableSchema.TableColumn colvarActivo = new TableSchema.TableColumn(schema); colvarActivo.ColumnName = "activo"; colvarActivo.DataType = DbType.Boolean; colvarActivo.MaxLength = 0; colvarActivo.AutoIncrement = false; colvarActivo.IsNullable = false; colvarActivo.IsPrimaryKey = false; colvarActivo.IsForeignKey = false; colvarActivo.IsReadOnly = false; colvarActivo.DefaultSetting = @"((1))"; colvarActivo.ForeignKeyTableName = ""; schema.Columns.Add(colvarActivo); TableSchema.TableColumn colvarCreatedBy = new TableSchema.TableColumn(schema); colvarCreatedBy.ColumnName = "CreatedBy"; colvarCreatedBy.DataType = DbType.String; colvarCreatedBy.MaxLength = 50; colvarCreatedBy.AutoIncrement = false; colvarCreatedBy.IsNullable = false; colvarCreatedBy.IsPrimaryKey = false; colvarCreatedBy.IsForeignKey = false; colvarCreatedBy.IsReadOnly = false; colvarCreatedBy.DefaultSetting = @"('')"; colvarCreatedBy.ForeignKeyTableName = ""; schema.Columns.Add(colvarCreatedBy); TableSchema.TableColumn colvarCreatedOn = new TableSchema.TableColumn(schema); colvarCreatedOn.ColumnName = "CreatedOn"; colvarCreatedOn.DataType = DbType.DateTime; colvarCreatedOn.MaxLength = 0; colvarCreatedOn.AutoIncrement = false; colvarCreatedOn.IsNullable = false; colvarCreatedOn.IsPrimaryKey = false; colvarCreatedOn.IsForeignKey = false; colvarCreatedOn.IsReadOnly = false; colvarCreatedOn.DefaultSetting = @"(((1)/(1))/(1900))"; colvarCreatedOn.ForeignKeyTableName = ""; schema.Columns.Add(colvarCreatedOn); TableSchema.TableColumn colvarModifiedBy = new TableSchema.TableColumn(schema); colvarModifiedBy.ColumnName = "ModifiedBy"; colvarModifiedBy.DataType = DbType.String; colvarModifiedBy.MaxLength = 50; colvarModifiedBy.AutoIncrement = false; colvarModifiedBy.IsNullable = false; colvarModifiedBy.IsPrimaryKey = false; colvarModifiedBy.IsForeignKey = false; colvarModifiedBy.IsReadOnly = false; colvarModifiedBy.DefaultSetting = @"('')"; colvarModifiedBy.ForeignKeyTableName = ""; schema.Columns.Add(colvarModifiedBy); TableSchema.TableColumn colvarModifiedOn = new TableSchema.TableColumn(schema); colvarModifiedOn.ColumnName = "ModifiedOn"; colvarModifiedOn.DataType = DbType.DateTime; colvarModifiedOn.MaxLength = 0; colvarModifiedOn.AutoIncrement = false; colvarModifiedOn.IsNullable = false; colvarModifiedOn.IsPrimaryKey = false; colvarModifiedOn.IsForeignKey = false; colvarModifiedOn.IsReadOnly = false; colvarModifiedOn.DefaultSetting = @"(((1)/(1))/(1900))"; colvarModifiedOn.ForeignKeyTableName = ""; schema.Columns.Add(colvarModifiedOn); TableSchema.TableColumn colvarGuia = new TableSchema.TableColumn(schema); colvarGuia.ColumnName = "guia"; colvarGuia.DataType = DbType.AnsiString; colvarGuia.MaxLength = 20; colvarGuia.AutoIncrement = false; colvarGuia.IsNullable = false; colvarGuia.IsPrimaryKey = false; colvarGuia.IsForeignKey = false; colvarGuia.IsReadOnly = false; colvarGuia.DefaultSetting = @"('')"; colvarGuia.ForeignKeyTableName = ""; schema.Columns.Add(colvarGuia); TableSchema.TableColumn colvarMetodo = new TableSchema.TableColumn(schema); colvarMetodo.ColumnName = "metodo"; colvarMetodo.DataType = DbType.AnsiString; colvarMetodo.MaxLength = 20; colvarMetodo.AutoIncrement = false; colvarMetodo.IsNullable = false; colvarMetodo.IsPrimaryKey = false; colvarMetodo.IsForeignKey = false; colvarMetodo.IsReadOnly = false; colvarMetodo.DefaultSetting = @"('')"; colvarMetodo.ForeignKeyTableName = ""; schema.Columns.Add(colvarMetodo); BaseSchema = schema; //add this schema to the provider //so we can query it later DataService.Providers["sicProvider"].AddSchema("MAM_AnatomiaPatologica", schema); } }
private static void GetTableSchema() { if (!IsSchemaInitialized) { //Schema declaration TableSchema.Table schema = new TableSchema.Table("InvoiceSubTable", TableType.Table, DataService.GetInstance("WWIprov")); schema.Columns = new TableSchema.TableColumnCollection(); schema.SchemaName = @"dbo"; //columns TableSchema.TableColumn colvarEntryNumber = new TableSchema.TableColumn(schema); colvarEntryNumber.ColumnName = "EntryNumber"; colvarEntryNumber.DataType = DbType.Int32; colvarEntryNumber.MaxLength = 0; colvarEntryNumber.AutoIncrement = true; colvarEntryNumber.IsNullable = false; colvarEntryNumber.IsPrimaryKey = true; colvarEntryNumber.IsForeignKey = false; colvarEntryNumber.IsReadOnly = false; colvarEntryNumber.DefaultSetting = @""; colvarEntryNumber.ForeignKeyTableName = ""; schema.Columns.Add(colvarEntryNumber); TableSchema.TableColumn colvarInvoiceNumber = new TableSchema.TableColumn(schema); colvarInvoiceNumber.ColumnName = "InvoiceNumber"; colvarInvoiceNumber.DataType = DbType.Int32; colvarInvoiceNumber.MaxLength = 0; colvarInvoiceNumber.AutoIncrement = false; colvarInvoiceNumber.IsNullable = true; colvarInvoiceNumber.IsPrimaryKey = false; colvarInvoiceNumber.IsForeignKey = false; colvarInvoiceNumber.IsReadOnly = false; colvarInvoiceNumber.DefaultSetting = @""; colvarInvoiceNumber.ForeignKeyTableName = ""; schema.Columns.Add(colvarInvoiceNumber); TableSchema.TableColumn colvarChargeType = new TableSchema.TableColumn(schema); colvarChargeType.ColumnName = "ChargeType"; colvarChargeType.DataType = DbType.Int32; colvarChargeType.MaxLength = 0; colvarChargeType.AutoIncrement = false; colvarChargeType.IsNullable = true; colvarChargeType.IsPrimaryKey = false; colvarChargeType.IsForeignKey = false; colvarChargeType.IsReadOnly = false; colvarChargeType.DefaultSetting = @""; colvarChargeType.ForeignKeyTableName = ""; schema.Columns.Add(colvarChargeType); TableSchema.TableColumn colvarDetail = new TableSchema.TableColumn(schema); colvarDetail.ColumnName = "Detail"; colvarDetail.DataType = DbType.String; colvarDetail.MaxLength = 50; colvarDetail.AutoIncrement = false; colvarDetail.IsNullable = true; colvarDetail.IsPrimaryKey = false; colvarDetail.IsForeignKey = false; colvarDetail.IsReadOnly = false; colvarDetail.DefaultSetting = @""; colvarDetail.ForeignKeyTableName = ""; schema.Columns.Add(colvarDetail); TableSchema.TableColumn colvarAmount = new TableSchema.TableColumn(schema); colvarAmount.ColumnName = "Amount"; colvarAmount.DataType = DbType.Currency; colvarAmount.MaxLength = 0; colvarAmount.AutoIncrement = false; colvarAmount.IsNullable = true; colvarAmount.IsPrimaryKey = false; colvarAmount.IsForeignKey = false; colvarAmount.IsReadOnly = false; colvarAmount.DefaultSetting = @""; colvarAmount.ForeignKeyTableName = ""; schema.Columns.Add(colvarAmount); TableSchema.TableColumn colvarVat = new TableSchema.TableColumn(schema); colvarVat.ColumnName = "VAT"; colvarVat.DataType = DbType.Boolean; colvarVat.MaxLength = 0; colvarVat.AutoIncrement = false; colvarVat.IsNullable = false; colvarVat.IsPrimaryKey = false; colvarVat.IsForeignKey = false; colvarVat.IsReadOnly = false; colvarVat.DefaultSetting = @"((0))"; colvarVat.ForeignKeyTableName = ""; schema.Columns.Add(colvarVat); TableSchema.TableColumn colvarVATAmount = new TableSchema.TableColumn(schema); colvarVATAmount.ColumnName = "VATAmount"; colvarVATAmount.DataType = DbType.Double; colvarVATAmount.MaxLength = 0; colvarVATAmount.AutoIncrement = false; colvarVATAmount.IsNullable = true; colvarVATAmount.IsPrimaryKey = false; colvarVATAmount.IsForeignKey = false; colvarVATAmount.IsReadOnly = false; colvarVATAmount.DefaultSetting = @""; colvarVATAmount.ForeignKeyTableName = ""; schema.Columns.Add(colvarVATAmount); TableSchema.TableColumn colvarTs = new TableSchema.TableColumn(schema); colvarTs.ColumnName = "TS"; colvarTs.DataType = DbType.Binary; colvarTs.MaxLength = 0; colvarTs.AutoIncrement = false; colvarTs.IsNullable = true; colvarTs.IsPrimaryKey = false; colvarTs.IsForeignKey = false; colvarTs.IsReadOnly = true; colvarTs.DefaultSetting = @""; colvarTs.ForeignKeyTableName = ""; schema.Columns.Add(colvarTs); BaseSchema = schema; //add this schema to the provider //so we can query it later DataService.Providers["WWIprov"].AddSchema("InvoiceSubTable", schema); } }
private static void GetTableSchema() { if (!IsSchemaInitialized) { //Schema declaration TableSchema.Table schema = new TableSchema.Table("Order Details Extended", TableType.View, DataService.GetInstance("Northwind")); schema.Columns = new TableSchema.TableColumnCollection(); schema.SchemaName = "dbo"; //columns TableSchema.TableColumn colvarOrderID = new TableSchema.TableColumn(schema); colvarOrderID.ColumnName = "OrderID"; colvarOrderID.DataType = DbType.Int32; colvarOrderID.MaxLength = 0; colvarOrderID.AutoIncrement = false; colvarOrderID.IsNullable = false; colvarOrderID.IsPrimaryKey = false; colvarOrderID.IsForeignKey = false; colvarOrderID.IsReadOnly = false; schema.Columns.Add(colvarOrderID); TableSchema.TableColumn colvarProductID = new TableSchema.TableColumn(schema); colvarProductID.ColumnName = "ProductID"; colvarProductID.DataType = DbType.Int32; colvarProductID.MaxLength = 0; colvarProductID.AutoIncrement = false; colvarProductID.IsNullable = false; colvarProductID.IsPrimaryKey = false; colvarProductID.IsForeignKey = false; colvarProductID.IsReadOnly = false; schema.Columns.Add(colvarProductID); TableSchema.TableColumn colvarProductName = new TableSchema.TableColumn(schema); colvarProductName.ColumnName = "ProductName"; colvarProductName.DataType = DbType.String; colvarProductName.MaxLength = 40; colvarProductName.AutoIncrement = false; colvarProductName.IsNullable = false; colvarProductName.IsPrimaryKey = false; colvarProductName.IsForeignKey = false; colvarProductName.IsReadOnly = false; schema.Columns.Add(colvarProductName); TableSchema.TableColumn colvarUnitPrice = new TableSchema.TableColumn(schema); colvarUnitPrice.ColumnName = "UnitPrice"; colvarUnitPrice.DataType = DbType.Currency; colvarUnitPrice.MaxLength = 0; colvarUnitPrice.AutoIncrement = false; colvarUnitPrice.IsNullable = false; colvarUnitPrice.IsPrimaryKey = false; colvarUnitPrice.IsForeignKey = false; colvarUnitPrice.IsReadOnly = false; schema.Columns.Add(colvarUnitPrice); TableSchema.TableColumn colvarQuantity = new TableSchema.TableColumn(schema); colvarQuantity.ColumnName = "Quantity"; colvarQuantity.DataType = DbType.Int16; colvarQuantity.MaxLength = 0; colvarQuantity.AutoIncrement = false; colvarQuantity.IsNullable = false; colvarQuantity.IsPrimaryKey = false; colvarQuantity.IsForeignKey = false; colvarQuantity.IsReadOnly = false; schema.Columns.Add(colvarQuantity); TableSchema.TableColumn colvarDiscount = new TableSchema.TableColumn(schema); colvarDiscount.ColumnName = "Discount"; colvarDiscount.DataType = DbType.Decimal; colvarDiscount.MaxLength = 0; colvarDiscount.AutoIncrement = false; colvarDiscount.IsNullable = false; colvarDiscount.IsPrimaryKey = false; colvarDiscount.IsForeignKey = false; colvarDiscount.IsReadOnly = false; schema.Columns.Add(colvarDiscount); TableSchema.TableColumn colvarExtendedPrice = new TableSchema.TableColumn(schema); colvarExtendedPrice.ColumnName = "ExtendedPrice"; colvarExtendedPrice.DataType = DbType.Currency; colvarExtendedPrice.MaxLength = 0; colvarExtendedPrice.AutoIncrement = false; colvarExtendedPrice.IsNullable = true; colvarExtendedPrice.IsPrimaryKey = false; colvarExtendedPrice.IsForeignKey = false; colvarExtendedPrice.IsReadOnly = false; schema.Columns.Add(colvarExtendedPrice); BaseSchema = schema; //add this schema to the provider //so we can query it later DataService.Providers["Northwind"].AddSchema("Order Details Extended", schema); } }
private static void GetTableSchema() { if (!IsSchemaInitialized) { //Schema declaration TableSchema.Table schema = new TableSchema.Table("Sales by Category", TableType.View, DataService.GetInstance("Northwind")); schema.Columns = new TableSchema.TableColumnCollection(); schema.SchemaName = @"dbo"; //columns TableSchema.TableColumn colvarCategoryID = new TableSchema.TableColumn(schema); colvarCategoryID.ColumnName = "CategoryID"; colvarCategoryID.DataType = DbType.Int32; colvarCategoryID.MaxLength = 0; colvarCategoryID.AutoIncrement = false; colvarCategoryID.IsNullable = false; colvarCategoryID.IsPrimaryKey = false; colvarCategoryID.IsForeignKey = false; colvarCategoryID.IsReadOnly = false; schema.Columns.Add(colvarCategoryID); TableSchema.TableColumn colvarCategoryName = new TableSchema.TableColumn(schema); colvarCategoryName.ColumnName = "CategoryName"; colvarCategoryName.DataType = DbType.String; colvarCategoryName.MaxLength = 15; colvarCategoryName.AutoIncrement = false; colvarCategoryName.IsNullable = false; colvarCategoryName.IsPrimaryKey = false; colvarCategoryName.IsForeignKey = false; colvarCategoryName.IsReadOnly = false; schema.Columns.Add(colvarCategoryName); TableSchema.TableColumn colvarProductName = new TableSchema.TableColumn(schema); colvarProductName.ColumnName = "ProductName"; colvarProductName.DataType = DbType.String; colvarProductName.MaxLength = 40; colvarProductName.AutoIncrement = false; colvarProductName.IsNullable = false; colvarProductName.IsPrimaryKey = false; colvarProductName.IsForeignKey = false; colvarProductName.IsReadOnly = false; schema.Columns.Add(colvarProductName); TableSchema.TableColumn colvarProductSales = new TableSchema.TableColumn(schema); colvarProductSales.ColumnName = "ProductSales"; colvarProductSales.DataType = DbType.Currency; colvarProductSales.MaxLength = 0; colvarProductSales.AutoIncrement = false; colvarProductSales.IsNullable = true; colvarProductSales.IsPrimaryKey = false; colvarProductSales.IsForeignKey = false; colvarProductSales.IsReadOnly = false; schema.Columns.Add(colvarProductSales); BaseSchema = schema; //add this schema to the provider //so we can query it later DataService.Providers["Northwind"].AddSchema("Sales by Category", schema); } }
private static void GetTableSchema() { if (!IsSchemaInitialized) { //Schema declaration TableSchema.Table schema = new TableSchema.Table("aspnet_Applications", TableType.Table, DataService.GetInstance("SSRepository")); schema.Columns = new TableSchema.TableColumnCollection(); schema.SchemaName = @"dbo"; //columns TableSchema.TableColumn colvarApplicationName = new TableSchema.TableColumn(schema); colvarApplicationName.ColumnName = "ApplicationName"; colvarApplicationName.DataType = DbType.String; colvarApplicationName.MaxLength = 256; colvarApplicationName.AutoIncrement = false; colvarApplicationName.IsNullable = false; colvarApplicationName.IsPrimaryKey = false; colvarApplicationName.IsForeignKey = false; colvarApplicationName.IsReadOnly = false; colvarApplicationName.DefaultSetting = @""; colvarApplicationName.ForeignKeyTableName = ""; schema.Columns.Add(colvarApplicationName); TableSchema.TableColumn colvarLoweredApplicationName = new TableSchema.TableColumn(schema); colvarLoweredApplicationName.ColumnName = "LoweredApplicationName"; colvarLoweredApplicationName.DataType = DbType.String; colvarLoweredApplicationName.MaxLength = 256; colvarLoweredApplicationName.AutoIncrement = false; colvarLoweredApplicationName.IsNullable = false; colvarLoweredApplicationName.IsPrimaryKey = false; colvarLoweredApplicationName.IsForeignKey = false; colvarLoweredApplicationName.IsReadOnly = false; colvarLoweredApplicationName.DefaultSetting = @""; colvarLoweredApplicationName.ForeignKeyTableName = ""; schema.Columns.Add(colvarLoweredApplicationName); TableSchema.TableColumn colvarApplicationId = new TableSchema.TableColumn(schema); colvarApplicationId.ColumnName = "ApplicationId"; colvarApplicationId.DataType = DbType.Guid; colvarApplicationId.MaxLength = 0; colvarApplicationId.AutoIncrement = false; colvarApplicationId.IsNullable = false; colvarApplicationId.IsPrimaryKey = true; colvarApplicationId.IsForeignKey = false; colvarApplicationId.IsReadOnly = false; colvarApplicationId.DefaultSetting = @"(newid())"; colvarApplicationId.ForeignKeyTableName = ""; schema.Columns.Add(colvarApplicationId); TableSchema.TableColumn colvarDescription = new TableSchema.TableColumn(schema); colvarDescription.ColumnName = "Description"; colvarDescription.DataType = DbType.String; colvarDescription.MaxLength = 256; colvarDescription.AutoIncrement = false; colvarDescription.IsNullable = true; colvarDescription.IsPrimaryKey = false; colvarDescription.IsForeignKey = false; colvarDescription.IsReadOnly = false; colvarDescription.DefaultSetting = @""; colvarDescription.ForeignKeyTableName = ""; schema.Columns.Add(colvarDescription); BaseSchema = schema; //add this schema to the provider //so we can query it later DataService.Providers["SSRepository"].AddSchema("aspnet_Applications", schema); } }
private static void GetTableSchema() { if (!IsSchemaInitialized) { //Schema declaration TableSchema.Table schema = new TableSchema.Table("SalesOrderHeader", TableType.Table, DataService.GetInstance("Default")); schema.Columns = new TableSchema.TableColumnCollection(); schema.SchemaName = @"Sales"; //columns TableSchema.TableColumn colvarSalesOrderID = new TableSchema.TableColumn(schema); colvarSalesOrderID.ColumnName = "SalesOrderID"; colvarSalesOrderID.DataType = DbType.Int32; colvarSalesOrderID.MaxLength = 0; colvarSalesOrderID.AutoIncrement = true; colvarSalesOrderID.IsNullable = false; colvarSalesOrderID.IsPrimaryKey = true; colvarSalesOrderID.IsForeignKey = false; colvarSalesOrderID.IsReadOnly = false; colvarSalesOrderID.DefaultSetting = @""; colvarSalesOrderID.ForeignKeyTableName = ""; schema.Columns.Add(colvarSalesOrderID); TableSchema.TableColumn colvarRevisionNumber = new TableSchema.TableColumn(schema); colvarRevisionNumber.ColumnName = "RevisionNumber"; colvarRevisionNumber.DataType = DbType.Byte; colvarRevisionNumber.MaxLength = 0; colvarRevisionNumber.AutoIncrement = false; colvarRevisionNumber.IsNullable = false; colvarRevisionNumber.IsPrimaryKey = false; colvarRevisionNumber.IsForeignKey = false; colvarRevisionNumber.IsReadOnly = false; colvarRevisionNumber.DefaultSetting = @"((0))"; colvarRevisionNumber.ForeignKeyTableName = ""; schema.Columns.Add(colvarRevisionNumber); TableSchema.TableColumn colvarOrderDate = new TableSchema.TableColumn(schema); colvarOrderDate.ColumnName = "OrderDate"; colvarOrderDate.DataType = DbType.DateTime; colvarOrderDate.MaxLength = 0; colvarOrderDate.AutoIncrement = false; colvarOrderDate.IsNullable = false; colvarOrderDate.IsPrimaryKey = false; colvarOrderDate.IsForeignKey = false; colvarOrderDate.IsReadOnly = false; colvarOrderDate.DefaultSetting = @"(getdate())"; colvarOrderDate.ForeignKeyTableName = ""; schema.Columns.Add(colvarOrderDate); TableSchema.TableColumn colvarDueDate = new TableSchema.TableColumn(schema); colvarDueDate.ColumnName = "DueDate"; colvarDueDate.DataType = DbType.DateTime; colvarDueDate.MaxLength = 0; colvarDueDate.AutoIncrement = false; colvarDueDate.IsNullable = false; colvarDueDate.IsPrimaryKey = false; colvarDueDate.IsForeignKey = false; colvarDueDate.IsReadOnly = false; colvarDueDate.DefaultSetting = @""; colvarDueDate.ForeignKeyTableName = ""; schema.Columns.Add(colvarDueDate); TableSchema.TableColumn colvarShipDate = new TableSchema.TableColumn(schema); colvarShipDate.ColumnName = "ShipDate"; colvarShipDate.DataType = DbType.DateTime; colvarShipDate.MaxLength = 0; colvarShipDate.AutoIncrement = false; colvarShipDate.IsNullable = true; colvarShipDate.IsPrimaryKey = false; colvarShipDate.IsForeignKey = false; colvarShipDate.IsReadOnly = false; colvarShipDate.DefaultSetting = @""; colvarShipDate.ForeignKeyTableName = ""; schema.Columns.Add(colvarShipDate); TableSchema.TableColumn colvarStatus = new TableSchema.TableColumn(schema); colvarStatus.ColumnName = "Status"; colvarStatus.DataType = DbType.Byte; colvarStatus.MaxLength = 0; colvarStatus.AutoIncrement = false; colvarStatus.IsNullable = false; colvarStatus.IsPrimaryKey = false; colvarStatus.IsForeignKey = false; colvarStatus.IsReadOnly = false; colvarStatus.DefaultSetting = @"((1))"; colvarStatus.ForeignKeyTableName = ""; schema.Columns.Add(colvarStatus); TableSchema.TableColumn colvarOnlineOrderFlag = new TableSchema.TableColumn(schema); colvarOnlineOrderFlag.ColumnName = "OnlineOrderFlag"; colvarOnlineOrderFlag.DataType = DbType.Boolean; colvarOnlineOrderFlag.MaxLength = 0; colvarOnlineOrderFlag.AutoIncrement = false; colvarOnlineOrderFlag.IsNullable = false; colvarOnlineOrderFlag.IsPrimaryKey = false; colvarOnlineOrderFlag.IsForeignKey = false; colvarOnlineOrderFlag.IsReadOnly = false; colvarOnlineOrderFlag.DefaultSetting = @"((1))"; colvarOnlineOrderFlag.ForeignKeyTableName = ""; schema.Columns.Add(colvarOnlineOrderFlag); TableSchema.TableColumn colvarSalesOrderNumber = new TableSchema.TableColumn(schema); colvarSalesOrderNumber.ColumnName = "SalesOrderNumber"; colvarSalesOrderNumber.DataType = DbType.String; colvarSalesOrderNumber.MaxLength = 25; colvarSalesOrderNumber.AutoIncrement = false; colvarSalesOrderNumber.IsNullable = false; colvarSalesOrderNumber.IsPrimaryKey = false; colvarSalesOrderNumber.IsForeignKey = false; colvarSalesOrderNumber.IsReadOnly = true; colvarSalesOrderNumber.DefaultSetting = @""; colvarSalesOrderNumber.ForeignKeyTableName = ""; schema.Columns.Add(colvarSalesOrderNumber); TableSchema.TableColumn colvarPurchaseOrderNumber = new TableSchema.TableColumn(schema); colvarPurchaseOrderNumber.ColumnName = "PurchaseOrderNumber"; colvarPurchaseOrderNumber.DataType = DbType.String; colvarPurchaseOrderNumber.MaxLength = 25; colvarPurchaseOrderNumber.AutoIncrement = false; colvarPurchaseOrderNumber.IsNullable = true; colvarPurchaseOrderNumber.IsPrimaryKey = false; colvarPurchaseOrderNumber.IsForeignKey = false; colvarPurchaseOrderNumber.IsReadOnly = false; colvarPurchaseOrderNumber.DefaultSetting = @""; colvarPurchaseOrderNumber.ForeignKeyTableName = ""; schema.Columns.Add(colvarPurchaseOrderNumber); TableSchema.TableColumn colvarAccountNumber = new TableSchema.TableColumn(schema); colvarAccountNumber.ColumnName = "AccountNumber"; colvarAccountNumber.DataType = DbType.String; colvarAccountNumber.MaxLength = 15; colvarAccountNumber.AutoIncrement = false; colvarAccountNumber.IsNullable = true; colvarAccountNumber.IsPrimaryKey = false; colvarAccountNumber.IsForeignKey = false; colvarAccountNumber.IsReadOnly = false; colvarAccountNumber.DefaultSetting = @""; colvarAccountNumber.ForeignKeyTableName = ""; schema.Columns.Add(colvarAccountNumber); TableSchema.TableColumn colvarCustomerID = new TableSchema.TableColumn(schema); colvarCustomerID.ColumnName = "CustomerID"; colvarCustomerID.DataType = DbType.Int32; colvarCustomerID.MaxLength = 0; colvarCustomerID.AutoIncrement = false; colvarCustomerID.IsNullable = false; colvarCustomerID.IsPrimaryKey = false; colvarCustomerID.IsForeignKey = true; colvarCustomerID.IsReadOnly = false; colvarCustomerID.DefaultSetting = @""; colvarCustomerID.ForeignKeyTableName = "Customer"; schema.Columns.Add(colvarCustomerID); TableSchema.TableColumn colvarContactID = new TableSchema.TableColumn(schema); colvarContactID.ColumnName = "ContactID"; colvarContactID.DataType = DbType.Int32; colvarContactID.MaxLength = 0; colvarContactID.AutoIncrement = false; colvarContactID.IsNullable = false; colvarContactID.IsPrimaryKey = false; colvarContactID.IsForeignKey = true; colvarContactID.IsReadOnly = false; colvarContactID.DefaultSetting = @""; colvarContactID.ForeignKeyTableName = "Contact"; schema.Columns.Add(colvarContactID); TableSchema.TableColumn colvarSalesPersonID = new TableSchema.TableColumn(schema); colvarSalesPersonID.ColumnName = "SalesPersonID"; colvarSalesPersonID.DataType = DbType.Int32; colvarSalesPersonID.MaxLength = 0; colvarSalesPersonID.AutoIncrement = false; colvarSalesPersonID.IsNullable = true; colvarSalesPersonID.IsPrimaryKey = false; colvarSalesPersonID.IsForeignKey = true; colvarSalesPersonID.IsReadOnly = false; colvarSalesPersonID.DefaultSetting = @""; colvarSalesPersonID.ForeignKeyTableName = "SalesPerson"; schema.Columns.Add(colvarSalesPersonID); TableSchema.TableColumn colvarTerritoryID = new TableSchema.TableColumn(schema); colvarTerritoryID.ColumnName = "TerritoryID"; colvarTerritoryID.DataType = DbType.Int32; colvarTerritoryID.MaxLength = 0; colvarTerritoryID.AutoIncrement = false; colvarTerritoryID.IsNullable = true; colvarTerritoryID.IsPrimaryKey = false; colvarTerritoryID.IsForeignKey = true; colvarTerritoryID.IsReadOnly = false; colvarTerritoryID.DefaultSetting = @""; colvarTerritoryID.ForeignKeyTableName = "SalesTerritory"; schema.Columns.Add(colvarTerritoryID); TableSchema.TableColumn colvarBillToAddressID = new TableSchema.TableColumn(schema); colvarBillToAddressID.ColumnName = "BillToAddressID"; colvarBillToAddressID.DataType = DbType.Int32; colvarBillToAddressID.MaxLength = 0; colvarBillToAddressID.AutoIncrement = false; colvarBillToAddressID.IsNullable = false; colvarBillToAddressID.IsPrimaryKey = false; colvarBillToAddressID.IsForeignKey = true; colvarBillToAddressID.IsReadOnly = false; colvarBillToAddressID.DefaultSetting = @""; colvarBillToAddressID.ForeignKeyTableName = "Address"; schema.Columns.Add(colvarBillToAddressID); TableSchema.TableColumn colvarShipToAddressID = new TableSchema.TableColumn(schema); colvarShipToAddressID.ColumnName = "ShipToAddressID"; colvarShipToAddressID.DataType = DbType.Int32; colvarShipToAddressID.MaxLength = 0; colvarShipToAddressID.AutoIncrement = false; colvarShipToAddressID.IsNullable = false; colvarShipToAddressID.IsPrimaryKey = false; colvarShipToAddressID.IsForeignKey = true; colvarShipToAddressID.IsReadOnly = false; colvarShipToAddressID.DefaultSetting = @""; colvarShipToAddressID.ForeignKeyTableName = "Address"; schema.Columns.Add(colvarShipToAddressID); TableSchema.TableColumn colvarShipMethodID = new TableSchema.TableColumn(schema); colvarShipMethodID.ColumnName = "ShipMethodID"; colvarShipMethodID.DataType = DbType.Int32; colvarShipMethodID.MaxLength = 0; colvarShipMethodID.AutoIncrement = false; colvarShipMethodID.IsNullable = false; colvarShipMethodID.IsPrimaryKey = false; colvarShipMethodID.IsForeignKey = true; colvarShipMethodID.IsReadOnly = false; colvarShipMethodID.DefaultSetting = @""; colvarShipMethodID.ForeignKeyTableName = "ShipMethod"; schema.Columns.Add(colvarShipMethodID); TableSchema.TableColumn colvarCreditCardID = new TableSchema.TableColumn(schema); colvarCreditCardID.ColumnName = "CreditCardID"; colvarCreditCardID.DataType = DbType.Int32; colvarCreditCardID.MaxLength = 0; colvarCreditCardID.AutoIncrement = false; colvarCreditCardID.IsNullable = true; colvarCreditCardID.IsPrimaryKey = false; colvarCreditCardID.IsForeignKey = true; colvarCreditCardID.IsReadOnly = false; colvarCreditCardID.DefaultSetting = @""; colvarCreditCardID.ForeignKeyTableName = "CreditCard"; schema.Columns.Add(colvarCreditCardID); TableSchema.TableColumn colvarCreditCardApprovalCode = new TableSchema.TableColumn(schema); colvarCreditCardApprovalCode.ColumnName = "CreditCardApprovalCode"; colvarCreditCardApprovalCode.DataType = DbType.String; colvarCreditCardApprovalCode.MaxLength = 15; colvarCreditCardApprovalCode.AutoIncrement = false; colvarCreditCardApprovalCode.IsNullable = true; colvarCreditCardApprovalCode.IsPrimaryKey = false; colvarCreditCardApprovalCode.IsForeignKey = false; colvarCreditCardApprovalCode.IsReadOnly = false; colvarCreditCardApprovalCode.DefaultSetting = @""; colvarCreditCardApprovalCode.ForeignKeyTableName = ""; schema.Columns.Add(colvarCreditCardApprovalCode); TableSchema.TableColumn colvarCurrencyRateID = new TableSchema.TableColumn(schema); colvarCurrencyRateID.ColumnName = "CurrencyRateID"; colvarCurrencyRateID.DataType = DbType.Int32; colvarCurrencyRateID.MaxLength = 0; colvarCurrencyRateID.AutoIncrement = false; colvarCurrencyRateID.IsNullable = true; colvarCurrencyRateID.IsPrimaryKey = false; colvarCurrencyRateID.IsForeignKey = true; colvarCurrencyRateID.IsReadOnly = false; colvarCurrencyRateID.DefaultSetting = @""; colvarCurrencyRateID.ForeignKeyTableName = "CurrencyRate"; schema.Columns.Add(colvarCurrencyRateID); TableSchema.TableColumn colvarSubTotal = new TableSchema.TableColumn(schema); colvarSubTotal.ColumnName = "SubTotal"; colvarSubTotal.DataType = DbType.Currency; colvarSubTotal.MaxLength = 0; colvarSubTotal.AutoIncrement = false; colvarSubTotal.IsNullable = false; colvarSubTotal.IsPrimaryKey = false; colvarSubTotal.IsForeignKey = false; colvarSubTotal.IsReadOnly = false; colvarSubTotal.DefaultSetting = @"((0.00))"; colvarSubTotal.ForeignKeyTableName = ""; schema.Columns.Add(colvarSubTotal); TableSchema.TableColumn colvarTaxAmt = new TableSchema.TableColumn(schema); colvarTaxAmt.ColumnName = "TaxAmt"; colvarTaxAmt.DataType = DbType.Currency; colvarTaxAmt.MaxLength = 0; colvarTaxAmt.AutoIncrement = false; colvarTaxAmt.IsNullable = false; colvarTaxAmt.IsPrimaryKey = false; colvarTaxAmt.IsForeignKey = false; colvarTaxAmt.IsReadOnly = false; colvarTaxAmt.DefaultSetting = @"((0.00))"; colvarTaxAmt.ForeignKeyTableName = ""; schema.Columns.Add(colvarTaxAmt); TableSchema.TableColumn colvarFreight = new TableSchema.TableColumn(schema); colvarFreight.ColumnName = "Freight"; colvarFreight.DataType = DbType.Currency; colvarFreight.MaxLength = 0; colvarFreight.AutoIncrement = false; colvarFreight.IsNullable = false; colvarFreight.IsPrimaryKey = false; colvarFreight.IsForeignKey = false; colvarFreight.IsReadOnly = false; colvarFreight.DefaultSetting = @"((0.00))"; colvarFreight.ForeignKeyTableName = ""; schema.Columns.Add(colvarFreight); TableSchema.TableColumn colvarTotalDue = new TableSchema.TableColumn(schema); colvarTotalDue.ColumnName = "TotalDue"; colvarTotalDue.DataType = DbType.Currency; colvarTotalDue.MaxLength = 0; colvarTotalDue.AutoIncrement = false; colvarTotalDue.IsNullable = false; colvarTotalDue.IsPrimaryKey = false; colvarTotalDue.IsForeignKey = false; colvarTotalDue.IsReadOnly = true; colvarTotalDue.DefaultSetting = @""; colvarTotalDue.ForeignKeyTableName = ""; schema.Columns.Add(colvarTotalDue); TableSchema.TableColumn colvarComment = new TableSchema.TableColumn(schema); colvarComment.ColumnName = "Comment"; colvarComment.DataType = DbType.String; colvarComment.MaxLength = 128; colvarComment.AutoIncrement = false; colvarComment.IsNullable = true; colvarComment.IsPrimaryKey = false; colvarComment.IsForeignKey = false; colvarComment.IsReadOnly = false; colvarComment.DefaultSetting = @""; colvarComment.ForeignKeyTableName = ""; schema.Columns.Add(colvarComment); TableSchema.TableColumn colvarRowguid = new TableSchema.TableColumn(schema); colvarRowguid.ColumnName = "rowguid"; colvarRowguid.DataType = DbType.Guid; colvarRowguid.MaxLength = 0; colvarRowguid.AutoIncrement = false; colvarRowguid.IsNullable = false; colvarRowguid.IsPrimaryKey = false; colvarRowguid.IsForeignKey = false; colvarRowguid.IsReadOnly = false; colvarRowguid.DefaultSetting = @"(newid())"; colvarRowguid.ForeignKeyTableName = ""; schema.Columns.Add(colvarRowguid); TableSchema.TableColumn colvarModifiedDate = new TableSchema.TableColumn(schema); colvarModifiedDate.ColumnName = "ModifiedDate"; colvarModifiedDate.DataType = DbType.DateTime; colvarModifiedDate.MaxLength = 0; colvarModifiedDate.AutoIncrement = false; colvarModifiedDate.IsNullable = false; colvarModifiedDate.IsPrimaryKey = false; colvarModifiedDate.IsForeignKey = false; colvarModifiedDate.IsReadOnly = false; colvarModifiedDate.DefaultSetting = @"(getdate())"; colvarModifiedDate.ForeignKeyTableName = ""; schema.Columns.Add(colvarModifiedDate); BaseSchema = schema; //add this schema to the provider //so we can query it later DataService.Providers["Default"].AddSchema("SalesOrderHeader", schema); } }
private static void GetTableSchema() { if (!IsSchemaInitialized) { //Schema declaration TableSchema.Table schema = new TableSchema.Table("L_Form_Control", TableType.Table, DataService.GetInstance("ORM")); schema.Columns = new TableSchema.TableColumnCollection(); schema.SchemaName = @"dbo"; //columns TableSchema.TableColumn colvarControlId = new TableSchema.TableColumn(schema); colvarControlId.ColumnName = "Control_ID"; colvarControlId.DataType = DbType.Int32; colvarControlId.MaxLength = 0; colvarControlId.AutoIncrement = true; colvarControlId.IsNullable = false; colvarControlId.IsPrimaryKey = true; colvarControlId.IsForeignKey = false; colvarControlId.IsReadOnly = false; colvarControlId.DefaultSetting = @""; colvarControlId.ForeignKeyTableName = ""; schema.Columns.Add(colvarControlId); TableSchema.TableColumn colvarFormName = new TableSchema.TableColumn(schema); colvarFormName.ColumnName = "Form_Name"; colvarFormName.DataType = DbType.String; colvarFormName.MaxLength = 50; colvarFormName.AutoIncrement = false; colvarFormName.IsNullable = true; colvarFormName.IsPrimaryKey = false; colvarFormName.IsForeignKey = false; colvarFormName.IsReadOnly = false; colvarFormName.DefaultSetting = @""; colvarFormName.ForeignKeyTableName = ""; schema.Columns.Add(colvarFormName); TableSchema.TableColumn colvarControlName = new TableSchema.TableColumn(schema); colvarControlName.ColumnName = "Control_Name"; colvarControlName.DataType = DbType.String; colvarControlName.MaxLength = 50; colvarControlName.AutoIncrement = false; colvarControlName.IsNullable = true; colvarControlName.IsPrimaryKey = false; colvarControlName.IsForeignKey = false; colvarControlName.IsReadOnly = false; colvarControlName.DefaultSetting = @""; colvarControlName.ForeignKeyTableName = ""; schema.Columns.Add(colvarControlName); TableSchema.TableColumn colvarControlTypeName = new TableSchema.TableColumn(schema); colvarControlTypeName.ColumnName = "Control_Type_Name"; colvarControlTypeName.DataType = DbType.String; colvarControlTypeName.MaxLength = 50; colvarControlTypeName.AutoIncrement = false; colvarControlTypeName.IsNullable = true; colvarControlTypeName.IsPrimaryKey = false; colvarControlTypeName.IsForeignKey = false; colvarControlTypeName.IsReadOnly = false; colvarControlTypeName.DefaultSetting = @""; colvarControlTypeName.ForeignKeyTableName = ""; schema.Columns.Add(colvarControlTypeName); TableSchema.TableColumn colvarPropertyName = new TableSchema.TableColumn(schema); colvarPropertyName.ColumnName = "Property_Name"; colvarPropertyName.DataType = DbType.String; colvarPropertyName.MaxLength = 50; colvarPropertyName.AutoIncrement = false; colvarPropertyName.IsNullable = true; colvarPropertyName.IsPrimaryKey = false; colvarPropertyName.IsForeignKey = false; colvarPropertyName.IsReadOnly = false; colvarPropertyName.DefaultSetting = @""; colvarPropertyName.ForeignKeyTableName = ""; schema.Columns.Add(colvarPropertyName); TableSchema.TableColumn colvarValueX = new TableSchema.TableColumn(schema); colvarValueX.ColumnName = "Value"; colvarValueX.DataType = DbType.String; colvarValueX.MaxLength = 50; colvarValueX.AutoIncrement = false; colvarValueX.IsNullable = true; colvarValueX.IsPrimaryKey = false; colvarValueX.IsForeignKey = false; colvarValueX.IsReadOnly = false; colvarValueX.DefaultSetting = @""; colvarValueX.ForeignKeyTableName = ""; schema.Columns.Add(colvarValueX); BaseSchema = schema; //add this schema to the provider //so we can query it later DataService.Providers["ORM"].AddSchema("L_Form_Control", schema); } }
private static void GetTableSchema() { if (!IsSchemaInitialized) { //Schema declaration TableSchema.Table schema = new TableSchema.Table("vw_EmployeeSummary", TableType.View, DataService.GetInstance("Billing")); schema.Columns = new TableSchema.TableColumnCollection(); schema.SchemaName = "dbo"; //columns TableSchema.TableColumn colvarTimesheetid = new TableSchema.TableColumn(schema); colvarTimesheetid.ColumnName = "timesheetid"; colvarTimesheetid.DataType = DbType.Int32; colvarTimesheetid.MaxLength = 0; colvarTimesheetid.AutoIncrement = false; colvarTimesheetid.IsNullable = false; colvarTimesheetid.IsPrimaryKey = false; colvarTimesheetid.IsForeignKey = false; colvarTimesheetid.IsReadOnly = false; schema.Columns.Add(colvarTimesheetid); TableSchema.TableColumn colvarUsername = new TableSchema.TableColumn(schema); colvarUsername.ColumnName = "username"; colvarUsername.DataType = DbType.String; colvarUsername.MaxLength = 100; colvarUsername.AutoIncrement = false; colvarUsername.IsNullable = false; colvarUsername.IsPrimaryKey = false; colvarUsername.IsForeignKey = false; colvarUsername.IsReadOnly = false; schema.Columns.Add(colvarUsername); TableSchema.TableColumn colvarPeriodaccountid = new TableSchema.TableColumn(schema); colvarPeriodaccountid.ColumnName = "periodaccountid"; colvarPeriodaccountid.DataType = DbType.Int32; colvarPeriodaccountid.MaxLength = 0; colvarPeriodaccountid.AutoIncrement = false; colvarPeriodaccountid.IsNullable = false; colvarPeriodaccountid.IsPrimaryKey = false; colvarPeriodaccountid.IsForeignKey = false; colvarPeriodaccountid.IsReadOnly = false; schema.Columns.Add(colvarPeriodaccountid); TableSchema.TableColumn colvarPeriodid = new TableSchema.TableColumn(schema); colvarPeriodid.ColumnName = "periodid"; colvarPeriodid.DataType = DbType.Int32; colvarPeriodid.MaxLength = 0; colvarPeriodid.AutoIncrement = false; colvarPeriodid.IsNullable = false; colvarPeriodid.IsPrimaryKey = false; colvarPeriodid.IsForeignKey = false; colvarPeriodid.IsReadOnly = false; schema.Columns.Add(colvarPeriodid); TableSchema.TableColumn colvarAccountid = new TableSchema.TableColumn(schema); colvarAccountid.ColumnName = "accountid"; colvarAccountid.DataType = DbType.Int32; colvarAccountid.MaxLength = 0; colvarAccountid.AutoIncrement = false; colvarAccountid.IsNullable = false; colvarAccountid.IsPrimaryKey = false; colvarAccountid.IsForeignKey = false; colvarAccountid.IsReadOnly = false; schema.Columns.Add(colvarAccountid); TableSchema.TableColumn colvarAccountname = new TableSchema.TableColumn(schema); colvarAccountname.ColumnName = "accountname"; colvarAccountname.DataType = DbType.String; colvarAccountname.MaxLength = 100; colvarAccountname.AutoIncrement = false; colvarAccountname.IsNullable = false; colvarAccountname.IsPrimaryKey = false; colvarAccountname.IsForeignKey = false; colvarAccountname.IsReadOnly = false; schema.Columns.Add(colvarAccountname); TableSchema.TableColumn colvarRategroupid = new TableSchema.TableColumn(schema); colvarRategroupid.ColumnName = "rategroupid"; colvarRategroupid.DataType = DbType.Int32; colvarRategroupid.MaxLength = 0; colvarRategroupid.AutoIncrement = false; colvarRategroupid.IsNullable = false; colvarRategroupid.IsPrimaryKey = false; colvarRategroupid.IsForeignKey = false; colvarRategroupid.IsReadOnly = false; schema.Columns.Add(colvarRategroupid); TableSchema.TableColumn colvarRategroupname = new TableSchema.TableColumn(schema); colvarRategroupname.ColumnName = "rategroupname"; colvarRategroupname.DataType = DbType.String; colvarRategroupname.MaxLength = 100; colvarRategroupname.AutoIncrement = false; colvarRategroupname.IsNullable = false; colvarRategroupname.IsPrimaryKey = false; colvarRategroupname.IsForeignKey = false; colvarRategroupname.IsReadOnly = false; schema.Columns.Add(colvarRategroupname); TableSchema.TableColumn colvarPerdiemrate = new TableSchema.TableColumn(schema); colvarPerdiemrate.ColumnName = "perdiemrate"; colvarPerdiemrate.DataType = DbType.Double; colvarPerdiemrate.MaxLength = 0; colvarPerdiemrate.AutoIncrement = false; colvarPerdiemrate.IsNullable = false; colvarPerdiemrate.IsPrimaryKey = false; colvarPerdiemrate.IsForeignKey = false; colvarPerdiemrate.IsReadOnly = false; schema.Columns.Add(colvarPerdiemrate); TableSchema.TableColumn colvarPerdiemcount = new TableSchema.TableColumn(schema); colvarPerdiemcount.ColumnName = "perdiemcount"; colvarPerdiemcount.DataType = DbType.Int32; colvarPerdiemcount.MaxLength = 0; colvarPerdiemcount.AutoIncrement = false; colvarPerdiemcount.IsNullable = false; colvarPerdiemcount.IsPrimaryKey = false; colvarPerdiemcount.IsForeignKey = false; colvarPerdiemcount.IsReadOnly = false; schema.Columns.Add(colvarPerdiemcount); TableSchema.TableColumn colvarMileagerate = new TableSchema.TableColumn(schema); colvarMileagerate.ColumnName = "mileagerate"; colvarMileagerate.DataType = DbType.Double; colvarMileagerate.MaxLength = 0; colvarMileagerate.AutoIncrement = false; colvarMileagerate.IsNullable = false; colvarMileagerate.IsPrimaryKey = false; colvarMileagerate.IsForeignKey = false; colvarMileagerate.IsReadOnly = false; schema.Columns.Add(colvarMileagerate); TableSchema.TableColumn colvarMileageclaimed = new TableSchema.TableColumn(schema); colvarMileageclaimed.ColumnName = "mileageclaimed"; colvarMileageclaimed.DataType = DbType.Double; colvarMileageclaimed.MaxLength = 0; colvarMileageclaimed.AutoIncrement = false; colvarMileageclaimed.IsNullable = false; colvarMileageclaimed.IsPrimaryKey = false; colvarMileageclaimed.IsForeignKey = false; colvarMileageclaimed.IsReadOnly = false; schema.Columns.Add(colvarMileageclaimed); TableSchema.TableColumn colvarRate = new TableSchema.TableColumn(schema); colvarRate.ColumnName = "rate"; colvarRate.DataType = DbType.Double; colvarRate.MaxLength = 0; colvarRate.AutoIncrement = false; colvarRate.IsNullable = false; colvarRate.IsPrimaryKey = false; colvarRate.IsForeignKey = false; colvarRate.IsReadOnly = false; schema.Columns.Add(colvarRate); TableSchema.TableColumn colvarIsDeleted = new TableSchema.TableColumn(schema); colvarIsDeleted.ColumnName = "IsDeleted"; colvarIsDeleted.DataType = DbType.Boolean; colvarIsDeleted.MaxLength = 0; colvarIsDeleted.AutoIncrement = false; colvarIsDeleted.IsNullable = false; colvarIsDeleted.IsPrimaryKey = false; colvarIsDeleted.IsForeignKey = false; colvarIsDeleted.IsReadOnly = false; schema.Columns.Add(colvarIsDeleted); BaseSchema = schema; //add this schema to the provider //so we can query it later DataService.Providers["Billing"].AddSchema("vw_EmployeeSummary", schema); } }
private static void GetTableSchema() { if (!IsSchemaInitialized) { //Schema declaration TableSchema.Table schema = new TableSchema.Table("tbl_Expenses", TableType.Table, DataService.GetInstance("OnlinePetrolPump")); schema.Columns = new TableSchema.TableColumnCollection(); schema.SchemaName = @"dbo"; //columns TableSchema.TableColumn colvarExpenseID = new TableSchema.TableColumn(schema); colvarExpenseID.ColumnName = "ExpenseID"; colvarExpenseID.DataType = DbType.Int32; colvarExpenseID.MaxLength = 0; colvarExpenseID.AutoIncrement = true; colvarExpenseID.IsNullable = false; colvarExpenseID.IsPrimaryKey = true; colvarExpenseID.IsForeignKey = false; colvarExpenseID.IsReadOnly = false; colvarExpenseID.DefaultSetting = @""; colvarExpenseID.ForeignKeyTableName = ""; schema.Columns.Add(colvarExpenseID); TableSchema.TableColumn colvarHeadID = new TableSchema.TableColumn(schema); colvarHeadID.ColumnName = "HeadID"; colvarHeadID.DataType = DbType.Int32; colvarHeadID.MaxLength = 0; colvarHeadID.AutoIncrement = false; colvarHeadID.IsNullable = true; colvarHeadID.IsPrimaryKey = false; colvarHeadID.IsForeignKey = false; colvarHeadID.IsReadOnly = false; colvarHeadID.DefaultSetting = @""; colvarHeadID.ForeignKeyTableName = ""; schema.Columns.Add(colvarHeadID); TableSchema.TableColumn colvarTitle = new TableSchema.TableColumn(schema); colvarTitle.ColumnName = "Title"; colvarTitle.DataType = DbType.AnsiString; colvarTitle.MaxLength = 250; colvarTitle.AutoIncrement = false; colvarTitle.IsNullable = true; colvarTitle.IsPrimaryKey = false; colvarTitle.IsForeignKey = false; colvarTitle.IsReadOnly = false; colvarTitle.DefaultSetting = @""; colvarTitle.ForeignKeyTableName = ""; schema.Columns.Add(colvarTitle); TableSchema.TableColumn colvarAmount = new TableSchema.TableColumn(schema); colvarAmount.ColumnName = "Amount"; colvarAmount.DataType = DbType.Int32; colvarAmount.MaxLength = 0; colvarAmount.AutoIncrement = false; colvarAmount.IsNullable = true; colvarAmount.IsPrimaryKey = false; colvarAmount.IsForeignKey = false; colvarAmount.IsReadOnly = false; colvarAmount.DefaultSetting = @""; colvarAmount.ForeignKeyTableName = ""; schema.Columns.Add(colvarAmount); TableSchema.TableColumn colvarDescription = new TableSchema.TableColumn(schema); colvarDescription.ColumnName = "Description"; colvarDescription.DataType = DbType.AnsiString; colvarDescription.MaxLength = -1; colvarDescription.AutoIncrement = false; colvarDescription.IsNullable = true; colvarDescription.IsPrimaryKey = false; colvarDescription.IsForeignKey = false; colvarDescription.IsReadOnly = false; colvarDescription.DefaultSetting = @""; colvarDescription.ForeignKeyTableName = ""; schema.Columns.Add(colvarDescription); TableSchema.TableColumn colvarExpenseDate = new TableSchema.TableColumn(schema); colvarExpenseDate.ColumnName = "ExpenseDate"; colvarExpenseDate.DataType = DbType.DateTime; colvarExpenseDate.MaxLength = 0; colvarExpenseDate.AutoIncrement = false; colvarExpenseDate.IsNullable = true; colvarExpenseDate.IsPrimaryKey = false; colvarExpenseDate.IsForeignKey = false; colvarExpenseDate.IsReadOnly = false; colvarExpenseDate.DefaultSetting = @""; colvarExpenseDate.ForeignKeyTableName = ""; schema.Columns.Add(colvarExpenseDate); TableSchema.TableColumn colvarDateX = new TableSchema.TableColumn(schema); colvarDateX.ColumnName = "Date"; colvarDateX.DataType = DbType.DateTime; colvarDateX.MaxLength = 0; colvarDateX.AutoIncrement = false; colvarDateX.IsNullable = true; colvarDateX.IsPrimaryKey = false; colvarDateX.IsForeignKey = false; colvarDateX.IsReadOnly = false; colvarDateX.DefaultSetting = @""; colvarDateX.ForeignKeyTableName = ""; schema.Columns.Add(colvarDateX); TableSchema.TableColumn colvarUpdateBy = new TableSchema.TableColumn(schema); colvarUpdateBy.ColumnName = "UpdateBy"; colvarUpdateBy.DataType = DbType.Int32; colvarUpdateBy.MaxLength = 0; colvarUpdateBy.AutoIncrement = false; colvarUpdateBy.IsNullable = true; colvarUpdateBy.IsPrimaryKey = false; colvarUpdateBy.IsForeignKey = false; colvarUpdateBy.IsReadOnly = false; colvarUpdateBy.DefaultSetting = @""; colvarUpdateBy.ForeignKeyTableName = ""; schema.Columns.Add(colvarUpdateBy); BaseSchema = schema; //add this schema to the provider //so we can query it later DataService.Providers["OnlinePetrolPump"].AddSchema("tbl_Expenses", schema); } }
private static void GetTableSchema() { if (!IsSchemaInitialized) { //Schema declaration TableSchema.Table schema = new TableSchema.Table("ProductModelProductDescriptionCulture", TableType.Table, DataService.GetInstance("Default")); schema.Columns = new TableSchema.TableColumnCollection(); schema.SchemaName = @"Production"; //columns TableSchema.TableColumn colvarProductModelID = new TableSchema.TableColumn(schema); colvarProductModelID.ColumnName = "ProductModelID"; colvarProductModelID.DataType = DbType.Int32; colvarProductModelID.MaxLength = 0; colvarProductModelID.AutoIncrement = false; colvarProductModelID.IsNullable = false; colvarProductModelID.IsPrimaryKey = true; colvarProductModelID.IsForeignKey = true; colvarProductModelID.IsReadOnly = false; colvarProductModelID.DefaultSetting = @""; colvarProductModelID.ForeignKeyTableName = "ProductModel"; schema.Columns.Add(colvarProductModelID); TableSchema.TableColumn colvarProductDescriptionID = new TableSchema.TableColumn(schema); colvarProductDescriptionID.ColumnName = "ProductDescriptionID"; colvarProductDescriptionID.DataType = DbType.Int32; colvarProductDescriptionID.MaxLength = 0; colvarProductDescriptionID.AutoIncrement = false; colvarProductDescriptionID.IsNullable = false; colvarProductDescriptionID.IsPrimaryKey = true; colvarProductDescriptionID.IsForeignKey = true; colvarProductDescriptionID.IsReadOnly = false; colvarProductDescriptionID.DefaultSetting = @""; colvarProductDescriptionID.ForeignKeyTableName = "ProductDescription"; schema.Columns.Add(colvarProductDescriptionID); TableSchema.TableColumn colvarCultureID = new TableSchema.TableColumn(schema); colvarCultureID.ColumnName = "CultureID"; colvarCultureID.DataType = DbType.String; colvarCultureID.MaxLength = 6; colvarCultureID.AutoIncrement = false; colvarCultureID.IsNullable = false; colvarCultureID.IsPrimaryKey = true; colvarCultureID.IsForeignKey = true; colvarCultureID.IsReadOnly = false; colvarCultureID.DefaultSetting = @""; colvarCultureID.ForeignKeyTableName = "Culture"; schema.Columns.Add(colvarCultureID); TableSchema.TableColumn colvarModifiedDate = new TableSchema.TableColumn(schema); colvarModifiedDate.ColumnName = "ModifiedDate"; colvarModifiedDate.DataType = DbType.DateTime; colvarModifiedDate.MaxLength = 0; colvarModifiedDate.AutoIncrement = false; colvarModifiedDate.IsNullable = false; colvarModifiedDate.IsPrimaryKey = false; colvarModifiedDate.IsForeignKey = false; colvarModifiedDate.IsReadOnly = false; colvarModifiedDate.DefaultSetting = @"(getdate())"; colvarModifiedDate.ForeignKeyTableName = ""; schema.Columns.Add(colvarModifiedDate); BaseSchema = schema; //add this schema to the provider //so we can query it later DataService.Providers["Default"].AddSchema("ProductModelProductDescriptionCulture", schema); } }
private static void GetTableSchema() { if (!IsSchemaInitialized) { //Schema declaration TableSchema.Table schema = new TableSchema.Table("APR_CategoriaPesoNacimiento", TableType.Table, DataService.GetInstance("RisProvider")); schema.Columns = new TableSchema.TableColumnCollection(); schema.SchemaName = @"dbo"; //columns TableSchema.TableColumn colvarIdCategoriaPesoNacimiento = new TableSchema.TableColumn(schema); colvarIdCategoriaPesoNacimiento.ColumnName = "idCategoriaPesoNacimiento"; colvarIdCategoriaPesoNacimiento.DataType = DbType.Int32; colvarIdCategoriaPesoNacimiento.MaxLength = 0; colvarIdCategoriaPesoNacimiento.AutoIncrement = true; colvarIdCategoriaPesoNacimiento.IsNullable = false; colvarIdCategoriaPesoNacimiento.IsPrimaryKey = true; colvarIdCategoriaPesoNacimiento.IsForeignKey = false; colvarIdCategoriaPesoNacimiento.IsReadOnly = false; colvarIdCategoriaPesoNacimiento.DefaultSetting = @""; colvarIdCategoriaPesoNacimiento.ForeignKeyTableName = ""; schema.Columns.Add(colvarIdCategoriaPesoNacimiento); TableSchema.TableColumn colvarNombre = new TableSchema.TableColumn(schema); colvarNombre.ColumnName = "nombre"; colvarNombre.DataType = DbType.AnsiString; colvarNombre.MaxLength = 50; colvarNombre.AutoIncrement = false; colvarNombre.IsNullable = false; colvarNombre.IsPrimaryKey = false; colvarNombre.IsForeignKey = false; colvarNombre.IsReadOnly = false; colvarNombre.DefaultSetting = @""; colvarNombre.ForeignKeyTableName = ""; schema.Columns.Add(colvarNombre); TableSchema.TableColumn colvarCreatedBy = new TableSchema.TableColumn(schema); colvarCreatedBy.ColumnName = "CreatedBy"; colvarCreatedBy.DataType = DbType.AnsiString; colvarCreatedBy.MaxLength = 50; colvarCreatedBy.AutoIncrement = false; colvarCreatedBy.IsNullable = true; colvarCreatedBy.IsPrimaryKey = false; colvarCreatedBy.IsForeignKey = false; colvarCreatedBy.IsReadOnly = false; colvarCreatedBy.DefaultSetting = @""; colvarCreatedBy.ForeignKeyTableName = ""; schema.Columns.Add(colvarCreatedBy); TableSchema.TableColumn colvarCreatedOn = new TableSchema.TableColumn(schema); colvarCreatedOn.ColumnName = "CreatedOn"; colvarCreatedOn.DataType = DbType.DateTime; colvarCreatedOn.MaxLength = 0; colvarCreatedOn.AutoIncrement = false; colvarCreatedOn.IsNullable = true; colvarCreatedOn.IsPrimaryKey = false; colvarCreatedOn.IsForeignKey = false; colvarCreatedOn.IsReadOnly = false; colvarCreatedOn.DefaultSetting = @""; colvarCreatedOn.ForeignKeyTableName = ""; schema.Columns.Add(colvarCreatedOn); TableSchema.TableColumn colvarModifiedBy = new TableSchema.TableColumn(schema); colvarModifiedBy.ColumnName = "ModifiedBy"; colvarModifiedBy.DataType = DbType.AnsiString; colvarModifiedBy.MaxLength = 50; colvarModifiedBy.AutoIncrement = false; colvarModifiedBy.IsNullable = true; colvarModifiedBy.IsPrimaryKey = false; colvarModifiedBy.IsForeignKey = false; colvarModifiedBy.IsReadOnly = false; colvarModifiedBy.DefaultSetting = @""; colvarModifiedBy.ForeignKeyTableName = ""; schema.Columns.Add(colvarModifiedBy); TableSchema.TableColumn colvarModifiedOn = new TableSchema.TableColumn(schema); colvarModifiedOn.ColumnName = "ModifiedOn"; colvarModifiedOn.DataType = DbType.DateTime; colvarModifiedOn.MaxLength = 0; colvarModifiedOn.AutoIncrement = false; colvarModifiedOn.IsNullable = true; colvarModifiedOn.IsPrimaryKey = false; colvarModifiedOn.IsForeignKey = false; colvarModifiedOn.IsReadOnly = false; colvarModifiedOn.DefaultSetting = @""; colvarModifiedOn.ForeignKeyTableName = ""; schema.Columns.Add(colvarModifiedOn); BaseSchema = schema; //add this schema to the provider //so we can query it later DataService.Providers["RisProvider"].AddSchema("APR_CategoriaPesoNacimiento", schema); } }
private static void GetTableSchema() { if (!IsSchemaInitialized) { //Schema declaration TableSchema.Table schema = new TableSchema.Table("CurrencyCloud_Markets", TableType.Table, DataService.GetInstance("Bitcoin_Notify")); schema.Columns = new TableSchema.TableColumnCollection(); schema.SchemaName = @"dbo"; //columns TableSchema.TableColumn colvarCurrencycloudMarketKey = new TableSchema.TableColumn(schema); colvarCurrencycloudMarketKey.ColumnName = "currencycloud_market_key"; colvarCurrencycloudMarketKey.DataType = DbType.Int32; colvarCurrencycloudMarketKey.MaxLength = 0; colvarCurrencycloudMarketKey.AutoIncrement = false; colvarCurrencycloudMarketKey.IsNullable = false; colvarCurrencycloudMarketKey.IsPrimaryKey = true; colvarCurrencycloudMarketKey.IsForeignKey = false; colvarCurrencycloudMarketKey.IsReadOnly = false; colvarCurrencycloudMarketKey.DefaultSetting = @""; colvarCurrencycloudMarketKey.ForeignKeyTableName = ""; schema.Columns.Add(colvarCurrencycloudMarketKey); TableSchema.TableColumn colvarSource = new TableSchema.TableColumn(schema); colvarSource.ColumnName = "source"; colvarSource.DataType = DbType.Int32; colvarSource.MaxLength = 0; colvarSource.AutoIncrement = false; colvarSource.IsNullable = false; colvarSource.IsPrimaryKey = false; colvarSource.IsForeignKey = false; colvarSource.IsReadOnly = false; colvarSource.DefaultSetting = @""; colvarSource.ForeignKeyTableName = ""; schema.Columns.Add(colvarSource); TableSchema.TableColumn colvarDestination = new TableSchema.TableColumn(schema); colvarDestination.ColumnName = "destination"; colvarDestination.DataType = DbType.Int32; colvarDestination.MaxLength = 0; colvarDestination.AutoIncrement = false; colvarDestination.IsNullable = false; colvarDestination.IsPrimaryKey = false; colvarDestination.IsForeignKey = false; colvarDestination.IsReadOnly = false; colvarDestination.DefaultSetting = @""; colvarDestination.ForeignKeyTableName = ""; schema.Columns.Add(colvarDestination); TableSchema.TableColumn colvarFeePercentage = new TableSchema.TableColumn(schema); colvarFeePercentage.ColumnName = "fee_percentage"; colvarFeePercentage.DataType = DbType.Decimal; colvarFeePercentage.MaxLength = 0; colvarFeePercentage.AutoIncrement = false; colvarFeePercentage.IsNullable = false; colvarFeePercentage.IsPrimaryKey = false; colvarFeePercentage.IsForeignKey = false; colvarFeePercentage.IsReadOnly = false; colvarFeePercentage.DefaultSetting = @""; colvarFeePercentage.ForeignKeyTableName = ""; schema.Columns.Add(colvarFeePercentage); TableSchema.TableColumn colvarRate = new TableSchema.TableColumn(schema); colvarRate.ColumnName = "rate"; colvarRate.DataType = DbType.Decimal; colvarRate.MaxLength = 0; colvarRate.AutoIncrement = false; colvarRate.IsNullable = true; colvarRate.IsPrimaryKey = false; colvarRate.IsForeignKey = false; colvarRate.IsReadOnly = false; colvarRate.DefaultSetting = @""; colvarRate.ForeignKeyTableName = ""; schema.Columns.Add(colvarRate); TableSchema.TableColumn colvarDatechanged = new TableSchema.TableColumn(schema); colvarDatechanged.ColumnName = "datechanged"; colvarDatechanged.DataType = DbType.DateTime; colvarDatechanged.MaxLength = 0; colvarDatechanged.AutoIncrement = false; colvarDatechanged.IsNullable = true; colvarDatechanged.IsPrimaryKey = false; colvarDatechanged.IsForeignKey = false; colvarDatechanged.IsReadOnly = false; colvarDatechanged.DefaultSetting = @""; colvarDatechanged.ForeignKeyTableName = ""; schema.Columns.Add(colvarDatechanged); TableSchema.TableColumn colvarFeeStatic = new TableSchema.TableColumn(schema); colvarFeeStatic.ColumnName = "fee_static"; colvarFeeStatic.DataType = DbType.Decimal; colvarFeeStatic.MaxLength = 0; colvarFeeStatic.AutoIncrement = false; colvarFeeStatic.IsNullable = false; colvarFeeStatic.IsPrimaryKey = false; colvarFeeStatic.IsForeignKey = false; colvarFeeStatic.IsReadOnly = false; colvarFeeStatic.DefaultSetting = @""; colvarFeeStatic.ForeignKeyTableName = ""; schema.Columns.Add(colvarFeeStatic); TableSchema.TableColumn colvarExchangetime = new TableSchema.TableColumn(schema); colvarExchangetime.ColumnName = "exchangetime"; colvarExchangetime.DataType = DbType.Int32; colvarExchangetime.MaxLength = 0; colvarExchangetime.AutoIncrement = false; colvarExchangetime.IsNullable = false; colvarExchangetime.IsPrimaryKey = false; colvarExchangetime.IsForeignKey = false; colvarExchangetime.IsReadOnly = false; colvarExchangetime.DefaultSetting = @""; colvarExchangetime.ForeignKeyTableName = ""; schema.Columns.Add(colvarExchangetime); BaseSchema = schema; //add this schema to the provider //so we can query it later DataService.Providers["Bitcoin_Notify"].AddSchema("CurrencyCloud_Markets", schema); } }
private static void GetTableSchema() { if (!IsSchemaInitialized) { //Schema declaration TableSchema.Table schema = new TableSchema.Table("Products", TableType.Table, DataService.GetInstance("Northwind")); schema.Columns = new TableSchema.TableColumnCollection(); schema.SchemaName = @"dbo"; //columns TableSchema.TableColumn colvarProductID = new TableSchema.TableColumn(schema); colvarProductID.ColumnName = "ProductID"; colvarProductID.DataType = DbType.Int32; colvarProductID.MaxLength = 0; colvarProductID.AutoIncrement = true; colvarProductID.IsNullable = false; colvarProductID.IsPrimaryKey = true; colvarProductID.IsForeignKey = false; colvarProductID.IsReadOnly = false; colvarProductID.DefaultSetting = @""; colvarProductID.ForeignKeyTableName = ""; schema.Columns.Add(colvarProductID); TableSchema.TableColumn colvarProductName = new TableSchema.TableColumn(schema); colvarProductName.ColumnName = "ProductName"; colvarProductName.DataType = DbType.String; colvarProductName.MaxLength = 40; colvarProductName.AutoIncrement = false; colvarProductName.IsNullable = false; colvarProductName.IsPrimaryKey = false; colvarProductName.IsForeignKey = false; colvarProductName.IsReadOnly = false; colvarProductName.DefaultSetting = @""; colvarProductName.ForeignKeyTableName = ""; schema.Columns.Add(colvarProductName); TableSchema.TableColumn colvarSupplierID = new TableSchema.TableColumn(schema); colvarSupplierID.ColumnName = "SupplierID"; colvarSupplierID.DataType = DbType.Int32; colvarSupplierID.MaxLength = 0; colvarSupplierID.AutoIncrement = false; colvarSupplierID.IsNullable = true; colvarSupplierID.IsPrimaryKey = false; colvarSupplierID.IsForeignKey = true; colvarSupplierID.IsReadOnly = false; colvarSupplierID.DefaultSetting = @""; colvarSupplierID.ForeignKeyTableName = "Suppliers"; schema.Columns.Add(colvarSupplierID); TableSchema.TableColumn colvarCategoryID = new TableSchema.TableColumn(schema); colvarCategoryID.ColumnName = "CategoryID"; colvarCategoryID.DataType = DbType.Int32; colvarCategoryID.MaxLength = 0; colvarCategoryID.AutoIncrement = false; colvarCategoryID.IsNullable = true; colvarCategoryID.IsPrimaryKey = false; colvarCategoryID.IsForeignKey = true; colvarCategoryID.IsReadOnly = false; colvarCategoryID.DefaultSetting = @""; colvarCategoryID.ForeignKeyTableName = "Categories"; schema.Columns.Add(colvarCategoryID); TableSchema.TableColumn colvarQuantityPerUnit = new TableSchema.TableColumn(schema); colvarQuantityPerUnit.ColumnName = "QuantityPerUnit"; colvarQuantityPerUnit.DataType = DbType.String; colvarQuantityPerUnit.MaxLength = 20; colvarQuantityPerUnit.AutoIncrement = false; colvarQuantityPerUnit.IsNullable = true; colvarQuantityPerUnit.IsPrimaryKey = false; colvarQuantityPerUnit.IsForeignKey = false; colvarQuantityPerUnit.IsReadOnly = false; colvarQuantityPerUnit.DefaultSetting = @""; colvarQuantityPerUnit.ForeignKeyTableName = ""; schema.Columns.Add(colvarQuantityPerUnit); TableSchema.TableColumn colvarUnitPrice = new TableSchema.TableColumn(schema); colvarUnitPrice.ColumnName = "UnitPrice"; colvarUnitPrice.DataType = DbType.Currency; colvarUnitPrice.MaxLength = 0; colvarUnitPrice.AutoIncrement = false; colvarUnitPrice.IsNullable = true; colvarUnitPrice.IsPrimaryKey = false; colvarUnitPrice.IsForeignKey = false; colvarUnitPrice.IsReadOnly = false; colvarUnitPrice.DefaultSetting = @"((0))"; colvarUnitPrice.ForeignKeyTableName = ""; schema.Columns.Add(colvarUnitPrice); TableSchema.TableColumn colvarUnitsInStock = new TableSchema.TableColumn(schema); colvarUnitsInStock.ColumnName = "UnitsInStock"; colvarUnitsInStock.DataType = DbType.Int16; colvarUnitsInStock.MaxLength = 0; colvarUnitsInStock.AutoIncrement = false; colvarUnitsInStock.IsNullable = true; colvarUnitsInStock.IsPrimaryKey = false; colvarUnitsInStock.IsForeignKey = false; colvarUnitsInStock.IsReadOnly = false; colvarUnitsInStock.DefaultSetting = @"((0))"; colvarUnitsInStock.ForeignKeyTableName = ""; schema.Columns.Add(colvarUnitsInStock); TableSchema.TableColumn colvarUnitsOnOrder = new TableSchema.TableColumn(schema); colvarUnitsOnOrder.ColumnName = "UnitsOnOrder"; colvarUnitsOnOrder.DataType = DbType.Int16; colvarUnitsOnOrder.MaxLength = 0; colvarUnitsOnOrder.AutoIncrement = false; colvarUnitsOnOrder.IsNullable = true; colvarUnitsOnOrder.IsPrimaryKey = false; colvarUnitsOnOrder.IsForeignKey = false; colvarUnitsOnOrder.IsReadOnly = false; colvarUnitsOnOrder.DefaultSetting = @"((0))"; colvarUnitsOnOrder.ForeignKeyTableName = ""; schema.Columns.Add(colvarUnitsOnOrder); TableSchema.TableColumn colvarReorderLevel = new TableSchema.TableColumn(schema); colvarReorderLevel.ColumnName = "ReorderLevel"; colvarReorderLevel.DataType = DbType.Int16; colvarReorderLevel.MaxLength = 0; colvarReorderLevel.AutoIncrement = false; colvarReorderLevel.IsNullable = true; colvarReorderLevel.IsPrimaryKey = false; colvarReorderLevel.IsForeignKey = false; colvarReorderLevel.IsReadOnly = false; colvarReorderLevel.DefaultSetting = @"((0))"; colvarReorderLevel.ForeignKeyTableName = ""; schema.Columns.Add(colvarReorderLevel); TableSchema.TableColumn colvarDiscontinued = new TableSchema.TableColumn(schema); colvarDiscontinued.ColumnName = "Discontinued"; colvarDiscontinued.DataType = DbType.Boolean; colvarDiscontinued.MaxLength = 0; colvarDiscontinued.AutoIncrement = false; colvarDiscontinued.IsNullable = false; colvarDiscontinued.IsPrimaryKey = false; colvarDiscontinued.IsForeignKey = false; colvarDiscontinued.IsReadOnly = false; colvarDiscontinued.DefaultSetting = @"((0))"; colvarDiscontinued.ForeignKeyTableName = ""; schema.Columns.Add(colvarDiscontinued); TableSchema.TableColumn colvarAttributeXML = new TableSchema.TableColumn(schema); colvarAttributeXML.ColumnName = "AttributeXML"; colvarAttributeXML.DataType = DbType.AnsiString; colvarAttributeXML.MaxLength = -1; colvarAttributeXML.AutoIncrement = false; colvarAttributeXML.IsNullable = true; colvarAttributeXML.IsPrimaryKey = false; colvarAttributeXML.IsForeignKey = false; colvarAttributeXML.IsReadOnly = false; colvarAttributeXML.DefaultSetting = @""; colvarAttributeXML.ForeignKeyTableName = ""; schema.Columns.Add(colvarAttributeXML); TableSchema.TableColumn colvarDateCreated = new TableSchema.TableColumn(schema); colvarDateCreated.ColumnName = "DateCreated"; colvarDateCreated.DataType = DbType.DateTime; colvarDateCreated.MaxLength = 0; colvarDateCreated.AutoIncrement = false; colvarDateCreated.IsNullable = true; colvarDateCreated.IsPrimaryKey = false; colvarDateCreated.IsForeignKey = false; colvarDateCreated.IsReadOnly = false; colvarDateCreated.DefaultSetting = @"(getdate())"; colvarDateCreated.ForeignKeyTableName = ""; schema.Columns.Add(colvarDateCreated); TableSchema.TableColumn colvarProductGUID = new TableSchema.TableColumn(schema); colvarProductGUID.ColumnName = "ProductGUID"; colvarProductGUID.DataType = DbType.Guid; colvarProductGUID.MaxLength = 0; colvarProductGUID.AutoIncrement = false; colvarProductGUID.IsNullable = true; colvarProductGUID.IsPrimaryKey = false; colvarProductGUID.IsForeignKey = false; colvarProductGUID.IsReadOnly = false; colvarProductGUID.DefaultSetting = @"(newid())"; colvarProductGUID.ForeignKeyTableName = ""; schema.Columns.Add(colvarProductGUID); TableSchema.TableColumn colvarCreatedOn = new TableSchema.TableColumn(schema); colvarCreatedOn.ColumnName = "CreatedOn"; colvarCreatedOn.DataType = DbType.DateTime; colvarCreatedOn.MaxLength = 0; colvarCreatedOn.AutoIncrement = false; colvarCreatedOn.IsNullable = false; colvarCreatedOn.IsPrimaryKey = false; colvarCreatedOn.IsForeignKey = false; colvarCreatedOn.IsReadOnly = false; colvarCreatedOn.DefaultSetting = @"(getdate())"; colvarCreatedOn.ForeignKeyTableName = ""; schema.Columns.Add(colvarCreatedOn); TableSchema.TableColumn colvarCreatedBy = new TableSchema.TableColumn(schema); colvarCreatedBy.ColumnName = "CreatedBy"; colvarCreatedBy.DataType = DbType.String; colvarCreatedBy.MaxLength = 50; colvarCreatedBy.AutoIncrement = false; colvarCreatedBy.IsNullable = true; colvarCreatedBy.IsPrimaryKey = false; colvarCreatedBy.IsForeignKey = false; colvarCreatedBy.IsReadOnly = false; colvarCreatedBy.DefaultSetting = @""; colvarCreatedBy.ForeignKeyTableName = ""; schema.Columns.Add(colvarCreatedBy); TableSchema.TableColumn colvarModifiedOn = new TableSchema.TableColumn(schema); colvarModifiedOn.ColumnName = "ModifiedOn"; colvarModifiedOn.DataType = DbType.DateTime; colvarModifiedOn.MaxLength = 0; colvarModifiedOn.AutoIncrement = false; colvarModifiedOn.IsNullable = false; colvarModifiedOn.IsPrimaryKey = false; colvarModifiedOn.IsForeignKey = false; colvarModifiedOn.IsReadOnly = false; colvarModifiedOn.DefaultSetting = @"(getdate())"; colvarModifiedOn.ForeignKeyTableName = ""; schema.Columns.Add(colvarModifiedOn); TableSchema.TableColumn colvarModifiedBy = new TableSchema.TableColumn(schema); colvarModifiedBy.ColumnName = "ModifiedBy"; colvarModifiedBy.DataType = DbType.String; colvarModifiedBy.MaxLength = 50; colvarModifiedBy.AutoIncrement = false; colvarModifiedBy.IsNullable = true; colvarModifiedBy.IsPrimaryKey = false; colvarModifiedBy.IsForeignKey = false; colvarModifiedBy.IsReadOnly = false; colvarModifiedBy.DefaultSetting = @""; colvarModifiedBy.ForeignKeyTableName = ""; schema.Columns.Add(colvarModifiedBy); TableSchema.TableColumn colvarDeleted = new TableSchema.TableColumn(schema); colvarDeleted.ColumnName = "Deleted"; colvarDeleted.DataType = DbType.Boolean; colvarDeleted.MaxLength = 0; colvarDeleted.AutoIncrement = false; colvarDeleted.IsNullable = false; colvarDeleted.IsPrimaryKey = false; colvarDeleted.IsForeignKey = false; colvarDeleted.IsReadOnly = false; colvarDeleted.DefaultSetting = @"((0))"; colvarDeleted.ForeignKeyTableName = ""; schema.Columns.Add(colvarDeleted); BaseSchema = schema; //add this schema to the provider //so we can query it later DataService.Providers["Northwind"].AddSchema("Products", schema); } }
private static void GetTableSchema() { if (!IsSchemaInitialized) { //Schema declaration TableSchema.Table schema = new TableSchema.Table("PN_desc_indicador_ins", TableType.Table, DataService.GetInstance("RisProvider")); schema.Columns = new TableSchema.TableColumnCollection(); schema.SchemaName = @"dbo"; //columns TableSchema.TableColumn colvarIdDescIndicadorIns = new TableSchema.TableColumn(schema); colvarIdDescIndicadorIns.ColumnName = "id_desc_indicador_ins"; colvarIdDescIndicadorIns.DataType = DbType.Int32; colvarIdDescIndicadorIns.MaxLength = 0; colvarIdDescIndicadorIns.AutoIncrement = true; colvarIdDescIndicadorIns.IsNullable = false; colvarIdDescIndicadorIns.IsPrimaryKey = true; colvarIdDescIndicadorIns.IsForeignKey = false; colvarIdDescIndicadorIns.IsReadOnly = false; colvarIdDescIndicadorIns.DefaultSetting = @""; colvarIdDescIndicadorIns.ForeignKeyTableName = ""; schema.Columns.Add(colvarIdDescIndicadorIns); TableSchema.TableColumn colvarDescripcion = new TableSchema.TableColumn(schema); colvarDescripcion.ColumnName = "descripcion"; colvarDescripcion.DataType = DbType.AnsiString; colvarDescripcion.MaxLength = -1; colvarDescripcion.AutoIncrement = false; colvarDescripcion.IsNullable = true; colvarDescripcion.IsPrimaryKey = false; colvarDescripcion.IsForeignKey = false; colvarDescripcion.IsReadOnly = false; colvarDescripcion.DefaultSetting = @""; colvarDescripcion.ForeignKeyTableName = ""; schema.Columns.Add(colvarDescripcion); TableSchema.TableColumn colvarDescMedicion = new TableSchema.TableColumn(schema); colvarDescMedicion.ColumnName = "desc_medicion"; colvarDescMedicion.DataType = DbType.AnsiString; colvarDescMedicion.MaxLength = -1; colvarDescMedicion.AutoIncrement = false; colvarDescMedicion.IsNullable = true; colvarDescMedicion.IsPrimaryKey = false; colvarDescMedicion.IsForeignKey = false; colvarDescMedicion.IsReadOnly = false; colvarDescMedicion.DefaultSetting = @""; colvarDescMedicion.ForeignKeyTableName = ""; schema.Columns.Add(colvarDescMedicion); TableSchema.TableColumn colvarValorDeseable = new TableSchema.TableColumn(schema); colvarValorDeseable.ColumnName = "valor_deseable"; colvarValorDeseable.DataType = DbType.Decimal; colvarValorDeseable.MaxLength = 0; colvarValorDeseable.AutoIncrement = false; colvarValorDeseable.IsNullable = true; colvarValorDeseable.IsPrimaryKey = false; colvarValorDeseable.IsForeignKey = false; colvarValorDeseable.IsReadOnly = false; colvarValorDeseable.DefaultSetting = @""; colvarValorDeseable.ForeignKeyTableName = ""; schema.Columns.Add(colvarValorDeseable); BaseSchema = schema; //add this schema to the provider //so we can query it later DataService.Providers["RisProvider"].AddSchema("PN_desc_indicador_ins", schema); } }
private static void GetTableSchema() { if (!IsSchemaInitialized) { //Schema declaration TableSchema.Table schema = new TableSchema.Table("CourierDetailsSubTable", TableType.Table, DataService.GetInstance("WWIprov")); schema.Columns = new TableSchema.TableColumnCollection(); schema.SchemaName = @"dbo"; //columns TableSchema.TableColumn colvarCourierDetailID = new TableSchema.TableColumn(schema); colvarCourierDetailID.ColumnName = "CourierDetailID"; colvarCourierDetailID.DataType = DbType.Int32; colvarCourierDetailID.MaxLength = 0; colvarCourierDetailID.AutoIncrement = true; colvarCourierDetailID.IsNullable = false; colvarCourierDetailID.IsPrimaryKey = true; colvarCourierDetailID.IsForeignKey = false; colvarCourierDetailID.IsReadOnly = false; colvarCourierDetailID.DefaultSetting = @""; colvarCourierDetailID.ForeignKeyTableName = ""; schema.Columns.Add(colvarCourierDetailID); TableSchema.TableColumn colvarOrderNumber = new TableSchema.TableColumn(schema); colvarOrderNumber.ColumnName = "OrderNumber"; colvarOrderNumber.DataType = DbType.Int32; colvarOrderNumber.MaxLength = 0; colvarOrderNumber.AutoIncrement = false; colvarOrderNumber.IsNullable = true; colvarOrderNumber.IsPrimaryKey = false; colvarOrderNumber.IsForeignKey = false; colvarOrderNumber.IsReadOnly = false; colvarOrderNumber.DefaultSetting = @""; colvarOrderNumber.ForeignKeyTableName = ""; schema.Columns.Add(colvarOrderNumber); TableSchema.TableColumn colvarDocsDespatchID = new TableSchema.TableColumn(schema); colvarDocsDespatchID.ColumnName = "DocsDespatchID"; colvarDocsDespatchID.DataType = DbType.Int32; colvarDocsDespatchID.MaxLength = 0; colvarDocsDespatchID.AutoIncrement = false; colvarDocsDespatchID.IsNullable = true; colvarDocsDespatchID.IsPrimaryKey = false; colvarDocsDespatchID.IsForeignKey = false; colvarDocsDespatchID.IsReadOnly = false; colvarDocsDespatchID.DefaultSetting = @""; colvarDocsDespatchID.ForeignKeyTableName = ""; schema.Columns.Add(colvarDocsDespatchID); TableSchema.TableColumn colvarOriginal = new TableSchema.TableColumn(schema); colvarOriginal.ColumnName = "Original"; colvarOriginal.DataType = DbType.Int32; colvarOriginal.MaxLength = 0; colvarOriginal.AutoIncrement = false; colvarOriginal.IsNullable = true; colvarOriginal.IsPrimaryKey = false; colvarOriginal.IsForeignKey = false; colvarOriginal.IsReadOnly = false; colvarOriginal.DefaultSetting = @""; colvarOriginal.ForeignKeyTableName = ""; schema.Columns.Add(colvarOriginal); TableSchema.TableColumn colvarDocumentationDespatched = new TableSchema.TableColumn(schema); colvarDocumentationDespatched.ColumnName = "DocumentationDespatched"; colvarDocumentationDespatched.DataType = DbType.DateTime; colvarDocumentationDespatched.MaxLength = 0; colvarDocumentationDespatched.AutoIncrement = false; colvarDocumentationDespatched.IsNullable = true; colvarDocumentationDespatched.IsPrimaryKey = false; colvarDocumentationDespatched.IsForeignKey = false; colvarDocumentationDespatched.IsReadOnly = false; colvarDocumentationDespatched.DefaultSetting = @""; colvarDocumentationDespatched.ForeignKeyTableName = ""; schema.Columns.Add(colvarDocumentationDespatched); TableSchema.TableColumn colvarDocsLastUpdated = new TableSchema.TableColumn(schema); colvarDocsLastUpdated.ColumnName = "DocsLastUpdated"; colvarDocsLastUpdated.DataType = DbType.DateTime; colvarDocsLastUpdated.MaxLength = 0; colvarDocsLastUpdated.AutoIncrement = false; colvarDocsLastUpdated.IsNullable = true; colvarDocsLastUpdated.IsPrimaryKey = false; colvarDocsLastUpdated.IsForeignKey = false; colvarDocsLastUpdated.IsReadOnly = false; colvarDocsLastUpdated.DefaultSetting = @""; colvarDocsLastUpdated.ForeignKeyTableName = ""; schema.Columns.Add(colvarDocsLastUpdated); TableSchema.TableColumn colvarCourierName = new TableSchema.TableColumn(schema); colvarCourierName.ColumnName = "CourierName"; colvarCourierName.DataType = DbType.String; colvarCourierName.MaxLength = 50; colvarCourierName.AutoIncrement = false; colvarCourierName.IsNullable = true; colvarCourierName.IsPrimaryKey = false; colvarCourierName.IsForeignKey = false; colvarCourierName.IsReadOnly = false; colvarCourierName.DefaultSetting = @""; colvarCourierName.ForeignKeyTableName = ""; schema.Columns.Add(colvarCourierName); TableSchema.TableColumn colvarAWBNumber = new TableSchema.TableColumn(schema); colvarAWBNumber.ColumnName = "AWBNumber"; colvarAWBNumber.DataType = DbType.String; colvarAWBNumber.MaxLength = 20; colvarAWBNumber.AutoIncrement = false; colvarAWBNumber.IsNullable = true; colvarAWBNumber.IsPrimaryKey = false; colvarAWBNumber.IsForeignKey = false; colvarAWBNumber.IsReadOnly = false; colvarAWBNumber.DefaultSetting = @""; colvarAWBNumber.ForeignKeyTableName = ""; schema.Columns.Add(colvarAWBNumber); TableSchema.TableColumn colvarSendByEmail = new TableSchema.TableColumn(schema); colvarSendByEmail.ColumnName = "SendByEmail"; colvarSendByEmail.DataType = DbType.Boolean; colvarSendByEmail.MaxLength = 0; colvarSendByEmail.AutoIncrement = false; colvarSendByEmail.IsNullable = false; colvarSendByEmail.IsPrimaryKey = false; colvarSendByEmail.IsForeignKey = false; colvarSendByEmail.IsReadOnly = false; colvarSendByEmail.DefaultSetting = @"(0)"; colvarSendByEmail.ForeignKeyTableName = ""; schema.Columns.Add(colvarSendByEmail); TableSchema.TableColumn colvarContactID = new TableSchema.TableColumn(schema); colvarContactID.ColumnName = "ContactID"; colvarContactID.DataType = DbType.Int32; colvarContactID.MaxLength = 0; colvarContactID.AutoIncrement = false; colvarContactID.IsNullable = true; colvarContactID.IsPrimaryKey = false; colvarContactID.IsForeignKey = false; colvarContactID.IsReadOnly = false; colvarContactID.DefaultSetting = @""; colvarContactID.ForeignKeyTableName = ""; schema.Columns.Add(colvarContactID); TableSchema.TableColumn colvarEmailAddress = new TableSchema.TableColumn(schema); colvarEmailAddress.ColumnName = "EmailAddress"; colvarEmailAddress.DataType = DbType.String; colvarEmailAddress.MaxLength = 50; colvarEmailAddress.AutoIncrement = false; colvarEmailAddress.IsNullable = true; colvarEmailAddress.IsPrimaryKey = false; colvarEmailAddress.IsForeignKey = false; colvarEmailAddress.IsReadOnly = false; colvarEmailAddress.DefaultSetting = @""; colvarEmailAddress.ForeignKeyTableName = ""; schema.Columns.Add(colvarEmailAddress); TableSchema.TableColumn colvarTs = new TableSchema.TableColumn(schema); colvarTs.ColumnName = "TS"; colvarTs.DataType = DbType.Binary; colvarTs.MaxLength = 0; colvarTs.AutoIncrement = false; colvarTs.IsNullable = true; colvarTs.IsPrimaryKey = false; colvarTs.IsForeignKey = false; colvarTs.IsReadOnly = true; colvarTs.DefaultSetting = @""; colvarTs.ForeignKeyTableName = ""; schema.Columns.Add(colvarTs); BaseSchema = schema; //add this schema to the provider //so we can query it later DataService.Providers["WWIprov"].AddSchema("CourierDetailsSubTable", schema); } }
/// <summary> /// Gets the table schema. /// </summary> /// <param name="tableName">Name of the table.</param> /// <param name="tableType">Type of the table.</param> /// <returns></returns> public override TableSchema.Table GetTableSchema(string tableName, TableType tableType) { //return base.GetTableSchema(tableName, tableType); MySqlConnection conn = new MySqlConnection(DefaultConnectionString); if(dsColumns.Tables[Name] == null) { lock(_lockColumns) { QueryCommand cmdColumns = new QueryCommand(ALL_TABLE_COLUMNS_SQL, Name); cmdColumns.Parameters.Add("?DatabaseName", conn.Database, DbType.AnsiString); DataTable dt = new DataTable(Name); dt.Load(GetReader(cmdColumns)); dsColumns.Tables.Add(dt); } } DataRow[] drColumns = dsColumns.Tables[Name].Select("TableName ='" + tableName + "'", "OrdinalPosition ASC"); if(drColumns.Length == 0) return null; TableSchema.TableColumnCollection columns = new TableSchema.TableColumnCollection(); TableSchema.Table tbl = new TableSchema.Table(tableName, tableType, this); tbl.ForeignKeys = new TableSchema.ForeignKeyTableCollection(); for(int i = 0; i < drColumns.Length; i++) { string nativeDataType = drColumns[i][SqlSchemaVariable.DATA_TYPE].ToString().ToLower(); TableSchema.TableColumn column = new TableSchema.TableColumn(tbl); column.ColumnName = drColumns[i][SqlSchemaVariable.COLUMN_NAME].ToString(); column.DataType = GetDbType(nativeDataType); if(SetPropertyDefaultsFromDatabase && drColumns[i][SqlSchemaVariable.COLUMN_DEFAULT] != DBNull.Value && drColumns[i][SqlSchemaVariable.COLUMN_DEFAULT].ToString() != "\0") column.DefaultSetting = drColumns[i][SqlSchemaVariable.COLUMN_DEFAULT].ToString().Trim(); //thanks rauchy! bool autoIncrement; bool successfullyParsed = bool.TryParse(drColumns[i][SqlSchemaVariable.IS_IDENTITY].ToString(), out autoIncrement); if(!successfullyParsed) autoIncrement = Convert.ToBoolean(drColumns[i][SqlSchemaVariable.IS_IDENTITY]); column.AutoIncrement = autoIncrement; int maxLength; int.TryParse(drColumns[i][SqlSchemaVariable.MAX_LENGTH].ToString(), out maxLength); column.MaxLength = maxLength; column.IsNullable = (drColumns[i][SqlSchemaVariable.IS_NULLABLE].ToString() == "YES"); //column.IsReadOnly = (nativeDataType == "timestamp"); columns.Add(column); } if(dsIndex.Tables[Name] == null) { lock(_lockIndex) { QueryCommand cmdIndex = new QueryCommand(ALL_TABLE_INDEXES_SQL, Name); cmdIndex.Parameters.Add("?DatabaseName", conn.Database, DbType.AnsiString); DataTable dt = new DataTable(Name); dt.Load(GetReader(cmdIndex)); dsIndex.Tables.Add(dt); } } DataRow[] drIndexes = dsIndex.Tables[Name].Select("TableName = '" + tableName + "'"); for(int i = 0; i < drIndexes.Length; i++) { string colName = drIndexes[i][SqlSchemaVariable.COLUMN_NAME].ToString(); string constraintType = drIndexes[i][SqlSchemaVariable.CONSTRAINT_TYPE].ToString(); TableSchema.TableColumn column = columns.GetColumn(colName); if(Utility.IsMatch(constraintType, SqlSchemaVariable.PRIMARY_KEY)) column.IsPrimaryKey = true; else if(Utility.IsMatch(constraintType, SqlSchemaVariable.FOREIGN_KEY)) column.IsForeignKey = true; //HACK: Allow second pass naming adjust based on whether a column is keyed column.ColumnName = column.ColumnName; } if(dsPK.Tables[Name] == null) { lock(_lockPK) { QueryCommand cmdPk = new QueryCommand(ALL_TABLE_PRIMARY_TABLES, Name); cmdPk.Parameters.Add("?DatabaseName", conn.Database, DbType.AnsiString); DataTable dt = new DataTable(Name); dt.Load(GetReader(cmdPk)); dsPK.Tables.Add(dt); } } DataRow[] drPK = dsPK.Tables[Name].Select("PK_Table ='" + tableName + "'"); for(int i = 0; i < drPK.Length; i++) { string colName = drPK[i]["FK_Column"].ToString(); string fkName = drPK[i]["FK_Table"].ToString(); TableSchema.PrimaryKeyTable pkTable = new TableSchema.PrimaryKeyTable(this); pkTable.ColumnName = colName; pkTable.TableName = fkName; tbl.PrimaryKeyTables.Add(pkTable); } if(dsFK.Tables[Name] == null) { lock(_lockFK) { QueryCommand cmdFK = new QueryCommand(ALL_TABLE_FOREIGN_TABLES, Name); cmdFK.Parameters.Add("?DatabaseName", conn.Database, DbType.AnsiString); DataTable dt = new DataTable(Name); dt.Load(GetReader(cmdFK)); dsFK.Tables.Add(dt); } } DataRow[] drFK = dsFK.Tables[Name].Select("FK_Table ='" + tableName + "'"); ArrayList usedConstraints = new ArrayList(); for(int i = 0; i < drFK.Length; i++) { string constraintName = drFK[i]["Constraint_Name"].ToString(); if(!usedConstraints.Contains(constraintName)) { usedConstraints.Add(constraintName); string colName = drFK[i]["FK_Column"].ToString(); string fkName = CorrectTableCasing(drFK[i]["PK_Table"].ToString(), conn.Database); TableSchema.TableColumn column = columns.GetColumn(colName); if(column != null) column.ForeignKeyTableName = fkName; else continue; TableSchema.ForeignKeyTable fkTable = new TableSchema.ForeignKeyTable(this); fkTable.ColumnName = colName; fkTable.TableName = fkName; tbl.ForeignKeys.Add(fkTable); } } if(dsManyToManyCheck.Tables[Name] == null) { lock(_lockManyToManyCheck) { QueryCommand cmdM2M = new QueryCommand(MANY_TO_MANY_CHECK_ALL, Name); cmdM2M.Parameters.Add("?DatabaseName", conn.Database, DbType.AnsiString); DataTable dt = new DataTable(Name); dt.Load(GetReader(cmdM2M)); dsManyToManyCheck.Tables.Add(dt); } } DataRow[] drs = dsManyToManyCheck.Tables[Name].Select("PK_Table = '" + tableName + "'"); if(drs.Length > 0) { for(int count = 0; count < drs.Length; count++) { string mapTable = drs[count]["FK_Table"].ToString(); string localKey = drs[count]["FK_Column"].ToString(); if(dsManyToManyMap.Tables[Name] == null) { lock(_lockManyToManyMap) { QueryCommand cmdM2MMap = new QueryCommand(MANY_TO_MANY_FOREIGN_MAP_ALL, Name); cmdM2MMap.Parameters.Add("?DatabaseName", conn.Database, DbType.AnsiString); DataTable dt = new DataTable(Name); dt.Load(GetReader(cmdM2MMap)); dsManyToManyMap.Tables.Add(dt); } } DataRow[] drMap = dsManyToManyMap.Tables[Name].Select("FK_Table = '" + mapTable + "' AND PK_Table <> '" + tableName + "'"); for(int i = 0; i < drMap.Length; i++) { TableSchema.ManyToManyRelationship m = new TableSchema.ManyToManyRelationship(mapTable, tbl.Provider); m.ForeignTableName = drMap[i]["PK_Table"].ToString(); m.ForeignPrimaryKey = drMap[i]["PK_Column"].ToString(); m.MapTableLocalTableKeyColumn = localKey; m.MapTableForeignTableKeyColumn = drMap[i]["FK_Column"].ToString(); tbl.ManyToManys.Add(m); } } } tbl.Columns = columns; return tbl; }
private static void GetTableSchema() { if (!IsSchemaInitialized) { //Schema declaration TableSchema.Table schema = new TableSchema.Table("dashCommerce_Core_Log", TableType.Table, DataService.GetInstance("dashCommerceProvider")); schema.Columns = new TableSchema.TableColumnCollection(); schema.SchemaName = @"dbo"; //columns TableSchema.TableColumn colvarLogID = new TableSchema.TableColumn(schema); colvarLogID.ColumnName = "LogID"; colvarLogID.DataType = DbType.Int32; colvarLogID.MaxLength = 0; colvarLogID.AutoIncrement = true; colvarLogID.IsNullable = false; colvarLogID.IsPrimaryKey = true; colvarLogID.IsForeignKey = false; colvarLogID.IsReadOnly = false; colvarLogID.DefaultSetting = @""; colvarLogID.ForeignKeyTableName = ""; schema.Columns.Add(colvarLogID); TableSchema.TableColumn colvarLogDate = new TableSchema.TableColumn(schema); colvarLogDate.ColumnName = "LogDate"; colvarLogDate.DataType = DbType.DateTime; colvarLogDate.MaxLength = 0; colvarLogDate.AutoIncrement = false; colvarLogDate.IsNullable = false; colvarLogDate.IsPrimaryKey = false; colvarLogDate.IsForeignKey = false; colvarLogDate.IsReadOnly = false; colvarLogDate.DefaultSetting = @"(getdate())"; colvarLogDate.ForeignKeyTableName = ""; schema.Columns.Add(colvarLogDate); TableSchema.TableColumn colvarMessage = new TableSchema.TableColumn(schema); colvarMessage.ColumnName = "Message"; colvarMessage.DataType = DbType.String; colvarMessage.MaxLength = 2147483647; colvarMessage.AutoIncrement = false; colvarMessage.IsNullable = true; colvarMessage.IsPrimaryKey = false; colvarMessage.IsForeignKey = false; colvarMessage.IsReadOnly = false; colvarMessage.DefaultSetting = @""; colvarMessage.ForeignKeyTableName = ""; schema.Columns.Add(colvarMessage); TableSchema.TableColumn colvarMessageType = new TableSchema.TableColumn(schema); colvarMessageType.ColumnName = "MessageType"; colvarMessageType.DataType = DbType.Byte; colvarMessageType.MaxLength = 0; colvarMessageType.AutoIncrement = false; colvarMessageType.IsNullable = false; colvarMessageType.IsPrimaryKey = false; colvarMessageType.IsForeignKey = false; colvarMessageType.IsReadOnly = false; colvarMessageType.DefaultSetting = @""; colvarMessageType.ForeignKeyTableName = ""; schema.Columns.Add(colvarMessageType); TableSchema.TableColumn colvarUserAgent = new TableSchema.TableColumn(schema); colvarUserAgent.ColumnName = "UserAgent"; colvarUserAgent.DataType = DbType.String; colvarUserAgent.MaxLength = 256; colvarUserAgent.AutoIncrement = false; colvarUserAgent.IsNullable = true; colvarUserAgent.IsPrimaryKey = false; colvarUserAgent.IsForeignKey = false; colvarUserAgent.IsReadOnly = false; colvarUserAgent.DefaultSetting = @""; colvarUserAgent.ForeignKeyTableName = ""; schema.Columns.Add(colvarUserAgent); TableSchema.TableColumn colvarRemoteHost = new TableSchema.TableColumn(schema); colvarRemoteHost.ColumnName = "RemoteHost"; colvarRemoteHost.DataType = DbType.String; colvarRemoteHost.MaxLength = 256; colvarRemoteHost.AutoIncrement = false; colvarRemoteHost.IsNullable = true; colvarRemoteHost.IsPrimaryKey = false; colvarRemoteHost.IsForeignKey = false; colvarRemoteHost.IsReadOnly = false; colvarRemoteHost.DefaultSetting = @""; colvarRemoteHost.ForeignKeyTableName = ""; schema.Columns.Add(colvarRemoteHost); TableSchema.TableColumn colvarAuthUser = new TableSchema.TableColumn(schema); colvarAuthUser.ColumnName = "AuthUser"; colvarAuthUser.DataType = DbType.String; colvarAuthUser.MaxLength = 64; colvarAuthUser.AutoIncrement = false; colvarAuthUser.IsNullable = true; colvarAuthUser.IsPrimaryKey = false; colvarAuthUser.IsForeignKey = false; colvarAuthUser.IsReadOnly = false; colvarAuthUser.DefaultSetting = @""; colvarAuthUser.ForeignKeyTableName = ""; schema.Columns.Add(colvarAuthUser); TableSchema.TableColumn colvarReferer = new TableSchema.TableColumn(schema); colvarReferer.ColumnName = "Referer"; colvarReferer.DataType = DbType.String; colvarReferer.MaxLength = 512; colvarReferer.AutoIncrement = false; colvarReferer.IsNullable = true; colvarReferer.IsPrimaryKey = false; colvarReferer.IsForeignKey = false; colvarReferer.IsReadOnly = false; colvarReferer.DefaultSetting = @""; colvarReferer.ForeignKeyTableName = ""; schema.Columns.Add(colvarReferer); TableSchema.TableColumn colvarMachineName = new TableSchema.TableColumn(schema); colvarMachineName.ColumnName = "MachineName"; colvarMachineName.DataType = DbType.String; colvarMachineName.MaxLength = 32; colvarMachineName.AutoIncrement = false; colvarMachineName.IsNullable = true; colvarMachineName.IsPrimaryKey = false; colvarMachineName.IsForeignKey = false; colvarMachineName.IsReadOnly = false; colvarMachineName.DefaultSetting = @""; colvarMachineName.ForeignKeyTableName = ""; schema.Columns.Add(colvarMachineName); TableSchema.TableColumn colvarFormData = new TableSchema.TableColumn(schema); colvarFormData.ColumnName = "FormData"; colvarFormData.DataType = DbType.String; colvarFormData.MaxLength = 2147483647; colvarFormData.AutoIncrement = false; colvarFormData.IsNullable = true; colvarFormData.IsPrimaryKey = false; colvarFormData.IsForeignKey = false; colvarFormData.IsReadOnly = false; colvarFormData.DefaultSetting = @""; colvarFormData.ForeignKeyTableName = ""; schema.Columns.Add(colvarFormData); TableSchema.TableColumn colvarQueryStringData = new TableSchema.TableColumn(schema); colvarQueryStringData.ColumnName = "QueryStringData"; colvarQueryStringData.DataType = DbType.String; colvarQueryStringData.MaxLength = 512; colvarQueryStringData.AutoIncrement = false; colvarQueryStringData.IsNullable = true; colvarQueryStringData.IsPrimaryKey = false; colvarQueryStringData.IsForeignKey = false; colvarQueryStringData.IsReadOnly = false; colvarQueryStringData.DefaultSetting = @""; colvarQueryStringData.ForeignKeyTableName = ""; schema.Columns.Add(colvarQueryStringData); TableSchema.TableColumn colvarCookiesData = new TableSchema.TableColumn(schema); colvarCookiesData.ColumnName = "CookiesData"; colvarCookiesData.DataType = DbType.String; colvarCookiesData.MaxLength = 2048; colvarCookiesData.AutoIncrement = false; colvarCookiesData.IsNullable = true; colvarCookiesData.IsPrimaryKey = false; colvarCookiesData.IsForeignKey = false; colvarCookiesData.IsReadOnly = false; colvarCookiesData.DefaultSetting = @""; colvarCookiesData.ForeignKeyTableName = ""; schema.Columns.Add(colvarCookiesData); TableSchema.TableColumn colvarExceptionType = new TableSchema.TableColumn(schema); colvarExceptionType.ColumnName = "ExceptionType"; colvarExceptionType.DataType = DbType.String; colvarExceptionType.MaxLength = 256; colvarExceptionType.AutoIncrement = false; colvarExceptionType.IsNullable = true; colvarExceptionType.IsPrimaryKey = false; colvarExceptionType.IsForeignKey = false; colvarExceptionType.IsReadOnly = false; colvarExceptionType.DefaultSetting = @""; colvarExceptionType.ForeignKeyTableName = ""; schema.Columns.Add(colvarExceptionType); TableSchema.TableColumn colvarScriptName = new TableSchema.TableColumn(schema); colvarScriptName.ColumnName = "ScriptName"; colvarScriptName.DataType = DbType.String; colvarScriptName.MaxLength = 256; colvarScriptName.AutoIncrement = false; colvarScriptName.IsNullable = true; colvarScriptName.IsPrimaryKey = false; colvarScriptName.IsForeignKey = false; colvarScriptName.IsReadOnly = false; colvarScriptName.DefaultSetting = @""; colvarScriptName.ForeignKeyTableName = ""; schema.Columns.Add(colvarScriptName); TableSchema.TableColumn colvarExceptionMessage = new TableSchema.TableColumn(schema); colvarExceptionMessage.ColumnName = "ExceptionMessage"; colvarExceptionMessage.DataType = DbType.String; colvarExceptionMessage.MaxLength = 512; colvarExceptionMessage.AutoIncrement = false; colvarExceptionMessage.IsNullable = true; colvarExceptionMessage.IsPrimaryKey = false; colvarExceptionMessage.IsForeignKey = false; colvarExceptionMessage.IsReadOnly = false; colvarExceptionMessage.DefaultSetting = @""; colvarExceptionMessage.ForeignKeyTableName = ""; schema.Columns.Add(colvarExceptionMessage); TableSchema.TableColumn colvarExceptionSource = new TableSchema.TableColumn(schema); colvarExceptionSource.ColumnName = "ExceptionSource"; colvarExceptionSource.DataType = DbType.String; colvarExceptionSource.MaxLength = 256; colvarExceptionSource.AutoIncrement = false; colvarExceptionSource.IsNullable = true; colvarExceptionSource.IsPrimaryKey = false; colvarExceptionSource.IsForeignKey = false; colvarExceptionSource.IsReadOnly = false; colvarExceptionSource.DefaultSetting = @""; colvarExceptionSource.ForeignKeyTableName = ""; schema.Columns.Add(colvarExceptionSource); TableSchema.TableColumn colvarExceptionStackTrace = new TableSchema.TableColumn(schema); colvarExceptionStackTrace.ColumnName = "ExceptionStackTrace"; colvarExceptionStackTrace.DataType = DbType.String; colvarExceptionStackTrace.MaxLength = 2048; colvarExceptionStackTrace.AutoIncrement = false; colvarExceptionStackTrace.IsNullable = true; colvarExceptionStackTrace.IsPrimaryKey = false; colvarExceptionStackTrace.IsForeignKey = false; colvarExceptionStackTrace.IsReadOnly = false; colvarExceptionStackTrace.DefaultSetting = @""; colvarExceptionStackTrace.ForeignKeyTableName = ""; schema.Columns.Add(colvarExceptionStackTrace); BaseSchema = schema; //add this schema to the provider //so we can query it later DataService.Providers["dashCommerceProvider"].AddSchema("dashCommerce_Core_Log", schema); } }
/// <summary> /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering. /// </summary> protected override void CreateChildControls() { base.CreateChildControls(); tbl.CellPadding = 3; tbl.CellSpacing = 0; tbl.Width = "100%"; tblPage.Width = "100%"; //add three rows to this table //i know this might seem sort of strange //but given that we're dealing with eventing of buttons //.NET is a bit clumsy about it - these controls //need to exist in the control bag in order for the //event to be recognize. So we add them up front trTop.Cells.Add(tdTop); tblWrap.Rows.Add(trTop); trBottom.Cells.Add(tdBottom); tblWrap.Rows.Add(trBottom); tdTop.Controls.Add(tbl); tdBottom.Controls.Add(tblPage); Controls.Add(tblWrap); //set CSS if(!String.IsNullOrEmpty(tableCSSClass)) tbl.Attributes.Add(CLASS, tableCSSClass); else tbl.Attributes.Add(STYLE, tableStyle); if(!String.IsNullOrEmpty(pagerButtonCSS)) { btnFirst.Attributes.Add(CLASS, pagerButtonCSS); btnPrev.Attributes.Add(CLASS, pagerButtonCSS); btnNext.Attributes.Add(CLASS, pagerButtonCSS); btnLast.Attributes.Add(CLASS, pagerButtonCSS); ddlPages.Attributes.Add(CLASS, pagerButtonCSS); } else { btnFirst.Attributes.Add(STYLE, pagerButtonStyle); btnPrev.Attributes.Add(STYLE, pagerButtonStyle); btnNext.Attributes.Add(STYLE, pagerButtonStyle); btnLast.Attributes.Add(STYLE, pagerButtonStyle); ddlPages.Attributes.Add(STYLE, pagerButtonStyle); } //have to load up the pager buttons to the control set so we recognize them on //postback //load the schema schema = DataService.GetSchema(tableName, ProviderName, TableType.Table) ?? DataService.GetSchema(tableName, ProviderName, TableType.View); if(schema == null) throw new Exception("Can't find a table names " + tableName + ". Did you set the correct providerName?"); //load the headers BuildHeader(); BuildPager(); //if(!Page.IsPostBack) //{ LoadGrid(); trBottom.Visible = !(pageSize >= totalRecords); //} }
private static void GetTableSchema() { if (!IsSchemaInitialized) { //Schema declaration TableSchema.Table schema = new TableSchema.Table("kcb_dangky_sokham", TableType.Table, DataService.GetInstance("ORM")); schema.Columns = new TableSchema.TableColumnCollection(); schema.SchemaName = @"dbo"; //columns TableSchema.TableColumn colvarIdSokcb = new TableSchema.TableColumn(schema); colvarIdSokcb.ColumnName = "id_sokcb"; colvarIdSokcb.DataType = DbType.Int64; colvarIdSokcb.MaxLength = 0; colvarIdSokcb.AutoIncrement = true; colvarIdSokcb.IsNullable = false; colvarIdSokcb.IsPrimaryKey = true; colvarIdSokcb.IsForeignKey = false; colvarIdSokcb.IsReadOnly = false; colvarIdSokcb.DefaultSetting = @""; colvarIdSokcb.ForeignKeyTableName = ""; schema.Columns.Add(colvarIdSokcb); TableSchema.TableColumn colvarIdBenhnhan = new TableSchema.TableColumn(schema); colvarIdBenhnhan.ColumnName = "id_benhnhan"; colvarIdBenhnhan.DataType = DbType.Int64; colvarIdBenhnhan.MaxLength = 0; colvarIdBenhnhan.AutoIncrement = false; colvarIdBenhnhan.IsNullable = false; colvarIdBenhnhan.IsPrimaryKey = false; colvarIdBenhnhan.IsForeignKey = false; colvarIdBenhnhan.IsReadOnly = false; colvarIdBenhnhan.DefaultSetting = @""; colvarIdBenhnhan.ForeignKeyTableName = ""; schema.Columns.Add(colvarIdBenhnhan); TableSchema.TableColumn colvarMaLuotkham = new TableSchema.TableColumn(schema); colvarMaLuotkham.ColumnName = "ma_luotkham"; colvarMaLuotkham.DataType = DbType.String; colvarMaLuotkham.MaxLength = 10; colvarMaLuotkham.AutoIncrement = false; colvarMaLuotkham.IsNullable = false; colvarMaLuotkham.IsPrimaryKey = false; colvarMaLuotkham.IsForeignKey = false; colvarMaLuotkham.IsReadOnly = false; colvarMaLuotkham.DefaultSetting = @""; colvarMaLuotkham.ForeignKeyTableName = ""; schema.Columns.Add(colvarMaLuotkham); TableSchema.TableColumn colvarMaSokcb = new TableSchema.TableColumn(schema); colvarMaSokcb.ColumnName = "ma_sokcb"; colvarMaSokcb.DataType = DbType.String; colvarMaSokcb.MaxLength = 20; colvarMaSokcb.AutoIncrement = false; colvarMaSokcb.IsNullable = false; colvarMaSokcb.IsPrimaryKey = false; colvarMaSokcb.IsForeignKey = false; colvarMaSokcb.IsReadOnly = false; colvarMaSokcb.DefaultSetting = @""; colvarMaSokcb.ForeignKeyTableName = ""; schema.Columns.Add(colvarMaSokcb); TableSchema.TableColumn colvarDonGia = new TableSchema.TableColumn(schema); colvarDonGia.ColumnName = "don_gia"; colvarDonGia.DataType = DbType.Decimal; colvarDonGia.MaxLength = 0; colvarDonGia.AutoIncrement = false; colvarDonGia.IsNullable = false; colvarDonGia.IsPrimaryKey = false; colvarDonGia.IsForeignKey = false; colvarDonGia.IsReadOnly = false; colvarDonGia.DefaultSetting = @""; colvarDonGia.ForeignKeyTableName = ""; schema.Columns.Add(colvarDonGia); TableSchema.TableColumn colvarBhytChitra = new TableSchema.TableColumn(schema); colvarBhytChitra.ColumnName = "bhyt_chitra"; colvarBhytChitra.DataType = DbType.Decimal; colvarBhytChitra.MaxLength = 0; colvarBhytChitra.AutoIncrement = false; colvarBhytChitra.IsNullable = false; colvarBhytChitra.IsPrimaryKey = false; colvarBhytChitra.IsForeignKey = false; colvarBhytChitra.IsReadOnly = false; colvarBhytChitra.DefaultSetting = @""; colvarBhytChitra.ForeignKeyTableName = ""; schema.Columns.Add(colvarBhytChitra); TableSchema.TableColumn colvarBnhanChitra = new TableSchema.TableColumn(schema); colvarBnhanChitra.ColumnName = "bnhan_chitra"; colvarBnhanChitra.DataType = DbType.Decimal; colvarBnhanChitra.MaxLength = 0; colvarBnhanChitra.AutoIncrement = false; colvarBnhanChitra.IsNullable = false; colvarBnhanChitra.IsPrimaryKey = false; colvarBnhanChitra.IsForeignKey = false; colvarBnhanChitra.IsReadOnly = false; colvarBnhanChitra.DefaultSetting = @""; colvarBnhanChitra.ForeignKeyTableName = ""; schema.Columns.Add(colvarBnhanChitra); TableSchema.TableColumn colvarPtramBhytGoc = new TableSchema.TableColumn(schema); colvarPtramBhytGoc.ColumnName = "ptram_bhyt_goc"; colvarPtramBhytGoc.DataType = DbType.Decimal; colvarPtramBhytGoc.MaxLength = 0; colvarPtramBhytGoc.AutoIncrement = false; colvarPtramBhytGoc.IsNullable = false; colvarPtramBhytGoc.IsPrimaryKey = false; colvarPtramBhytGoc.IsForeignKey = false; colvarPtramBhytGoc.IsReadOnly = false; colvarPtramBhytGoc.DefaultSetting = @""; colvarPtramBhytGoc.ForeignKeyTableName = ""; schema.Columns.Add(colvarPtramBhytGoc); TableSchema.TableColumn colvarPtramBhyt = new TableSchema.TableColumn(schema); colvarPtramBhyt.ColumnName = "ptram_bhyt"; colvarPtramBhyt.DataType = DbType.Decimal; colvarPtramBhyt.MaxLength = 0; colvarPtramBhyt.AutoIncrement = false; colvarPtramBhyt.IsNullable = false; colvarPtramBhyt.IsPrimaryKey = false; colvarPtramBhyt.IsForeignKey = false; colvarPtramBhyt.IsReadOnly = false; colvarPtramBhyt.DefaultSetting = @""; colvarPtramBhyt.ForeignKeyTableName = ""; schema.Columns.Add(colvarPtramBhyt); TableSchema.TableColumn colvarPhuThu = new TableSchema.TableColumn(schema); colvarPhuThu.ColumnName = "phu_thu"; colvarPhuThu.DataType = DbType.Decimal; colvarPhuThu.MaxLength = 0; colvarPhuThu.AutoIncrement = false; colvarPhuThu.IsNullable = false; colvarPhuThu.IsPrimaryKey = false; colvarPhuThu.IsForeignKey = false; colvarPhuThu.IsReadOnly = false; colvarPhuThu.DefaultSetting = @""; colvarPhuThu.ForeignKeyTableName = ""; schema.Columns.Add(colvarPhuThu); TableSchema.TableColumn colvarTrangthaiThanhtoan = new TableSchema.TableColumn(schema); colvarTrangthaiThanhtoan.ColumnName = "trangthai_thanhtoan"; colvarTrangthaiThanhtoan.DataType = DbType.Byte; colvarTrangthaiThanhtoan.MaxLength = 0; colvarTrangthaiThanhtoan.AutoIncrement = false; colvarTrangthaiThanhtoan.IsNullable = false; colvarTrangthaiThanhtoan.IsPrimaryKey = false; colvarTrangthaiThanhtoan.IsForeignKey = false; colvarTrangthaiThanhtoan.IsReadOnly = false; colvarTrangthaiThanhtoan.DefaultSetting = @""; colvarTrangthaiThanhtoan.ForeignKeyTableName = ""; schema.Columns.Add(colvarTrangthaiThanhtoan); TableSchema.TableColumn colvarIdThanhtoan = new TableSchema.TableColumn(schema); colvarIdThanhtoan.ColumnName = "id_thanhtoan"; colvarIdThanhtoan.DataType = DbType.Int64; colvarIdThanhtoan.MaxLength = 0; colvarIdThanhtoan.AutoIncrement = false; colvarIdThanhtoan.IsNullable = true; colvarIdThanhtoan.IsPrimaryKey = false; colvarIdThanhtoan.IsForeignKey = false; colvarIdThanhtoan.IsReadOnly = false; colvarIdThanhtoan.DefaultSetting = @""; colvarIdThanhtoan.ForeignKeyTableName = ""; schema.Columns.Add(colvarIdThanhtoan); TableSchema.TableColumn colvarNgayThanhtoan = new TableSchema.TableColumn(schema); colvarNgayThanhtoan.ColumnName = "ngay_thanhtoan"; colvarNgayThanhtoan.DataType = DbType.DateTime; colvarNgayThanhtoan.MaxLength = 0; colvarNgayThanhtoan.AutoIncrement = false; colvarNgayThanhtoan.IsNullable = true; colvarNgayThanhtoan.IsPrimaryKey = false; colvarNgayThanhtoan.IsForeignKey = false; colvarNgayThanhtoan.IsReadOnly = false; colvarNgayThanhtoan.DefaultSetting = @""; colvarNgayThanhtoan.ForeignKeyTableName = ""; schema.Columns.Add(colvarNgayThanhtoan); TableSchema.TableColumn colvarNguoiThanhtoan = new TableSchema.TableColumn(schema); colvarNguoiThanhtoan.ColumnName = "nguoi_thanhtoan"; colvarNguoiThanhtoan.DataType = DbType.String; colvarNguoiThanhtoan.MaxLength = 30; colvarNguoiThanhtoan.AutoIncrement = false; colvarNguoiThanhtoan.IsNullable = true; colvarNguoiThanhtoan.IsPrimaryKey = false; colvarNguoiThanhtoan.IsForeignKey = false; colvarNguoiThanhtoan.IsReadOnly = false; colvarNguoiThanhtoan.DefaultSetting = @""; colvarNguoiThanhtoan.ForeignKeyTableName = ""; schema.Columns.Add(colvarNguoiThanhtoan); TableSchema.TableColumn colvarTuTuc = new TableSchema.TableColumn(schema); colvarTuTuc.ColumnName = "tu_tuc"; colvarTuTuc.DataType = DbType.Byte; colvarTuTuc.MaxLength = 0; colvarTuTuc.AutoIncrement = false; colvarTuTuc.IsNullable = false; colvarTuTuc.IsPrimaryKey = false; colvarTuTuc.IsForeignKey = false; colvarTuTuc.IsReadOnly = false; colvarTuTuc.DefaultSetting = @""; colvarTuTuc.ForeignKeyTableName = ""; schema.Columns.Add(colvarTuTuc); TableSchema.TableColumn colvarMaDoituongkcb = new TableSchema.TableColumn(schema); colvarMaDoituongkcb.ColumnName = "ma_doituongkcb"; colvarMaDoituongkcb.DataType = DbType.String; colvarMaDoituongkcb.MaxLength = 10; colvarMaDoituongkcb.AutoIncrement = false; colvarMaDoituongkcb.IsNullable = false; colvarMaDoituongkcb.IsPrimaryKey = false; colvarMaDoituongkcb.IsForeignKey = false; colvarMaDoituongkcb.IsReadOnly = false; colvarMaDoituongkcb.DefaultSetting = @""; colvarMaDoituongkcb.ForeignKeyTableName = ""; schema.Columns.Add(colvarMaDoituongkcb); TableSchema.TableColumn colvarIdDoituongkcb = new TableSchema.TableColumn(schema); colvarIdDoituongkcb.ColumnName = "id_doituongkcb"; colvarIdDoituongkcb.DataType = DbType.Int16; colvarIdDoituongkcb.MaxLength = 0; colvarIdDoituongkcb.AutoIncrement = false; colvarIdDoituongkcb.IsNullable = false; colvarIdDoituongkcb.IsPrimaryKey = false; colvarIdDoituongkcb.IsForeignKey = false; colvarIdDoituongkcb.IsReadOnly = false; colvarIdDoituongkcb.DefaultSetting = @""; colvarIdDoituongkcb.ForeignKeyTableName = ""; schema.Columns.Add(colvarIdDoituongkcb); TableSchema.TableColumn colvarIdLoaidoituongkcb = new TableSchema.TableColumn(schema); colvarIdLoaidoituongkcb.ColumnName = "id_loaidoituongkcb"; colvarIdLoaidoituongkcb.DataType = DbType.Byte; colvarIdLoaidoituongkcb.MaxLength = 0; colvarIdLoaidoituongkcb.AutoIncrement = false; colvarIdLoaidoituongkcb.IsNullable = false; colvarIdLoaidoituongkcb.IsPrimaryKey = false; colvarIdLoaidoituongkcb.IsForeignKey = false; colvarIdLoaidoituongkcb.IsReadOnly = false; colvarIdLoaidoituongkcb.DefaultSetting = @""; colvarIdLoaidoituongkcb.ForeignKeyTableName = ""; schema.Columns.Add(colvarIdLoaidoituongkcb); TableSchema.TableColumn colvarIdKhoakcb = new TableSchema.TableColumn(schema); colvarIdKhoakcb.ColumnName = "id_khoakcb"; colvarIdKhoakcb.DataType = DbType.Int16; colvarIdKhoakcb.MaxLength = 0; colvarIdKhoakcb.AutoIncrement = false; colvarIdKhoakcb.IsNullable = false; colvarIdKhoakcb.IsPrimaryKey = false; colvarIdKhoakcb.IsForeignKey = false; colvarIdKhoakcb.IsReadOnly = false; colvarIdKhoakcb.DefaultSetting = @""; colvarIdKhoakcb.ForeignKeyTableName = ""; schema.Columns.Add(colvarIdKhoakcb); TableSchema.TableColumn colvarIdNhanvien = new TableSchema.TableColumn(schema); colvarIdNhanvien.ColumnName = "id_nhanvien"; colvarIdNhanvien.DataType = DbType.Int16; colvarIdNhanvien.MaxLength = 0; colvarIdNhanvien.AutoIncrement = false; colvarIdNhanvien.IsNullable = true; colvarIdNhanvien.IsPrimaryKey = false; colvarIdNhanvien.IsForeignKey = false; colvarIdNhanvien.IsReadOnly = false; colvarIdNhanvien.DefaultSetting = @""; colvarIdNhanvien.ForeignKeyTableName = ""; schema.Columns.Add(colvarIdNhanvien); TableSchema.TableColumn colvarIdGoi = new TableSchema.TableColumn(schema); colvarIdGoi.ColumnName = "id_goi"; colvarIdGoi.DataType = DbType.Int32; colvarIdGoi.MaxLength = 0; colvarIdGoi.AutoIncrement = false; colvarIdGoi.IsNullable = true; colvarIdGoi.IsPrimaryKey = false; colvarIdGoi.IsForeignKey = false; colvarIdGoi.IsReadOnly = false; colvarIdGoi.DefaultSetting = @""; colvarIdGoi.ForeignKeyTableName = ""; schema.Columns.Add(colvarIdGoi); TableSchema.TableColumn colvarTrongGoi = new TableSchema.TableColumn(schema); colvarTrongGoi.ColumnName = "trong_goi"; colvarTrongGoi.DataType = DbType.Byte; colvarTrongGoi.MaxLength = 0; colvarTrongGoi.AutoIncrement = false; colvarTrongGoi.IsNullable = true; colvarTrongGoi.IsPrimaryKey = false; colvarTrongGoi.IsForeignKey = false; colvarTrongGoi.IsReadOnly = false; colvarTrongGoi.DefaultSetting = @""; colvarTrongGoi.ForeignKeyTableName = ""; schema.Columns.Add(colvarTrongGoi); TableSchema.TableColumn colvarNguonThanhtoan = new TableSchema.TableColumn(schema); colvarNguonThanhtoan.ColumnName = "nguon_thanhtoan"; colvarNguonThanhtoan.DataType = DbType.Byte; colvarNguonThanhtoan.MaxLength = 0; colvarNguonThanhtoan.AutoIncrement = false; colvarNguonThanhtoan.IsNullable = true; colvarNguonThanhtoan.IsPrimaryKey = false; colvarNguonThanhtoan.IsForeignKey = false; colvarNguonThanhtoan.IsReadOnly = false; colvarNguonThanhtoan.DefaultSetting = @""; colvarNguonThanhtoan.ForeignKeyTableName = ""; schema.Columns.Add(colvarNguonThanhtoan); TableSchema.TableColumn colvarNoitru = new TableSchema.TableColumn(schema); colvarNoitru.ColumnName = "noitru"; colvarNoitru.DataType = DbType.Byte; colvarNoitru.MaxLength = 0; colvarNoitru.AutoIncrement = false; colvarNoitru.IsNullable = true; colvarNoitru.IsPrimaryKey = false; colvarNoitru.IsForeignKey = false; colvarNoitru.IsReadOnly = false; colvarNoitru.DefaultSetting = @""; colvarNoitru.ForeignKeyTableName = ""; schema.Columns.Add(colvarNoitru); TableSchema.TableColumn colvarIdLichsuDoituongKcb = new TableSchema.TableColumn(schema); colvarIdLichsuDoituongKcb.ColumnName = "id_lichsu_doituong_Kcb"; colvarIdLichsuDoituongKcb.DataType = DbType.Int64; colvarIdLichsuDoituongKcb.MaxLength = 0; colvarIdLichsuDoituongKcb.AutoIncrement = false; colvarIdLichsuDoituongKcb.IsNullable = true; colvarIdLichsuDoituongKcb.IsPrimaryKey = false; colvarIdLichsuDoituongKcb.IsForeignKey = false; colvarIdLichsuDoituongKcb.IsReadOnly = false; colvarIdLichsuDoituongKcb.DefaultSetting = @""; colvarIdLichsuDoituongKcb.ForeignKeyTableName = ""; schema.Columns.Add(colvarIdLichsuDoituongKcb); TableSchema.TableColumn colvarMatheBhyt = new TableSchema.TableColumn(schema); colvarMatheBhyt.ColumnName = "mathe_bhyt"; colvarMatheBhyt.DataType = DbType.String; colvarMatheBhyt.MaxLength = 30; colvarMatheBhyt.AutoIncrement = false; colvarMatheBhyt.IsNullable = true; colvarMatheBhyt.IsPrimaryKey = false; colvarMatheBhyt.IsForeignKey = false; colvarMatheBhyt.IsReadOnly = false; colvarMatheBhyt.DefaultSetting = @""; colvarMatheBhyt.ForeignKeyTableName = ""; schema.Columns.Add(colvarMatheBhyt); TableSchema.TableColumn colvarNgayTao = new TableSchema.TableColumn(schema); colvarNgayTao.ColumnName = "ngay_tao"; colvarNgayTao.DataType = DbType.DateTime; colvarNgayTao.MaxLength = 0; colvarNgayTao.AutoIncrement = false; colvarNgayTao.IsNullable = false; colvarNgayTao.IsPrimaryKey = false; colvarNgayTao.IsForeignKey = false; colvarNgayTao.IsReadOnly = false; colvarNgayTao.DefaultSetting = @""; colvarNgayTao.ForeignKeyTableName = ""; schema.Columns.Add(colvarNgayTao); TableSchema.TableColumn colvarNguoiTao = new TableSchema.TableColumn(schema); colvarNguoiTao.ColumnName = "nguoi_tao"; colvarNguoiTao.DataType = DbType.String; colvarNguoiTao.MaxLength = 30; colvarNguoiTao.AutoIncrement = false; colvarNguoiTao.IsNullable = false; colvarNguoiTao.IsPrimaryKey = false; colvarNguoiTao.IsForeignKey = false; colvarNguoiTao.IsReadOnly = false; colvarNguoiTao.DefaultSetting = @""; colvarNguoiTao.ForeignKeyTableName = ""; schema.Columns.Add(colvarNguoiTao); TableSchema.TableColumn colvarNgaySua = new TableSchema.TableColumn(schema); colvarNgaySua.ColumnName = "ngay_sua"; colvarNgaySua.DataType = DbType.DateTime; colvarNgaySua.MaxLength = 0; colvarNgaySua.AutoIncrement = false; colvarNgaySua.IsNullable = true; colvarNgaySua.IsPrimaryKey = false; colvarNgaySua.IsForeignKey = false; colvarNgaySua.IsReadOnly = false; colvarNgaySua.DefaultSetting = @""; colvarNgaySua.ForeignKeyTableName = ""; schema.Columns.Add(colvarNgaySua); TableSchema.TableColumn colvarNguoiSua = new TableSchema.TableColumn(schema); colvarNguoiSua.ColumnName = "nguoi_sua"; colvarNguoiSua.DataType = DbType.String; colvarNguoiSua.MaxLength = 30; colvarNguoiSua.AutoIncrement = false; colvarNguoiSua.IsNullable = true; colvarNguoiSua.IsPrimaryKey = false; colvarNguoiSua.IsForeignKey = false; colvarNguoiSua.IsReadOnly = false; colvarNguoiSua.DefaultSetting = @""; colvarNguoiSua.ForeignKeyTableName = ""; schema.Columns.Add(colvarNguoiSua); BaseSchema = schema; //add this schema to the provider //so we can query it later DataService.Providers["ORM"].AddSchema("kcb_dangky_sokham", schema); } }