using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace HRApplication
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            //TODO: 1.宣告變數
            decimal salary, actualSalary;
            string name;
            DateTime hireDate;
            decimal taxRate = 0.1;

            //TODO: 2.指定變數值
            salary = txtBaseSalary.Text;
            name = txtName.Text;
            hireDate = txtHireDate.Text;


            //TODO: 3.使用變數
            //實領薪 = 月薪 - 稅額 (月薪 * 稅率)
            actualSalary = salary - (salary * taxRate);
            txtResult.Text = name + "於" + hireDate +
                    "到職, 本月實領薪資為" + actualSalary;
        }
    }
}
