Пример #1
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            // going to run through db and add any missing uci where we have an exam no...

            SimpleStudentList sl1    = new SimpleStudentList(SimpleStudentList.LIST_TYPE.NOFORM_ONROLE);
            PupilDetails      pupil1 = new PupilDetails();
            string            s      = "";

            ExamFiles ef = new ExamFiles();
            Encode    en = new Encode();
            int       n = 0; int n1 = 0;

            foreach (SimplePupil p in sl1._studentlist)
            {
                pupil1.m_UCI = "";
                pupil1.Load(p.m_StudentId.ToString());
                string year = DateTime.Now.Year.ToString();
                if ((pupil1.m_UCI == "") && (pupil1.m_examNo > 0))
                {
                    pupil1.m_UCI = ef.Calculate_UCI_Checksum("52205", "0", year, pupil1.m_examNo.ToString());
                    s            = "UPDATE dbo.tbl_Core_Students SET StudentUCI='" + pupil1.m_UCI + "' ";
                    s           += "WHERE StudentId = '" + p.m_StudentId.ToString() + "' ";
                    en.ExecuteSQL(s);
                    n++;
                }
                if (pupil1.m_examNo == 0)
                {
                    n1++;
                }
            }
            Label1.Text = "Created " + n.ToString() + " new UCIs.  There were " + n1.ToString() + " students found with no Exam Number!";
        }
Пример #2
0
        private void PermissiontoLeave(string stype)
        {
            int  i           = System.Convert.ToInt32(stype);
            bool title_found = false;

            content0.InnerHtml = "";
            SimpleStudentList sl  = new SimpleStudentList("");
            StudentConsent    sc1 = new StudentConsent();
            string            s   = "";
            string            s2  = "<p style=\"font-size:small \"> <table align =center  border  style=\"font-size:x-small \">";

            s2 += "<tr><td>Surname</td><td>FirstName</td><td>Year</td><td>Form</td><td>";
            sc1.Load(((SimplePupil)sl._studentlist[0]).m_StudentId.ToString(), i);
            s = "</td></tr>";
            foreach (SimplePupil p1 in sl)
            {
                s += "<tr><td>" + p1.m_Surname + "</td><td>" + p1.m_GivenName + "</td><td>" + p1.m_year.ToString() + "</td><td>" + p1.m_form + "</td>";
                if (sc1.Load(p1.m_StudentId.ToString(), i))
                {
                    s += "<td>Permission granted " + sc1.m_ConsentFrom.ToShortDateString() + "</td>";
                    if (!title_found)
                    {
                        s2 += sc1.m_ConsentDescription; title_found = true;
                    }
                }
                else
                {
                    s += "<td>NONE</td>";
                }
                s += "</tr>";
            }
            s += "</table></p>";
            content0.InnerHtml = s2 + s;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            SimpleStudentList sl1 = new SimpleStudentList();

            sl1.LoadFull();
            foreach (SimplePupil p in sl1._studentlist)
            {
                ListItem l = new ListItem(p.m_GivenName + p.m_Surname, p.m_adno.ToString());
                DropDownList1.Items.Add(l);
            }
        }
Пример #4
0
        protected void TextBox_mask_TextChanged(object sender, EventArgs e)
        {
            NameList.Items.Clear();

            string type = (string)ViewState["ListType"];

            if (type == "Left")
            {
                PastStudentList stlist = new PastStudentList("Expr13 = 0");//not on role
                foreach (SimplePupil sp in stlist._studentlist)
                {
                    if ((sp.m_Surname.ToUpper().Contains(TextBox_mask.Text.ToUpper()) || (sp.m_GivenName.ToUpper().Contains(TextBox_mask.Text.ToUpper()))) || sp.m_adno.ToString().Contains(TextBox_mask.Text))
                    {
                        ListItem Item = new ListItem(sp.m_GivenName + " " + sp.m_Surname + "(" + sp.m_dol.Year.ToString() + ")", sp.m_StudentId.ToString());
                        NameList.Items.Add(Item);
                    }
                }
            }
            else
            {
                SimpleStudentList stlist = new SimpleStudentList("");
                foreach (SimplePupil sp in stlist)
                {
                    if ((sp.m_Surname.ToUpper().Contains(TextBox_mask.Text.ToUpper()) || (sp.m_GivenName.ToUpper().Contains(TextBox_mask.Text.ToUpper()))) || sp.m_adno.ToString().Contains(TextBox_mask.Text))
                    {
                        ListItem Item = new ListItem(sp.m_GivenName + " " + sp.m_Surname + " (" + sp.m_form + ")", sp.m_StudentId.ToString());
                        NameList.Items.Add(Item);
                    }
                }
            }

            if (NameList.Items.Count > 0)
            {
                NameList.Items[0].Selected = true;
                NameList.Visible           = true;
                Display_List.Visible       = true;
                Display();
            }
        }
