Esempio n. 1
0
        // GET: StudentHD/Home
        public ActionResult Index()
        {
            var session = (UserLogin)Session[CommonConstants.USER_SESSION];
            int idStd   = service.FindStudent(session.UserName);

            return(View("Index", service2.GetStudent(idStd)));
        }
Esempio n. 2
0
        // GET: StudentHD/Register
        public ActionResult Index()
        {
            var session = (UserLogin)Session[CommonConstants.USER_SESSION];
            int idStd   = service.FindStudent(session.UserName);

            var model = new DetailScheduleStudent();

            model.listSchedule = service.GetListSchedule(idStd);
            model.listCar      = service2.GetListAllCar();
            model.listStudent  = service2.GetListAllStudent();
            model.listTeacher  = service2.GetListAllTeacher();
            return(View("Index", model));
        }
Esempio n. 3
0
        public ActionResult Register(int id = -1, int hour = 0, int day = 0, int month = 0, int year = 0)
        {
            var session = (UserLogin)Session[CommonConstants.USER_SESSION];
            int idStd   = service2.FindStudent(session.UserName);

            if (id < 0 || hour < 1 || hour > 4 || day < 1 || day > 30 || year < 2016 || year > 2019)
            {
                ModelState.AddModelError("error", "ERROR!");
            }
            else if (service2.RegisterClass(idStd, id))
            {
                ModelState.AddModelError("error", "Add OK!");
            }
            else
            {
                ModelState.AddModelError("error", "ERROR!");
            }
            return(Detail(hour, day, month, year));
        }