Ejemplo n.º 1
0
        public ActionResult RegisterStudentSubmit(string username, string password, string fname, string lname, string email, int yearLevel, float gpa)
        {
            if (!loggedIn())
            {
                return(RedirectToAction("Index", "Login", new { redirectAction = "Index", redirectController = "Admin" }));
            }
            if (!checkPermission())
            {
                return(RedirectToAction("AccessDenied", "Home"));
            }
            Student student = new Student(0, username, email, fname, lname, yearLevel, gpa);
            bool    success = proxy.createStudent(student, password);
            string  message = success ? "Student was successfully created!" : "There was an error creating the Student.";

            return(RedirectToAction("FormResponse", "Admin", new { message }));
        }