Exemplo n.º 1
0
        public override TableSchema GetTableSchema()
        {
            if (null == _TableSchema)
            {
                TableSchema schema = new TableSchema();
                schema.SchemaName = @"SupplierProduct";
                schema.AddColumn(Columns.SupplierId, typeof(Int64), 0, 0, 0, false, false, false, null);
                schema.AddColumn(Columns.ProductId, typeof(Int64), 0, 0, 0, false, false, false, null);
                schema.AddColumn(Columns.Price, typeof(decimal), 0, 0, 0, false, false, false, 0);
                schema.AddColumn(Columns.Gift, typeof(string), DataType.Char, 100, 0, 0, false, false, false, string.Empty);
                schema.AddColumn(Columns.CreateDate, typeof(DateTime), 0, 0, 0, false, false, false, DateTime.MinValue);

                _TableSchema = schema;

                schema.AddIndex("pk_SupplierProduct_SupplierIdProductId", TableSchema.ClusterMode.None, TableSchema.IndexMode.PrimaryKey, TableSchema.IndexType.None, Columns.SupplierId, Columns.ProductId);
                schema.AddIndex("ix_SupplierProduct_SupplierId", TableSchema.ClusterMode.None, TableSchema.IndexMode.None, TableSchema.IndexType.None, Columns.SupplierId);
                schema.AddIndex("ix_SupplierProduct_ProductId", TableSchema.ClusterMode.None, TableSchema.IndexMode.None, TableSchema.IndexType.None, Columns.ProductId);
                schema.AddIndex("ix_SupplierProduct_CreateDate", TableSchema.ClusterMode.None, TableSchema.IndexMode.None, TableSchema.IndexType.None, Columns.CreateDate, SortDirection.ASC);

                schema.AddForeignKey("fk_SupplierProduct_AppSupplier", SupplierProduct.Columns.SupplierId, AppSupplier.TableSchema.SchemaName, AppSupplier.Columns.SupplierId, TableSchema.ForeignKeyReference.Cascade, TableSchema.ForeignKeyReference.Cascade);
                schema.AddForeignKey("fk_SupplierProduct_ProductId", SupplierProduct.Columns.ProductId, Product.TableSchema.SchemaName, Product.Columns.ProductId, TableSchema.ForeignKeyReference.Cascade, TableSchema.ForeignKeyReference.Cascade);
            }

            return(_TableSchema);
        }
Exemplo n.º 2
0
        public override TableSchema GetTableSchema()
        {
            if (null == _TableSchema)
            {
                TableSchema schema = new TableSchema();
                schema.SchemaName = @"Comment";
                schema.AddColumn(Columns.CommentId, typeof(Int64), 0, 0, 0, true, true, false, null);
                schema.AddColumn(Columns.Name, typeof(string), DataType.Char, 255, 0, 0, false, false, false, null);
                schema.AddColumn(Columns.Rate, typeof(double), 0, 0, 0, false, false, false, null);
                schema.AddColumn(Columns.Content, typeof(string), DataType.Char, 255, 0, 0, false, false, false, null);
                schema.AddColumn(Columns.AppUserId, typeof(Int64), 0, 0, 0, false, false, false, null);
                schema.AddColumn(Columns.SupplierId, typeof(Int64), 0, 0, 0, false, false, false, null);
                schema.AddColumn(Columns.BidId, typeof(Int64), 0, 0, 0, false, false, true, null);
                schema.AddColumn(Columns.Status, typeof(CommentStatus), 0, 0, 0, false, false, false, CommentStatus.Wait);
                schema.AddColumn(Columns.CreateDate, typeof(DateTime), 0, 0, 0, false, false, false, DateTime.MinValue);
                schema.AddColumn(Columns.ApproveDate, typeof(DateTime), 0, 0, 0, false, false, true, null);

                _TableSchema = schema;

                schema.AddIndex("ix_Comment_CommentId", TableSchema.ClusterMode.None, TableSchema.IndexMode.None, TableSchema.IndexType.None, Columns.CommentId);
                schema.AddIndex("ix_Comment_CreateDate", TableSchema.ClusterMode.None, TableSchema.IndexMode.None, TableSchema.IndexType.None, Columns.CreateDate, SortDirection.ASC);

                schema.AddForeignKey("fk_Comment_SupplierId", Comment.Columns.SupplierId, AppSupplier.TableSchema.SchemaName, AppSupplier.Columns.SupplierId, TableSchema.ForeignKeyReference.None, TableSchema.ForeignKeyReference.None);
                schema.AddForeignKey("fk_Comment_AppUserId", Comment.Columns.AppUserId, AppUser.TableSchema.SchemaName, AppUser.Columns.AppUserId, TableSchema.ForeignKeyReference.None, TableSchema.ForeignKeyReference.None);
            }

            return(_TableSchema);
        }
