public IView Register(string username, string password, string confirmPassword, string role) { if (password != confirmPassword) { throw new ArgumentException("The provided passwords do not match."); } this.EnsureNoLoggedInUser(); var existingUser = this.Data.Users.GetByUsername(username); if (existingUser != null) { throw new ArgumentException(string.Format("A user with username {0} already exists.", username)); } Role userRole = (Role)Enum.Parse(typeof(Role), role, true); var user = new User(username, password, userRole); this.Data.Users.Add(user); return this.View(user); }
public CoursesController(IBangaloreUniversityDate data, User user) { this.Data = data; this.User = user; }
public Logout(User user) : base(user) { }
public void AddStudent(User student) { this.Students.Add(student); student.Courses.Add(this); }
public Register(User user) : base(user) { }
public Login(User user) : base(user) { }