示例#1
0
 private OrderViewModel GetOrderVM(int i) {
     var shipcountry = ShipCountry[r.Next(5)];
     var shipcitycoll = ShipCity[shipcountry];
     var vm = new OrderViewModel();
     if (i % 3 == 0) {
         vm.IsClosed = true;
     }
     vm.CustomerId = GetCustomerId(i);
     vm.OrderId = i;
     vm.OrderDate = new DateTime(r.Next(2011, 2013), r.Next(1, 12), r.Next(1, 28));
     vm.Quantity = r.Next(20, 60);
     vm.UnitPrice = unitPrice[r.Next(35)];
     vm.Freight = Math.Round(r.Next(1000) + r.NextDouble(), 2);
     vm.Discount = ((r.Next(20, 40)));
     vm.ShipCountry = shipcountry;
     vm.ShipPostalCode = shipPostalCode[r.Next(shipPostalCode.Count() - 1)];
     vm.ShipCity = shipcitycoll[r.Next(shipcitycoll.Length - 1)];
     vm.ShipDate = new DateTime(r.Next(2012, 2014), r.Next(1, 12), r.Next(1, 28));
     vm.Expense = cost.Next(2000, 4000);
     vm.EmployeeId = "" + arr[r.Next(5)] + arr[r.Next(5)] + arr[r.Next(5)] + r.Next(100, 200);
     return vm;
 }
示例#2
0
 private OrderViewModel GetComplexPropertiesOrderInfo() {
     OrderViewModel ord = new OrderViewModel();
     if (discount > 25)
         discount = 5;
     ord.Discount = discount + 3;
     ord.Expense = (discount * discount) + 100;
     ord.Quantity = discount + 65;
     discount++;
     return ord;
 }