public List <ListStudent> ListFilterUni(Guid UniversityID) { var listUser = new UserDao().ListUser(); var listStudent = new UserLearningDao().ListUserLearning(); var listJob = new UserMajorDao().ListUserMajor(); var result = (from user in listUser join student in listStudent on user.UserId equals student.UserID join job in listJob on user.UserId equals job.UserID where student.SchoolID == UniversityID select new { UserName = user.UserName, UserBirthDay = user.UserBirthDay, UserEmail = user.UserEmail, UserMobile = user.UserMobile, JobName = db.JobMajors.Find(student.Major).JobName, NameArea = db.Areas.Find(user.UserArea).NameArea, LanguageLevel = db.UserForeignLanguages.Find(user.UserId).LanguageLevel, listJob = db.JobMajors.Where(x => x.JobID == job.MajorID).Select(x => x.JobName).ToList(), }).AsEnumerable().Select(x => new ListStudent() { UserName = x.UserName, UserBirthDay = x.UserBirthDay, UserEmail = x.UserEmail, UserMobile = x.UserMobile, JobName = x.JobName, NameArea = x.NameArea, LanguageLevel = x.LanguageLevel, listJob = x.listJob }); return(result.ToList()); }
public List <ShowInfoCandidate> InfoUser(Guid UserID) { var listUser = new UserDao().ListUsers(); var listMajor = new UserMajorDao().ListUserMajor(); var listStudy = new UserLearningDao().ListUserLearning(); var result = (from user in listUser join major in listMajor on user.UserId equals major.UserID join study in listStudy on user.UserId equals study.UserID where user.UserId == UserID select new { UserName = user.UserName, UserImage = user.UserImage, UserBirthDay = user.UserBirthDay, UserEmail = user.UserEmail, UserAddress = user.UserAddress, UserMobile = user.UserMobile, listJob = db.JobMajors.Where(x => x.JobID == major.MajorID).Select(x => x.JobName).ToList(), Amount = db.Salaries.Find(user.Salary).Amount, NamePosition = db.PositionEmployees.Find(user.PositionApply).NamePosition, UserArea = db.Areas.Find(user.UserArea).NameArea, StudyLevel = db.LevelLearnings.Find(study.StudyLevel).NameLevel, SchoolName = study.SchoolName, TimeStart = study.TimeStart, TimeEnd = study.TimeEnd, JobName = db.JobMajors.Find(study.Major).JobName, }).AsEnumerable().Select(x => new ShowInfoCandidate() { UserName = x.UserName, UserImage = x.UserImage, UserBirthDay = x.UserBirthDay, UserEmail = x.UserEmail, UserAddress = x.UserAddress, UserArea = x.UserArea, UserMobile = x.UserMobile, listJob = x.listJob, Amount = x.Amount, NamePosition = x.NamePosition, StudyLevel = x.StudyLevel, SchoolName = x.SchoolName, TimeStart = x.TimeStart, TimeEnd = x.TimeEnd, JobName = x.JobName }); return(result.ToList()); }