Пример #1
0
        public Product ProductSearching(string productName)
        {
            ProductClassesDataContext currectProduct = new ProductClassesDataContext();
            var product = currectProduct.GetTable <Product>()
                          .Where(pr => pr.Name == productName)
                          .FirstOrDefault();

            if (product != null)
            {
                return(product);
            }
            else
            {
                return(null);
            }
        }
Пример #2
0
        public static string ProductStatus(string productID)
        {
            ProductClassesDataContext currectProduct = new ProductClassesDataContext();
            var product = currectProduct.GetTable <Product>()
                          .Where(pr => pr.UNumber == productID)
                          .FirstOrDefault();

            if (product != null)
            {
                return("Product found!");
            }
            else
            {
                return("Product is not found!");
            }
        }