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); } }
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!"); } }