/// <summary> /// 删除学生信息 /// </summary> /// <param name="ids"></param> /// <returns></returns> public int deleteStudent(string ids) { bool isOK = new JiaJiBLL.stubll().DelStudent(ids); if (isOK) { return(0); } else { return(1); } }
public JsonResult addStudent(JiaJiModels.student infor) { try { infor.Image = "/image/" + infor.Image; var i = new JiaJiBLL.stubll().addStu(infor); if (i > 0) { return(Json(new { Success = true, Message = "添加成功" })); } else { return(Json(new { Success = false, Message = "添加失败" })); } } catch { return(Json(new { Success = false, Message = "添加失败" })); } }
public JsonResult editStudent(JiaJiModels.student model) { try { int id = model.StudentID; var i = new JiaJiBLL.stubll().UpdateStu(model); if (i > 0) { return(Json(new { Success = true, Message = "修改成功" })); } else { return(Json(new { Success = false, Message = "修改失败" })); } } catch { return(Json(new { Success = false, Message = "修改失败" })); } }
public JsonResult getStudent(int page, int rows, int?CollegeID = null, int?EducationID = null, int?CountryID = null) { var list = new JiaJiBLL.stubll().stushow(); var result = new { total = list. Where(e => (CollegeID == null ? true : e.CollegeID == CollegeID) && (EducationID == null ? true : e.EducationID == EducationID) && (CountryID == null ? true : e.CountryID == CountryID) ).Count(), rows = list. Where(e => (CollegeID == null ? true : e.CollegeID == CollegeID) && (EducationID == null ? true : e.EducationID == EducationID) && (CountryID == null ? true : e.CountryID == CountryID) ).Skip((page - 1) * rows).Take(rows) }; return(Json(result)); }
/// <summary> /// 获取就读学院 /// </summary> /// <returns></returns> public string TeamJson() { List <JiaJiModels.Team> list = new JiaJiBLL.stubll().Tshow(); return(JsonConvert.SerializeObject(list)); }