Exemple #1
0
 public static Position Position(SupplyPosition pos)
 {
     var repo = new ProductRepository();
     var result = new Position
     {
         Lp = pos.Lp,
         Count = pos.Count,
         Product = repo.GetById(pos.ProductId.Id.ToString())
     };
     return result;
 }
Exemple #2
0
        public static List<SupplyPosition> CreateSupplyPosition()
        {
            var productRepository = new ProductRepository();
            var products = productRepository.GetItemsList().ToList();
            var radProduct = new Random(DateTime.Now.Millisecond);
            var productCount = radProduct.Next(1, 10);
            var result = new List<SupplyPosition>();

            for (int i = 0; i <= productCount; i++)
            {
                var j = radProduct.Next(products.Count());
                var item = new SupplyPosition(i + 1, products[j].Id.ToString(), radProduct.Next(10, 100));
                result.Add(item);
            }
            return result;
        }