public static void Init(XmsDbContext context)
        {
            List <TbCurrencyRate> list = new List <TbCurrencyRate>()
            {
                new TbCurrencyRate()
                {
                    Id = 1, IsEnabled = true, BeginDate = DateTime.Now, EndDate = DateTime.Now, Code = "GBP", Name = "英镑", Rate = 8.9000, CreateTime = DateTime.Now, ModifyTime = DateTime.Now
                },
                new TbCurrencyRate()
                {
                    Id = 2, IsEnabled = true, BeginDate = DateTime.Now, EndDate = DateTime.Now, Code = "HKD", Name = "港币", Rate = 0.8000, CreateTime = DateTime.Now, ModifyTime = DateTime.Now
                },
                new TbCurrencyRate()
                {
                    Id = 3, IsEnabled = true, BeginDate = DateTime.Now, EndDate = DateTime.Now, Code = "RMB", Name = "人民币", Rate = 1.0000, CreateTime = DateTime.Now, ModifyTime = DateTime.Now
                },
                new TbCurrencyRate()
                {
                    Id = 4, IsEnabled = true, BeginDate = DateTime.Now, EndDate = DateTime.Now, Code = "RUB", Name = "俄罗斯卢布", Rate = 0.1000, CreateTime = DateTime.Now, ModifyTime = DateTime.Now
                },
                new TbCurrencyRate()
                {
                    Id = 5, IsEnabled = true, BeginDate = DateTime.Now, EndDate = DateTime.Now, Code = "SGD", Name = "新加坡元", Rate = 4.8000, CreateTime = DateTime.Now, ModifyTime = DateTime.Now
                },
                new TbCurrencyRate()
                {
                    Id = 6, IsEnabled = true, BeginDate = DateTime.Now, EndDate = DateTime.Now, Code = "USD", Name = "美元", Rate = 6.5000, CreateTime = DateTime.Now, ModifyTime = DateTime.Now
                },
            };

            list.ForEach(tmp => context.CurrencyRates.Add(tmp));
            context.SaveChanges();
        }
        public static void Init(XmsDbContext context)
        {
            //context.Database.ExecuteSqlCommand("ALTER TABLE [dbo].[DistributionCenter] DROP CONSTRAINT [FK_dbo.DistributionCenter_dbo.DistributionCenter_ParentId]");
            List <TbDistributionCenter> list = new List <TbDistributionCenter>();
            int lastId = 1;

            list.AddRange(InitType1(lastId, out lastId));
            list.ForEach(tmp => context.DistributionCenters.Add(tmp));
            context.SaveChanges();
        }
        public static void Init(XmsDbContext context)
        {
            context.Database.ExecuteSqlCommand("ALTER TABLE [dbo].[TbDataDictionary] DROP CONSTRAINT [FK_dbo.TbDataDictionary_dbo.TbDataDictionary_ParentId]");
            List <TbDataDictionary> list = new List <TbDataDictionary>();
            int lastId = 1;

            list.AddRange(InitType1(lastId, out lastId));
            list.ForEach(tmp => context.DataDictionarys.Add(tmp));
            context.SaveChanges();
        }
Exemple #4
0
        public static void Init(XmsDbContext context)
        {
            List <TbChannel> list = new List <TbChannel>()
            {
                new TbChannel()
                {
                    Id = 1, Name = "渠道A"
                },
                new TbChannel()
                {
                    Id = 2, Name = "渠道B"
                },
                new TbChannel()
                {
                    Id = 3, Name = "渠道C"
                },
                new TbChannel()
                {
                    Id = 4, Name = "渠道D"
                },
                new TbChannel()
                {
                    Id = 5, Name = "渠道E"
                },
                new TbChannel()
                {
                    Id = 6, Name = "渠道F"
                },
                new TbChannel()
                {
                    Id = 7, Name = "渠道G"
                },
            };

            list.ForEach(tmp => context.Channels.Add(tmp));
            context.SaveChanges();
        }
