Beispiel #1
0
        public Student(int idStudent, string PWD)
        {
            IdStudent = idStudent;
            DSConfigurator config = new DSConfigurator();
            string         info   = config.StudentInfo(idStudent, PWD);
            XmlDocument    xDoc   = new XmlDocument();

            xDoc.LoadXml(info);
            XmlNode xnd = xDoc.SelectSingleNode("Student");

            if (xnd != null)
            {
                foreach (XmlNode xn in xnd.ChildNodes)
                {
                    switch (xn.Name)
                    {
                    case "SurName": surname = xn.InnerText; break;

                    case "FirstName": firstname = xn.InnerText; break;

                    case "MiddleName": middlename = xn.InnerText; break;

                    case "Status": status = xn.InnerText; break;

                    case "Group": group = xn.InnerText; break;

                    case "Numberofunitsacquired": acquiredunits = double.Parse(xn.InnerText); break;

                    case "Numberofunitsused": usedunits = double.Parse(xn.InnerText); break;
                    }
                }
            }
            isAuthorized = !(status == "UnAuthorized");
        }
Beispiel #2
0
        private void GetTheXml()
        {
            DSConfigurator config = new DSConfigurator();
            string         info   = config.Schedule(idstudent, day);

            _body = new XmlDocument();
            _body.LoadXml(info);
        }
Beispiel #3
0
        public MyExams ShowMyExams()
        {
            DSConfigurator config    = new DSConfigurator();
            string         info      = config.FData("spGetStudentExamsK1", "IdStudent", IdStudent.ToString());
            XmlSerializer  formatter = new XmlSerializer(typeof(MyExams));
            MyExams        me;

            using (TextReader textReader = new StringReader(info))
            {
                me = (MyExams)formatter.Deserialize(textReader);
            }
            return(me);
        }
Beispiel #4
0
        public StudentInfo ShowStudentInfo()
        {
            StudentInfo    studentInfo   = new StudentInfo();
            XmlSerializer  serializer    = new XmlSerializer(typeof(StudentInfo));
            DSConfigurator config        = new DSConfigurator();
            string         serializedXML = config.FData("spGetStudentInfo", "@IdStudent", this.Id.ToString());
            XmlSerializer  formatter     = new XmlSerializer(typeof(StudentInfo));

            using (TextReader textReader = new StringReader(serializedXML))
            {
                studentInfo = (StudentInfo)formatter.Deserialize(textReader);
            }
            return(studentInfo);
        }
Beispiel #5
0
        /// <summary>
        /// Нажать кнопку (Записаться или отменить)
        /// </summary>
        /// <param name="buttonValue">Значение кнопки в формате "IdShift|IdShift|IdVehicle|IdVehicle|"</param>
        public void PressButton(string buttonValue)
        {
            DSHelper.ClearValue();
            DSHelper.Delimiter = "|";
            DSHelper.BuildStringWithDelimeter("IdStudent", idstudent.ToString());
            DSHelper.BuildStringWithDelimeter("IdPlace", selectedplace.ToString());
            DSHelper.BuildStringWithDelimeter("WayOfAssignment", "DrivingSite");
            DSHelper.BuildStringWithDelimeter("DateDrive", DSHelper.RussianDate(Day));
            string         info   = DSHelper.Value + buttonValue;
            DSConfigurator config = new DSConfigurator();

            info = config.Subscribe(info);
            BuildFromXml();
            buttonmessage = info;
        }
Beispiel #6
0
        public MySchedule(int IdStudent)
        {
            DSConfigurator config = new DSConfigurator();
            string         info   = config.MySchedule(IdStudent);
            XmlDocument    X      = new XmlDocument();

            X.LoadXml(info);
            Drivings = new List <Driving>();
            XmlNode xnd = X.SelectSingleNode("МоёРасписание");

            if (xnd != null)
            {
                foreach (XmlNode xn in xnd.ChildNodes)
                {
                    Driving D = new Driving(xn);
                    Drivings.Add(D);
                }
            }
        }
Beispiel #7
0
        public void LogIn()
        {
            DSConfigurator config = new DSConfigurator();
            string         info   = config.StudentInfo(Login, Crypt.Encrypt(Password, "df89ygy"));
            XmlDocument    xDoc   = new XmlDocument();

            xDoc.LoadXml(info);
            XmlNode xnd = xDoc.SelectSingleNode("Student");

            if (xnd != null)
            {
                foreach (XmlNode xn in xnd.ChildNodes)
                {
                    switch (xn.Name)
                    {
                    case "IdStudent": IdStudent = Int32.Parse(xn.InnerText); break;

                    case "SurName": surname = xn.InnerText; break;

                    case "FirstName": firstname = xn.InnerText; break;

                    case "MiddleName": middlename = xn.InnerText; break;

                    case "Status": status = xn.InnerText; break;

                    case "Group": group = xn.InnerText; break;

                    case "Numberofunitsacquired": acquiredunits = double.Parse(xn.InnerText); break;

                    case "Numberofunitsused": usedunits = double.Parse(xn.InnerText); break;

                    case "Message": message = xn.InnerText; break;
                    }
                }
            }
            isAuthorized = !(status == "UnAuthorized");
        }