コード例 #1
0
        /// <summary>
        /// Agent that runs a scheduled task
        /// </summary>
        /// <param name="task">
        /// The invoked task
        /// </param>
        /// <remarks>
        /// This method is called when a periodic or resource intensive task is invoked
        /// </remarks>
        protected override void OnInvoke(ScheduledTask task)
        {
            //TODO: Add code to perform your task in background


            if (task is PeriodicTask)
            {
                //ToastMessage = "";
            }
            try
            {
                student       = StudentData.LoadMyData("Student");
                currentPeriod = student.Programs[0].Periods[0];
                if (student != null && currentPeriod != null && student.ID != null && student.Password != null)
                {
                    ObisisMobileServiceClient client = new ObisisMobileServiceClient();
                    client.GetCurrentPeriodAsync(currentPeriod, student.ID, student.Password);
                    client.GetCurrentPeriodCompleted += client_GetCurrentPeriodCompleted;
                }
                else
                {
                    NotifyComplete();
                }
            }
            catch (Exception)
            {
                NotifyComplete();
            }
        }
コード例 #2
0
        private void Login_Click(object sender, RoutedEventArgs e)
        {
            if (Microsoft.Phone.Net.NetworkInformation.NetworkInterface.NetworkInterfaceType == Microsoft.Phone.Net.NetworkInformation.NetworkInterfaceType.None)
            {
                MessageBox.Show("İnternet bağlantınızı kontrol ediniz!");
                NavigationService.Navigate(new Uri("/LoginPage.xaml", UriKind.Relative));
            }
            else if (string.IsNullOrEmpty(txtStudentID.Text) || string.IsNullOrEmpty(txtPassword.Password))
            {
                MessageBox.Show("Boş bıraktığınız alan(lar) var!");
            }
            else
            {
                ProgressIndicator indicator = new ProgressIndicator();
                indicator.IsIndeterminate = true;
                indicator.IsVisible       = true;
                indicator.Text            = "Giriş yapılıyor..";
                SystemTray.SetProgressIndicator(this, indicator);

                int    studentID = Convert.ToInt32(txtStudentID.Text);
                string password  = txtPassword.Password;
                try
                {
                    ObisisMobileServiceClient client = new ObisisMobileServiceClient();
                    client.GetStudentAsync(studentID, password);
                    client.GetStudentCompleted += client_GetStudentCompleted;
                }
                catch (Exception)
                {
                    MessageBox.Show("Sunucuya bağlanırken bir sorun oluştu!\nDaha sonra tekrar deneyiniz..");
                }
            }
        }
コード例 #3
0
ファイル: Ogrenci.cs プロジェクト: oguzhankiyar/old-projects
        public Ogrenci(string OgrenciNo = null, string Sifre = null)
        {
            this.OgrenciNo = OgrenciNo;
            this.Sifre     = Sifre;
            this.Donemler  = new HashSet <Donem>();

            if (!string.IsNullOrEmpty(OgrenciNo))
            {
                ObisisMobileServiceClient client = new ObisisMobileServiceClient();
                OgrenciResult             or     = client.OgrenciDonemGetir(OgrenciNo);
                DataTable dt = or.Data.Tables[0];
                foreach (DataRow item in dt.Rows)
                {
                    this.Donemler.Add(new Donem(this, item["DONEM_ADI"].ToString(), item["OGRETIM_YILI"].ToString(), Convert.ToInt32(item["OGRETIM_YILI_KODU"]), Convert.ToInt32(item["DONEM_NO"])));
                }
                HtmlDocument document = new HtmlDocument();
                document.LoadHtml(Function.GetHTML("http://obisis.erciyes.edu.tr/Default.aspx?tabInd=3&tabNo=5", OgrenciNo, Sifre));
                HtmlNode node = document.DocumentNode;
                try
                {
                    this.AdSoyad = Function.TidyText(node.SelectSingleNode("//span[@id='Banner1_Kullanici1_txtAdiSoyadi']").InnerText);
                    this.Fakulte = Function.TidyText(node.SelectSingleNode("//span[@id='Banner1_Kullanici1_txtFakulteAdi']").InnerText);
                    this.Bolum   = Function.TidyText(node.SelectSingleNode("//span[@id='Banner1_Kullanici1_txtBolumAdi']").InnerText);
                    string SinifGano = node.SelectSingleNode("//span[@id='Banner1_Kullanici1_txtSinifSeneGano']").InnerText;
                    this.Sinif = Convert.ToInt32(SinifGano.Split('(')[1].Split('.')[0]);
                    this.GANO  = Convert.ToDouble(SinifGano.Split(':')[1]);
                }
                catch (Exception) { }
            }
        }