Exemplo n.º 3
0
        public override TableSchema GetTableSchema()
        {
            if (null == _TableSchema)
            {
                TableSchema schema = new TableSchema();
                schema.SchemaName = @"pricedeviation";
                schema.AddColumn(Columns.ProductId, typeof(Int64), 0, 0, 0, false, true, false, null);
                schema.AddColumn(Columns.SupplierId, typeof(Int64), 0, 0, 0, false, true, false, null);
                schema.AddColumn(Columns.ProductName, typeof(string), DataType.Char, 64, 0, 0, false, false, false, string.Empty);
                schema.AddColumn(Columns.SupplierName, typeof(string), DataType.Char, 128, 0, 0, false, false, false, string.Empty);
                schema.AddColumn(Columns.RecommendedPrice, typeof(decimal), 0, 64, 0, 0, false, false, false, null);
                schema.AddColumn(Columns.ActualPrice, typeof(decimal), 0, 64, 0, 0, false, false, false, null);
                schema.AddColumn(Columns.DeviationPercentage, typeof(int), 0, 64, 0, 0, false, false, false, null);
                schema.AddColumn(Columns.TimeOfApproval, typeof(DateTime), 0, 0, 0, false, false, false, null);
                schema.AddColumn(Columns.IsApproved, typeof(bool), 0, 0, 0, false, false, false, null);

                schema.AddIndex("pk_SupplierProduct_SupplierIdProductId", TableSchema.ClusterMode.None, TableSchema.IndexMode.PrimaryKey, TableSchema.IndexType.None, Columns.SupplierId, Columns.ProductId);
                schema.AddIndex("ix_SupplierProduct_SupplierId", TableSchema.ClusterMode.None, TableSchema.IndexMode.None, TableSchema.IndexType.None, Columns.SupplierId);
                schema.AddIndex("ix_SupplierProduct_ProductId", TableSchema.ClusterMode.None, TableSchema.IndexMode.None, TableSchema.IndexType.None, Columns.ProductId);

                schema.AddForeignKey("fk_SupplierProduct_AppSupplier", SupplierProduct.Columns.SupplierId, AppSupplier.TableSchema.SchemaName, AppSupplier.Columns.SupplierId, TableSchema.ForeignKeyReference.Cascade, TableSchema.ForeignKeyReference.Cascade);
                schema.AddForeignKey("fk_SupplierProduct_ProductId", SupplierProduct.Columns.ProductId, Product.TableSchema.SchemaName, Product.Columns.ProductId, TableSchema.ForeignKeyReference.Cascade, TableSchema.ForeignKeyReference.Cascade);

                _TableSchema = schema;
            }

            return(_TableSchema);
        }
Exemplo n.º 4
0
        public override TableSchema GetTableSchema()
        {
            if (null == _TableSchema)
            {
                TableSchema schema = new TableSchema();
                schema.SchemaName = @"bidmessage";
                schema.AddColumn(Columns.BidId, typeof(Int64), 0, 0, 0, false, true, false, null);
                schema.AddColumn(Columns.SupplierId, typeof(Int64), 0, 0, 0, false, true, false, null);
                schema.AddColumn(Columns.IsActive, typeof(bool), 0, 0, 0, false, false, false, null);
                schema.AddColumn(Columns.ExpirationTime, typeof(DateTime), 0, 0, 0, false, false, false, null);
                schema.AddColumn(Columns.MessageId, typeof(Int64), 0, 0, 0, false, true, false, null);
                schema.AddColumn(Columns.Stage, typeof(string), DataType.Char, 64, 0, 0, false, false, false, string.Empty);
                schema.AddColumn(Columns.SendingTime, typeof(DateTime), 0, 0, 0, false, false, false, null);
                schema.AddColumn(Columns.OriginalSupplierId, typeof(Int64), 0, 0, 0, false, false, false, null);


                schema.AddIndex("pk_MessageId", TableSchema.ClusterMode.None, TableSchema.IndexMode.PrimaryKey, TableSchema.IndexType.None, Columns.SupplierId, Columns.MessageId);
                schema.AddIndex("ix_BidMessage_IsActive", TableSchema.ClusterMode.None, TableSchema.IndexMode.None, TableSchema.IndexType.None, Columns.IsActive);
                schema.AddIndex("ix_BidMessage_ExpirationTime", TableSchema.ClusterMode.None, TableSchema.IndexMode.None, TableSchema.IndexType.None, Columns.ExpirationTime);
                schema.AddIndex("ix_BidMessage_SupplierId", TableSchema.ClusterMode.None, TableSchema.IndexMode.None, TableSchema.IndexType.None, Columns.SupplierId);

                schema.AddForeignKey("fk_Supplier_Message", Columns.SupplierId, AppSupplier.TableSchema.SchemaName, AppSupplier.Columns.SupplierId, TableSchema.ForeignKeyReference.Cascade, TableSchema.ForeignKeyReference.Cascade);
                schema.AddForeignKey("fk_Bid_Message", Columns.MessageId, Bid.TableSchema.SchemaName, Bid.Columns.BidId, TableSchema.ForeignKeyReference.Cascade, TableSchema.ForeignKeyReference.Cascade);

                _TableSchema = schema;
            }

            return(_TableSchema);
        }
