Пример #1
0
 public static SupplyItem Supply(Supply supply)
 {
     var result = new SupplyItem
                  {
                      Id = supply.SupplierId.ToString(),
                      City = supply.City,
                      CountryCode = supply.CountryCode,
                      CreateDate = supply.CreateDate,
                      FlatNumber = supply.FlatNumber,
                      HouseNumber = supply.HouseNumber,
                      Positions = ObjectMapper.Position(supply.Positions.ToList()),
                      PostalCode = supply.PostalCode,
                      Street = supply.Street,
                      SupplierId = supply.SupplierId,
                      SupplyNumber = supply.SupplyNumber,
                      SupplyStatus = supply.SupplyStatus
                  };
     return result;
 }
Пример #2
0
        public static void CreateSupply()
        {
            var radOrder = new Random(DateTime.Now.Millisecond);
            var supply = new Supply
                         {
                             City = "Sławno",
                             SupplyNumber = String.Format("{0}/{1}/{2}", radOrder.Next(10, 99), radOrder.Next(10, 99), radOrder.Next(1000, 9999)),
                             SupplierId = radOrder.Next(1, 10),
                             CountryCode = "PL",
                             HouseNumber = "10",
                             SupplyStatus = eSupplyStatus.New,
                             PostalCode = "76-100",
                             CreateDate = DateTime.Now.AddDays(radOrder.Next(10)),
                             Street = "Warszkowo",
                             Positions = CreateSupplyPosition(),

                         };
            var item = SupplyService.AddSupply(supply);
        }