/// <summary> /// calculate the payment and other things /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Calculate_payment(object sender, RoutedEventArgs e) { try { contract = bl.CheckContract(contract, mother, nanny, bl.getChild(contract.id_child)); this.payment.Text = contract.payment.ToString(); name_childTextBox.Text = contract.name_child; dateOfBirthing.Text = contract.dateOfBirth.ToLongDateString(); this.DataContext = contract; } catch (Exception ex) { MessageBox.Show(ex.Message); } }