Exemplo n.º 5
0
        public override TableSchema GetTableSchema()
        {
            if (null == _TableSchema)
            {
                TableSchema schema = new TableSchema();
                schema.SchemaName = @"promotedarea";
                schema.AddColumn(Columns.Id, typeof(int), 0, 0, 0, false, true, false, null);
                schema.AddColumn(Columns.Name, typeof(string), 0, 0, 0, false, false, false, null);

                _TableSchema = schema;
            }

            return(_TableSchema);
        }
Exemplo n.º 6
0
        public override TableSchema GetTableSchema()
        {
            if (null == _TableSchema)
            {
                TableSchema schema = new TableSchema();
                schema.SchemaName = @"Setting";
                schema.AddColumn(Columns.Key, typeof(string), DataType.Char, 64, 0, 0, false, true, false, null);
                schema.AddColumn(Columns.Value, typeof(string), DataType.Char, 255, 0, 0, false, false, false, null);

                _TableSchema = schema;
            }

            return(_TableSchema);
        }
Exemplo n.º 7
0
        public override TableSchema GetTableSchema()
        {
            if (null == _TableSchema)
            {
                TableSchema schema = new TableSchema();
                schema.SchemaName = @"AppUserCampaign";
                schema.AddColumn(Columns.AppUserCampaignId, typeof(Int64), 0, 0, 0, true, true, false, null);
                schema.AddColumn(Columns.AppUserId, typeof(Int64), 0, 0, 0, false, false, false, null);
                schema.AddColumn(Columns.CampaignId, typeof(Int64), 0, 0, 0, false, false, false, null);

                _TableSchema = schema;
            }

            return(_TableSchema);
        }
Exemplo n.º 8
0
        public override TableSchema GetTableSchema()
        {
            if (null == _TableSchema)
            {
                TableSchema schema = new TableSchema();
                schema.SchemaName = @"PriceFilter";
                schema.AddColumn(Columns.PriceId, typeof(Int64), 0, 0, 0, true, true, false, null);
                schema.AddColumn(Columns.PriceName, typeof(string), DataType.Char, 128, 0, 0, false, false, false, null);

                _TableSchema = schema;

                schema.AddIndex("ik_PriceFilter_PriceId", TableSchema.ClusterMode.None, TableSchema.IndexMode.None, TableSchema.IndexType.None, Columns.PriceId);
            }

            return(_TableSchema);
        }
        public DbSchema GetSchema()
        {
            var schema = new DbSchema();
            var map = _configuration.BuildMapping();
            var mappings = _configuration.ClassMappings;

            foreach(var class_map in mappings)
            {
                var table = class_map.Table;
                var table_schema = new TableSchema() {TableName = table.Name, SchemaName = table.Schema};
                foreach (var column in table.ColumnIterator)
                {

                    var type_code = column.GetSqlTypeCode(map);

                    var columnSchema = new ColumnSchema()
                                           {
                                               TableName = table_schema.TableName,
                                               ColumnName = column.Name,
                                               IsNullable = column.IsNullable,
                                               DatabaseType = type_code.DbType,
                                               Size = column.Length,
                                               Scale = column.Scale,
                                               Precision = column.Precision,
                                               IsPrimaryKey = table.PrimaryKey.Columns.Contains(column)
                                           };

                    // columnSchema.DatabaseType = property.GetSqlTypeCode(map).DbType;
                    table_schema.AddColumn(columnSchema);
                }
                schema.AddTable(table_schema);
            }
            return schema;
        }
Exemplo n.º 10
0
        public override TableSchema GetTableSchema()
        {
            if (null == _TableSchema)
            {
                TableSchema schema = new TableSchema();
                schema.SchemaName = @"Permission";
                schema.AddColumn(Columns.PermissionId, typeof(Int32), 0, 0, 0, true, true, false, null);
                schema.AddColumn(Columns.Key, typeof(string), DataType.Char, 64, 0, 0, false, false, false, null);

                _TableSchema = schema;

                schema.AddIndex("ix_Permission_Key", TableSchema.ClusterMode.None, TableSchema.IndexMode.Unique, TableSchema.IndexType.None, Columns.Key);
            }

            return(_TableSchema);
        }
Exemplo n.º 11
0
        public override TableSchema GetTableSchema()
        {
            if (null == _TableSchema)
            {
                TableSchema schema = new TableSchema();
                schema.SchemaName = @"Area";
                schema.AddColumn(Columns.AreaId, typeof(Int64), 0, 0, 0, true, true, false, null);
                schema.AddColumn(Columns.AreaName, typeof(string), DataType.Char, 64, 0, 0, false, false, false, null);

                _TableSchema = schema;

                schema.AddIndex("ix_Area_AreaId", TableSchema.ClusterMode.None, TableSchema.IndexMode.None, TableSchema.IndexType.None, Columns.AreaId);
            }

            return(_TableSchema);
        }
