Skip to content

Instantly share code, notes, and snippets.

@L3au
Created June 11, 2012 15:35
Show Gist options
  • Save L3au/2910701 to your computer and use it in GitHub Desktop.
Save L3au/2910701 to your computer and use it in GitHub Desktop.
// 获取学生信息
public ArrayList getRecords(Hashtable ht) {
ArrayList<HashMap> list = null;
String stu_dept = "<select id=\"BO_STUDENT_DEPT\" width=\"100px\" >";
String linkStr = "";
String[] depts = { "计算机", "经管", "英语" };
try {
list = stuDao.getRecords(ht);
int j = 0;
for (HashMap map : list) {
if (map != null
&& !"".equals(map.get("BO_STUDENT_DEPT").toString())) {
for (int i = 0; i < depts.length; i++) {
if (depts[i].equals(map.get("BO_STUDENT_DEPT")
.toString())) {
stu_dept += "<option value=\"" + depts[i]
+ "\" selected>" + depts[i] + "<option>";
} else {
stu_dept += "<option value=\"" + depts[i] + "\" >"
+ depts[i] + "<option>";
}
}
stu_dept += "</select>";
map.put("BO_STUDENT_DEPT", stu_dept);
}
if (map != null) {
Date date = new Date();
String year = DateUtil.formatYMD(date);
if (map.get("BO_STUDENT_YEAR") != null
&& !"".equals(map.get("BO_STUDENT_YEAR").toString())) {
linkStr = "<input type=text size=12 id=BO_STUDENT_YEAR name=BO_STUDENT_YEAR"
+ j
+ " value="
+ map.get("BO_STUDENT_YEAR").toString()
+ " readonly "
+ "onfocus=\"WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd'})\" onChange=\"saveEnrollmentDate('"
+ j
+ "','"
+ map.get("BO_STUDENT_YEAR").toString()
+ "')\" "
+ "class=\"Wdate\" MINDATE=\"#F{$('BO_STUDENT_YEAR"
+ j
+ "').innerText}\" style=\"background-color: white;\">";
} else {
linkStr = "<input type=text size=12 id=BO_STUDENT_YEAR name=BO_STUDENT_YEAR"
+ j
+ " value="
+ year
+ " readonly "
+ "onfocus=\"WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd'})\" onChange=\"saveEnrollmentDate('"
+ j
+ "','"
+ map.get("BO_STUDENT_YEAR").toString()
+ "')\" "
+ "class=\"Wdate\" MINDATE=\"#F{$('BO_STUDENT_YEAR"
+ j
+ "').innerText}\" style=\"background-color: white;\">";
}
j++;
map.put("BO_STUDENT_YEAR", linkStr);
}
}
} catch (Exception e) {
e.printStackTrace();
}
return list;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment