static void Main(string[] args) { Console.WriteLine("ID: "); int id = Int32.Parse(Console.ReadLine()); // Take a Category ID and name CategoryClient client = new CategoryClient(); client.Open(); Console.WriteLine(client.GetCategoryID(id)); Console.WriteLine("\r\n"); Console.WriteLine(client.GetCategoryName(id)); client.Close(); ProductsClient productClient = new ProductsClient(); productClient.Open(); Console.WriteLine(productClient.GetCategoryName(id)); Console.WriteLine("\r\n"); Console.WriteLine(productClient.GetProductName(id)); Console.WriteLine("\r\n"); Console.WriteLine(productClient.GetProductQty(id)); Console.WriteLine("\r\n"); Console.WriteLine(productClient.GetCategoryID(id)); productClient.Close(); Console.ReadKey(); }
private void Form1_Load(object sender, EventArgs e) { int id = 1; CategoryClient client = new CategoryClient(); client.Open(); txtCategoryID.Text = client.GetCategoryID(id).ToString(); txtCategoryName.Text = client.GetCategoryName(id); client.Close(); ProductsClient productClient = new ProductsClient(); productClient.Open(); txtProductID.Text = id.ToString(); txtProductName.Text = productClient.GetProductName(id).ToString(); txtProductCategoryID.Text = productClient.GetCategoryID(id).ToString(); txtProductCategoryName.Text = productClient.GetCategoryName(id).ToString(); txtProductQty.Text = productClient.GetProductQty(id).ToString(); productClient.Close(); }