コード例 #1
0
 public static OrderBlob Create(int orderId)
 {
     return(new OrderBlob
     {
         Id = orderId,
         Customer =
             NorthwindFactory.Customer("ALFKI", "Alfreds Futterkiste", "Maria Anders", "Sales Representative",
                                       "Obere Str. 57", "Berlin", null, "12209", "Germany", "030-0074321", "030-0076545",
                                       null),
         Employee =
             NorthwindFactory.Employee(1, "Davolio", "Nancy", "Sales Representative", "Ms.",
                                       NorthwindData.ToDateTime("12/08/1948"), NorthwindData.ToDateTime("05/01/1992"),
                                       "507 - 20th Ave. E. Apt. 2A", "Seattle", "WA", "98122", "USA", "(206) 555-9857",
                                       "5467", null,
                                       "Education includes a BA in psychology from Colorado State University in 1970.  She also completed 'The Art of the Cold Call.'  Nancy is a member of Toastmasters International.",
                                       2, "http://accweb/emmployees/davolio.bmp"),
         OrderDate = NorthwindData.ToDateTime("7/4/1996"),
         RequiredDate = NorthwindData.ToDateTime("8/1/1996"),
         ShippedDate = NorthwindData.ToDateTime("7/16/1996"),
         ShipVia = 5,
         Freight = 32.38m,
         ShipName = "Vins et alcools Chevalier",
         ShipAddress = "59 rue de l'Abbaye",
         ShipCity = "Reims",
         ShipRegion = null,
         ShipPostalCode = "51100",
         ShipCountry = "France",
         OrderDetails = new List <OrderDetailBlob>
         {
             new OrderDetailBlob {
                 ProductId = 11, UnitPrice = 11, Quantity = 14, Discount = 0
             },
             new OrderDetailBlob {
                 ProductId = 42, UnitPrice = 9.8m, Quantity = 10, Discount = 0
             },
             new OrderDetailBlob {
                 ProductId = 72, UnitPrice = 34.8m, Quantity = 5, Discount = 0
             },
         },
         IntIds = new List <int> {
             10, 20, 30
         },
         CharMap = new Dictionary <int, string>
         {
             { 1, "A" },
             { 2, "B" },
             { 3, "C" },
         }
     });
 }
コード例 #2
0
        public static void LoadData(bool loadImages)
        {
            NorthwindData.LoadData(loadImages);

            Instance = new NorthwindDtoData {
                Categories            = NorthwindData.Categories.ConvertAll(x => ToCategoryDto(x)),
                Customers             = NorthwindData.Customers.ConvertAll(x => ToCustomerDto(x)),
                Employees             = NorthwindData.Employees.ConvertAll(x => ToEmployeeDto(x)),
                Shippers              = NorthwindData.Shippers.ConvertAll(x => ToShipperDto(x)),
                Suppliers             = NorthwindData.Suppliers.ConvertAll(x => ToSupplierDto(x)),
                Orders                = NorthwindData.Orders.ConvertAll(x => ToOrderDto(x)),
                Products              = NorthwindData.Products.ConvertAll(x => ToProduct(x)),
                OrderDetails          = NorthwindData.OrderDetails.ConvertAll(x => ToOrderDetailDto(x)),
                CustomerCustomerDemos = NorthwindData.CustomerCustomerDemos.ConvertAll(x => ToCustomerCustomerDemoDto(x)),
                Regions               = NorthwindData.Regions.ConvertAll(x => ToRegionDto(x)),
                Territories           = NorthwindData.Territories.ConvertAll(x => ToTerritoryDto(x)),
                EmployeeTerritories   = NorthwindData.EmployeeTerritories.ConvertAll(x => ToEmployeeTerritoryDto(x)),
            };
        }