Example #1
0
        public Productview GetProductById(int id)
        {
            ProductLogic productLogic = productManagerLogic.GetProductById(id);

            if (productLogic == null)
            {
                return(null);
            }
            Productview productView = new Productview
            {
                productId          = productLogic.productId,
                productName        = productLogic.productName,
                productDescription = productLogic.productDescription,
                quantity           = productLogic.quantity,
                productPrice       = productLogic.productPrice,
                productCategory    = productLogic.productCategory
            };

            return(productView);
        }
Example #2
0
        private List <Productview> ConvertToProductview(List <ProductLogic> productsLogic)
        {
            List <Productview> productsView = new List <Productview>();

            foreach (var productLogic in productsLogic)
            {
                Productview productview = new Productview
                {
                    productId          = productLogic.productId,
                    productName        = productLogic.productName,
                    productDescription = productLogic.productDescription,
                    quantity           = productLogic.quantity,
                    productPrice       = productLogic.productPrice,
                    companyID          = company.companyID,
                    productCategory    = productLogic.productCategory
                };
                productsView.Add(productview);
            }

            return(productsView);
        }