private void btnSave_Click(object sender, RoutedEventArgs e) { string ename, title, position, gender = " "; double salary; ename = txtEmpName.Text; title = txtTitle.Text; position = txtPosition.Text; salary = double.Parse(txtSalary.Text); if (rdoFemale.IsChecked == true) { gender = "Female"; } else if (rdoMale.IsChecked == true) { gender = "Male"; } //create object of type employee employee em = new employee(); em.addEmployee(ename, title, position, gender, salary); MessageBox.Show("Records saved"); }