public XmlProcess(XmlDocument xdoc, Clients clients, Zayavki zayavki, Opers opers) { this.xDoc = xdoc; this.C = clients; this.Z = zayavki; this.O = opers; }
public XmlProcess(XmlDocument xdoc) { this.xDoc = xdoc; this.C = new Clients(); this.O = new Opers(); this.Z = new Zayavki(); }
public Form2(Form main) { this.main = main; InitializeComponent(); opers = new Opers(); clients = new Clients(); zayavki = new Zayavki(clients, opers); tek = zayavki.getMax(); Zayavka Z = zayavki.findByID(tek); FillComboBoxes(); this.ShowData(Z); this.Check(); }
public List <Zayavka> readZayavki(Clients clients, Opers opers) { List <Zayavka> catalog = new List <Zayavka>(); XmlDocument xDoc = new XmlDocument(); xDoc.Load("../../DataBase.xml"); XmlElement xRoot = xDoc.DocumentElement; // получим корневой элемент foreach (XmlNode xnode in xRoot) // обход всех узлов в корневом элементе { Zayavka temp = new Zayavka(); XmlNode attr = xnode.Attributes.GetNamedItem("ID"); temp.ID = Convert.ToInt32(attr.Value); // обходим все дочерние узлы foreach (XmlNode childnode in xnode.ChildNodes) { if (childnode.Name == "Client") { temp.client = clients.findByID(Convert.ToInt32(childnode.InnerText)); } if (childnode.Name == "OperrationType") { temp.oper = opers.findByID(Convert.ToInt32(childnode.InnerText)); } if (childnode.Name == "Cost") { temp.cost = Convert.ToInt32(childnode.InnerText); } if (childnode.Name == "During") { temp.time = childnode.InnerText; } if (childnode.Name == "Nomenklatura") { temp.nomen = childnode.InnerText; } if (childnode.Name == "Date") { temp.date = childnode.InnerText; } } catalog.Add(temp); } return(catalog); }
public Zayavki(Clients clients, Opers opers) { AllZayavki = new List <Zayavka>(); AllZayavki = readZayavki(clients, opers); }
public Zayavka(int tek, string C, int O, string Cost, string Time, string date, Clients clients, Opers opers) { this.ID = tek; this.client = clients.findByFIO(C); this.oper = opers.findByID(O); this.cost = Convert.ToInt32(Cost); this.time = Time; this.date = date; }