Exemplo n.º 12
0
        public override TableSchema GetTableSchema()
        {
            if (null == _TableSchema)
            {
                TableSchema schema = new TableSchema();
                schema.SchemaName = @"CartProduct";
                schema.AddColumn(Columns.CartId, typeof(int), 0, 0, 0, false, true, false, null);
                schema.AddColumn(Columns.ProductId, typeof(Int64), 0, 0, 0, false, true, false, null);
                schema.AddColumn(Columns.CartProductId, typeof(Int64), 0, 0, 0, true, false, false, null);
                schema.AddColumn(Columns.ProductAmount, typeof(int), 0, 0, 0, false, false, false, null);

                schema.AddForeignKey("appuser_id", Columns.ProductId, AppSupplier.TableSchema.SchemaName, Product.Columns.ProductId, TableSchema.ForeignKeyReference.Cascade, TableSchema.ForeignKeyReference.Cascade);
                _TableSchema = schema;
            }

            return(_TableSchema);
        }
Exemplo n.º 13
0
        public override TableSchema GetTableSchema()
        {
            if (null == _TableSchema)
            {
                TableSchema schema = new TableSchema();
                schema.SchemaName = @"Category";
                schema.AddColumn(Columns.CategoryId, typeof(Int64), 0, 0, 0, true, true, false, null);
                schema.AddColumn(Columns.CategoryName, typeof(string), 64, 0, 0, false, false, false, null);
                schema.AddColumn(Columns.CategoryImage, typeof(string), 255, 0, 0, false, false, false, string.Empty);
                schema.AddColumn(Columns.CategoryRate, typeof(Int64), 0, 0, 0, false, false, false, null);

                _TableSchema = schema;

                schema.AddIndex("ix_Category_CategoryName", TableSchema.ClusterMode.None, TableSchema.IndexMode.Unique, TableSchema.IndexType.None, Columns.CategoryName);
            }

            return(_TableSchema);
        }
Exemplo n.º 14
0
        public override TableSchema GetTableSchema()
        {
            if (null == _TableSchema)
            {
                TableSchema schema = new TableSchema();
                schema.SchemaName = @"Donation";
                schema.AddColumn(Columns.DonationId, typeof(Int64), 0, 0, 0, true, true, false, null);
                schema.AddColumn(Columns.DonationName, typeof(string), DataType.Char, 128, 0, 0, false, false, false, string.Empty);
                schema.AddColumn(Columns.DonationPrice, typeof(decimal), 0, 0, 0, false, false, false, 0);
                schema.AddColumn(Columns.DonationItem, typeof(string), DataType.Char, 128, 0, 0, false, false, false, string.Empty);

                _TableSchema = schema;

                schema.AddIndex("ix_Donation", TableSchema.ClusterMode.None, TableSchema.IndexMode.None, TableSchema.IndexType.None, Columns.DonationId);
            }

            return(_TableSchema);
        }
Exemplo n.º 15
0
        public override TableSchema GetTableSchema()
        {
            if (null == _TableSchema)
            {
                TableSchema schema = new TableSchema();
                schema.SchemaName = @"tbl_Message";
                schema.AddColumn(Columns.MessageId, typeof(Int64), 0, 0, 0, true, true, false, null);
                schema.AddColumn(Columns.Description, typeof(string), DataType.Char, 1000, 0, 0, false, false, false, string.Empty);
                schema.AddColumn(Columns.SendingDate, typeof(DateTime), 0, 0, 0, false, false, false, DateTime.Now);

                _TableSchema = schema;

                schema.AddIndex("ik_Message_Id", TableSchema.ClusterMode.None, TableSchema.IndexMode.None, TableSchema.IndexType.None, Columns.MessageId);
                schema.AddIndex("ix_Message_Date", TableSchema.ClusterMode.None, TableSchema.IndexMode.None, TableSchema.IndexType.None, Columns.SendingDate, SortDirection.ASC);
            }

            return(_TableSchema);
        }
Exemplo n.º 16
0
        public override TableSchema GetTableSchema()
        {
            if (null == _TableSchema)
            {
                TableSchema schema = new TableSchema();
                schema.SchemaName = @"TempAppUser";
                schema.AddColumn(Columns.TempAppUserId, typeof(Int64), 0, 0, 0, true, true, false, null);
                schema.AddColumn(Columns.CityId, typeof(Int64), 0, 0, 0, false, false, false, null);
                schema.AddColumn(Columns.Location, typeof(Geometry.Point), DataType.Point, 0, 0, 0, false, false, false, null);
                schema.AddColumn(Columns.DeviceUdid, typeof(string), DataType.Char, 255, 0, 0, false, false, false, null);

                _TableSchema = schema;

                schema.AddIndex("ix_TempAppUser", TableSchema.ClusterMode.None, TableSchema.IndexMode.None, TableSchema.IndexType.None, Columns.TempAppUserId);
            }

            return(_TableSchema);
        }
