示例#1
0
        private void BackToMenu_Click(object sender, EventArgs e)
        {
            Hide();
            TeacherMenu newTeacherMenu = new TeacherMenu();

            newTeacherMenu.Show();
        }
示例#2
0
        private void button1_Click(object sender, EventArgs e)
        {
            XmlDocument xDoc = new XmlDocument();

            xDoc.Load("users.xml");
            //XmlDocument xText = new XmlDocument();
            //xText.Load("1.xml");
            XmlElement xRoot = xDoc.DocumentElement;

            foreach (XmlNode xnode in xRoot)
            {
                if (xnode.Name == "teachers")
                {
                    foreach (XmlNode childteacher in xnode.ChildNodes)
                    {
                        log  = false;
                        pass = false;
                        foreach (XmlNode childlogpass in childteacher.ChildNodes)
                        {
                            if (childlogpass.Name == "login" && childlogpass.InnerText == Login.Text)
                            {
                                log = true;
                            }
                            else if (childlogpass.Name == "password" && childlogpass.InnerText == Parol.Text)
                            {
                                pass = true;
                            }
                            if (log && pass && !isOpenWindow_Form)
                            {
                                isOpenWindow_Form = true;

                                Hide();
                                TeacherMenu newTeacherMenu = new TeacherMenu();
                                newTeacherMenu.Show();
                            }
                        }
                    }
                }
                else if (xnode.Name == "students")
                {
                    foreach (XmlNode childstudents in xnode.ChildNodes)
                    {
                        log  = false;
                        pass = false;

                        foreach (XmlNode childlogpass in childstudents.ChildNodes)
                        {
                            if (childlogpass.Name == "login" && childlogpass.InnerText == Login.Text)
                            {
                                log = true;
                            }
                            else if (childlogpass.Name == "password" && childlogpass.InnerText == Parol.Text)
                            {
                                pass = true;
                            }
                            if (log && pass && !isOpenWindow_Form)
                            {
                                isOpenWindow_Form = true;
                                account_login     = Login.Text;

                                Hide();
                                Меню_для_студента newForm = new Меню_для_студента();
                                newForm.Show();
                            }
                        }
                    }
                }
            }
        }