Exemple #1
0
        public ActionResult TeacherEditForIdari(int OgretmenId)
        {
            HttpCookie myCookie = new HttpCookie("LoginCookie");

            myCookie = Request.Cookies["LoginCookie"];
            Int64  tcno = Convert.ToInt64(myCookie.Value.Split('=')[1].ToString());
            School sch  = SchoolManager.GetSchoolByTCNo(tcno);

            List <School> schList = new List <School>();

            schList.Add(sch);

            var list = new SelectList(schList, "SchoolId", "Ad");

            ViewBag.SchoolList = list;

            if (myCookie != null)
            {
                ViewBag.School   = sch.Ad;
                ViewBag.SchoolId = sch.SchoolId;
            }

            var             items = new List <UnvanHelper>();
            ResourceManager rm    = new ResourceManager("SinavGorevlendirme.Resources.Genel", typeof(TeacherController).Assembly);

            Teacher tch = TeacherManager.GetTeacher(OgretmenId);
            User    usr = UserManager.GetUserByTeacherId(OgretmenId);

            var Kidemler = new SelectList(new[]
            {
                new{ Text = "1", Value = "1" },
                new{ Text = "2", Value = "2" },
                new{ Text = "3", Value = "3" },
            },
                                          "Text", "Value", tch.Kidem);

            ViewBag.Kidemler = Kidemler;

            foreach (var unv in Enum.GetValues(typeof(EnumUnvan)))
            {
                items.Add(new UnvanHelper((int)unv, rm.GetString(unv.ToString())));
            }

            var unvanList = new SelectList(items, "UnvanId", "Unvan", tch.Unvan);

            ViewBag.UnvanList = unvanList;

            //School sch = SchoolManager.GetSchoolByTCNo(usr.TCKimlik);

            TeacherWrapperModel model = new TeacherWrapperModel(usr, tch, sch);

            return(View(model));
        }
        public ActionResult SinavListeForIdari()
        {
            HttpCookie myCookie = new HttpCookie("LoginCookie");

            myCookie = Request.Cookies["LoginCookie"];
            Int64  tcno = Convert.ToInt64(myCookie.Value.Split('=')[1].ToString());
            School sch  = SchoolManager.GetSchoolByTCNo(tcno);

            ViewBag.SchoolId = sch.SchoolId;

            var oturumlar = new List <SinavOturum>();

            oturumlar = SinavManager.SinavListe((int)SG_DAL.Enums.EnumSinavDurum.OnaylanmisSinav);

            var sinavlist = new SinavListeWrapperModel(new List <Sinav>(), oturumlar, SettingManager.GetSettings(), new List <SinavOturum>(), new List <SinavOturum>());

            return(View(sinavlist));
        }
Exemple #3
0
        public ActionResult TeacherListForIdari()
        {
            HttpCookie myCookie = new HttpCookie("LoginCookie");

            myCookie = Request.Cookies["LoginCookie"];
            Int64  tcno = Convert.ToInt64(myCookie.Value.Split('=')[1].ToString());
            School sch  = SchoolManager.GetSchoolByTCNo(tcno);

            List <Teacher> teacher = TeacherManager.GetTeacherListBySchoolId(sch.SchoolId);

            //ResourceManager rm = new ResourceManager("SinavGorevlendirme.Resources.Genel", typeof(TeacherController).Assembly);
            //foreach (var tch in teacher)
            //{
            //    tch.Unvan = rm.GetString((SG_DAL.Enums.EnumUnvan)tch.Unvan);
            //}

            return(View(teacher));
        }
        public ActionResult CreateTeacherForIdari()
        {
            HttpCookie myCookie = new HttpCookie("LoginCookie");

            myCookie = Request.Cookies["LoginCookie"];

            //Int64 tcno = Convert.ToInt64(myCookie.Value.Split('&')[0].Split('=')[1].ToString());
            Int64 tcno = Convert.ToInt64(myCookie.Value.Split('=')[1].ToString());

            School sch = SchoolManager.GetSchoolByTCNo(tcno);

            List <School> schList = new List <School>();

            schList.Add(sch);

            var list = new SelectList(schList, "SchoolId", "Ad");

            ViewBag.SchoolList = list;


            if (myCookie != null)
            {
                ViewBag.School   = sch.Ad;
                ViewBag.SchoolId = sch.SchoolId;
            }

            var             items = new List <UnvanHelper>();
            ResourceManager rm    = new ResourceManager("SinavGorevlendirme.Resources.Genel", typeof(TeacherController).Assembly);

            foreach (var unv in Enum.GetValues(typeof(EnumUnvan)))
            {
                items.Add(new UnvanHelper((int)unv, rm.GetString(unv.ToString())));
            }

            var unvanList = new SelectList(items, "UnvanId", "Unvan");

            ViewBag.UnvanList = unvanList;
            return(View());
        }