public classStudent LoginStudent(string id, string password) { //first check if user exists as a Student then check if password is true if (database.table_student.Any(user => user.idStudent == id) && database.table_user.Any(user => user.idUser == id && user.password == password)) { //return Class student this.user = new classStudent(id, database, this.IsTA(id), numberYearFromStart, term); return((classStudent)this.user); } return(null); }
//login method and creater of professor public classProfessor LoginProfessor(string id, string password) { //first check if user exists as a professor then check if password is true if (database.table_professor.Any(user => user.idProfessor == id) && database.table_user.Any(user => user.idUser == id && user.password == password)) { //return professor if user is valid this.user = new classProfessor(id, database, this.IsPrimeProfessor(id), numberYearFromStart, term); return((classProfessor)this.user); } return(null); }