public ActionResult HopDongTruong(int schoolId) { Account account = (Account)Session[CommonConstant.USER_SESSION]; if (account == null) { return(Json(new ReturnFormat(403, "Access denied", null), JsonRequestBehavior.AllowGet)); } string MaTruong = schoolRepository.GetSchoolById(schoolId).MaTruong; List <HopDong> HopDongs = hopDongRepository.GetHopDongsBySchoolId(schoolId); var hopDongJson = JsonConvert.SerializeObject(new KiemTraTruongDTO(MaTruong, HopDongs), Formatting.None, new JsonSerializerSettings() { ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore }); return(Json(new ReturnFormat(200, "success", hopDongJson), JsonRequestBehavior.AllowGet)); }
public ActionResult ThongTinDonVi(string matruong) { School school = schoolRepository.GetSchoolByMaTruong(matruong.Trim()); if (school == null || school.IsDaTaoMoi == false) { return(RedirectToRoute("kiemtramatruong")); } List <District> districts = districtRepository.GetDistrictsByProvinceId(79); List <Ward> wards; if (school.WardId == null) { wards = wardRepository.GetWardsByDistrictId(760); } wards = wardRepository.GetWardsByDistrictId(school.Ward.DistrictID); ThongTinTruongOneViewModel thongTinTruongOneViewModel = new ThongTinTruongOneViewModel(school, districts, wards); ViewBag.HopDongDaKis = hopDongRepository.GetHopDongsBySchoolId(school.Id); return(View(thongTinTruongOneViewModel)); }