Beispiel #1
0
        private void Save_Click(object sender, RoutedEventArgs e)
        {
            var emp = new Employee();

            emp.FirstName = FirstName.Text;
            emp.LastName  = LastName.Text;
            emp.Phone     = Phone.Text;
            emp.Job       = Job.Text;

            XMLActions.SaveEmployees(ConfigurationManager.AppSettings["employee"], emp);

            var main = new MainWindow();

            main.Show();
            Close();
        }
Beispiel #2
0
        private void DeleteEmp_Click(object sender, RoutedEventArgs e)
        {
            var res = MessageBox.Show("Czy na pewno chcesz usunąc pracownika?", "Usunąć?", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No);

            if (res == MessageBoxResult.Yes)
            {
                var emp = new Employee();
                emp.FirstName = "";
                emp.LastName  = "";
                emp.Job       = "";
                emp.Phone     = "";

                XMLActions.SaveEmployees(ConfigurationManager.AppSettings["employee"], emp);
                DataEmployee.Text = emp.ToString();
            }
        }