Exemplo n.º 17
0
        public override TableSchema GetTableSchema()
        {
            if (null == _TableSchema)
            {
                TableSchema schema = new TableSchema();
                schema.SchemaName = @"SubCategory";
                schema.AddColumn(Columns.SubCategoryId, typeof(Int64), 0, 0, 0, true, true, false, null);
                schema.AddColumn(Columns.SubCategoryName, typeof(string), DataType.Char, 64, 0, 0, false, false, false, null);
                schema.AddColumn(Columns.CategoryId, typeof(Int64), 0, 0, 0, false, false, false, null);
                schema.AddColumn(Columns.SubCategoryImage, typeof(string), DataType.Char, 255, 0, 0, false, false, false, string.Empty);
                schema.AddColumn(Columns.SubCategoryRate, typeof(Int64), 0, 0, 0, false, false, false, null);
                _TableSchema = schema;

                schema.AddForeignKey("fk_SubCategory_CategoryId", SubCategory.Columns.CategoryId, Category.TableSchema.SchemaName, Category.Columns.CategoryId, TableSchema.ForeignKeyReference.Cascade, TableSchema.ForeignKeyReference.Cascade);
            }

            return(_TableSchema);
        }
Exemplo n.º 18
0
        public override TableSchema GetTableSchema()
        {
            if (null == _TableSchema)
            {
                TableSchema schema = new TableSchema();
                schema.SchemaName = @"Service";
                schema.AddColumn(Columns.ServiceId, typeof(Int64), 0, 0, 0, true, true, false, null);
                schema.AddColumn(Columns.ServiceName, typeof(string), DataType.Char, 64, 0, 0, false, false, false, null);
                schema.AddColumn(Columns.ServiceComment, typeof(string), DataType.Char, 255, 0, 0, false, false, false, null);
                schema.AddColumn(Columns.IsHomeService, typeof(bool), 0, 0, 0, false, false, false, null);

                _TableSchema = schema;

                schema.AddIndex("ix_Service_ServiceName", TableSchema.ClusterMode.None, TableSchema.IndexMode.Unique, TableSchema.IndexType.None, Columns.ServiceName);
            }

            return(_TableSchema);
        }
Exemplo n.º 19
0
        public override TableSchema GetTableSchema()
        {
            if (null == _TableSchema)
            {
                TableSchema schema = new TableSchema();
                schema.SchemaName = @"supplierevent";
                schema.AddColumn(Columns.id, typeof(Int64), 0, 0, 0, true, true, false, null);
                schema.AddColumn(Columns.SupplierId, typeof(Int64), 0, 0, 0, false, false, false, null);
                schema.AddColumn(Columns.UserId, typeof(Int64), 0, 0, 0, false, false, true, null);
                schema.AddColumn(Columns.EventTime, typeof(DateTime), 0, 0, 0, false, false, false, DateTime.Now);
                schema.AddColumn(Columns.EventType, typeof(string), 0, 0, 0, false, false, false, null);

                schema.AddIndex("pk_SupplierEventId", TableSchema.ClusterMode.None, TableSchema.IndexMode.PrimaryKey, TableSchema.IndexType.None, Columns.id);
                _TableSchema = schema;
            }

            return(_TableSchema);
        }
Exemplo n.º 20
0
        public override TableSchema GetTableSchema()
        {
            if (null == _TableSchema)
            {
                TableSchema schema = new TableSchema();
                schema.SchemaName = @"SubFilter";
                schema.AddColumn(Columns.SubFilterId, typeof(Int64), 0, 0, 0, true, true, false, null);
                schema.AddColumn(Columns.SubFilterName, typeof(string), 64, 0, 0, false, false, false, null);
                schema.AddColumn(Columns.FilterId, typeof(Int64), 0, 0, 0, false, false, false, null);

                _TableSchema = schema;

                schema.AddIndex("ix_SubFilter_SubFilterName", TableSchema.ClusterMode.None, TableSchema.IndexMode.None, TableSchema.IndexType.None, Columns.SubFilterName);

                schema.AddForeignKey("fk_SubFilter_FilterId", SubFilter.Columns.FilterId, Filter.TableSchema.SchemaName, Filter.Columns.FilterId, TableSchema.ForeignKeyReference.Cascade, TableSchema.ForeignKeyReference.Cascade);
            }

            return(_TableSchema);
        }
        public override TableSchema GetTableSchema()
        {
            if (null == _TableSchema)
            {
                TableSchema schema = new TableSchema();
                schema.SchemaName = @"ProductYad2Category";
                schema.AddColumn(Columns.CategoryYad2Id, typeof(Int64), 0, 0, 0, false, false, false, null);
                schema.AddColumn(Columns.ProductId, typeof(Int64), 0, 0, 0, false, false, false, null);

                _TableSchema = schema;

                schema.AddIndex("pk_ProductYad2Category", TableSchema.ClusterMode.None, TableSchema.IndexMode.PrimaryKey, TableSchema.IndexType.None, Columns.CategoryYad2Id, Columns.ProductId);

                schema.AddForeignKey("fk_ProductYad2Category_ProductId", ProductYad2Category.Columns.ProductId, ProductYad2.TableSchema.SchemaName, ProductYad2.Columns.ProductId, TableSchema.ForeignKeyReference.Cascade, TableSchema.ForeignKeyReference.Cascade);
                schema.AddForeignKey("fk_ProductYad2Category_CategoryYad2Id", ProductYad2Category.Columns.CategoryYad2Id, CategoryYad2.TableSchema.SchemaName, CategoryYad2.Columns.CategoryYad2Id, TableSchema.ForeignKeyReference.Cascade, TableSchema.ForeignKeyReference.Cascade);
            }

            return(_TableSchema);
        }
