protected void Page_Load(object sender, EventArgs e) { if (!IsRetakeActive()) { servercontent.InnerHtml = "<H3><center>No re-take entries are possible at this time.</center></H3>"; Label1.Visible = false; TextBox_cost.Visible = false; Button_submit.Visible = false; Label_title.Visible = false; return; } Utility u1 = new Utility(); PersonID = u1.GetPersonIdfromRequest(Request); #if DEBUG //u1.Is_student = true; PersonID = u1.GetPersonIDX(@"CHALLONERS\michael.warren");//development //u1.Is_student = true;PersonID = u1.GetPersonIDX(@"CHALLONERS\Henry.Anning");//development #endif //u1.Is_student = true; PersonID = u1.GetPersonIDX(@"CHALLONERS\Benjamin.Smith1");//development if ((PersonID == Guid.Empty)) { Response.Write("<center> No Data to display</center>"); return; } if (!IsPostBack) { ViewState.Add("PersonID", PersonID); ResultsList rl = new ResultsList(); rl.LoadList("StudentPersonId", PersonID.ToString()); resultlist1._results.Clear(); ExamOption exo1 = new ExamOption(); TextBox_cost.Text = "0"; //first time we load ... get the results data... foreach (Result res1 in rl._results) { if (res1.OptionItem == "U") { Result r1 = new Result(); r1 = res1; r1.Valid = false; exo1.Load(res1.OptionId); exo1.Load(exo1.m_OptionCode, RetakeSeason(), RetakeYear(), exo1.m_ExamBoardID); r1.Valid = exo1.m_valid; //if (exo1.NeedsTeacherMarks()) r1.Valid = false;//try to disable csewrk modules..?? resultlist1._results.Add(r1); r1.OptionId = exo1.m_OptionID;//update optionID!!!! } } ViewState.Add("ResultList", resultlist1); } resultlist1 = (ResultsList)ViewState["ResultList"]; int cost = AddControls(resultlist1, !IsPostBack); if (!IsPostBack) { double x = (double)cost; x = x / 100; TextBox_cost.Text = x.ToString(); ViewState.Add("cost", cost); } }
private ExamOption Find_OptionEntry1(string f, string code, Exam_Board eb, string season, string series, string year) { ExamOption exo1 = new ExamOption(); if (exo1.Load(code, season, year, eb.m_ExamBoardId)) { return(exo1); } Stream myStream; string s = ""; string s1 = ""; string s2 = ""; string s_file = "S" + f.Substring(1, f.Length - 1); string line; string Qualification; int JCQ_Version = 0; if ((myStream = File.Open(path + f, FileMode.Open)) != null) { using (StreamReader sr = new StreamReader(myStream)) { //ExamFiles exfiles1 = new ExamFiles(); while ((line = sr.ReadLine()) != null) { s = line.Substring(0, 2); Qualification = line.Substring(14, 4); s1 = line.Substring(2, 6); if (code.Length > 6) { code = code.Substring(0, 6); } s2 = line.Substring(8, 6);//syllabus code.. if (s == "O1") { JCQ_Version = Convert.ToInt32(line.Substring(24, 2)); } if ((s1.Trim().ToUpper() == code.Trim().ToUpper()) && (s == "O5")) { Load_Option(line, eb, season, series, year, s_file, path, JCQ_Version); if (exo1.Load(s1, season, year, eb.m_ExamBoardId)) { return(exo1); } } } } } return(null);//not found }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.QueryString.Count >= 2) { string s = "test"; string id0 = Request.QueryString["StudentId"]; ViewState.Add("StudentId", id0); string id1 = Request.QueryString["OptionId"]; ExamComponentResultList ecrl1 = new ExamComponentResultList(); ecrl1.Load_OptionStudent(new Guid(id1), new Guid(id0)); SimplePupil pupil1 = new SimplePupil(); pupil1.Load(id0); ExamOption exo1 = new ExamOption(); exo1.Load(new Guid(id1)); ExamComponent ec1 = new ExamComponent(); ResultsList rl1 = new ResultsList(); rl1.LoadListSimple(" WHERE (ExamsOptionId = '" + id1 + "') AND (StudentID = '" + id0 + "')"); Result r1 = new Result(); r1 = (Result)rl1._results[0]; s = " <p><h3> Component Scores for "; s += pupil1.m_GivenName + " " + pupil1.m_Surname + " for " + exo1.m_OptionTitle + "(" + r1.Text + ")</h3></p>"; s += "This table gives your component marks for this subject. Please note these are <b>not</b> UMS marks. "; s += "<br/> The sum of the component marks gives your TQM (Total Qualification Mark), which leads to your final grade."; s += "The table below tells you how the TQM is related to the final grade, i.e. the grade boundaries, if we know them! If not, please speak to a member of staff in school."; s += "<br/><br /> Note that for Drama and Music the non-integer Scaling factors may mean that the component marks do not exactly add up to the TQM. In this case the TQM is CORRECT!<br/>"; s += "<br/><br /><TABLE BORDER class=\"ResultsTbl\" style = \"font-size:small\" align=\"center\">"; s += "<TR><th>Syllabus Code</th><th>Option Code</th><th>Component Code</th><th>Component Name</th>"; s += "<th>Mark</th> <th>Max Mark</th></tr>"; foreach (ExamComponentResult r in ecrl1.m_list) { ec1.Load(r.ComponentId); s += "<tr align=\"center\">"; s += "<td>" + exo1.m_Syllabus_Code + "</td>"; s += "<td>" + exo1.m_OptionCode + "</td>"; s += "<td>" + ec1.m_ComponentCode + "</td>"; s += "<TD>" + ec1.m_ComponentTitle + "</td>"; s += "<td>" + r.ComponentScaledMark.ToString() + "</td>"; s += "<td>" + ec1.m_MaximumMark.ToString() + "</td>"; s += " </tr>"; } s += "</table>"; ExamTQMBoundaryList bl1 = new ExamTQMBoundaryList();//will be ordered largest first bl1.LoadList(new Guid(id1), exo1.m_year_Code, exo1.m_Season_code); s += "<br/><br/>"; s += " <p><h3 align=\"center\" > TQM Grade Boundaries</h3></p>"; s += "<TABLE BORDER class=\"TimetableTable\" style = \"font-size:small\" align=\"center\" >"; s += "<tr><th>Grade</th><th> TQM </th></tr>"; foreach (ExamTQMBoundary eb in bl1.m_list) { s += "<tr><td>" + eb.Grade + "</td><td>" + eb.Mark + "</td></tr>"; } s += "</table>"; content.InnerHtml = s; } } }
protected void DropDownList_data_SelectedIndexChanged(object sender, EventArgs e) { if (DropDownList_data.SelectedIndex > -1) { string id = DropDownList_ExamBoards.SelectedValue; string s = ""; Exam_Board eb = new Exam_Board(new Guid(id)); ExamFiles ef = new ExamFiles(); foreach (ExamBaseOption ebo in ef.ExamsOptionsFromBaseData(eb, SeasonCode.ToString(), YearCode.ToString())) { if (ebo.m_OptionEntryCode == DropDownList_data.SelectedValue) { s = "Option Code: " + ebo.m_OptionEntryCode + Environment.NewLine; s += "Option Title: " + ebo.m_Title + Environment.NewLine; s += "Qualification/Level: " + ebo.m_Qualification + ebo.m_Level + Environment.NewLine; s += "Cost: " + ebo.m_Fee + Environment.NewLine; s += "SyllabusCode: " + ebo.m_SyllabusCode + Environment.NewLine; s += "Item (C=Cert.): " + ebo.m_Item + Environment.NewLine; s += "QCA Number: " + ebo.m_QCANumber + Environment.NewLine; ExamOption eo1 = new ExamOption(); if (eo1.Load(DropDownList_data.SelectedValue, SeasonCode.ToString(), YearCode.ToString(), eb.m_ExamBoardId)) { s += Environment.NewLine + Environment.NewLine + "Option is known to Cerval"; } else { s += Environment.NewLine + Environment.NewLine + "Option is NOT known to Cerval"; } TextBox1.Text = s; } } } }
public ExamOption Find_Option(string code, Exam_Board eb, string season, string year) { //find the entry in db... or search basedata files code = code + " "; if (code.Length > 6) { code = code.Substring(0, 6); } ExamOption exo1 = new ExamOption(); exo1.Load(code, season, year, eb.m_ExamBoardId); if (exo1.m_valid) { return(exo1); } string search = "O" + season + "?" + year + "_" + eb.m_LegacyExamBdId + ".X??"; string[] filelist = System.IO.Directory.GetFiles(path, search); foreach (string s1 in filelist) { int n = s1.ToUpper().IndexOf("O"); n = s1.ToUpper().LastIndexOf("O"); string s = s1.Substring(n); string series = s.Substring(1, 2); exo1 = Find_OptionEntry1(s, code, eb, season, series, year); if (exo1 != null) { return(exo1); } } return(null); }
protected void Button_Upload_Click(object sender, EventArgs e) { string id = DropDownList_ExamBoards.SelectedValue; Exam_Board eb1 = new Exam_Board(new Guid(id)); string s1 = DropDownList_data.SelectedValue; ExamOption exo1 = new ExamOption(); ExamFiles ef1 = new ExamFiles(); exo1.Load(s1, SeasonCode.ToString(), YearCode.ToString(), eb1.m_LegacyExamBdId); if (!exo1.m_valid) { ExamOption exo2 = ef1.Find_Option(s1, eb1, SeasonCode.ToString(), YearCode.ToString()); if (exo2 != null) { //Label_Result.Text = "Successfully uploaded " + exo.m_OptionCode + " : " + exo.m_OptionTitle + " to Cerval"; //DropDownList1.SelectedIndex = -1; //ListItem l = DropDownList1.SelectedItem; //DropDownList1.Items.Remove(l); } else { //Label_Result.Text = "Failed to upload " + exo.m_OptionCode + " : " + exo.m_OptionTitle + " to Cerval"; } } }
private void SetUpForReatkes() { List <ExamOption> list1 = new List <ExamOption>(); int no_new = 0; int no_found = 0; string Errors = "The following Options seem not to be offered this summer: "; ExamOption_List exoL1 = new ExamOption_List(); ExamFiles ef1 = new ExamFiles(); ExamOption exo1 = new ExamOption(); //load results for last JUNE sitting now. exoL1.Load((YearCode - 1).ToString(), SeasonCode.ToString()); foreach (ExamOption exo in exoL1.m_list) { Exam_Board eb1 = new Exam_Board(exo.m_ExamBoardID); exo1.Load(exo.m_OptionCode, SeasonCode.ToString(), YearCode.ToString(), eb1.m_LegacyExamBdId); if (exo1.m_valid) { no_found++; } else { if (!exo.NeedsTeacherMarks()) { ExamOption exo2 = ef1.Find_Option(exo.m_OptionCode, eb1, SeasonCode.ToString(), YearCode.ToString()); if (exo2 != null) { no_new++; } else { Errors += exo.m_OptionCode + ", "; } } else { list1.Add(exo); //list has those needing teacher marks } } } Label_Result.Text = "We made " + no_new.ToString() + " new options and found already " + no_found.ToString(); Label_Error.Text = Errors; //now need to offer those with coursework... if (list1.Count > 0) { DropDownList1.Visible = true; Button_Upload.Visible = true; foreach (ExamOption e in list1) { ListItem l = new ListItem(e.m_OptionCode + e.m_OptionTitle, e.m_OptionID.ToString()); DropDownList1.Items.Add(l); } LabelDropDown.Text = "The list below are options that require Teacher marks... select and add any you want students to see."; } }
protected void Button_Upload_Click(object sender, EventArgs e) { foreach (GridViewRow r in GridView1.Rows) { if (r.BackColor == System.Drawing.Color.Red) { string ErrorMsg = ""; Label_Error.Text = ""; Exam_ResitEntry exr1 = new Exam_ResitEntry(); Guid g1 = new Guid(r.Cells[1].Text); exr1.Load(g1); ExamOption exo1 = new ExamOption(); exo1.Load(exr1.m_OptionId); Exam_Board exbde1 = new Exam_Board(exo1.m_ExamBoardID); Guid g2 = new Guid(); g2 = Guid.Empty; ExamsUtility u = new ExamsUtility(); try { if (u.AddEntry(new Guid(StudentID), exbde1, Year, YearCode, SeasonCode, r.Cells[2].Text, 1, true, ref ErrorMsg, ref g2)) { //it worked so delete the resit entry exr1.Delete(); Encode en = new Encode(); SqlDataSource1.SelectCommand = GetQueryString(); SqlDataSource1.ConnectionString = en.GetDbConnection(); SqlDataSource1.DataBind(); } else { //it didn't Label_Error.Text = ErrorMsg; break; } } catch (Exception ex) { Label_Error.Text = ex.ToString(); break; } } } int cost = 0; foreach (GridViewRow r in GridView1.Rows) { if (r.BackColor == System.Drawing.Color.Red) { cost += System.Convert.ToInt32(r.Cells[5].Text); } } double costd = (double)cost / 100; Label_cost.Text = " Total cost of selected = £" + costd.ToString(); }
public void Install_Components(string OptionCode, string l_file, string c_file, Exam_Board ExamBoard, string season, string year) { string s, line; Stream myStream; string LinkOption = ""; string LinkComponent = ""; ExamOption opt1 = new ExamOption(); Guid opt1ID = new Guid(); Guid com1ID = new Guid(); opt1.Load(OptionCode, season, year, ExamBoard.m_ExamBoardId); opt1ID = opt1.m_OptionID; //TODO ADD EXCEPTION HANDLING... IF LINE <12 if ((myStream = File.Open(l_file, FileMode.Open)) != null) { using (StreamReader sr = new StreamReader(myStream)) { while ((line = sr.ReadLine()) != null) { s = line.Substring(0, 2); LinkOption = line.Substring(2, 6); if ((s == "L5") && (LinkOption == OptionCode)) { LinkComponent = line.Substring(8, 12); com1ID = Find_Component(c_file, LinkComponent, ExamBoard.m_ExamBoardId.ToString(), season, year, true);//forceupdate = true means it will search basedata to check OK //now check the link file ExamLinkComponent_List elcl1 = new ExamLinkComponent_List(); elcl1.LoadList_Option(opt1.m_OptionID); bool found = false; foreach (ExamLinkComponent ec1 in elcl1.m_list) { if (ec1.m_ComponentId == com1ID) { found = true; } } if (!found) { s = " INSERT INTO dbo.tbl_Exams_Link ( OptionID, ComponentID ) "; s += " VALUES ('" + opt1ID.ToString() + "' , '" + com1ID.ToString() + "' )"; if ((opt1.m_valid) && (com1ID != Guid.Empty)) { ExecuteSQL(s); } } } } } } return; }
protected void Button_Update_Click(object sender, EventArgs e) { //so first check we have a valid option and value int v = 0; try { v = System.Convert.ToInt32(TextBox_Value.Text); } catch { //flag error return; } ExamOption ex1 = new ExamOption(); ex1.Load(new Guid(DropDownList_Options.SelectedValue)); if (!ex1.m_valid) { //flag error return; } ExamTQMBoundaryList exTQMlist1 = new ExamTQMBoundaryList(); exTQMlist1.LoadList(ex1.m_OptionID, YearCode.ToString(), SeasonCode.ToString()); bool found = false; foreach (ExamTQMBoundary eb in exTQMlist1.m_list) { if (eb.Grade == DropDownList_Grades.SelectedItem.Value) { found = true; eb.Mark = v; eb.Save(); break; } } if (!found) { ExamTQMBoundary eb1 = new ExamTQMBoundary(); eb1.OptionId = ex1.m_OptionID; eb1.Season = SeasonCode.ToString(); eb1.Year = YearCode.ToString(); eb1.Grade = DropDownList_Grades.SelectedItem.Value; eb1.Mark = v; eb1.Version = 1; eb1.Save(); } exTQMlist1.LoadList(ex1.m_OptionID, YearCode.ToString(), SeasonCode.ToString()); Current_Data.InnerHtml = UpdateCurrentData(exTQMlist1); }
protected void Button_Enter_Click(object sender, EventArgs e) { //do the entry.... List <Guid> students = new List <Guid>(); students = (List <Guid>)ViewState["studentlist"]; List <Guid> Options = new List <Guid>(); foreach (ListItem item in ListBox_Options.Items) { if (item.Selected) { Options.Add(new Guid(item.Value)); } } ExamsUtility u = new ExamsUtility(); string Errors = ""; Guid g2 = new Guid(); int n = 0; foreach (Guid g in Options) { ExamOption eo1 = new ExamOption(); eo1.Load(g); Exam_Board eb1 = new Exam_Board(eo1.m_ExamBoardID); foreach (Guid g1 in students) { //try { u.AddEntry(g1, eb1, Year, YearCode, SeasonCode, eo1.m_OptionCode, 2, false, ref Errors, ref g2); n++; //} //catch //{ // n = n; // } } } TextBox2.Text = ""; TextBox2.Visible = false; TextBox1.Text = " Made " + n.ToString() + " Entries"; ButtonTest.Visible = false; Button_Enter.Visible = false; DropDownList_Course.SelectedIndex = -1; foreach (ListItem item in ListBox_Options.Items) { if (item.Selected) { item.Selected = false; } } }
protected void GridView1_DataBound(object sender, EventArgs e) { //going to check if any need teacher marks. string s = ""; foreach (GridViewRow r in GridView1.Rows) { Exam_ResitEntry exr1 = new Exam_ResitEntry(); Guid g1 = new Guid(r.Cells[1].Text); exr1.Load(g1); ExamOption exo1 = new ExamOption(); exo1.Load(exr1.m_OptionId); if (exo1.NeedsTeacherMarks()) { s += "WARNING: Option " + r.Cells[2].Text + " requires Teacher Marks! "; } } Label_Error.Text = s; }
protected void Button_Delete_Click(object sender, EventArgs e) { ExamOption ex1 = new ExamOption(); ex1.Load(new Guid(DropDownList_Options.SelectedValue)); if (!ex1.m_valid) { //flag error return; } ExamTQMBoundaryList exTQMlist1 = new ExamTQMBoundaryList(); exTQMlist1.LoadList(ex1.m_OptionID, YearCode.ToString(), SeasonCode.ToString()); foreach (ExamTQMBoundary eb in exTQMlist1.m_list) { eb.Delete(); } exTQMlist1.LoadList(ex1.m_OptionID, YearCode.ToString(), SeasonCode.ToString()); Current_Data.InnerHtml = UpdateCurrentData(exTQMlist1); }
protected void Button_PullEntries_Click(object sender, EventArgs e) { ISAMS_SimpleExamEntry_List IEntries = new ISAMS_SimpleExamEntry_List(); int c = 0; c = System.Convert.ToInt32(TextBox_CycleNumber.Text); IEntries.LoadList(c); foreach (ISAMS_SimpleExamEntry Ien in IEntries.m_list) { //need to find Guids for Pupil, OPtion etc... Utility u = new Utility(); Guid SId = new Guid(); SId = u.GetStudentIDfromiSAMS(Ien.m_PupilId); Exam_Board eb1 = new Exam_Board(Ien.m_UABCode); ExamOption eo1 = new ExamOption(); eo1.Load(Ien.m_OptionCode, SeasonCode.ToString(), YearCode.ToString(), Ien.m_UABCode.ToString()); Exam_Entry Ex1 = new Exam_Entry(); Ex1.Load(Ien.m_OptionCode, SeasonCode.ToString(), YearCode.ToString(), eb1.m_ExamBoardId, SId); if (!Ex1.m_valid) { Ex1.m_Date_Created = DateTime.Now; Ex1.m_OptionID = eo1.m_OptionID; Ex1.m_season = SeasonCode.ToString(); Ex1.m_StudentID = SId; Ex1.m_withdrawn = false; Ex1.m_year = Year.ToString(); Ex1.m_EntryStatus = 7; Ex1.Save(); } else { bool f = Ex1.m_valid; } } }
protected void cb_CheckedChanged(object sender, EventArgs e) { string s = sender.ToString(); CheckBox cb1 = (CheckBox)sender; string Option_id = cb1.ID; Guid g1 = new Guid(Option_id); //if it has been checked.... increase cost..... ExamOption exo1 = new ExamOption(); exo1.Load(g1); int cover_cost = RetakeCoverCost(); int cost = (int)ViewState["cost"]; if (cb1.Checked) { cost += exo1.m_feeInt + cover_cost; } else { cost -= (exo1.m_feeInt + cover_cost); } ViewState.Add("cost", cost); double x = (double)cost; x = x / 100; TextBox_cost.Text = x.ToString(); }
/* * 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; }
protected void Button1_Click(object sender, EventArgs e) { //file has Board short name/optioncode/grade/mark if (!FileUpload1.HasFile) { return; } Cerval_Library.TextReader TxtRd1 = new Cerval_Library.TextReader(); TextRecord t = new TextRecord(); int l = 0; int n = 0; string s1 = ""; char ct = (char)0x09; int n_Board = 0; int n_OptionCode = 0; int n_Grade = 0; int n_Mark = 0; bool f_Board = false; bool f_OptionCode = false; bool f_Grade = false; bool f_Mark = false; while (TxtRd1.ReadTextLine(FileUpload1.FileContent, ref t) == Cerval_Library.TextReader.READ_LINE_STATUS.VALID) { l = s1.Length; for (int i = 0; i <= t.number_fields; i++) { s1 += t.field[i] + ct; } if (s1.Length > l) { s1 += Environment.NewLine; } if (n == 0) { //going to look for our columns: for (int i = 0; i <= t.number_fields; i++) { switch (t.field[i]) { case "Board": n_Board = i; f_Board = true; break; case "Option": n_OptionCode = i; f_OptionCode = true; break; case "Mark": n_Mark = i; f_Mark = true; break; case "Grade": n_Grade = i; f_Grade = true; break; default: break; } } // so do we have all the required columns?? if (!(f_Board && f_OptionCode && f_Grade && f_Mark)) { Label_Text.Text = "Can't recognise the format of this file. "; if (!f_Board) { Label_Text.Text += "No Board Column"; } if (!f_OptionCode) { Label_Text.Text += "No Option Column"; } if (!f_Mark) { Label_Text.Text += "No Mark Column"; } if (!f_Grade) { Label_Text.Text += "No Grade Column"; } return; } else { Label_Text.Text = "File Format Fine: "; } } } //so process the file... string s2 = ""; char[] ct1 = new char[1]; ct1[0] = (char)0x09; string[] fields = new string[20]; using (StringReader sr = new StringReader(s1)) { string firstline = sr.ReadLine(); string line; while ((line = sr.ReadLine()) != null) { fields = line.Split(ct1); bool found = false; Exam_Board eb1 = new Exam_Board(); eb1.Load(fields[n_Board]); ExamOption eo1 = new ExamOption(); if (eo1.Load(fields[n_OptionCode], SeasonCode.ToString(), YearCode.ToString(), eb1.m_ExamBoardId)) { //valid option cod ExamTQMBoundaryList l1 = new ExamTQMBoundaryList(); l1.LoadList(eo1.m_OptionID, YearCode.ToString(), SeasonCode.ToString()); foreach (ExamTQMBoundary b in l1.m_list) { if (b.Grade == fields[n_Grade]) { b.Mark = Convert.ToInt32(fields[n_Mark]); b.Save(); found = true; s2 += eb1.m_OrganisationFriendlyName + ct + eo1.m_OptionCode + ct + eo1.m_OptionTitle + ct + b.Grade + ct + b.Mark + ct + "Updated" + System.Environment.NewLine; } } if (!found) { ExamTQMBoundary etqm1 = new ExamTQMBoundary(); etqm1.OptionId = eo1.m_OptionID; etqm1.Mark = Convert.ToInt32(fields[n_Mark]); etqm1.Grade = fields[n_Grade]; etqm1.OptionCode = eo1.m_OptionCode; etqm1.OptionTitle = eo1.m_OptionTitle; etqm1.Season = SeasonCode.ToString(); etqm1.Year = YearCode.ToString(); etqm1.Version = 22; etqm1.Save(); s2 += eb1.m_OrganisationFriendlyName + ct + eo1.m_OptionCode + ct + eo1.m_OptionTitle + ct + etqm1.Grade + ct + etqm1.Mark + ct + "New Entry" + System.Environment.NewLine; } } } Label_Text.Text = " Completed... saved as below:"; TextBox1.Text = s2; } }
public bool AddEntry(Guid StudentId, Exam_Board exbde1, int Year, int YearCode, int Season, string option, int EntryStatusCode, bool checkDisallowed, ref string ErrorMessage, ref Guid EntryId) { //Year is 2 digit code..... bool disallowed = false; ErrorMessage = ""; ExamOption ex01 = new ExamOption(); ExamOption ex02 = new ExamOption(); ExamFiles ef1 = new ExamFiles(); ex01.Load(option, Season.ToString(), YearCode.ToString(), exbde1.m_ExamBoardId); if (!ex01.m_valid) { //need to search basedata... ex01 = ef1.Find_Option(option, exbde1, Season.ToString(), YearCode.ToString()); } if (ex01 != null) { ExamEntries_List exen1 = new ExamEntries_List(); exen1.Load(StudentId, Year.ToString(), Season.ToString()); if (checkDisallowed) { foreach (Exam_Entry ex1 in exen1.m_list) { if (!ex1.m_withdrawn) { ex02.Load(ex1.m_OptionID); disallowed = ef1.CombinationDisallowed(exbde1, ex01.m_OptionCode, ex02.m_OptionCode, ex01.m_SeriesIdentifier, ex01.m_year_Code); if (disallowed) { ErrorMessage = "Combination of " + ex01.m_OptionCode + " and " + ex02.m_OptionCode + " not allowed!"; return(false); } } } } if (!disallowed) { Exam_Entry entry1 = new Exam_Entry(); entry1.m_OptionID = ex01.m_OptionID; entry1.m_StudentID = StudentId; entry1.m_Date_Created = DateTime.Now; entry1.m_season = Season.ToString(); entry1.m_year = Year.ToString(); entry1.m_ExamEntryID = Guid.Empty; entry1.m_EntryStatus = EntryStatusCode; foreach (Exam_Entry ex1 in exen1.m_list) { if (ex1.m_OptionID == ex01.m_OptionID) { //found this student, this series, this option entry1.m_ExamEntryID = ex1.m_ExamEntryID; } } entry1.Save(); EntryId = entry1.m_ExamEntryID; return(true); } } else { ErrorMessage = "Option code " + option + " not found"; return(false); } return(false); }
protected void Button_PullBaseData_Click(object sender, EventArgs e) { // so first we are going to get a list of all options used... int c = 0; c = System.Convert.ToInt32(TextBox_CycleNumber.Text); ISAMS_OptionsUsed_List list1 = new ISAMS_OptionsUsed_List(); list1.LoadList(c); string s = ""; foreach (ISAMS_OptionUsed o in list1.m_list) { s += o.m_OptionCode; //need the Cerval ExamBde Guid Exam_Board CExamBoard = new Exam_Board(o.m_UABCode); // so load option / link /components ISAMS_ExamOption Opt = new ISAMS_ExamOption(); Opt.Load(c, o.m_OptionCode, o.m_UABCode); s += " : " + Opt.m_OptionTitle; ISAMS_ExamSyllabus Syl = new ISAMS_ExamSyllabus(); Syl.Load(Opt.m_cycle, Opt.m_ExamBoardCode, Opt.m_Syllabus_Code); ISAMS_ExamLink_List Link = new ISAMS_ExamLink_List(); Link.LoadList_Option(Opt.m_OptionCode, Opt.m_ExamBoardCode, Opt.m_cycle); //so try to find the Ceral Syllabus ExamSyllabus CSyllabus = new ExamSyllabus(); CSyllabus.Load(Syl.m_SyllabusCode, SeasonCode.ToString(), YearCode.ToString(), CExamBoard.m_ExamBoardId); if (!CSyllabus.m_valid) { CSyllabus.m_ExamBoardId = CExamBoard.m_ExamBoardId; CSyllabus.m_Syllabus_Code = Syl.m_SyllabusCode; CSyllabus.m_Syllabus_Title = Syl.m_SyllabusTitle; CSyllabus.m_SyllabusId = CSyllabus.CreateNew("22"); } //now try to find the option ExamOption COption = new ExamOption(); COption.Load(Opt.m_OptionCode, SeasonCode.ToString(), YearCode.ToString(), Opt.m_ExamBoardCode); if (COption.m_valid) { //option found... } else { //option not found need to create... COption.m_SyllabusID = CSyllabus.m_SyllabusId; COption.m_OptionCode = Opt.m_OptionCode; COption.m_OptionTitle = Opt.m_OptionTitle; COption.m_OptionQualification = Opt.m_OptionQualification; COption.m_OptionLevel = Opt.m_OptionLevel; COption.m_Item = Opt.m_Item; COption.m_Process = Opt.m_Process; COption.m_QCACode = Opt.m_QCACode; COption.m_QCANumber = Opt.m_QCANumber; COption.m_fee = Opt.m_fee; COption.m_OptionMaximumMark = Opt.m_OptionMaximumMark; COption.m_year_Code = YearCode.ToString(); COption.m_Season_code = SeasonCode.ToString(); COption.m_SeriesIdentifier = Opt.m_SeriesIdentifier; COption.m_OptionID = COption.CreateNew("22"); } foreach (ISAMS_ExamLink el1 in Link.m_list) { ISAMS_ExamComponent ec1 = new ISAMS_ExamComponent(); ec1.Load(el1.m_ComponentCode, Opt.m_cycle, Opt.m_ExamBoardCode); s += " & " + ec1.m_ComponentTitle; //so should be able to insert into Cerval //OK so now the components... ExamComponent CComp = new ExamComponent(); CComp.Load(ec1.m_ComponentCode, SeasonCode.ToString(), YearCode.ToString()); if (!CComp.m_valid) { //so need to create CComp.m_ComponentCode = ec1.m_ComponentCode; CComp.m_ComponentTitle = ec1.m_ComponentTitle; CComp.m_ExamBoardID = CExamBoard.m_ExamBoardId; CComp.m_year = YearCode.ToString(); CComp.m_season = SeasonCode.ToString(); CComp.m_Teachermarks = ec1.m_Teachermarks; CComp.m_MaximumMark = ec1.m_MaximumMark; CComp.m_Due_Date = ec1.m_Due_Date; CComp.m_Timetabled = ec1.m_Timetabled; CComp.m_TimetableSession = ec1.m_TimetableSession; CComp.m_Time = ec1.m_TimeAllowed; DateTime t1 = new DateTime(); t1 = System.Convert.ToDateTime(ec1.m_TimetableDate); CComp.m_TimetableDate = t1; CComp.m_ComponentID = CComp.CreateNew(); } ExamLinkComponent_List l2 = new ExamLinkComponent_List(); l2.LoadList_OptionComponent(COption.m_OptionID, CComp.m_ComponentID); if (l2.m_list.Count == 0) { //need to make the link ExamLinkComponent Clink = new ExamLinkComponent(); Clink.m_OptionId = COption.m_OptionID; Clink.m_ComponentId = CComp.m_ComponentID; Clink.CreateNew("22"); } } s += Environment.NewLine; } TextBox_test.Text = s; }
void GridView1_RowCommand(Object sender, GridViewCommandEventArgs e) { //calls here for any command - including a sort if (e.CommandName == "Edit_Grade") { Cerval_Configuration c = new Cerval_Configuration("StaffIntranet_Forecast_Grade_Edit"); string s1 = c.Value; if (!c.valid)//try revert to config file { System.Configuration.AppSettingsReader ar = new AppSettingsReader(); s1 = ar.GetValue("Exam Entries Forecast Grade Edit", s1.GetType()).ToString(); } if (s1 == "none") { visibility(4); { ListBox_PredictedGrades.Visible = false; Button_Save_Prediction.Visible = false; Label_Title_for_Edit.Text = "Predicted grades can't be edited at present"; return; } } int row = Convert.ToInt32(e.CommandArgument); GridViewRow row1 = GridView1.Rows[row]; string s = Server.HtmlDecode(row1.Cells[0].Text);//is id Exam_Entry ex1 = new Exam_Entry(); ex1.Load(s); SimplePupil p1 = new SimplePupil(); p1.Load(ex1.m_StudentID.ToString()); ExamOption exo1 = new ExamOption(); exo1.Load(ex1.m_OptionID); Utility u = new Utility(); bool valid = false; PupilPeriodList PPLlist1 = new PupilPeriodList(); PPLlist1.LoadList("StudentID", ex1.m_StudentID.ToString(), true, DateTime.Now); //now I'd like to find the cse... but we dont know these CourseList cselist1 = new CourseList(ex1.m_OptionID); GroupList_SL grplist1 = new GroupList_SL(Label_staffCode.Text.Trim()); foreach (Course c1 in cselist1._courses) { foreach (ScheduledPeriod scp in PPLlist1.m_pupilTTlist) { if (scp.m_groupcode.Substring(2, 2).ToUpper().Trim() == c1.CourseCode.ToUpper().Trim()) { if (scp.m_staffcode.Trim().ToUpper() == Label_staffCode.Text.Trim().ToUpper()) { if (s1 == "staff") { valid = true; } } foreach (Group g1 in grplist1._groups) { if (g1._GroupCode == scp.m_groupcode) { valid = true; //is SL } } } } } if (s1 == "all") { valid = true; } visibility(4); if (!valid) { ListBox_PredictedGrades.Visible = false; Button_Save_Prediction.Visible = false; Label_Title_for_Edit.Text = "Can't edit this grade as you don't teach the student"; return; } Label_Title_for_Edit.Text = "Predicted Grade for " + p1.m_GivenName + " " + p1.m_Surname + " for " + exo1.m_OptionCode + ": " + exo1.m_OptionTitle; Label_EntryID_for_edit.Text = s; ListBox_PredictedGrades.Items.Clear(); if (exo1.m_OptionQualification == "GCE") { ListBox_PredictedGrades.Items.Add("A*"); ListBox_PredictedGrades.Items.Add("A"); ListBox_PredictedGrades.Items.Add("B"); ListBox_PredictedGrades.Items.Add("C"); ListBox_PredictedGrades.Items.Add("D"); ListBox_PredictedGrades.Items.Add("E"); ListBox_PredictedGrades.Items.Add("U"); } if (exo1.m_OptionQualification == "GCSE") { ListBox_PredictedGrades.Items.Add("A*"); ListBox_PredictedGrades.Items.Add("A"); ListBox_PredictedGrades.Items.Add("B"); ListBox_PredictedGrades.Items.Add("C"); ListBox_PredictedGrades.Items.Add("D"); ListBox_PredictedGrades.Items.Add("E"); ListBox_PredictedGrades.Items.Add(""); } if (ListBox_PredictedGrades.Items.FindByText(Server.HtmlDecode(row1.Cells[7].Text)) != null) { ListBox_PredictedGrades.Items.FindByText(Server.HtmlDecode(row1.Cells[7].Text)).Selected = true; Button_Save_Prediction.Visible = true; } else { //ListBox_PredictedGrades.Visible = false; //Button_Save_Prediction.Visible = false; //Label_Title_for_Edit.Text = "Can't edit this grade"; } Button_Save_Prediction.Visible = true; } if (e.CommandName == "Edit_Button") { int row = Convert.ToInt32(e.CommandArgument); GridViewRow row1 = GridView1.Rows[row]; string s = Server.HtmlDecode(row1.Cells[0].Text);//is id Exam_Entry ex1 = new Exam_Entry(); ex1.Load(s); ExamsEntries_sql.UpdateCommand = "UPDATE dbo.tbl_Exams_Entries SET PredictedGrade = '?' WHERE ExamEntryID ='" + s + "' "; } if (e.CommandName == "Delete_Button") { int row = Convert.ToInt32(e.CommandArgument); GridViewRow row1 = GridView1.Rows[row]; string s = Server.HtmlDecode(row1.Cells[0].Text); //do delete... } }
protected void Button_Process_Click(object sender, EventArgs e) { string s = TextBox1.Text; TextFileType ftype1 = TextFileType.Unknown; try { ftype1 = (TextFileType)ViewState["TextFileType"]; } catch { Label_Text.Text = "File Type not recognised"; return; } if (ftype1 == TextFileType.Unknown) { Label_Text.Text = "Board Not Set!!!"; return; } char[] ct1 = new char[1]; ct1[0] = (char)0x09; string[] fields = new string[20]; ExamsUtility u = new ExamsUtility(); PupilGroupList pgl = new PupilGroupList(); ExamConversions Ec = new ExamConversions(); SimplePupil pupil1 = new SimplePupil(); Guid g1 = new Guid(); g1 = Guid.Empty; Exam_Board eb1 = new Exam_Board(); SimplePupil p1 = new SimplePupil(); ExamComponent ec1 = new ExamComponent(); ExamOption exo1 = new ExamOption(); ExamComponentResultList ecrl1 = new ExamComponentResultList(); string component_code = ""; int adno1 = 0; string Option_Code = ""; string ScaledMark = ""; string ComponentUMS = ""; string ComponentStatus = ""; string TQM_value = ""; int n_Year = (int)ViewState["n_Year"]; int n_Season = (int)ViewState["n_Season"]; int n_OptionCode = (int)ViewState["n_OptionCode"]; int n_TQM = (int)ViewState["n_TQM"]; int n_ComponentCode = (int)ViewState["n_ComponentCode"]; int n_ComponentUMS = (int)ViewState["n_ComponentUMS"]; int n_ScaledMark = (int)ViewState["n_ScaledMark"]; int n_Status = (int)ViewState["n_Status"]; int n_CandNo = (int)ViewState["n_CandNo"]; int number_entered = 0; //get exam board.... switch (ftype1) { case TextFileType.Unknown: return; case TextFileType.AQA_GCE: eb1 = new Exam_Board("70"); break; case TextFileType.OCR_GCE: eb1 = new Exam_Board("01"); break; case TextFileType.EDEXCEL_GCE: eb1 = new Exam_Board("11"); break; case TextFileType.AQA_GCSE: eb1 = new Exam_Board("70"); break; case TextFileType.OCR_GCSE: break; case TextFileType.EDEXCEL_GCSE: eb1 = new Exam_Board("10"); break; case TextFileType.CIE: eb1 = new Exam_Board("02"); break; case TextFileType.WJEC_GCSE: eb1 = new Exam_Board("40"); break; case TextFileType.WJEC_GCE: eb1 = new Exam_Board("41"); break; default: break; } using (StringReader sr = new StringReader(s)) { string firstline = sr.ReadLine(); string line; while ((line = sr.ReadLine()) != null) { fields = line.Split(ct1); adno1 = 0; component_code = ""; Option_Code = ""; ScaledMark = ""; ComponentUMS = ""; ComponentStatus = ""; adno1 = Convert.ToInt32(fields[n_CandNo]); if (Year.ToString() != fields[n_Year]) { Label_Text.Text = "Year code mismatch in file, line" + number_entered.ToString(); return; } if (SeasonCode.ToString() != fields[n_Season].Substring(0, 1)) { Label_Text.Text = "Series code mismatch in file, line" + number_entered.ToString(); return; } component_code = fields[n_ComponentCode]; Option_Code = fields[n_OptionCode]; ScaledMark = fields[n_ScaledMark]; ComponentUMS = fields[n_ComponentUMS]; ComponentStatus = fields[n_Status]; TQM_value = fields[n_TQM]; ExamComponentResult r = new ExamComponentResult(); try { p1.Load_StudentIdOnly(adno1); ec1.Load(component_code, SeasonCode.ToString(), YearCode.ToString()); exo1.Load(Option_Code, SeasonCode.ToString(), YearCode.ToString(), eb1.m_ExamBoardId); r.OptionId = exo1.m_OptionID; r.ComponentId = ec1.m_ComponentID; r.StudentId = p1.m_StudentId; try { r.ComponentScaledMark = System.Convert.ToInt32(ScaledMark); } catch { //assume it is non integer.... double d = Convert.ToDouble(ScaledMark); r.ComponentScaledMark = Convert.ToInt32(d); } try { r.ComponentUMS = System.Convert.ToInt32(ComponentUMS); } catch { } r.ComponentStatus = ComponentStatus; switch (ecrl1.Load_OptionStudent(r.OptionId, r.StudentId, r.ComponentId)) { case 0: //so can write in r.Save(); break; case 1: //so update r.ComponentResultId = ecrl1.m_list[0].ComponentResultId; r.Save(); break; case 2: //so problem break; default: break; } //now find the result.... ResultsList rl1 = new ResultsList(); rl1.m_parameters = 0; rl1.m_where = "WHERE (dbo.tbl_Core_Students.StudentId='" + r.StudentId.ToString() + "')AND(dbo.tbl_Core_Results.ExamsOptionId='" + r.OptionId.ToString() + "') "; rl1.LoadList("", ""); Result r1 = new Result(); r1 = (Result)rl1._results[0]; r1.Text = "TQM=" + TQM_value; r1.UpdateResultTextOnly(); number_entered++; } catch (Exception ex) { Label_Text.Text = ex.ToString(); } } } Label_Text.Text = "Correctly processed... " + number_entered.ToString() + " entries"; }
protected int AddControls(ResultsList rl, bool setup) { int cost = 0; Guid[] listID = new Guid[100]; Exam_ResitEntry ExamResit1 = new Exam_ResitEntry(); Exam_Entry entry1 = new Exam_Entry(); Table1.Visible = true; Table tb1 = (Table)content.FindControl("table1"); tb1.Width = 700; tb1.EnableViewState = true; TableRow r0 = new TableRow(); tb1.Controls.Add(r0); TableCell c01 = new TableCell(); r0.Controls.Add(c01); SetCellStyle(c01, tb1); TableCell c02 = new TableCell(); r0.Controls.Add(c02); SetCellStyle(c02, tb1); TableCell c03 = new TableCell(); r0.Controls.Add(c03); SetCellStyle(c03, tb1); TableCell c04 = new TableCell(); r0.Controls.Add(c04); SetCellStyle(c04, tb1); TableCell c05 = new TableCell(); r0.Controls.Add(c05); SetCellStyle(c05, tb1); c01.Text = "Code"; c02.Text = "Title"; c03.Text = "Result"; c04.Text = "Date Taken"; c05.Text = "Retake ?"; foreach (Result res1 in rl._results) { if (res1.OptionItem == "U") {//we have a module result TableRow r1 = new TableRow(); tb1.Controls.Add(r1); r1.BorderStyle = BorderStyle.Solid; r1.BorderColor = tb1.BorderColor; r1.BorderWidth = tb1.BorderWidth; TableCell c1 = new TableCell(); r1.Controls.Add(c1); SetCellStyle(c1, tb1); TableCell c2 = new TableCell(); r1.Controls.Add(c2); SetCellStyle(c2, tb1); TableCell c3 = new TableCell(); r1.Controls.Add(c3); SetCellStyle(c3, tb1); TableCell c4 = new TableCell(); r1.Controls.Add(c4); SetCellStyle(c4, tb1); TableCell c5 = new TableCell(); r1.Controls.Add(c5); SetCellStyle(c5, tb1); if ((res1.Valid) && ((CheckBox)content.FindControl(res1.OptionId.ToString()) == null)) { entry1.Load(res1.OptionId, res1.StudentID); //now if already entered we don't want to offer..... if (entry1.m_valid) { c5.Text = "Entered"; } else { CheckBox cb1 = new CheckBox(); cb1.ID = res1.OptionId.ToString(); c5.Controls.Add(cb1); //decide if we already have an entry.... if (setup) { ExamResit1.Load(res1.StudentID, res1.OptionId); if (ExamResit1.m_valid) { cb1.Checked = true; ExamOption exo1 = new ExamOption(); exo1.Load(res1.OptionId); cost += exo1.m_feeInt + RetakeCoverCost(); } } cb1.CheckedChanged += new EventHandler(cb_CheckedChanged); cb1.AutoPostBack = true; } } else { c5.Text = "Not available"; } c1.Text = res1.OptionCode; c2.Text = res1.OptionTitle; c3.Text = res1.Value; c4.Text = res1.Date.ToShortDateString(); } } return(cost); }
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 bool ProcessFile(Exam_Board exb1, string series, ref string Errors) { //so are we able to do E file or A file... string s = ""; string line = ""; Cerval_Configuration c = new Cerval_Configuration("StaffIntranet_Exams_CentreNumber"); string centre_number = ""; if (c.valid) { centre_number = c.Value; } else { Errors = "Centre Number not found in cerval..." + centre_number; return(false); } //check that if we are asked for an E file we dont already have one... //could just check no entries have been sent for this series... ExamEntries_List exl0 = new ExamEntries_List(); exl0.LoadAllSeries(Year.ToString(), series, true, exb1.m_ExamBoardId.ToString()); char type = exl0.m_list.Count > 0 ? 'A' : 'E'; int n1 = 0; Encode en = new Encode(); PupilDetails p1 = new PupilDetails(); DateTime date1 = new DateTime(); date1 = DateTime.Now; if (centre_number.Length != 5) { Errors = "Centre Number wrong!" + centre_number; return(false); } Exam_File ef1 = new Exam_File(); StreamWriter fs = OpenFile(exb1, type, ref ef1, 194, series, centre_number, "14"); if (fs == null) { Errors = "Error opening file"; return(false); } if (type == 'A') { //going to find any not yet sent and for these students clear the sent dates... exl0.m_list.Clear(); exl0.LoadAllSeries(Year.ToString(), series, false, exb1.m_ExamBoardId.ToString()); //now for each student in this list we need to re-send entries.... foreach (Exam_Entry ex in exl0.m_list) { ExamOption exo0 = new ExamOption(); exo0.Load(ex.m_OptionID); ExamEntries_List exl2 = new ExamEntries_List(); exl2.Load(ex.m_StudentID, Year.ToString(), series, true, exb1.m_ExamBoardId.ToString()); foreach (Exam_Entry ex0 in exl2.m_list) { s = "UPDATE tbl_Exams_Entries SET EntryFileID = NULL , DateEntered = NULL WHERE (ExamEntryID ='" + ex0.m_ExamEntryID.ToString() + "')"; n1 = en.Execute_count_SQL(s); } } } ExamEntries_List exl1 = new ExamEntries_List(); exl1.LoadAllSeries(Year.ToString(), series, false, exb1.m_ExamBoardId.ToString()); int n = 0; int n_record = -1;//don't write first one int n_records = 0; Guid std1 = Guid.Empty; foreach (Exam_Entry ex1 in exl1.m_list) { if (ex1.m_StudentID != std1) { //have a new student while (line.Length < 192) { line += " "; } if (n_record >= 0) { fs.WriteLine(line); n_records++; } std1 = ex1.m_StudentID; p1.m_UCI = ""; p1.Load(std1.ToString()); n_record = 0; line = ""; } if (n_record == 12) { while (line.Length < 192) { line += " "; } fs.WriteLine(line); n_records++; line = ""; n_record = 0; } n++; if (line == "") { line = type + "5"; if (p1.m_IsOnRole) { line += "C"; } else { line += "P"; } line += centre_number; s = p1.m_examNo.ToString(); while (s.Length < 4) { s = "0" + s; } line += s; //going to strip , from middle names to space... s = p1.m_Surname + ":" + p1.m_GivenName + " " + p1.m_MiddleName.Replace(",", " "); while (s.Length < 40) { s += " "; } if (s.Length > 40) { s.Substring(0, 40); } line += s; if (p1.m_Gender == "F") { line += "F"; } else { line += "M"; } if (p1.m_dob == null) { s = "000000"; } else { s = p1.m_dob.ToString("ddMMyy"); } if (s == "010101") { s = "000000"; //010101 appears to the the defauult date if date in NULL in db } line += s; if ((p1.m_UCI.Length != 13) || (p1.m_examNo == 0)) { // todo .. need to hanlde this error /// clean up or offer UCI generation.... Errors = "No UCI for " + p1.m_GivenName + " " + p1.m_Surname + "(" + p1.m_adno.ToString() + ")"; Errors += "Please create UCI for student and re-run"; //first mark any entries made for this file as not made........ s = "UPDATE dbo.tbl_Exams_Entries SET EntryFileID = NULL , DateEntered = NULL "; s += " WHERE (EntryFileID ='" + ef1.m_EntryFileId.ToString() + "' )"; Encode en1 = new Encode(); n1 = en1.Execute_count_SQL(s); fs.Close(); return(false); } s = p1.m_UCI; line += s; line += p1.m_upn.Trim(); //TODO.... line += p1.m_uln.Trim(); //line += " ";//uln //now the guest flag..... hmm... //ought to do this really for cand from collaboration... line += " ";// up to byte 108 in jcq mess... } ExamOption exo1 = new ExamOption(); exo1.Load(ex1.m_OptionID); if (exo1.m_ExamBoardID == exb1.m_ExamBoardId) { //add it to the file unless withdrawn if (!ex1.m_withdrawn) { s = exo1.m_OptionCode + " "; s = s.Substring(0, 6); line += s + " "; n_record++; } //now update the Exam Entry record... s = "UPDATE tbl_Exams_Entries SET EntryFileID ='" + ef1.m_EntryFileId.ToString() + "' "; s += " , DateEntered =CONVERT(DATETIME, '" + ef1.m_DateCreated.ToString("yyyy-MM-dd HH:mm:ss") + "', 102) "; s += " , EntryStatus = '4' "; s += " WHERE (ExamEntryID = '" + ex1.m_ExamEntryID.ToString() + "' )"; en.ExecuteSQL(s); } } while (line.Length < 192) { line += " "; } if (n_record >= 0) { fs.WriteLine(line); n_records++; } EndFile(type, n_records, date1, fs, 194, ef1); return(true); }