コード例 #4
0
ファイル: Obisis.cs プロジェクト: oguzhankiyar/old-projects
 public Donem(Ogrenci ogrenci, int yil_kodu, int donem_no)
 {
     if (!string.IsNullOrEmpty(ogrenci.OgrenciNo))
     {
         this.Dersler         = new HashSet <Ders>();
         this.No              = donem_no;
         this.OgretimYiliKodu = yil_kodu;
         this.Ogrenci         = ogrenci;
         ObisisMobileServiceClient client = new ObisisMobileServiceClient();
         OgrenciResult             or     = client.OgrenciBilgiGetir(ogrenci.OgrenciNo, ogrenci.Sifre, yil_kodu, donem_no);
         DataTable dt = or.Data.Tables[0];
         foreach (DataRow item in dt.Rows)
         {
             this.Dersler.Add(new Ders()
             {
                 DersAdi   = item["DERS_ADI_TR"].ToString(),
                 Vize1     = string.IsNullOrEmpty(item["VIZE1"].ToString()) ? -1 : Convert.ToInt32(item["VIZE1"]),
                 Vize2     = string.IsNullOrEmpty(item["VIZE2"].ToString()) ? -1 : Convert.ToInt32(item["VIZE2"]),
                 Vize3     = string.IsNullOrEmpty(item["VIZE3"].ToString()) ? -1 : Convert.ToInt32(item["VIZE3"]),
                 Final     = string.IsNullOrEmpty(item["FINAL"].ToString()) ? -1 : Convert.ToInt32(item["FINAL"]),
                 Butunleme = string.IsNullOrEmpty(item["BUTUNLEME"].ToString()) ? -1 : Convert.ToInt32(item["BUTUNLEME"]),
                 Ortalama  = string.IsNullOrEmpty(item["FINAL"].ToString()) ? 0 : Convert.ToDouble(item["ORTALAMA"]),
                 HarfNotu  = item["HARF_NOTU"].ToString(),
                 Durum     = item["GECTI_KALDI"].ToString(),
                 Donem     = this,
                 Ogrenci   = ogrenci
             });
         }
     }
 }
コード例 #5
0
        public void Baglan(string OgrenciNo, string Sifre)
        {
            OgrenciResult ogrResult = null;

            try
            {
                ObisisMobileServiceClient client = new ObisisMobileServiceClient();
                ogrResult      = client.OgrenciBilgiGetir(OgrenciNo, Sifre, 0, 0);
                this.OgrenciNo = OgrenciNo;
                this.Sifre     = Sifre;
                this.Durum     = ogrResult.Message == "Başarılı";

                this.Ogrenci = new Ogrenci(OgrenciNo, Sifre);
                this.Mesaj   = this.Reference == "WP8" ? "Mobisis+ 1.1 sürümü Windows Phone Store'da.." : null;

                try
                {
                    var        path = System.Web.Hosting.HostingEnvironment.MapPath("~/LoginLog.txt");
                    TextWriter tw   = new StreamWriter(path, true, Encoding.UTF8);
                    tw.WriteLine(DateTime.Now + " - " + this.Reference + " - " + this.Ogrenci.AdSoyad + " - " + this.Ogrenci.Fakulte + " " + this.Ogrenci.Bolum + " " + this.Ogrenci.Sinif);
                    tw.Close();
                }
                catch (Exception) { }
            }
            catch (Exception)
            {
                this.Durum = false;
                this.Mesaj = ogrResult == null ? "Üniversite kaynaklı bir sorun oluştu!\n\nEn kısa sürede düzeltilecektir.." : null;
            }
        }
