public void SaveToNode(XmlNode projectNode) { XmlNodeHelper.SetNodeAttributeI(projectNode, XMLNodeAttributeID, this.ProjectID); XmlNodeHelper.SetNodeAttribute(projectNode, XMLProjectAttributeName, this.Name); XmlNodeHelper.SetNodeAttribute(projectNode, XMLProjectAttributeDateAgreement, this.DateAgreement.ToString(DateFormat)); XmlNodeHelper.SetNodeAttributeF(projectNode, XMLProjectAttributeCost, this.Cost); XmlNodeHelper.SetNodeAttribute(projectNode, XMLProjectAttributeStatus, this.Status.ToString()); XmlNodeHelper.SetNodeAttribute(projectNode, XMLProjectAttributeCustomer, this.CustomerID.ToString()); for (int i = 0; i < this.EmployeesID.Count; i++) { XmlNode projectEmployeeNode = XmlNodeHelper.RequiredNode(projectNode, Project.XMLNodeEmployee, Project.XmlAttributeEmployeeID, this.EmployeesID[i].ToString()); } XmlNodeList xmlProjectList = projectNode.SelectNodes(Project.XMLNodeEmployee); foreach (XmlNode node in xmlProjectList) { int employeeInProjectId = XmlNodeHelper.GetNodeAttributeI(node, Project.XmlAttributeEmployeeID); if (this.EmployeesID.IndexOf(employeeInProjectId) < 0) { node.ParentNode.RemoveChild(node); } } }
public void SaveToNode(XmlNode customerNode) { XmlNodeHelper.SetNodeAttributeI(customerNode, XMLCustomerAttributeID, this.CustomerID); XmlNodeHelper.SetNodeAttribute(customerNode, XMLCustomerAttributeName, this.Name); XmlNodeHelper.SetNodeAttribute(customerNode, XMLCustomerAttributeSurname, this.Surname); XmlNodeHelper.SetNodeAttribute(customerNode, XMLCustomerAttributeCountry, this.Country); XmlNodeHelper.SetNodeAttribute(customerNode, XMLCustomerAttributeDateAgreement, this.DateOfAgreement.ToString(DateFormat)); }
public void SaveToNode(XmlNode employeeNode) { XmlNodeHelper.SetNodeAttributeI(employeeNode, XMLEmployeeAttributeID, this.EmployeeID); XmlNodeHelper.SetNodeAttribute(employeeNode, XMLEmployeeAttributeName, this.Name); XmlNodeHelper.SetNodeAttribute(employeeNode, XMLEmployeeAttributeSurname, this.Surname); XmlNodeHelper.SetNodeAttribute(employeeNode, XMLEmployeeAttributeDateOfEmployeement, this.DateOfEmployment.ToString(DateFormat)); XmlNodeHelper.SetNodeAttributeF(employeeNode, XMLEmployeeAttributeSalary, this.Salary); }