public void ChooseCourse(string st_Id, int pc_Id, string LearnYear, int LearnTerm, string te_id) { int result = course.ChooseCourse(st_Id, pc_Id, LearnYear, LearnTerm, te_id); switch (result) { case 1: JScript.AlertAndRedirect("选课成功!", "ChooseCourse.aspx"); break; case -2: JScript.AlertAndRedirect("已经选了该课程了!", "ChooseCourse.aspx"); break; case -1: JScript.AlertAndRedirect("超出人数限制了!", "ChooseCourse.aspx"); break; case 0: JScript.AlertAndRedirect("选课失败!", "ChooseCourse.aspx"); break; } }