Пример #5
0
        private void MedicalList()
        {
            SimpleStudentList sstl1 = new SimpleStudentList("");
            string            s     = "<p style=\"font-size:small \"> <table align =center  border  style=\"font-size:x-small \">";

            s += "<tr><td>Surname</td><td>FirstName</td><td>Medical</td><td>Edit</td></tr>";
            foreach (SimplePupil p1 in sstl1)
            {
                StudentMedical sm1 = new StudentMedical();
                sm1.Load(p1.m_StudentId.ToString());
                s += "<tr><td>" + p1.m_Surname + "</td><td>" + p1.m_GivenName + "</td>";
                s += "<td>" + p1.m_adno.ToString() + "</td>";
                s += "<td>" + sm1.m_MedicalNotes + "</td>";
                s += "<td><A HREF=\"";
                s += "../content/AdminTasks.aspx";
                s += "?Type=MedicalEdit&StudentId=" + p1.m_StudentId.ToString();
                s += "\">Edit</A></td>";
                s += "</tr>";
            }
            s += "</table></p>";
            content0.InnerHtml = s;
        }
        protected void YearDisplay()
        {
            List <Course> StudentCourse = new List <Course>();
            string        s             = Request.QueryString["Year"];

            s = "10";
            SimpleStudentList stdlist1 = new SimpleStudentList();

            stdlist1.LoadList_atDate(DateTime.Now.AddMonths(2));
            stdlist1.Restrict_to_year(System.Convert.ToInt16(s));
            string class1 = "";
            StudentAccademicProfile StudentProfile = new StudentAccademicProfile();

            string[,] outputA = new string[250, 30];//students,subject
            outputA[0, 0]     = "<th> Surname</th>"; outputA[0, 1] = "<th> GivenName</th> "; outputA[0, 2] = "<th> Adno</th> ";
            int no_cses = 0; int no_students = 0;
            int KeyStage = 0; int n = 0;

            switch (s)
            {
            case "7":
            case "8":
            case "9":
                KeyStage = 3;
                break;

            case "10":
            case "11":
                KeyStage = 4;
                break;

            case "12":
            case "13":
                KeyStage = 5;
                break;
            }
            CourseList  cl1 = new CourseList(KeyStage);
            CourseList  cl4 = new CourseList(50);//needed to get predicted grades for KS3.... ugh
            ResultsList rl1 = new ResultsList(); rl1.m_parameters = 1;

            foreach (SimplePupil p in stdlist1._studentlist)
            {
                rl1._results.Clear();
                StudentCourse.Clear();
                StudentProfile.profile.Clear();
                rl1.LoadList("dbo.tbl_Core_Students.StudentId", p.m_StudentId.ToString());
                ReportList repl = new ReportList(p.m_StudentId.ToString(), KeyStage - 2);
                //going to try to add the report grades in to the results...
                foreach (ReportValue v in repl.m_list)
                {
                    Result res1 = new Result();
                    rl1._results.Add(res1);
                    res1.External  = false;
                    res1.Date      = v.m_date;
                    res1.Shortname = "Report";
                    res1.Code      = v.m_course;
                    if (v.m_IsCommitment)
                    {
                        res1.Resulttype = 998;
                    }
                    else
                    {
                        res1.Resulttype = 999;
                    }
                    res1.Value = Round0(v.m_value).ToString();
                }
                //date sort with newest at front...
                Result r0 = new Result();
                Result r2 = new Result();
                for (int j = 0; j < rl1._results.Count; j++)
                {
                    for (int k = 0; k < (rl1._results.Count - 1 - j); k++)
                    {
                        r0 = (Result)rl1._results[k]; r2 = (Result)rl1._results[k + 1];
                        if (r0.Date < r2.Date)
                        {
                            rl1._results[k] = r2; rl1._results[k + 1] = r0;
                        }
                    }
                }
                double d = 0; int x = 0;

                ValueAddedMethodList vaml1     = new ValueAddedMethodList();
                ValueAddedMethod     vam       = new ValueAddedMethod();
                foreach (ValueAddedMethod VA_method1 in vaml1._ValueAddedMethodList)
                {
                    //going to use Yellis for KS4, CATs for KS3 and Alis for KS5..
                    if (VA_method1.m_ValueAddedShortName.ToUpper().Contains("YE") && (KeyStage == 4))
                    {
                        vam = new ValueAddedMethod(VA_method1.m_ValueAddedMethodID);
                    }
                    if (VA_method1.m_ValueAddedShortName.ToUpper().Contains("AL") && (KeyStage == 5))
                    {
                        vam = new ValueAddedMethod(VA_method1.m_ValueAddedMethodID);
                    }
                    if (VA_method1.m_ValueAddedShortName.ToUpper().Contains("CATS") && (KeyStage == 3))
                    {
                        vam = new ValueAddedMethod(VA_method1.m_ValueAddedMethodID);
                    }
                }
                ValueAddedConversionList vacl1 = new ValueAddedConversionList();
                ValueAddedEquation       va1   = new ValueAddedEquation();

                //going to find his current courses....
                PupilPeriodList ppl1           = new PupilPeriodList();
                ppl1.LoadList("StudentId", p.m_StudentId.ToString(), true);
                foreach (ScheduledPeriod sc in ppl1.m_pupilTTlist)
                {
                    s = sc.m_groupcode;
                    if (KeyStage == 3)
                    {
                        if (s.Contains("-"))
                        {
                            s = sc.m_groupcode.Substring(3, 2);
                        }
                        else
                        {
                            s = sc.m_groupcode.Substring(1, 2);//maths stes
                        }
                    }
                    else
                    {
                        s = sc.m_groupcode.Substring(2, 2);
                    }
                    //going to assume that code is correct... ie 11HI4 is History KS4...

                    foreach (Course c in cl1._courses)
                    {
                        if (c.CourseCode == s)
                        {
                            if (!StudentCourse.Contains(c))
                            {
                                StudentCourse.Add(c);
                                StudentSubjectProfile sbp1 = new StudentSubjectProfile();
                                sbp1.course   = c;
                                sbp1.KeyStage = KeyStage;
                                StudentProfile.profile.Add(sbp1);
                            }
                        }
                    }
                }
                //so now we have a list of his courses.....
                //for each course we find latest grade and predicion?
                bool foundpg = false; bool foundcg = false; bool foundint = false; bool foundVAM = false;

                foreach (StudentSubjectProfile sp in StudentProfile.profile)
                {
                    foundpg = false; foundcg = false; foundint = false; foundVAM = false;
                    foreach (Result r in rl1._results)//they are in date order...
                    {
                        if (r.Resulttype == vam.m_ValueAddedBaseResultType)
                        {
                            foundVAM = true; sp.VA_Base_Score = System.Convert.ToDouble(r.Value);
                        }
                        if (r.Code == sp.course.CourseCode)
                        {
                            if ((r.Resulttype == 999) && !foundpg)
                            {
                                foundpg = true; sp.latestProfileGrade = r;
                            }
                            if ((r.Resulttype == 998) && !foundcg)
                            {
                                foundcg = true; sp.latestCommintmentGrade = r;
                            }
                            if (!foundint && (r.Resulttype == 5))
                            {
                                foundint = true; sp.latestInternalExamResult = r;
                                ResultsList rl2 = new ResultsList();
                                rl2.m_parameters = 3;
                                rl2.m_db_field2  = "CourseId"; rl2.m_value2 = r.CourseID.ToString();
                                string date1 = "CONVERT(DATETIME, '" + r.Date.AddDays(-5).ToString("yyyy-MM-dd HH:mm:ss") + "', 102)";
                                string date2 = "CONVERT(DATETIME, '" + r.Date.AddDays(5).ToString("yyyy-MM-dd HH:mm:ss") + "', 102)";
                                rl2.m_db_extraquery = " AND (ResultDate > " + date1 + ") AND (ResultDate < " + date2 + ")";
                                //d = rl2.AverageResult("ResultType", "5", ref sp.NumberInternalResult);
                                x = (int)(d * 10);
                                //sp.AvgInternalResult = (double)x / 10;
                                //sp.PositionInternalResult = rl2.YearPosition("ResultType", "5", r.Value);
                            }
                            if (foundpg && foundcg && foundint && foundVAM)
                            {
                                break;
                            }
                        }
                    }
                    if (sp.VA_Base_Score > 0)
                    {
                        string cse1id = sp.course._CourseID.ToString();
                        if (KeyStage == 3)
                        {
                            foreach (Course c in cl4._courses)
                            {
                                if (sp.course.CourseCode == c.CourseCode)
                                {
                                    cse1id = c._CourseID.ToString();
                                }
                            }
                        }
                        va1.Load1("WHERE (ValueAddedMethodID='" + vam.m_ValueAddedMethodID.ToString() + "') AND ( CourseID='" + cse1id + "' ) ");
                        sp.PredictedGrade = Round1(va1.m_coef0 + va1.m_coef1 * sp.VA_Base_Score + va1.m_coef2 * sp.VA_Base_Score * sp.VA_Base_Score);
                    }
                }
                //so now to add to list.....
                outputA[no_students + 1, 0] = "<td>" + p.m_Surname + "</td>";
                outputA[no_students + 1, 1] = "<td>" + p.m_GivenName + "</td>";
                outputA[no_students + 1, 2] = "<td>" + p.m_adno.ToString() + "</td>";
                int cse_no = -1;
                foreach (StudentSubjectProfile sp in StudentProfile.profile)
                {
                    cse_no = -1;
                    for (int i = 0; i < no_cses + 1; i++)
                    {
                        if (outputA[0, 3 + i] == "<th>" + sp.course.CourseCode + "</th>")
                        {
                            cse_no = i;;
                        }
                    }
                    if (cse_no < 0)
                    {
                        outputA[0, 3 + no_cses] = "<th>" + sp.course.CourseCode + "</th>";
                        cse_no = no_cses;
                        no_cses++;
                    }


                    if (sp.latestProfileGrade != null)
                    {
                        d = System.Convert.ToDouble(sp.latestProfileGrade.Value);
                        if (KeyStage < 5)
                        {
                            d = 34 + 6 * d;              //convert to gcse points
                        }
                        if (KeyStage == 5)
                        {
                            d = 60 + 20 * d;
                        }
                        class1 = " class=\"tableHighlight3\"";
                        if ((sp.PredictedGrade - d) > 1)
                        {
                            class1 = " class=\"tableHighlight4\"";
                        }
                        if ((sp.PredictedGrade - d) > 2)
                        {
                            class1 = " class=\"tableHighlight5\"";
                        }
                        if ((d - sp.PredictedGrade) > 1)
                        {
                            class1 = " class=\"tableHighlight2\"";
                        }
                        if ((d - sp.PredictedGrade) > 2)
                        {
                            class1 = " class=\"tableHighlight1\"";
                        }
                        if (sp.PredictedGrade == 0)
                        {
                            class1 = " class=\"tableHighlight3\"";
                        }
                        s = "<td" + class1 + " >" + d.ToString() + "</td>";
                    }
                    else
                    {
                        s = "<td></td>";
                    }
                    outputA[no_students + 1, cse_no + 3] = s;

                    //if (sp.PredictedGrade != 0) s += "<td>" + sp.PredictedGrade.ToString() + "</td>"; else s += "<td></td>";

                    /*
                     * if (sp.latestCommintmentGrade != null)
                     * {
                     *  class1 = " class=\"tableHighlight3\"";
                     *  d = System.Convert.ToDouble(sp.latestCommintmentGrade.Value);
                     *  if (d > 3) class1 = " class=\"tableHighlight2\"";
                     *  if (d > 4) class1 = " class=\"tableHighlight1\"";
                     *  if (d < 2) class1 = " class=\"tableHighlight4\"";
                     *  if (d < 1) class1 = " class=\"tableHighlight5\"";
                     *  s += "<td" + class1 + " >" + sp.latestCommintmentGrade.Value.ToString() + "</td>";
                     * }
                     * else
                     *  s += "<td></td>";
                     *
                     * if (sp.latestInternalExamResult != null)
                     * {
                     *  s += "<td>" + sp.latestInternalExamResult.Value + "</td>";
                     *  s += "<td>" + sp.AvgInternalResult.ToString() + "</td>";
                     *  n = (int)Round1(100 * ((double)sp.PositionInternalResult / (double)sp.NumberInternalResult));
                     *  class1 = " class=\"tableHighlight3\"";
                     *  if (n < 30) class1 = " class=\"tableHighlight2\"";
                     *  if (n < 15) class1 = " class=\"tableHighlight1\"";
                     *  if (n > 70) class1 = " class=\"tableHighlight4\"";
                     *  if (n > 85) class1 = " class=\"tableHighlight5\"";
                     *  s += "<td" + class1 + " >" + n.ToString() + "</td>";
                     * }
                     * else
                     * {
                     *  s += "<td></td>";
                     *  s += "<td></td>";
                     *  s += "<td></td>";
                     * }
                     * s += "</tr>";
                     */
                }


                no_students++;
                //if (no_students > 5) break;
            }



            //so now to display...
            string s1 = "";

            s  = "<h3>Academic Profile for Year</h3><br />";
            s += "<table class=\"EventsTable\" > ";
            for (int i = 0; i < no_students + 1; i++)
            {
                s += "<tr>";
                for (int j = 0; j < no_cses + 3; j++)
                {
                    if (outputA[i, j] == null)
                    {
                        s += "<td></td>";
                    }
                    else
                    {
                        s += outputA[i, j];
                    }
                }
                s += "</tr>";
            }

            s += "</table>";

            content0.InnerHtml = s;
        }
