protected void DropDownList_Options_SelectedIndexChanged(object sender, EventArgs e) { //so option selection .. need to get TQM data DropDownList_Component.Items.Clear(); ExamCompononent_List ecl1 = new ExamCompononent_List(); ecl1.Load(new Guid(DropDownList_Options.SelectedItem.Value)); if (ecl1.m_list.Count > 0) { foreach (ExamComponent ec1 in ecl1.m_list) { DropDownList_Component.Items.Add(new System.Web.UI.WebControls.ListItem(ec1.m_ComponentCode + " : " + ec1.m_ComponentTitle, ec1.m_ComponentID.ToString())); } DropDownList_Components_SelectedIndexChanged(sender, e); } }
protected void DropDownList_ExamBoards_SelectedIndexChanged(object sender, EventArgs e) { ExamOption_List exol1 = new ExamOption_List(); exol1.Load(DropDownList_ExamBoards.SelectedValue, YearCode.ToString(), SeasonCode.ToString()); DropDownList_Options.Items.Clear(); foreach (ExamOption e1 in exol1.m_list)//only add if we HAVE components!! { ExamCompononent_List ecl1 = new ExamCompononent_List(); ecl1.Load(e1.m_OptionID); if (ecl1.m_list.Count > 0) { ListItem l1 = new ListItem(e1.m_OptionCode + ":" + e1.m_OptionTitle, e1.m_OptionID.ToString()); DropDownList_Options.Items.Add(l1); } } DropDownList_Options_SelectedIndexChanged(sender, e); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Utility u1 = new Utility(); DateTime t1 = new DateTime(); DateTime t0 = new DateTime(); DateTime t2; t0 = u1.ThisExamSeasonStart(); t1 = u1.ThisExamSeasonEnd(t0); string season = u1.ThisSeason(t0); season = "3"; ArrayList m_list = new ArrayList(); PersonID = u1.GetPersonIdfromRequest(Request); #if DEBUG u1.Is_student = true; u1.Is_student = true; PersonID = u1.GetPersonIDX(@"CHALLONERS\william.arnold");//development #endif string s = ""; string s1 = ""; if ((PersonID != Guid.Empty) && (u1.Is_student)) { s1 += "<br><center><h2>Exam Entries</h2></center>"; s1 += "<p align=\"center\"><TABLE BORDER><Tr>"; s = "Option"; s1 += "<Th>" + s + "</Th>"; s = "Code"; s1 += "<Th>" + s + "</Th>"; s = "Qualification"; s1 += "<Th>" + s + "</Th>"; s = "Level"; s1 += "<Th>" + s + "</Th>"; s = "Status"; s1 += "<Th>" + s + "</Th>"; s1 += "</Tr>"; ExamEntries_List exl1 = new ExamEntries_List(); exl1.Load(u1.GetStudentId(PersonID)); foreach (Exam_Entry ex1 in exl1.m_list) { ExamOption exo1 = new ExamOption(); exo1.Load(ex1.m_OptionID); //if ((ex1.m_season == season) && (ex1.m_year == t0.Year.ToString())&&(!ex1.m_withdrawn)) if ((ex1.m_year == t0.Year.ToString()) && (!ex1.m_withdrawn)) { //ExamOption exo1 = new ExamOption(); exo1.Load(ex1.m_OptionID); //if (exo1.m_Item == "C") { s1 += "<TR>"; s = exo1.m_OptionTitle; s1 += "<TD>" + s + "</TD>"; s = exo1.m_OptionCode; s1 += "<TD>" + s + "</TD>"; s = exo1.m_OptionQualification; s1 += "<TD>" + s + "</TD>"; if (exo1.m_OptionLevel != "B") { s = exo1.m_OptionLevel; s1 += "<TD>" + s + "</TD>"; } else { s1 += "<TD></TD>"; } if (ex1.m_EntryFileID == Guid.Empty) { //if DCGS board then Mock/Internal exam if (exo1.m_ExamBoardID.ToString() == "436ff234-0457-430a-b1e2-b08758ff30ef") { //so internal.. if Jan is mocks.. if (exo1.m_Season_code == "1") { s1 += "<td>Mock</td>"; } else { s1 += "<td>Internal</td>"; } } else { s1 += "<TD>Provisional</TD>"; } } else { s1 += "<TD>Entered</TD>"; } s1 += "</TR>"; } ExamCompononent_List excl1 = new ExamCompononent_List(); excl1.Load(ex1.m_OptionID); foreach (ExamComponent ec in excl1.m_list) { if (ec.m_Timetabled == "T") { ExamComponent ec2 = new ExamComponent(); ec2 = ec; m_list.Add(ec2); ec2.m_OptionTitle = exo1.m_Syllabus_Title; } } } } s1 += "</TABLE>"; s1 += "<center>FC = Full Course, SC = Short(Half) Course<br>"; foreach (ExamComponent ec in m_list) { t2 = System.Convert.ToDateTime(ec.m_TimetableDate); if (t2 < t1) { t1 = System.Convert.ToDateTime(ec.m_TimetableDate); } if (t2 > t0) { t0 = System.Convert.ToDateTime(ec.m_TimetableDate); } } int month = t1.Month; ExamComponent ecx; int day = t1.Day; s1 += "<br><br><br><center><h2>Outline Exam Timetable</h2>"; s1 += "Full Exam Timetable can be found <a href=\"ExamTimetables.aspx?\">here</a></center>"; s1 += "<center>Note that for GCSE Languages the tier (Foundation or Higher) is not significant. "; s1 += "<BR><p align=\"center\"><TABLE BORDER><TR>"; s = "Date"; s1 += "<Th>" + s + "</Th>"; s = "AM Session"; s1 += "<Th>" + s + "</Th>"; s = "PM Session"; s1 += "<Th>" + s + "</Th>"; s1 += "</TR>"; //from t1 to t0... t2 = t1; t0 = t0.AddDays(1); while (t2 < t0) { if ((t2.DayOfWeek.ToString() != "Saturday") && (t2.DayOfWeek.ToString() != "Sunday")) { s1 += "<TR>"; s = t2.DayOfWeek.ToString(); s += "<br>" + t2.ToShortDateString(); s1 += "<TD>" + s + "</TD>"; s = ""; ecx = null; foreach (ExamComponent ec in m_list) { if ((t2 == System.Convert.ToDateTime(ec.m_TimetableDate)) && (ec.m_TimetableSession == "A")) { s += ec.m_OptionTitle + ec.m_ComponentTitle.ToLower() + "<br>"; ecx = ec; } } if (ecx != null) { m_list.Remove(ecx); } s1 += "<TD>" + s + "</TD>"; s = ""; ecx = null; foreach (ExamComponent ec in m_list) { if ((t2 == System.Convert.ToDateTime(ec.m_TimetableDate)) && (ec.m_TimetableSession == "P")) { s += ec.m_OptionTitle + ec.m_ComponentTitle.ToLower() + "<br>"; ecx = ec; } } m_list.Remove(ecx); s1 += "<TD>" + s + "</TD>"; s1 += "</TR>"; } t2 = t2.AddDays(1); } s1 += "</TABLE>"; servercontent.InnerHtml = s1; } } }
/* * private void RenderModuleResultLine(HttpResponse Response, Result r1,bool retake) * { * string s = ""; * ExamOption exo1 = new ExamOption(); * Response.Write("<TR>"); * s = r1.Date.ToShortDateString(); Response.Write("<TD>" + s + "</TD>"); * s = r1.Coursename; Response.Write("<TD>" + s + "</TD>"); * s = r1.OptionTitle; Response.Write("<TD>" + s + "</TD>"); * s = r1.OptionCode; Response.Write("<TD>" + s + "</TD>"); * s = r1.Value; Response.Write("<TD>" + s + "</TD>"); * s = r1.OptionMaximumMark; Response.Write("<TD>" + s + "</TD>"); * * s = ""; * if (r1.Resulttype == 27)//UMS mark for GCSE * { * try * { * double v1 = System.Convert.ToDouble(r1.Value); * double v2 = System.Convert.ToDouble(r1.OptionMaximumMark); * v1 = v1 / v2; * if (v1 >= 0.9) s = "a*"; * if ((v1 < 0.9) && (v1 >= 0.8)) s = "a"; * if ((v1 < 0.8) && (v1 >= 0.7)) s = "b"; * if ((v1 < 0.7) && (v1 >= 0.6)) s = "c"; * if ((v1 < 0.6) && (v1 >= 0.5)) s = "d"; * if ((v1 < 0.5) && (v1 >= 0.4)) s = "e"; * if ((v1 < 0.4)) s = "u"; * } * catch (Exception exc1) * { * s = exc1.Message; * } * } * if (r1.Resulttype == 11)//GCE module mark * { * try * { * double v1 = System.Convert.ToDouble(r1.Value); * double v2 = System.Convert.ToDouble(r1.OptionMaximumMark); * v1 = v1 / v2; * if (v1 >= 0.8) s = "a"; * if ((v1 < 0.8) && (v1 >= 0.7)) s = "b"; * if ((v1 < 0.7) && (v1 >= 0.6)) s = "c"; * if ((v1 < 0.6) && (v1 >= 0.5)) s = "d"; * if ((v1 < 0.5) && (v1 >= 0.4)) s = "e"; * if ((v1 < 0.4)) s = "u"; * } * catch (Exception exc1) * { * s = exc1.Message; * } * } * * Response.Write("<TD>" + s + "</TD>"); * exo1.Load(r1.OptionId); * Exam_Board exb1 = new Exam_Board(exo1.m_ExamBoardID); * Response.Write("<TD>" + exb1.m_OrganisationFriendlyName + "</TD>"); * if (retake) * { * CheckBox cb1 = new CheckBox(); * cb1.ID = "CheckBox-" + r1.OptionId.ToString() ; * Response.Write("<TD><asp:CheckBox ID=\"" + cb1.ID.ToString() + "\" runat=\"server\" /></TD>"); * } * Response.Write("</TR>"); * } * * private void RenderModuleResultTableHeader(HttpResponse Response, Guid PersonId,bool retake) * { * Utility u1 = new Utility(); * Response.Write("<H1><center> Module Results for " + u1.GetPersonName(PersonID) + "</H1></center><BR>"); * Response.Write("<BR><p align=\"center\"><TABLE BORDER><TR>"); * Response.Write("<TD>Date</TD>"); * Response.Write("<TD>Subject</TD>"); * Response.Write("<TD>Option Title</TD>"); * Response.Write("<TD>Option Code</TD>"); * Response.Write("<TD>Result</TD>"); * Response.Write("<TD>Max Mark</TD>"); * Response.Write("<TD>Grade</TD>"); * Response.Write("<TD>Exam Board</TD>"); * if (retake) Response.Write("<TD>Retake ?</TD>"); * Response.Write("</TR>"); * } */ protected void Button_submit_Click(object sender, EventArgs e) { Guid PersonID = (Guid)ViewState["PersonID"]; Table1.Visible = false; Label1.Visible = false; TextBox_cost.Visible = false; Button_submit.Visible = false; Label_title.Visible = false; ExamOption exo1 = new ExamOption(); ExamCompononent_List ecl1 = new ExamCompononent_List(); string dates = ""; double cost = 0; double total = 0; Utility u1 = new Utility(); Guid[] list1 = new Guid[100]; int no_list1 = 0; bool in_list1 = false; PupilDetails pupil1 = new PupilDetails(u1.GetStudentId(PersonID).ToString()); int cover_cost = RetakeCoverCost(); string season = RetakeSeason(); string year = RetakeYear(); string s1 = RetakeMessage(); string s2 = ""; s2 = "<H2><center>Entry Requests for " + u1.GetPersonName(PersonID) + " " + u1.Get_Form(pupil1.m_StudentId.ToString()) + "(" + pupil1.m_examNo.ToString() + ")</H2></center><BR>"; s2 += "<H3><center>You should print this page and take it with your cheque "; s2 += "made out to DCGS to the Exams Office.</H3></center><BR><H3><center>" + s1 + "</H3></center><BR>"; s2 += "<BR><p align=\"center\"><TABLE BORDER><TR><TD>Option Code</TD><TD>Option Title</TD>"; s2 += "<TD>Exam Board</TD><TD>Date</TD><TD>Cost</TD><TD>Comment</TD></TR>"; resultlist1 = (ResultsList)ViewState["ResultList"]; string s = ""; CheckBox cb1 = new CheckBox(); foreach (Result r1 in resultlist1._results) { s = r1.OptionId.ToString(); cb1 = null; cb1 = (CheckBox)content.FindControl(s); if (cb1 != null) { if (cb1.Checked) { exo1.Load(r1.OptionId); ecl1.m_list.Clear(); ecl1.Load(r1.OptionId); Exam_ResitEntry exres1 = new Exam_ResitEntry(); exres1.Load(r1.StudentID, r1.OptionId); in_list1 = false; for (int i = 0; i < no_list1; i++) { if (list1[i] == r1.OptionId) { in_list1 = true; } } if (in_list1) { //already entered...... } else { s2 += "<TR><TD>" + r1.OptionCode + "</TD><TD>" + r1.OptionTitle + "</TD>"; Exam_Board exb1 = new Exam_Board(exo1.m_ExamBoardID); s2 += "<TD>" + exb1.m_OrganisationFriendlyName + "</TD>"; dates = ""; foreach (ExamComponent c1 in ecl1.m_list) { if (c1.m_Timetabled == "T") { dates += c1.m_TimetableDate.ToShortDateString(); } } s2 += "<TD>" + dates + "</TD>"; cost = (double)exo1.m_feeInt + cover_cost; exres1.Load(r1.StudentID, r1.OptionId); if (!exres1.m_valid) { exres1.m_cost = (int)cost; exres1.m_DateCreated = DateTime.Now; exres1.m_OptionId = r1.OptionId;//has been updated when we loaded it to be the new one.. exres1.m_season = season; exres1.m_year = year; exres1.m_StudentId = u1.GetStudentId(PersonID); exres1.m_version = 1; exres1.Save(); } cost = cost / 100; total += cost; s2 += "<TD>" + cost.ToString() + "</TD>"; if (exo1.NeedsTeacherMarks()) { s2 += "<TD>Warning - Needs CW</TD></TR>"; } else { s2 += "<TD></TD></TR>"; } list1[no_list1] = r1.OptionId; no_list1++; } } else { Exam_ResitEntry exres1 = new Exam_ResitEntry(); exres1.Load(r1.StudentID, r1.OptionId); if (exres1.m_valid) { exres1.Delete(); //need to delete it!!!; } } } } s2 += "</TABLE> <H3><center>Total Cost : £" + total.ToString() + "</H3></center><H3><center>Dates are provisional!</H3></center>"; servercontent.InnerHtml = s2; }