public ActionResult FromDept()
        {
            string url = "";
            StudentInfo stdinfo = new StudentInfo();
            List<RssNews> rssnewslist = new List<RssNews>();
            int studentnumber =0;
            HttpCookie userCookie = Request.Cookies["UserInfo"];

            if (userCookie != null)
            {
                studentnumber = Convert.ToInt32(userCookie["username"]);

            }
            using (IzmirUnivEntities stdcon = new IzmirUnivEntities())
            {
                if (studentnumber != 0) {
                stdinfo = stdcon.StudentInfoes.Single(stdid => stdid.stdNumber == studentnumber);
                }
            }

            if (stdinfo.deptId == 1)
            {
                url = "http://izmir.edu.tr/muh/bilgisayar-muhendisligi-duyurular.feed?type=rss";
                 rssnewslist = getAnnoucment(url);
                 TempData["message"] = false;
                ViewBag.Annoucment = true;
            }
            else if (stdinfo.deptId == 2)
            {
                url = "http://izmir.edu.tr/muh/bilgisayar-muhendisligi-duyurular.feed?type=rss";
                rssnewslist = getAnnoucment(url);
                TempData["message"] = false;
                ViewBag.Annoucment = true;
            }
            else if (stdinfo.deptId == 3)
            {
                url = "http://izmir.edu.tr/muh/bilgisayar-muhendisligi-duyurular.feed?type=rss";
                rssnewslist = getAnnoucment(url);
                TempData["message"] = false;
                ViewBag.Annoucment = true;
            }
            else if (stdinfo.deptId == 4)
            {
                url = "http://izmir.edu.tr/muh/bilgisayar-muhendisligi-duyurular.feed?type=rss";
                rssnewslist = getAnnoucment(url);
                TempData["message"] = false;
                ViewBag.Annoucment = true;
            }
            else
            {
                ViewBag.Annoucment = false;

                TempData["message"] = true;
            }

            return View(rssnewslist);
        }
        public void addStudentInfo()
        {
            string passmod = "http://87.251.2.70:85/api/ogrenci";

            if (getAuthentication() == false)
            {
                Response.Redirect("/StudentPanel/Index", true);
            }

            json = (methods.getJSONFromURL(passmod, user, pass));

            var result = json["data"];

            using (IzmirUnivEntities stdcon = new IzmirUnivEntities())
            {
                StudentInfo stdinfo = new StudentInfo();

                stdinfo.stdNumber = Convert.ToInt32((string)result["OgrenciNo"]);
            stdinfo.stdFullName= (string)result["AdiSoyadi"];
            stdinfo.facId = (int)result["FakulteId"];
            stdinfo.facName = (string)result["FakulteAdi"];
            stdinfo.deptId = (int)result["BolumId"];
            stdinfo.deptName = (string)result["BolumAdi"];
            var existstudentnumber = stdcon.StudentInfoes.Count(stdnumber => stdnumber.stdNumber == stdinfo.stdNumber);

            if (existstudentnumber == 0)
            {
                stdcon.StudentInfoes.Add(stdinfo);

                stdcon.SaveChanges();

            }
            else
            {
                Console.WriteLine("Exist Primary key");
            }

            }
        }