Exemplo n.º 22
0
        protected override void BuildColumns(TableSchema ts)
        {
            DataView view = new DataView(columns);

            view.RowFilter = "table_name='" + ts.Name + "'";
            foreach (DataRowView dr in view)
            {
                ts.AddColumn(BuildColumn(dr));
            }
        }
        public override TableSchema GetTableSchema()
        {
            if (null == _TableSchema)
            {
                TableSchema schema = new TableSchema();
                schema.SchemaName = @"AppSupplierAPNSToken";
                schema.AddColumn(Columns.SupplierId, typeof(Int64), 0, 0, 0, false, false, false, null);
                schema.AddColumn(Columns.Token, typeof(string), DataType.Char, 64, 0, 0, false, false, false, null);

                _TableSchema = schema;

                schema.AddIndex("ix_AppSupplierAPNSToken_AppSupplierIdToken", TableSchema.ClusterMode.None, TableSchema.IndexMode.PrimaryKey, TableSchema.IndexType.None, Columns.SupplierId, Columns.Token);
                schema.AddIndex("ix_AppSupplierAPNSToken_AppSupplierId", TableSchema.ClusterMode.None, TableSchema.IndexMode.None, TableSchema.IndexType.None, Columns.SupplierId);
                schema.AddIndex("ix_AppSupplierAPNSToken_Token", TableSchema.ClusterMode.None, TableSchema.IndexMode.None, TableSchema.IndexType.None, Columns.Token);

                schema.AddForeignKey("fk_AppSupplierAPNSToken_AppSupplierId", AppSupplierAPNSToken.Columns.SupplierId, AppSupplier.TableSchema.SchemaName, AppSupplier.Columns.SupplierId, TableSchema.ForeignKeyReference.Cascade, TableSchema.ForeignKeyReference.Cascade);
            }

            return(_TableSchema);
        }
Exemplo n.º 24
0
        public override TableSchema GetTableSchema()
        {
            if (null == _TableSchema)
            {
                TableSchema schema = new TableSchema();
                schema.SchemaName = @"BidProduct";
                schema.AddColumn(Columns.BidId, typeof(Int64), 0, 0, 0, false, false, false, null);
                schema.AddColumn(Columns.ProductId, typeof(Int64), 0, 0, 0, false, false, false, null);
                schema.AddColumn(Columns.Amount, typeof(Int32), 0, 0, 0, false, false, false, 1);
                schema.AddColumn(Columns.Price, typeof(decimal), 0, 0, 0, false, false, false, null);

                _TableSchema = schema;

                schema.AddIndex("pk_BidProduct_BidId_ProductId", TableSchema.ClusterMode.None, TableSchema.IndexMode.None, TableSchema.IndexType.None);
                schema.AddIndex("ix_BidProduct_BidId", TableSchema.ClusterMode.None, TableSchema.IndexMode.None, TableSchema.IndexType.None, Columns.BidId);
                schema.AddIndex("ix_BidProduct_ProductId", TableSchema.ClusterMode.None, TableSchema.IndexMode.None, TableSchema.IndexType.None, Columns.ProductId);
            }

            return(_TableSchema);
        }
Exemplo n.º 25
0
        public override TableSchema GetTableSchema()
        {
            if (null == _TableSchema)
            {
                TableSchema schema = new TableSchema();
                schema.SchemaName = @"City";
                schema.AddColumn(Columns.CityId, typeof(Int64), 0, 0, 0, true, true, false, null);
                schema.AddColumn(Columns.CityName, typeof(string), DataType.Char, 64, 0, 0, false, false, false, null);
                schema.AddColumn(Columns.AreaId, typeof(Int64), 0, 0, 0, false, false, false, null);
                schema.AddColumn(Columns.PromotedAreaId, typeof(int), 0, 0, 0, false, false, false, null);

                _TableSchema = schema;

                schema.AddIndex("ix_City_CityId", TableSchema.ClusterMode.None, TableSchema.IndexMode.None, TableSchema.IndexType.None, Columns.CityId);

                schema.AddForeignKey("fk_City_AreaId", City.Columns.AreaId, Area.TableSchema.SchemaName, Area.Columns.AreaId, TableSchema.ForeignKeyReference.Cascade, TableSchema.ForeignKeyReference.Cascade);
            }

            return(_TableSchema);
        }