Exemple #5
0
        public static void Init(XmsDbContext context)
        {
            List <TbIncidentalPrice> list = new List <TbIncidentalPrice>()
            {
                new TbIncidentalPrice()
                {
                    Id = 1, GoodsType = GoodsType.Bag, UnitCode = "KG", UnitNumber = 1.0, UnitValue = 2.5000, Name = "Z2", BeginTime = DateTime.Now, EndTime = DateTime.Now
                },
                new TbIncidentalPrice()
                {
                    Id = 2, GoodsType = GoodsType.Bag, UnitCode = "BS", UnitNumber = 1.0, UnitValue = 10.0000, Name = "Z3", BeginTime = DateTime.Now, EndTime = DateTime.Now
                },
                new TbIncidentalPrice()
                {
                    Id = 3, GoodsType = GoodsType.Bag, UnitCode = "BS", UnitNumber = 1.0, UnitValue = 0.0000, Name = "Z4", BeginTime = DateTime.Now, EndTime = DateTime.Now
                },
                new TbIncidentalPrice()
                {
                    Id = 4, GoodsType = GoodsType.Bag, UnitCode = "BS", UnitNumber = 1.0, UnitValue = 0.0000, Name = "Z5", BeginTime = DateTime.Now, EndTime = DateTime.Now
                },
                new TbIncidentalPrice()
                {
                    Id = 5, GoodsType = GoodsType.Bag, UnitCode = "BS", UnitNumber = 1.0, UnitValue = 0.0000, Name = "Z6", BeginTime = DateTime.Now, EndTime = DateTime.Now
                },
                new TbIncidentalPrice()
                {
                    Id = 6, GoodsType = GoodsType.Bag, UnitCode = "BS", UnitNumber = 1.0, UnitValue = 10.0000, Name = "Z7", BeginTime = DateTime.Now, EndTime = DateTime.Now
                },
                new TbIncidentalPrice()
                {
                    Id = 7, GoodsType = GoodsType.Bag, UnitCode = "BS", UnitNumber = 1.0, UnitValue = 20.0000, Name = "Z8", BeginTime = DateTime.Now, EndTime = DateTime.Now
                },
                new TbIncidentalPrice()
                {
                    Id = 8, GoodsType = GoodsType.Bag, UnitCode = "BS", UnitNumber = 1.0, UnitValue = 50.0000, Name = "P2", BeginTime = DateTime.Now, EndTime = DateTime.Now
                },
                new TbIncidentalPrice()
                {
                    Id = 9, GoodsType = GoodsType.Bag, UnitCode = "DP", UnitNumber = 1.0, UnitValue = 0.0300, Name = "E4", BeginTime = DateTime.Now, EndTime = DateTime.Now
                },
                new TbIncidentalPrice()
                {
                    Id = 10, GoodsType = GoodsType.Bag, UnitCode = "DP", UnitNumber = 1.0, UnitValue = 0.0300, Name = "H7", BeginTime = DateTime.Now, EndTime = DateTime.Now
                },
                new TbIncidentalPrice()
                {
                    Id = 11, GoodsType = GoodsType.Bag, UnitCode = "BS", UnitNumber = 1.0, UnitValue = 0.0000, Name = "Y6", BeginTime = DateTime.Now, EndTime = DateTime.Now
                },
                new TbIncidentalPrice()
                {
                    Id = 12, GoodsType = GoodsType.Bag, UnitCode = "BS", UnitNumber = 1.0, UnitValue = 0.0000, Name = "Y7", BeginTime = DateTime.Now, EndTime = DateTime.Now
                },
                new TbIncidentalPrice()
                {
                    Id = 13, GoodsType = GoodsType.Bag, UnitCode = "BS", UnitNumber = 1.0, UnitValue = 0.0000, Name = "Y5", BeginTime = DateTime.Now, EndTime = DateTime.Now
                },
            };

            list.ForEach(tmp => context.IncidentalPrices.Add(tmp));
            context.SaveChanges();
        }