Пример #1
0
        public IActionResult Registration(viewModelStudentCourse student)
        {
            //send it to the DB
            //validate the info


            DALStudent dp  = new DALStudent(configuration);
            int        uID = dp.addStudent(student);

            student.UID             = uID;
            student.Courses         = new Courselist();
            student.Courses.Courses = dp.getCourses(student.UID);



            //save the User ID to the session
            HttpContext.Session.SetString("uID", uID.ToString()); //write to the session
            string strUID = HttpContext.Session.GetString("uID"); //reads from the session


            return(View(student));
        }