public void OnGet() { var courseDao = new CourseDao(); Courses = courseDao.GetAll(); var subjectDao = new SubjectDao(); Subjects = subjectDao.GetAll(); }
public JsonResult ExsitsCourseName(string cou_Coursename, int?cou_id) { CourseDao dao = new CourseDao(); List <course> lts_cou = dao.GetAll(); if (cou_id != null) { lts_cou.Remove(dao.GetById(cou_id)); //////////////?????????????????????? } return(Json(!lts_cou.Any(x => x.co_name.Trim().ToLower() == cou_Coursename.Trim().ToLower()), JsonRequestBehavior.AllowGet)); }