private void button1_Click(object sender, EventArgs e) { var proxy = new AgeCheckerClient(); AgeInDaysLabel.Text = proxy.AgeInDays(DateTime.Parse(DateBox.Text)).ToString(); AgeInHoursLabel.Text = proxy.AgeInHours(DateTime.Parse(DateBox.Text)).ToString(); AgeInYearsLabel.Text = proxy.AgeInYears(DateTime.Parse(DateBox.Text)).ToString(); }
static void Main(string[] args) { Console.WriteLine("Provide your date of birth in a yyyy/mm/dd format:"); var result = Console.ReadLine(); var proxy = new AgeCheckerClient(); var ageInDays = proxy.AgeInDays(DateTime.Parse(result)); var ageInHours = proxy.AgeInHours(DateTime.Parse(result)); var age = proxy.AgeInYears(DateTime.Parse(result)); Console.WriteLine($"Your age in days: {ageInDays}"); Console.WriteLine($"Your age in Hours: {ageInHours}"); Console.WriteLine($"Your age this year: {age}"); Console.ReadKey(); }