public string GenerateReport() { SelectAll(); string main_tmpl = File.ReadAllText("tmpl/final_grade_main.htm"); string erow = GetSub(main_tmpl, "<%erow%>", "</%erow%>"); string orow = GetSub(main_tmpl, "<%orow%>", "</%orow%>"); string rows = ""; string trow = ""; // main_tmpl = main_tmpl.Replace("%inst_name%", Program.main.CurrentLogin); main_tmpl = main_tmpl.Replace("%season%", Program.main.CurrentSeason); main_tmpl = main_tmpl.Replace("%year%", Program.main.CurrentYear.ToString()); main_tmpl = main_tmpl.Replace("%course_name%", Program.main.CurrentCourse); for (int i = 0; i < dlist.Count; i++) { cInstSignupViewRow d = (cInstSignupViewRow)dlist[i]; if (d != null) { if ((i & 1) == 1) { trow = orow; // odd } else { trow = erow; // even } trow = trow.Replace("%id%", d.Last4ID); trow = trow.Replace("%grade_points%", d.GradePoints); string gl = d.GradeLetter; if (gl.Length < 1) { trow = trow.Replace("%grade_letter%", " "); } else { trow = trow.Replace("%grade_letter%", gl); } rows += trow; } } main_tmpl = ReplaceSub(main_tmpl, rows, "<%rows%>", "</%rows%>"); return(main_tmpl); }
public override int UpdateDB(object o) { // custom update signup cInstSignupViewRow d = (cInstSignupViewRow)o; if (d != null) { vlist.Reset(); vlist.Add(nlist[2].ToString(), d.data[5]); // grade_letter vlist.Add(nlist[3].ToString(), d.data[6]); // grade_points vlist.Add(nlist[4].ToString(), d.data[8]); // details string sql = string.Format("{0} WHERE {1}={2} AND {3}={4}", vlist.SQL, nlist[0], d.data[3], nlist[1], d.data[2] ); return(Update("js_signup", sql)); } return(1); }