コード例 #6
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            PageCanvas       = new SwipeMenu(this, PageCanvas, LayoutRoot, MoveAnimation, LeftMenu);
            Container.Height = App.Current.RootVisual.RenderSize.Height;

            DateTime currentDate = DateTime.Now;

            if (DateTime.Now.DayOfWeek == DayOfWeek.Saturday)
            {
                currentDate = currentDate.AddDays(2);
            }
            else if (DateTime.Now.DayOfWeek == DayOfWeek.Sunday)
            {
                currentDate = currentDate.AddDays(1);
            }

            if (Database.FoodLists == null || Database.FoodLists.SingleOrDefault(x => x.Date == Convert.ToDateTime(currentDate.ToString("dd.MM.yyyy"))) == null)
            {
                if (Database.FoodLists == null)
                {
                    if (Microsoft.Phone.Net.NetworkInformation.NetworkInterface.NetworkInterfaceType == Microsoft.Phone.Net.NetworkInformation.NetworkInterfaceType.None)
                    {
                        MessageBox.Show("İnternet bağlantınızı kontrol ediniz!");
                    }
                }
                else
                {
                    FoodLists.ItemsSource   = Database.FoodLists;
                    FoodLists.SelectedIndex = Database.FoodLists.Count - 1;
                }
                if (Microsoft.Phone.Net.NetworkInformation.NetworkInterface.NetworkInterfaceType != Microsoft.Phone.Net.NetworkInformation.NetworkInterfaceType.None)
                {
                    ProgressIndicator indicator = new ProgressIndicator();
                    indicator.IsIndeterminate = true;
                    indicator.IsVisible       = true;
                    indicator.Text            = "Yemekler güncelleniyor..";
                    SystemTray.SetProgressIndicator(this, indicator);
                    ObisisMobileServiceClient client = new ObisisMobileServiceClient();
                    client.GetFoodListsAsync();
                    client.GetFoodListsCompleted += client_GetFoodListsCompleted;
                }
                else
                {
                    FoodLists.ItemsSource   = Database.FoodLists;
                    FoodLists.SelectedIndex = Database.FoodLists.Count - 1;
                }
            }
            else
            {
                FoodLists.ItemsSource   = Database.FoodLists;
                FoodLists.SelectedIndex = Database.FoodLists.FindIndex(x => x.Date == Convert.ToDateTime(currentDate.ToString("dd.MM.yyyy")));
            }
            base.OnNavigatedTo(e);
        }
コード例 #7
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            PageCanvas       = new SwipeMenu(this, PageCanvas, LayoutRoot, MoveAnimation, LeftMenu);
            Container.Height = App.Current.RootVisual.RenderSize.Height;

            if (Database.Student == null)
            {
                MessageBox.Show("Giriş yapmanız gerekiyor..");
                NavigationService.Navigate(new Uri("/LoginPage.xaml", UriKind.Relative));
            }
            else
            {
                code     = NavigationContext.QueryString.ContainsKey("Code") ? Convert.ToInt32(NavigationContext.QueryString["Code"]) : 0;
                yearCode = NavigationContext.QueryString.ContainsKey("YearCode") ? Convert.ToInt32(NavigationContext.QueryString["YearCode"]) : 0;
                Period currentPeriod = Database.Student.Programs[0].Periods.First();
                if ((code == 0 && yearCode == 0) || (code == currentPeriod.Code && yearCode == currentPeriod.YearCode))
                {
                    code     = currentPeriod.Code;
                    yearCode = currentPeriod.YearCode;
                    Container.DataContext = currentPeriod;
                    if (Microsoft.Phone.Net.NetworkInformation.NetworkInterface.NetworkInterfaceType != Microsoft.Phone.Net.NetworkInformation.NetworkInterfaceType.None)
                    {
                        try
                        {
                            ProgressIndicator indicator = new ProgressIndicator();
                            indicator.IsIndeterminate = true;
                            indicator.IsVisible       = true;
                            indicator.Text            = "Dersler güncelleniyor..";
                            ObisisMobileServiceClient client = new ObisisMobileServiceClient();
                            client.GetCurrentPeriodAsync(currentPeriod, Database.Student.ID, Database.Student.Password);
                            client.GetCurrentPeriodCompleted += client_GetCurrentPeriodCompleted;
                            SystemTray.SetProgressIndicator(this, indicator);
                        }
                        catch (Exception)
                        {
                            if (SystemTray.ProgressIndicator != null)
                            {
                                SystemTray.ProgressIndicator.IsVisible = false;
                            }
                        }
                    }
                }
                else
                {
                    Container.DataContext = Database.Student.Programs[0].Periods.SingleOrDefault(x => x.Code == code && x.YearCode == yearCode);
                }
                Lessons.SelectedItem = null;
            }
            base.OnNavigatedTo(e);
        }
コード例 #8
0
            public Ogrenci(string ogrNo = null, string sifre = null)
            {
                this.OgrenciNo = ogrNo;
                this.Sifre     = sifre;
                this.Donemler  = new HashSet <Donem>();
                this.Dersler   = new HashSet <Ders>();
                if (!string.IsNullOrEmpty(ogrNo))
                {
                    ObisisMobileServiceClient client = new ObisisMobileServiceClient();
                    OgrenciResult             or     = client.OgrenciDonemGetir(ogrNo);
                    DataTable dt = or.Data.Tables[0];
                    foreach (DataRow item in dt.Rows)
                    {
                        this.Donemler.Add(new Donem(this, item["DONEM_ADI"].ToString(), item["OGRETIM_YILI"].ToString(), Convert.ToInt32(item["OGRETIM_YILI_KODU"]), Convert.ToInt32(item["DONEM_NO"])));
                    }
                    foreach (Donem donem in this.Donemler)
                    {
                        foreach (Ders ders in donem.Dersler)
                        {
                            this.Dersler.Add(ders);
                        }
                    }

                    HtmlDocument document = new HtmlDocument();
                    document.LoadHtml(GetHTML("http://obisis.erciyes.edu.tr/Default.aspx?tabInd=3&tabNo=5", ogrNo, sifre));
                    HtmlNode node = document.DocumentNode;
                    try
                    {
                        this.AdSoyad = TidyText(node.SelectSingleNode("//span[@id='Banner1_Kullanici1_txtAdiSoyadi']").InnerText);
                        this.Fakulte = TidyText(node.SelectSingleNode("//span[@id='Banner1_Kullanici1_txtFakulteAdi']").InnerText);
                        this.Bolum   = TidyText(node.SelectSingleNode("//span[@id='Banner1_Kullanici1_txtBolumAdi']").InnerText);
                        string SinifGano = node.SelectSingleNode("//span[@id='Banner1_Kullanici1_txtSinifSeneGano']").InnerText;
                        this.Sinif            = Convert.ToInt32(SinifGano.Split('(')[1].Split('.')[0]);
                        this.GANO             = Convert.ToDouble(SinifGano.Split(':')[1]);
                        this.GerekenGANO      = Convert.ToDouble(node.SelectSingleNode("//table[@id='ctl00_dgMezuniyetDurum']/tr[2]/td[1]").InnerText.Replace("Ortalama en az", "").Replace("olmalı", "").Trim());
                        this.MezuniyetKredisi = Convert.ToDouble(node.SelectSingleNode("//table[@id='ctl00_dgMezuniyetDurum']/tr[7]/td[1]").InnerText.Replace("Mezuniyet kredisi", "").Replace("olmalı", "").Trim()) / 100;
                        this.ToplamKredi      = Convert.ToDouble(node.SelectSingleNode("//table[@id='ctl00_dgMezuniyetDurum']/tr[7]/td[2]").InnerText.Replace("Toplam krediniz", "").Trim()) / 100;
                        this.StajDurum        = node.SelectSingleNode("//table[@id='ctl00_dgMezuniyetDurum']/tr[6]/td[3]").InnerHtml == "<img src=\"/images/Valid.gif\">";
                    }
                    catch (Exception) { }
                }
            }
コード例 #9
0
 public Donem(Ogrenci ogrenci, string donem_adi, string ogretim_yili, int yil_kodu, int donem_no)
 {
     if (!string.IsNullOrEmpty(ogrenci.OgrenciNo))
     {
         this.Dersler         = new HashSet <Ders>();
         this.Adi             = donem_adi;
         this.No              = donem_no;
         this.OgretimYili     = ogretim_yili;
         this.OgretimYiliKodu = yil_kodu;
         this.Ogrenci         = ogrenci;
         ObisisMobileServiceClient client = new ObisisMobileServiceClient();
         OgrenciResult             or     = client.OgrenciBilgiGetir(ogrenci.OgrenciNo, ogrenci.Sifre, yil_kodu, donem_no);
         DataTable    dt       = or.Data.Tables[0];
         HtmlDocument document = new HtmlDocument();
         try
         {
             document.LoadHtml(GetHTML("http://obisis.erciyes.edu.tr/Default.aspx?tabInd=4&tabNo=8", ogrenci.OgrenciNo, ogrenci.Sifre));
             this.GANO = Convert.ToDouble(document.DocumentNode.SelectSingleNode("//*[contains(text(), '" + this.OgretimYili + " " + this.Adi + "')]").InnerText.Split(':')[1].Trim());
         }
         catch (Exception)
         {
             try
             {
                 document.LoadHtml(GetHTML("http://obisis.erciyes.edu.tr/Default.aspx?tabInd=5&tabNo=8", ogrenci.OgrenciNo, ogrenci.Sifre));
                 this.GANO = Convert.ToDouble(document.DocumentNode.SelectSingleNode("//*[contains(text(), '" + this.OgretimYili + " " + this.Adi + "')]").InnerText.Split(':')[1].Trim());
             }
             catch (Exception)
             {
                 document.LoadHtml(GetHTML("http://obisis.erciyes.edu.tr/Default.aspx?tabInd=6&tabNo=8", ogrenci.OgrenciNo, ogrenci.Sifre));
                 this.GANO = Convert.ToDouble(document.DocumentNode.SelectSingleNode("//*[contains(text(), '" + this.OgretimYili + " " + this.Adi + "')]").InnerText.Split(':')[1].Trim());
             }
         }
         int i = 1;
         foreach (DataRow item in dt.Rows)
         {
             HtmlNode node            = document.DocumentNode.SelectSingleNode("//tr[contains(td[1], '" + this.OgretimYili + " " + this.Adi + "')]/following-sibling::tr[" + i++ + "]");
             string   ads             = node.SelectSingleNode("./td[2]").InnerText;
             double   kredi           = 0.0;
             int      sinif           = 1;
             bool     ortalamayaEtki  = true;
             double   basariKatsayisi = 0.0;
             string   kod             = "";
             string   text            = node.InnerText;
             if (node != null)
             {
                 kod             = node.SelectSingleNode("./td[1]").InnerText;
                 kredi           = Convert.ToDouble(node.SelectSingleNode("./td[6]").InnerText.Trim());
                 sinif           = Convert.ToInt32(node.SelectSingleNode("./td[3]").InnerText);
                 ortalamayaEtki  = node.SelectSingleNode("./td[8]").InnerText != "&nbsp;" && node.SelectSingleNode("./td[9]").InnerText == "&nbsp;" ? false : true;
                 basariKatsayisi = node.SelectSingleNode("./td[9]").InnerText == "&nbsp;" ? 0.0 : Convert.ToDouble(node.SelectSingleNode("./td[9]").InnerText.Trim());
             }
             this.Dersler.Add(new Ders()
             {
                 DersAdi         = item["DERS_ADI_TR"].ToString(),
                 Vize1           = string.IsNullOrEmpty(item["VIZE1"].ToString()) ? -1 : Convert.ToInt32(item["VIZE1"]),
                 Vize2           = string.IsNullOrEmpty(item["VIZE2"].ToString()) ? -1 : Convert.ToInt32(item["VIZE2"]),
                 Vize3           = string.IsNullOrEmpty(item["VIZE3"].ToString()) ? -1 : Convert.ToInt32(item["VIZE3"]),
                 Final           = string.IsNullOrEmpty(item["FINAL"].ToString()) ? -1 : Convert.ToInt32(item["FINAL"]),
                 Butunleme       = string.IsNullOrEmpty(item["BUTUNLEME"].ToString()) ? -1 : Convert.ToInt32(item["BUTUNLEME"]),
                 Ortalama        = string.IsNullOrEmpty(item["ORTALAMA"].ToString()) ? 0 : Convert.ToDouble(item["ORTALAMA"]),
                 HarfNotu        = item["HARF_NOTU"].ToString(),
                 Durum           = item["GECTI_KALDI"].ToString(),
                 Kod             = kod,
                 Kredi           = kredi,
                 OrtalamayaEtki  = ortalamayaEtki,
                 BasariKatsayisi = basariKatsayisi,
                 Sinif           = sinif,
                 Donem           = this,
                 Ogrenci         = ogrenci
             });
         }
     }
 }
コード例 #10
0
ファイル: Obisis.cs プロジェクト: oguzhankiyar/old-projects
            public Ogrenci(string ogrNo = "", string sifre = "")
            {
                this.OgrenciNo = ogrNo;
                this.Sifre     = sifre;
                this.Donemler  = new HashSet <Donem>();
                this.Dersler   = new HashSet <Ders>();
                if (!string.IsNullOrEmpty(ogrNo))
                {
                    ObisisMobileServiceClient client = new ObisisMobileServiceClient();
                    OgrenciResult             or     = client.OgrenciDonemGetir(ogrNo);
                    DataTable dt = or.Data.Tables[0];
                    foreach (DataRow item in dt.Rows)
                    {
                        this.Donemler.Add(new Donem(this, Convert.ToInt32(item["OGRETIM_YILI_KODU"]), Convert.ToInt32(item["DONEM_NO"]))
                        {
                            Adi         = item["DONEM_ADI"].ToString(),
                            OgretimYili = item["OGRETIM_YILI"].ToString()
                        });
                    }
                    foreach (Donem donem in this.Donemler)
                    {
                        foreach (Ders ders in donem.Dersler)
                        {
                            this.Dersler.Add(ders);
                        }
                    }

                    HttpWebRequest  request          = (HttpWebRequest)WebRequest.Create("http://obisis.erciyes.edu.tr");
                    HttpWebResponse response         = (HttpWebResponse)request.GetResponse();
                    StreamReader    reader           = new StreamReader(response.GetResponseStream());
                    string          strResponse      = reader.ReadToEnd();
                    HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();
                    doc.LoadHtml(strResponse);
                    HtmlNodeCollection collection = doc.DocumentNode.SelectNodes("//input");

                    string         getUrl     = "http://obisis.erciyes.edu.tr";
                    string         postData   = string.Format("__VIEWSTATE={0}&__EVENTVALIDATION={1}&ctl00$txtboxOgrenciNo={2}&ctl00$txtBoxSifre={3}&ctl00$btnLogin={4}", HttpUtility.UrlEncode(collection[1].Attributes["value"].Value), HttpUtility.UrlEncode(collection[2].Attributes["value"].Value), ogrNo, sifre, HttpUtility.UrlEncode("Giriş"));
                    HttpWebRequest getRequest = (HttpWebRequest)WebRequest.Create(getUrl);
                    getRequest.CookieContainer = new CookieContainer();
                    getRequest.Method          = "POST";
                    getRequest.ContentType     = "application/x-www-form-urlencoded";

                    byte[] byteArray = Encoding.ASCII.GetBytes(postData);
                    getRequest.ContentLength = byteArray.Length;
                    Stream newStream = getRequest.GetRequestStream(); //open connection
                    newStream.Write(byteArray, 0, byteArray.Length);  // Send the data.
                    newStream.Close();

                    HttpWebResponse getResponse           = (HttpWebResponse)getRequest.GetResponse();
                    StreamReader    sr                    = new StreamReader(getResponse.GetResponseStream());
                    HtmlAgilityPack.HtmlDocument document = new HtmlAgilityPack.HtmlDocument();
                    document.LoadHtml(sr.ReadToEnd());
                    HtmlNode node = document.DocumentNode;
                    this.AdSoyad = node.SelectSingleNode("//span[@id='Banner1_Kullanici1_txtAdiSoyadi']").InnerText;
                    this.Fakulte = node.SelectSingleNode("//span[@id='Banner1_Kullanici1_txtFakulteAdi']").InnerText;
                    this.Bolum   = node.SelectSingleNode("//span[@id='Banner1_Kullanici1_txtBolumAdi']").InnerText;
                    string SinifGano = node.SelectSingleNode("//span[@id='Banner1_Kullanici1_txtSinifSeneGano']").InnerText;
                    this.Sinif = Convert.ToInt32(SinifGano.Split('(')[1].Split('.')[0]);
                    this.GANO  = Convert.ToDouble(SinifGano.Split(':')[1]);
                }
            }
