Exemple #1
0
        public void TestMethod1()
        {
            Lib.GetJWXT.GetJWXT jwxt   = new Lib.GetJWXT.GetJWXT();
            HtmlDocument        GpaDoc = jwxt.GetGPA();

            /*    string str = (string)GpaDoc.Body.InnerHtml;
             *  List<Gpa> gpas=jwxt.GetGpaList(str);
             * // Assert.Equals(gpas[0].schoolyear, "2016-2017");
             * //            Assert.Equals();
             */}
Exemple #2
0
        private void SetGpa()
        {
            show_gpa.Clear();
            TableLoad();

            HtmlDocument GpaDoc   = jwxt.GetGPA();
            string       str      = (string)GpaDoc.Body.InnerHtml;
            string       itemlist = null;
            List <Gpa>   Gpas;

            Gpas = jwxt.GetGpaList(str);

            foreach (Gpa g in Gpas)
            {
                itemlist += g.mark + "\r\n";
            }
            ListViewItem temp = new ListViewItem();
            int          flag = 0;

            if (choose_academic_year.Text != "ALL")
            {
                flag++;
            }
            if (choose_semester.Text != "ALL")
            {
                flag += 2;
            }

            this.show_gpa.BeginUpdate();
            switch (flag)
            {
            case 0:
                foreach (Gpa g in Gpas)
                {
                    ShowGpa(temp, g);
                }
                break;

            case 1:
                foreach (Gpa g in Gpas)
                {
                    if (g.schoolyear == choose_academic_year.Text)
                    {
                        ShowGpa(temp, g);
                    }
                }
                break;

            case 2:
                foreach (Gpa g in Gpas)
                {
                    if (g.semester == choose_semester.Text)
                    {
                        ShowGpa(temp, g);
                    }
                }
                break;

            case 3:
                foreach (Gpa g in Gpas)
                {
                    if ((g.schoolyear == choose_academic_year.Text) &&
                        (g.semester == choose_semester.Text))
                    {
                        ShowGpa(temp, g);
                    }
                }
                break;

            default:
                MessageBox.Show("switch error");
                break;
            }//end of switch
            this.show_gpa.EndUpdate();
        }