Exemplo n.º 26
0
        public override TableSchema GetTableSchema()
        {
            if (null == _TableSchema)
            {
                TableSchema schema = new TableSchema();
                schema.SchemaName = @"SupplierService";
                schema.AddColumn(Columns.ServiceId, typeof(Int64), 0, 0, 0, false, false, false, null);
                schema.AddColumn(Columns.SupplierId, typeof(Int64), 0, 0, 0, false, false, false, null);

                _TableSchema = schema;

                schema.AddIndex("pk_SupplierService", TableSchema.ClusterMode.None, TableSchema.IndexMode.PrimaryKey, TableSchema.IndexType.None, Columns.ServiceId, Columns.SupplierId);
                schema.AddIndex("ix_SupplierService_SupplierId", TableSchema.ClusterMode.None, TableSchema.IndexMode.None, TableSchema.IndexType.None, Columns.SupplierId);
                schema.AddIndex("ix_SupplierService_ServiceId", TableSchema.ClusterMode.None, TableSchema.IndexMode.None, TableSchema.IndexType.None, Columns.ServiceId);

                schema.AddForeignKey("fk_SupplierService_ServiceId", SupplierService.Columns.ServiceId, Service.TableSchema.SchemaName, Service.Columns.ServiceId, TableSchema.ForeignKeyReference.Cascade, TableSchema.ForeignKeyReference.Cascade);
                schema.AddForeignKey("fk_SupplierService_SupplierId", SupplierService.Columns.SupplierId, AppSupplier.TableSchema.SchemaName, AppSupplier.Columns.SupplierId, TableSchema.ForeignKeyReference.Cascade, TableSchema.ForeignKeyReference.Cascade);
            }

            return(_TableSchema);
        }
Exemplo n.º 27
0
        public override TableSchema GetTableSchema()
        {
            if (null == _TableSchema)
            {
                TableSchema schema = new TableSchema();
                schema.SchemaName = @"Offer";
                schema.AddColumn(Columns.OfferId, typeof(Int64), 0, 0, 0, true, true, false, null);
                schema.AddColumn(Columns.SupplierId, typeof(Int64), 0, 0, 0, false, false, false, null);
                schema.AddColumn(Columns.BidId, typeof(Int64), 0, 0, 0, false, false, false, null);
                schema.AddColumn(Columns.Gift, typeof(string), DataType.Char, 255, 0, 0, false, false, false, null);
                schema.AddColumn(Columns.Price, typeof(decimal), 0, 0, 0, false, false, false, 0);
                schema.AddColumn(Columns.CreateDate, typeof(DateTime), 0, 0, 0, false, false, false, DateTime.MinValue);

                _TableSchema = schema;

                schema.AddIndex("ix_Offer_OfferId", TableSchema.ClusterMode.None, TableSchema.IndexMode.None, TableSchema.IndexType.None, Columns.OfferId);
                schema.AddIndex("ix_Offer_BidId", TableSchema.ClusterMode.None, TableSchema.IndexMode.None, TableSchema.IndexType.None, Columns.BidId);
                schema.AddIndex("ix_Offer_SupplierId", TableSchema.ClusterMode.None, TableSchema.IndexMode.None, TableSchema.IndexType.None, Columns.SupplierId);

                schema.AddForeignKey("fk_Offer_BidId", Offer.Columns.BidId, Bid.TableSchema.SchemaName, Bid.Columns.BidId, TableSchema.ForeignKeyReference.Cascade, TableSchema.ForeignKeyReference.Cascade);
                schema.AddForeignKey("fk_Offer_SupplierId", Offer.Columns.SupplierId, AppSupplier.TableSchema.SchemaName, AppSupplier.Columns.SupplierId, TableSchema.ForeignKeyReference.Cascade, TableSchema.ForeignKeyReference.Cascade);
            }

            return(_TableSchema);
        }
