using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ConsumeWCFService
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            //---tworzenie obiektu klasy usługi---
            ServiceReference1.Service1Client client =
                new ConsumeWCFService.ServiceReference1.Service1Client();

            //---tworzenie obiektu klasy Contact---
            ServiceReference1.Contact c =
                new ConsumeWCFService.ServiceReference1.Contact()
                {
                    Name = "Wei-Meng Lee",
                    YearofBirth = 1990
                };

            //---wywołanie usługi i wyświetlenie wyniku---
            MessageBox.Show(client.getAge(c).ToString());

            //---zamknięcie klienta---
            client.Close();

        }
    }
}