Пример #7
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            Response.Redirect("../xmatrix/selectmodel.aspx");
            //ReportScale r = new ReportScale(new Guid("5e5d8ab4-aa9a-46cf-a1c2-83352bb2ef57"));
            //string s = r.AssessmentLevelDetail.LevelName;
            //s = s;

            //toclean up left students...
            return;


            SimpleStudentList          stl1 = new SimpleStudentList(SimpleStudentList.LIST_TYPE.NOFORM_ONROLE);
            Group                      g1   = new Group();
            StudentGroupMembershipList sg1  = new StudentGroupMembershipList();

            g1.Load("13year", new DateTime(2019, 4, 1));
            sg1.LoadList_Group(g1._GroupID, new DateTime(2019, 4, 1));

            //mark all as left in 2019

            foreach (StudentGroupMembership s1 in sg1.m_list)
            {
                MarkAsLeft(new DateTime(2019, 7, 31), s1.m_Studentid);
            }

            g1.Load("13year", new DateTime(2018, 4, 1));
            sg1.LoadList_Group(g1._GroupID, new DateTime(2018, 4, 1));

            foreach (StudentGroupMembership s1 in sg1.m_list)
            {
                MarkAsLeft(new DateTime(2018, 7, 31), s1.m_Studentid);
            }

            return;

            foreach (SimplePupil p in stl1._studentlist)
            {
                //so going to find last known rg group??
                sg1.LoadList(p.m_StudentId, new DateTime(2019, 4, 1));
                foreach (StudentGroupMembership s1 in sg1.m_list)
                {
                    g1.Load(s1.m_Groupid);
                    if (g1._GroupPrimaryAdministrative)
                    {
                        MarkAsLeft(new DateTime(2018, 7, 31), s1.m_Studentid);
                    }
                }

                sg1 = new StudentGroupMembershipList();
                sg1.LoadList(p.m_StudentId, new DateTime(2018, 4, 1));
                foreach (StudentGroupMembership s1 in sg1.m_list)
                {
                    g1.Load(s1.m_Groupid);
                    if (g1._GroupPrimaryAdministrative)
                    {
                        //so was here in 2018, but not in 2019
                        //so leaving date is 31/7/2018
                        MarkAsLeft(new DateTime(2018, 7, 31), s1.m_Studentid);
                    }
                }

                sg1 = new StudentGroupMembershipList();
                sg1.LoadList(p.m_StudentId, new DateTime(2017, 4, 1));
                foreach (StudentGroupMembership s1 in sg1.m_list)
                {
                    g1.Load(s1.m_Groupid);
                    if (g1._GroupPrimaryAdministrative)
                    {
                        //so was here in 2017 but not in 2018
                    }
                }
            }

            Response.Redirect("../content/TestForm.aspx");
            //Response.Redirect("../Exams/UploadComponentResults.aspx");
        }
