public void Init(Pachet pachet) { XmlDocument doc = new XmlDocument(); doc.Load("D:\\Anul II\\OOP\\labs\\lab-6\\POS\\app1\\Servicii.xml"); XmlNodeList lista_noduri = doc.SelectNodes("/servicii/Serviciu"); foreach (XmlNode nod in lista_noduri) { string nume = nod["Nume"].InnerText; string codIntern = nod["CodIntern"].InnerText; int pret = int.Parse(nod["Pret"].InnerText); string categorie = nod["Categorie"].InnerText; Serviciu serv = new Serviciu(elemente.Count + 1, nume, codIntern, pret, categorie);// think about another id not related to elemente.Count same in PacheteMgr pachet.Add_element(serv); } }
public void Init(Pachet pachet) { XmlDocument doc = new XmlDocument(); doc.Load("D:\\Anul II\\OOP\\labs\\lab-6\\POS\\app1\\Produse.xml"); XmlNodeList lista_noduri = doc.SelectNodes("/produse/Produs"); foreach (XmlNode nod in lista_noduri) { string nume = nod["Nume"].InnerText; string codIntern = nod["CodIntern"].InnerText; int pret = int.Parse(nod["Pret"].InnerText); string categorie = nod["Categorie"].InnerText; string producator = nod["Producator"].InnerText; Produs prod = new Produs(elemente.Count + 1, nume, codIntern, pret, categorie, producator); pachet.Add_element(prod); } }