public ActionResult HopDongTaoLap() { Account account = (Account)Session[CommonConstant.USER_SESSION]; if (account == null) { return(RedirectToRoute("login")); } List <District> districts = districtRepository.GetDistrictsByProvinceId(79); List <CapTruong> captruongs = capTruongRepository.GetCapTruongs(); List <School> schools = schoolRepository.GetSchoolsByDistrictAndCapHoc(760, 1); HopDongOneViewModel hopDongOneViewModel = new HopDongOneViewModel(districts, captruongs, schools); return(View(hopDongOneViewModel)); }
public ActionResult ThemMoiHopDongGiaHan() { Account account = (Account)Session[CommonConstant.USER_SESSION]; if (account == null) { return(RedirectToRoute("login")); } List <District> districts = districtRepository.GetDistrictsByProvinceId(79); List <CapTruong> captruongs = capTruongRepository.GetCapTruongs(); List <School> schools = schoolRepository.GetSchoolsByDistrictAndCapHoc(760, 1).Where(s => s.IsDaTaoMoi == true).ToList(); //List<School> schoolDaGiaHan = hopDongRepository.GetHopDongsByYear(DateTime.Now.Year).Select(s => s.School).ToList(); //List<School> schoolChuaGiaHan = schools.Where(s => !schoolDaGiaHan.Any(s1 => s.Id == s1.Id)).ToList(); HopDongOneViewModel hopDongOneViewModel = new HopDongOneViewModel(districts, captruongs, schools); return(View(hopDongOneViewModel)); }