Esempio n. 1
0
        public ProductWCF[] getAllProducts()
        {
            List <Product>    allProductsList = ProductDAO.selectAllProductList();
            List <ProductWCF> productWCFList  = new List <ProductWCF>();

            foreach (Product p in allProductsList)
            {
                ProductWCF pwcf = new ProductWCF();
                pwcf.ItemNumber             = p.ItemNumber;
                pwcf.Description            = p.Description;
                pwcf.Category               = p.Category;
                pwcf.ReorderLevel           = p.ReorderLevel != null ? (int)p.ReorderLevel : 0;
                pwcf.ReorderQuantity        = p.ReorderQuantity != null ? (int)p.ReorderQuantity : 0;
                pwcf.UnitofMeasure          = p.UnitOfMeasure;
                pwcf.Bin                    = p.Bin != null ? (int)p.Bin : 0;
                pwcf.Supplier1ID            = p.Supplier1ID;
                pwcf.Supplier2ID            = p.Supplier2ID;
                pwcf.Supplier3ID            = p.Supplier3ID;
                pwcf.AdjustmentVoucherPrice = p.AdjustmentVoucherPrice != null ? (double)p.AdjustmentVoucherPrice : 0.0;
                pwcf.Stock                  = p.Stock.TotalInventoryBalance != null ? (int)p.Stock.TotalInventoryBalance : 0;

                pwcf.ConsolidatedListID     = 0;
                pwcf.ActualQuantityAccepted = 0;
                pwcf.QuantityRequested      = 0;

                productWCFList.Add(pwcf);
            }

            return(productWCFList.ToArray <ProductWCF>());
        }