コード例 #1
0
        public void CreateDatabaseSchemaTest()
        {
            ProductModel    product     = new ProductModel();
            StockLevelModel stockLevel1 = new StockLevelModel();

            stockLevel1.Amount = 10;
            stockLevel1.Products.Add(product);
            product.ProductName = "可口可乐";
            product.UnitName    = "瓶子";
            product.StockLevels.Add(stockLevel1);
            productService.Add(product);
            stockLevelService.Add(stockLevel1);

            WarehouseModel warehouse = new WarehouseModel();

            warehouse.Address = "chengdu shi";
            warehouse.StockLevels.Add(stockLevel1);
            stockLevel1.Warehouses.Add(warehouse);

            warehouseService.Add(warehouse);

            IList <string> productNames = productService.GetAllProductNames();

            Console.WriteLine(productNames);

            DistributorModel distributor = new DistributorModel();

            distributor.Name    = "黄凯";
            distributor.Address = "贵州";

            distributorService.Add(distributor);

            IList <string> distributorNames = distributorService.GetAllDistributorNames();

            Console.WriteLine(distributorNames);
        }