Esempio n. 1
0
        public ProductWCF getProductFromName(string pname)
        {
            List <ProductWCF> pppl  = new List <ProductWCF>();
            List <Product>    plist = new List <Product>();

            plist.Add(ProductDAO.gethProductbyName(pname));
            foreach (Product p in plist)
            {
                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;

                pppl.Add(pwcf);
            }
            return(pppl[0]);
        }