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 Button1_Click(object sender, EventArgs e) { using (WebClient client = new WebClient()) { client.Headers.Add("user-agent", "Mozilla / 5.0(Windows NT 10.0; WOW64; Trident / 7.0; rv: 11.0) like Gecko"); //client.Headers.Add("Content-Type", "application/x-www-form-urlencoded"); client.Headers.Add("Authorization", "SNAeoB88JTmAXfNTAfpR"); try { string response = client.DownloadString("https://sandbox.apply-for-teacher-training.service.gov.uk/api/v1"); } catch (Exception e2) { string s5455 = e2.ToString(); s5455 = e2.InnerException.ToString(); } } return; ISAMS_ExamStudentAccessList list44 = new ISAMS_ExamStudentAccessList(); list44.load(18); ISAMS_ExamSeatingPlan_List list33 = new ISAMS_ExamSeatingPlan_List(); list33.Load(18); // ISAMS_Set_PTOList Leena = new ISAMS_Set_PTOList(); // Leena.load(12); return; ExamComponentResultList ecrl1 = new ExamComponentResultList(); ecrl1.Load_OptionStudent(new Guid("d22c0f3e-38ff-4a81-9c00-dc7892548f68"), new Guid("fbbd073f-b4cd-4fb1-a12f-e3a755e7cc63")); string s = ""; foreach (ExamComponentResult r in ecrl1.m_list) { s = r.ComponentStatus; } Response.Redirect("../studentinformation/ComponentResults.aspx?StudentId=fbbd073f-b4cd-4fb1-a12f-e3a755e7cc63 &OptionId=d22c0f3e-38ff-4a81-9c00-dc7892548f68"); TT_compare(); return; //call from button.. RegistrationsList r1 = new RegistrationsList(); r1.Get_Recent_Registrations("6368"); foreach (Registrations r in r1.Registrations) { TextBox1.Text += r.m_date.ToString() + " " + r.m_staff + Environment.NewLine; } return; List <string> test3 = Get_Registrations("6368"); foreach (string s4 in test3) { TextBox1.Text += s4 + Environment.NewLine; } return; IntPtr token = IntPtr.Zero; string adno = "6368"; bool isSuccess = LogonUser("test-staff", "challoners", "123Password", LOGON32_LOGON_NEW_CREDENTIALS, LOGON32_PROVIDER_DEFAULT, ref token); using (WindowsImpersonationContext person = new WindowsIdentity(token).Impersonate()) { string path1 = @"\\registration.challoners.net\STEARsoft\Reg\data\cc\testfile.txt"; //StreamReader sr1 = new StreamReader(path1); //string s = sr1.ReadLine(); //Label4.Text = s; //s = s; int i = 0; s = ""; int imax = 0; string sfile = ""; string[] fileEntries = Directory.GetFiles(@"\\registration.challoners.net\STEARsoft\Reg\data", "attend*.csv"); foreach (string fileName in fileEntries) { //find last one! s = fileName.Substring(fileName.IndexOf("log")); try { s = s.Substring(3, 2); i = System.Convert.ToInt32(s); if (i > imax) { imax = i; sfile = fileName; } } catch { try { s = s.Substring(3, 3); i = System.Convert.ToInt32(s); if (i > imax) { imax = i; sfile = fileName; } } catch { } } } if (imax > 0) { string s1 = ""; Label4.Text = sfile; StreamReader sr1 = new StreamReader(sfile); while (!sr1.EndOfStream) { s = sr1.ReadLine(); string[] fred = s.Split((char)(',')); if (fred[4] == adno) { s1 = fred[11]; } } } person.Undo(); } return; //adno first name surname StudentId CourseId StaffId CommentType poliyID text Cerval_Library.TextReader text1 = new Cerval_Library.TextReader(); Cerval_Library.TextRecord t = new TextRecord(); string path = Server.MapPath(@"../App_Data/test.txt"); FileStream f = new FileStream(path, FileMode.Open); text1.ReadTextLine(f, ref t);//header row while (text1.ReadTextLine(f, ref t) == Cerval_Library.TextReader.READ_LINE_STATUS.VALID) { ReportComment r = new ReportComment(); r.m_studentId = new Guid(t.field[3]); r.m_courseId = new Guid(t.field[4]); r.m_staffId = new Guid(t.field[5]); r.m_commentType = System.Convert.ToInt32(t.field[6]); r.m_dateCreated = DateTime.Now; r.m_dateModified = r.m_dateCreated; r.m_collectionOutputPolicyId = new Guid(t.field[7]); r.m_content = t.field[8]; r.Save(); } f.Close(); }
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"; }