private void Delete_Employee(object sender, MouseButtonEventArgs e) { EmployeesContainer employees = EmployeesContainer.Instance; employees.Remove(_employee.EGN); this.Close(); }
private void buttonSave_Click(object sender, RoutedEventArgs e) { XElement dataNode = new XElement("Data"); StudentsContainer students = StudentsContainer.Instance; XElement studentsNode = new XElement("ListOfStudents"); foreach (var student in students.StudentList) { studentsNode.Add(student.toXML()); } dataNode.Add(new XComment("Students")); dataNode.Add(studentsNode); EmployeesContainer employees = EmployeesContainer.Instance; XElement employeesNode = new XElement("ListOfEmployees"); foreach (var student in employees.EmployeesList) { employeesNode.Add(student.toXML()); } dataNode.Add(new XComment("Employees")); dataNode.Add(employeesNode); XmlDocument XMLFile = new XmlDocument(); XMLFile.LoadXml(dataNode.ToString()); // ulgy, I had not time to find the right use of the class XMLFile.Save(Utils.Constants.FILENAME); }
public CreateEmployee(EmployeesContainer container) { InitializeComponent(); _employeeContainer = container; List <Position> allPositions = new List <Position>(); foreach (Position position in (Position[])Enum.GetValues(typeof(Position))) { allPositions.Add(position); } positionComboBox.ItemsSource = allPositions; positionComboBox.SelectedIndex = 1; List <ContractType> allContractTypes = new List <ContractType>(); foreach (ContractType type in (ContractType[])Enum.GetValues(typeof(ContractType))) { allContractTypes.Add(type); } contractTypeComboBox.ItemsSource = allContractTypes; contractTypeComboBox.SelectedIndex = 1; }