/* public IQueryable<TinViecLam> timKiemTinViecLam(SearchHomeModel searchModel) * { * var result = db.TinViecLams.AsQueryable(); * IEnumerable<CongTy> congTies = db.CongTies.Where(t => t.ID_ThanhPho == searchModel.ID_ThanhPho).AsEnumerable(); * * TinViecLam tinViecLam = db.TinViecLams.Where * * if (searchModel != null) * { * * if (searchModel.ID_NganhNghe.HasValue) * result = result.Where(x => x.ID_NganhNghe == searchModel.ID_NganhNghe && x.ID_CongTy = (congTies.)); * * * * result = result.Where(x => x.ID_CongTy); * * * * * * * } * return result; * } */ public SearchHomeModel listHome() { CongTyDAO congTyDAO = new CongTyDAO(); NganhNgheDAO ngheDAO = new NganhNgheDAO(); ThanhPhoDAO thanhPhoDAO = new ThanhPhoDAO(); TinViecLamDAO tinViecLamDAO = new TinViecLamDAO(); var CongTyList = congTyDAO.dsCongTy(); var NganhNGheList = ngheDAO.dsNganhNghe(); var thanhPhoList = thanhPhoDAO.dsThanhPho(); var tinviecLamList = tinViecLamDAO.dsTinViecLam(); var cV_UngViens = db.CV_UngVien.ToList(); var UngViens = db.UngViens.ToList(); var model = new SearchHomeModel() { CvUngviens = cV_UngViens, Ungviens = UngViens, ThanhPhos = thanhPhoList, NganhNghes = NganhNGheList, CongTys = CongTyList, TinViecLams = tinviecLamList }; return(model); }
public HomeView ListDetail(int?id) { if (db.TinViecLams.Find(id) == null) { return(null); } TinViecLam tinViecLam = db.TinViecLams.Find(id); var congty = db.CongTies.Find(tinViecLam.ID_CongTy); var thanhPho = db.ThanhPhoes.Find(congty.ID_ThanhPho); var nganhNghe = db.NganhNghes.Find(tinViecLam.ID_NganhNghe); var trinhdo = db.TrinhDoes.Find(tinViecLam.ID_TrinhDo); var kinhnghiem = db.KinhNghiems.Find(tinViecLam.ID_KinhNghiem); var vitri = db.ViTriUngTuyens.Find(tinViecLam.ID_ViTri); CongTyDAO congTyDAO = new CongTyDAO(); NganhNgheDAO ngheDAO = new NganhNgheDAO(); ThanhPhoDAO thanhPhoDAO = new ThanhPhoDAO(); TinViecLamDAO tinViecLamDAO = new TinViecLamDAO(); var CongTyList = congTyDAO.dsCongTy(); var tinviecLamList = tinViecLamDAO.dsTinViecLam(); var model = new HomeView { CongTy = congty, ThanhPho = thanhPho, NganhNghe = nganhNghe, TrinhDo = trinhdo, KinhNghiem = kinhnghiem, ViTriUngTuyen = vitri, TinViecLam = tinViecLam, TinViecLams = tinviecLamList, CongTies = CongTyList, }; return(model); }