Esempio n. 1
0
        public void delete()
        {
            XmlDb    xmlDb            = new XmlDb(xmlPath);
            XElement employeeToDelete = getXElementFromEmployee();

            xmlDb.deleteElement(employeeToDelete);
        }
Esempio n. 2
0
        public void add()
        {
            XElement empElem = getXElementFromEmployee();
            XmlDb    xmlDb   = new XmlDb(xmlPath);

            xmlDb.addElement(empElem);
        }
Esempio n. 3
0
        public void edit()
        {
            XmlDb    xmlDb = new XmlDb(xmlPath);
            XElement positionBeforeEdit = xmlDb.getElement("Position", "Id", Id.ToString());
            XElement positionAfterEdit  = getXElementFromPosition();

            xmlDb.editElement(positionBeforeEdit, positionAfterEdit);
        }
Esempio n. 4
0
        public void edit()
        {
            XmlDb    xmlDb = new XmlDb(xmlPath);
            XElement employeeBeforeEdit = xmlDb.getElement("Employee", "Id", Id.ToString());
            XElement employeeAfterEdit  = getXElementFromEmployee();

            xmlDb.editElement(employeeBeforeEdit, employeeAfterEdit);
        }
Esempio n. 5
0
        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);
        }
Esempio n. 6
0
        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);
        }
Esempio n. 7
0
        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);
        }
Esempio n. 8
0
 public void delete()
 {
     XmlDb    xmlDb            = new XmlDb(xmlPath);
     XElement positionToDelete = getXElementFromPosition();
 }
Esempio n. 9
0
        public int getId()
        {
            XmlDb xmlDb = new XmlDb(xmlPath);

            return(xmlDb.getId());
        }