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

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

            xmlDb.addElement(empElem);
        }
Exemplo 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);
        }
Exemplo 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);
        }
Exemplo 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);
        }
Exemplo 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);
        }
Exemplo 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);
        }
Exemplo n.º 8
0
 public void delete()
 {
     XmlDb    xmlDb            = new XmlDb(xmlPath);
     XElement positionToDelete = getXElementFromPosition();
 }
Exemplo n.º 9
0
        public int getId()
        {
            XmlDb xmlDb = new XmlDb(xmlPath);

            return(xmlDb.getId());
        }