コード例 #11
0
        public static List <Period> GetPeriods(string html)
        {
            List <Period> periods = new List <Period>();
            HtmlDocument  doc     = new HtmlDocument();

            doc.LoadHtml(html);
            HtmlNode                  node   = doc.DocumentNode;
            HtmlNodeCollection        col    = node.SelectNodes("//table[@id='ctl00_gvDersDurum']//tr");
            Period                    period = new Period();
            ObisisMobileServiceClient client = new ObisisMobileServiceClient();

            for (int i = 1; i < col.Count; i++)
            {
                HtmlNode item = col[i];
                if (item.InnerText.Contains("ORTALAMASI"))
                {
                    if (i != 1)
                    {
                        periods.Add(period);
                    }
                    period = new Period();
                    string text = item.InnerText.Replace("\r", "").Replace("\t", "").Replace("\n", "");
                    period.Name     = Function.TidyText(text.Split(' ')[1]);
                    period.Code     = GetCode(period.Name);
                    period.Year     = text.Split(' ')[0];
                    period.YearCode = GetYearCode(period.Year);
                    period.GANO     = Convert.ToDouble(text.Split(':')[1].Replace(",", "").Replace(".", "").Trim()) / 100;
                    period.Lessons  = new List <Lesson>();
                    OgrenciResult result = client.OgrenciBilgiGetir(Data.StudentID.ToString(), Data.Password, period.YearCode, period.Code);
                    DataTable     dt     = result.Data.Tables[0];
                    foreach (DataRow data in dt.Rows)
                    {
                        Lesson lesson = new Lesson()
                        {
                            Name         = Function.TidyText(data["DERS_ADI_TR"].ToString()),
                            FirstMidterm = new Exam()
                            {
                                Mark = string.IsNullOrEmpty(data["VIZE1"].ToString()) ? (int?)null : Convert.ToInt32(data["VIZE1"])
                            },
                            SecondMidterm = new Exam()
                            {
                                Mark = string.IsNullOrEmpty(data["VIZE2"].ToString()) ? (int?)null : Convert.ToInt32(data["VIZE2"])
                            },
                            ThirdMidterm = new Exam()
                            {
                                Mark = string.IsNullOrEmpty(data["VIZE3"].ToString()) ? (int?)null : Convert.ToInt32(data["VIZE3"])
                            },
                            Final = new Exam()
                            {
                                Mark = string.IsNullOrEmpty(data["FINAL"].ToString()) ? (int?)null : Convert.ToInt32(data["FINAL"])
                            },
                            Integration = new Exam()
                            {
                                Mark = string.IsNullOrEmpty(data["BUTUNLEME"].ToString()) ? (int?)null : Convert.ToInt32(data["BUTUNLEME"])
                            },
                            Average = string.IsNullOrEmpty(data["ORTALAMA"].ToString()) ? (int?)null : Convert.ToInt32(data["ORTALAMA"]),
                            Grade   = string.IsNullOrEmpty(data["HARF_NOTU"].ToString()) ? null : Lesson.GetGrade(data["HARF_NOTU"].ToString()),
                            State   = string.IsNullOrEmpty(data["GECTI_KALDI"].ToString()) ? (bool?)null : data["GECTI_KALDI"].ToString() == "GEÇTİ"
                        };
                        period.Lessons.Add(lesson);
                    }
                }
                else
                {
                    string code       = item.SelectSingleNode("./td[1]").InnerText;
                    string name       = Function.TidyText(item.SelectSingleNode("./td[2]").InnerText);
                    double credit     = Convert.ToDouble(item.SelectSingleNode("./td[6]").InnerText.Trim().Replace(",", "."));
                    int    cls        = Convert.ToInt32(item.SelectSingleNode("./td[3]").InnerText);
                    bool   ganoEffect = item.SelectSingleNode("./td[8]").InnerText != "&nbsp;" && item.SelectSingleNode("./td[9]").InnerText == "&nbsp;" ? false : true;
                    double factor     = item.SelectSingleNode("./td[9]").InnerText == "&nbsp;" ? 0.0 : Convert.ToDouble(item.SelectSingleNode("./td[9]").InnerText.Trim());

                    Lesson lesson = period.Lessons.SingleOrDefault(x => x.Name == name);
                    if (lesson != null)
                    {
                        lesson.Code          = code;
                        lesson.Credit        = credit;
                        lesson.AverageEffect = ganoEffect;
                        lesson.SuccessFactor = factor;
                        lesson.Class         = cls;
                    }
                }
                if (i == col.Count - 1)
                {
                    periods.Add(period);
                }
            }
            return(periods.OrderBy(x => x.YearCode).ThenBy(x => x.Code).ToList());
        }