static void Main(string[] args) { var client = new AgeCalculatorServiceClient(); Console.WriteLine("Mata in ditt födelsedatum. (YYYY-MM-DD)"); var birthdate = DateTime.Parse(Console.ReadLine()); Console.WriteLine("Du är {0} dagar gammal.", client.CalculateAgedays(birthdate)); Console.WriteLine("Du fyller jämt antal tusen dagar på datumet: {0}",client.CalculateEvenBirthday(birthdate) ); Console.ReadKey(); }
static void Main(string[] args) { var client = new AgeCalculatorServiceClient(); Console.WriteLine("Mata in ditt födelsedatum. (YYYY-MM-DD)"); var birthdate = DateTime.Parse(Console.ReadLine()); Console.WriteLine("Du är {0} dagar gammal.", client.CalculateAgedays(birthdate)); Console.WriteLine("Du fyller jämt antal tusen dagar på datumet: {0}", client.CalculateEvenBirthday(birthdate)); Console.ReadKey(); }
protected void Button1_Click(object sender, EventArgs e) { var client = new AgeCalculatorServiceClient(); var birthdate = DateTime.Parse(TextBox1.Text); var daysOld = client.CalculateAgedays(birthdate); var even1KDays = client.CalculateEvenBirthday(birthdate); Label1.Text = daysOld.ToString(); TextBox2.Text = even1KDays; }