Exemplo n.º 28
0
        public override TableSchema GetTableSchema()
        {
            if (null == _TableSchema)
            {
                TableSchema schema = new TableSchema();
                schema.SchemaName = @"UserAuthToken";
                schema.AddColumn(Columns.UserAuthTokenId, typeof(Int64), 0, 0, 0, true, true, false, null);
                schema.AddColumn(Columns.UserId, typeof(Int32), 0, 0, 0, false, false, false, null);
                schema.AddColumn(Columns.Secret, typeof(Guid), 0, 0, 0, false, false, false, null);
                schema.AddColumn(Columns.Key, typeof(string), DataType.Char, 128, 0, 0, false, false, false, null);
                schema.AddColumn(Columns.CreatedOn, typeof(DateTime), 0, 0, 0, false, false, false, DateTime.MinValue);
                schema.AddColumn(Columns.Expiry, typeof(DateTime), 0, 0, 0, false, false, false, DateTime.MinValue);

                _TableSchema = schema;

                schema.AddIndex("ix_UserAuthToken_SecretKey", TableSchema.ClusterMode.None, TableSchema.IndexMode.Unique, TableSchema.IndexType.None, Columns.Secret, Columns.Key);
                schema.AddIndex("ix_UserAuthToken_UserId", TableSchema.ClusterMode.None, TableSchema.IndexMode.None, TableSchema.IndexType.None, Columns.UserId);
                schema.AddIndex("ix_UserAuthToken_Expiry", TableSchema.ClusterMode.None, TableSchema.IndexMode.None, TableSchema.IndexType.None, Columns.Expiry, SortDirection.ASC);
                schema.AddIndex("ix_UserAuthToken_CreatedOn", TableSchema.ClusterMode.None, TableSchema.IndexMode.None, TableSchema.IndexType.None, Columns.CreatedOn, SortDirection.ASC);

                schema.AddForeignKey("fk_UserAuthToken_UserId", UserAuthToken.Columns.UserId, User.TableSchema.SchemaName, User.Columns.UserId, TableSchema.ForeignKeyReference.Cascade, TableSchema.ForeignKeyReference.Cascade);
            }

            return(_TableSchema);
        }
Exemplo n.º 29
0
        public override TableSchema GetTableSchema()
        {
            if (null == _TableSchema)
            {
                TableSchema schema = new TableSchema();
                schema.SchemaName = @"UserPermissionMap";
                schema.AddColumn(Columns.UserId, typeof(Int32), 0, 0, 0, false, false, false, null);
                schema.AddColumn(Columns.PermissionId, typeof(Int32), 0, 0, 0, false, false, false, null);

                _TableSchema = schema;

                schema.AddIndex("pk_UserPermissionMap_UserIdPermissionId", TableSchema.ClusterMode.None, TableSchema.IndexMode.PrimaryKey, TableSchema.IndexType.None, Columns.UserId, Columns.PermissionId);
                schema.AddIndex("ix_UserPermissionMap_UserId", TableSchema.ClusterMode.None, TableSchema.IndexMode.None, TableSchema.IndexType.None, Columns.UserId);
                schema.AddIndex("ix_UserPermissionMap_PermissionId", TableSchema.ClusterMode.None, TableSchema.IndexMode.None, TableSchema.IndexType.None, Columns.PermissionId);

                schema.AddForeignKey("fk_UserPermissionMap_UserId", UserPermissionMap.Columns.UserId, User.TableSchema.SchemaName, User.Columns.UserId, TableSchema.ForeignKeyReference.Cascade, TableSchema.ForeignKeyReference.Cascade);
                schema.AddForeignKey("fk_UserPermissionMap_PermissionId", UserPermissionMap.Columns.PermissionId, Permission.TableSchema.SchemaName, Permission.Columns.PermissionId, TableSchema.ForeignKeyReference.Cascade, TableSchema.ForeignKeyReference.Cascade);

            }

            return _TableSchema;
        }
Exemplo n.º 30
0
        public override TableSchema GetTableSchema()
        {
            if (null == _TableSchema)
            {
                TableSchema schema = new TableSchema();
                schema.SchemaName = @"WebErrorLog";
                schema.AddColumn(Columns.WebErrorLogId, typeof(Int64), 0, 0, 0, true, true, false, null);
                schema.AddColumn(Columns.Referrer, typeof(string), DataType.MediumText, 0, 0, 0, false, false, false, null);
                schema.AddColumn(Columns.Url, typeof(string), DataType.MediumText, 0, 0, 0, false, false, false, null);
                schema.AddColumn(Columns.StatusCode, typeof(Int32), 0, 0, 0, false, false, false, null);
                schema.AddColumn(Columns.UserId, typeof(Int32), 0, 0, 0, false, false, true, null);
                schema.AddColumn(Columns.UserEmail, typeof(string), DataType.Char, 64, 0, 0, false, false, true, null);
                schema.AddColumn(Columns.AccountId, typeof(Int32), 0, 0, 0, false, false, true, null);
                schema.AddColumn(Columns.AccountName, typeof(string), DataType.Char, 64, 0, 0, false, false, true, null);
                schema.AddColumn(Columns.When, typeof(DateTime), 0, 0, 0, false, false, false, DateTime.MinValue);
                schema.AddColumn(Columns.Exception, typeof(string), DataType.MediumText, 0, 0, 0, false, false, true, null);

                _TableSchema = schema;
            }

            return(_TableSchema);
        }
Exemplo n.º 31
0
        /// <summary>
        /// Builds the columns.
        /// </summary>
        /// <param name="ts">The ts.</param>
        protected virtual void BuildColumns(TableSchema ts)
        {
            DataTable dt = GetOleDbSchema(OleDbSchemaGuid.Columns, ts.Name, null, null, null);

            if (dt == null)
            {
                return;
            }

            foreach (DataRow dr in dt.Rows)
            {
                ts.AddColumn(BuildColumn(dr));
            }
        }