public void delete() { XmlDb xmlDb = new XmlDb(xmlPath); XElement employeeToDelete = getXElementFromEmployee(); xmlDb.deleteElement(employeeToDelete); }
public void add() { XElement empElem = getXElementFromEmployee(); XmlDb xmlDb = new XmlDb(xmlPath); xmlDb.addElement(empElem); }
public void edit() { XmlDb xmlDb = new XmlDb(xmlPath); XElement positionBeforeEdit = xmlDb.getElement("Position", "Id", Id.ToString()); XElement positionAfterEdit = getXElementFromPosition(); xmlDb.editElement(positionBeforeEdit, positionAfterEdit); }
public void edit() { XmlDb xmlDb = new XmlDb(xmlPath); XElement employeeBeforeEdit = xmlDb.getElement("Employee", "Id", Id.ToString()); XElement employeeAfterEdit = getXElementFromEmployee(); xmlDb.editElement(employeeBeforeEdit, employeeAfterEdit); }
public void add() { XElement posElem = new XElement("Position"); XAttribute id = new XAttribute("Id", Id); XAttribute name = new XAttribute("Name", Name); posElem.Add(id, name); XmlDb xmlDb = new XmlDb(xmlPath); xmlDb.addElement(posElem); }
public List <Position> getPositions() { XmlDb xmlDb = new XmlDb(xmlPath); List <XElement> xElems = xmlDb.getElements(); List <Position> positionsList = new List <Position>(); foreach (XElement xElem in xElems) { Position pos = getPositionFromXElem(xElem); positionsList.Add(pos); } return(positionsList); }
public List <Employee> getEmployees() { XmlDb xmlDb = new XmlDb(xmlPath); List <XElement> xElems = xmlDb.getElements(); List <Employee> employeesList = new List <Employee>(); foreach (XElement xElem in xElems) { Employee emp = getEmployeeFromXElem(xElem); employeesList.Add(emp); } return(employeesList); }
public void delete() { XmlDb xmlDb = new XmlDb(xmlPath); XElement positionToDelete = getXElementFromPosition(); }
public int getId() { XmlDb xmlDb = new XmlDb(xmlPath); return(xmlDb.getId()); }