예제 #1
0
 public XmlProcess(XmlDocument xdoc, Clients clients, Zayavki zayavki, Opers opers)
 {
     this.xDoc = xdoc;
     this.C    = clients;
     this.Z    = zayavki;
     this.O    = opers;
 }
예제 #2
0
 public XmlProcess(XmlDocument xdoc)
 {
     this.xDoc = xdoc;
     this.C    = new Clients();
     this.O    = new Opers();
     this.Z    = new Zayavki();
 }
예제 #3
0
        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();
        }
예제 #4
0
        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);
        }
예제 #5
0
 public Zayavki(Clients clients, Opers opers)
 {
     AllZayavki = new List <Zayavka>();
     AllZayavki = readZayavki(clients, opers);
 }
예제 #6
0
 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;
 }