Пример #8
0
        private void AC1List()
        {
            SimpleStudentList sstl1 = new SimpleStudentList("");
            int    no_on_role       = sstl1._studentlist.Count;
            double p = new double(); p = 0;
            string s = "<p style=\"font-size:small \"> <table align =center  border  style=\"font-size:x-small \">";

            s += "<tr><td>Item</td><td>Number</td><td>Percentage</td><td>.....</td></tr>";
            Utility u = new Utility();
            int     n = 0; int n1 = 0;

            s += "<tr><td>On Role</td><td>" + no_on_role.ToString() + "</td><td>100</td><td></td></tr>";
            sstl1.LoadList_FreeMealsOnly();
            n  = sstl1._studentlist.Count;
            p  = 100 * ((double)n / (double)no_on_role);
            s += "<tr><td>";
            s += (u.CheckStaffInConfigGroup(Context, "AdminAccess") ? "<A HREF=\"PlainResponseForm.aspx?Type=FSM\">FSM</A>" : "FSM");
            s += "</td><td>" + n.ToString() + "</td><td>" + p.ToString() + "</td><td></td></tr>";

            n = 0;
            foreach (SimplePupil p1 in sstl1._studentlist)
            {
                if (p1.m_year < 12)
                {
                    n++;
                }
            }

            p  = 100 * ((double)n / (double)no_on_role);
            s += "<tr><td>FSM Y7-11</td><td>" + n.ToString() + "</td><td>" + p.ToString() + "</td><td></td></tr>";

            sstl1.LoadHMFList(); n = sstl1._studentlist.Count;
            p  = 100 * ((double)n / (double)no_on_role);
            s += "<tr><td>HMF</td><td>" + n.ToString() + "</td><td>" + p.ToString() + "</td><td></td></tr>";



            sstl1.LoadList_SENOnly(3);
            n = sstl1._studentlist.Count; n1 = 0;
            foreach (SimplePupil p1 in sstl1._studentlist)
            {
                if (p1.m_year < 12)
                {
                    n1++;
                }
            }
            p  = 100 * ((double)n / (double)no_on_role);
            s += "<tr><td>Shool Action</td><td>" + n.ToString() + "</td><td>" + p.ToString() + "</td><td></td></tr>";

            sstl1.LoadList_SENOnly(4);
            foreach (SimplePupil p1 in sstl1._studentlist)
            {
                if (p1.m_year < 12)
                {
                    n1++;
                }
            }
            n += sstl1._studentlist.Count;
            p  = 100 * ((double)sstl1._studentlist.Count / (double)no_on_role);
            s += "<tr><td>Shool Action+</td><td>" + sstl1._studentlist.Count.ToString() + "</td><td>" + p.ToString() + "</td><td></td></tr>";

            p  = 100 * ((double)n / (double)no_on_role);
            s += "<tr><td>SA and SA+</td><td>" + n.ToString() + "</td><td>" + p.ToString() + "</td><td></td></tr>";

            p  = 100 * ((double)n1 / (double)no_on_role);
            s += "<tr><td>SA and SA+in Y7-11</td><td>" + n1.ToString() + "</td><td>" + p.ToString() + "</td><td></td></tr>";


            s += "</table></p>";
            content0.InnerHtml = s;
        }