protected void AddSupervision(DateTime t_start, DateTime t_end, ScheduledComponent sc)
        {
            ScheduledComponent sched1 = new ScheduledComponent();
            TimeSpan           tgap   = new TimeSpan();

            tgap = t_end - t_start;
            if ((tgap.TotalMinutes >= 10) && (tgap.TotalDays < 2))
            {
                ExamConversions u   = new ExamConversions();
                ExamComponent   ec1 = new ExamComponent();
                ec1.m_ComponentCode    = "Super";
                ec1.m_ComponentTitle   = "Supervision";
                ec1.m_ComponentTitle  += "-" + sc.GetHashCode().ToString();
                ec1.m_ExamBoardID      = new Guid("436ff234-0457-430a-b1e2-b08758ff30ef");
                ec1.m_year             = Year.ToString().Substring(2, 2);
                ec1.m_season           = u.GetSeasonCode(SeasonCode);
                ec1.m_Teachermarks     = "0"; ec1.m_MaximumMark = "0";
                ec1.m_Timetabled       = "T"; ec1.m_TimetableDate = t_start;
                ec1.m_TimetableSession = "A";
                ec1.m_Time             = tgap.TotalMinutes.ToString();
                //now if the brat has extra time we need to reduce...>!!!!
                StudentSENList ssen1      = new StudentSENList(sc.m_StudentId.ToString());
                double         extra_time = 0;
                double         time1      = tgap.TotalMinutes;
                //now if the brat has extra time we need to reduce.. becasue it will be increased by code when read...
                foreach (StudentSEN sen1 in ssen1.m_List)
                {
                    if (sen1.m_ExamsExtraTime > 0)
                    {
                        extra_time = (double)sen1.m_ExamsExtraTime;
                    }
                }
                time1 = time1 / ((100 + extra_time) / 100);
                int i = (int)time1;
                ec1.m_Time = i.ToString();
                ec1.Create();

                ec1.m_ComponentID = ec1.Find_ComponentID(ec1.m_ComponentCode, ec1.m_ComponentTitle, ec1.m_ExamBoardID.ToString(), ec1.m_season, ec1.m_year);

                if (ec1.m_ComponentID != Guid.Empty)
                {
                    sched1.Load(ec1.m_ComponentID, sc.m_StudentId);

                    if (!sched1.m_valid)
                    {
                        sched1.m_StudentId   = sc.m_StudentId;
                        sched1.m_ComponentId = ec1.m_ComponentID;
                        sched1.m_RoomId      = Guid.Empty;
                        sched1.m_Year        = Year.ToString();
                        sched1.m_Season      = u.GetSeasonCode(SeasonCode);
                        sched1.m_valid       = true;
                        sched1.m_Date        = t_start;
                        sched1.m_Desk        = "";
                        sched1.m_Will_Type   = false;// do these later...
                        sched1.Save();
                    }
                }
            }
        }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //going to try to get from iSAMS data
                iSAMSLoad(); return;

                Utility  u1 = new Utility();
                DateTime t1 = new DateTime();
                DateTime t0 = new DateTime();
                t0 = DateTime.Now;
                t1 = t0.AddMonths(6);
                t0 = t0.AddMonths(-1);
                //SO   in future and up to 1 month in the past
                //string season = u1.ThisSeason(t0);

                //season = "3";

                ArrayList m_list   = new ArrayList();
                Guid      PersonID = new Guid();
                PersonID = u1.GetPersonIdfromRequest(Request);


#if DEBUG
                PersonID = u1.GetPersonIDX(@"CHALLONERS\charles.manning");//development
#endif

                //check they have read the exams notice...

                //string y = t0.Year.ToString();
                //bool v = false;
                //WarningNoticeRead w = new WarningNoticeRead(u1.GetStudentId(PersonID), u1.ThisSeason(t0), y, ref v);
                //if (!v)
                //{
                //Server.Transfer("ExamWarnings.aspx");//go and make them read the notice...
                //}

                PupilDetails p1 = new PupilDetails(u1.GetStudentId(PersonID).ToString());
                {
                    string s0 = "";
                    string s  = "PersonImagePage.aspx?id=" + p1.m_PersonId.ToString();
                    s  = "\"" + s;
                    s += "\" width = \"110\" height=\"140\"";
                    s  = "<FONT FACE = \"Arial\"><p align=\"center\"> <img src=" + s + "></p>";
                    s += "<p align=\"center\">This page should be printed and brought to all exams</p>";
                    {
                        s += "<center><h2>Exam Timetable for " + p1.m_GivenName + "  " + p1.m_Surname + "</h2></center>";
                        StudentSENList sen1 = new StudentSENList(p1.m_StudentId.ToString()); s0 = "";
                        foreach (StudentSEN s1 in sen1.m_List)
                        {
                            if (s1.m_ExamsExtraTime > 0)
                            {
                                s0 += "Extra Time (" + s1.m_ExamsExtraTime.ToString() + "%)  ";
                            }
                            if (s1.m_ExamsCanType)
                            {
                                s0 += " Can Type(Please report to IT4 for any exam where you wish to type)";
                            }
                        }
                        if (s0 != "")
                        {
                            s += "<center><h3>" + s0 + "</h3></center>";
                        }
                        ScheduledComponentList scl1 = new ScheduledComponentList();
                        t0 = t0.AddMonths(-3);
                        scl1.LoadList_Student(t0, t1, p1.m_StudentId.ToString());
                        SimpleRoom room1 = new SimpleRoom();
                        s += "<BR><center><TABLE BORDER><TR>";
                        s += "<Th>Date</Th>";
                        s += "<Th>Day</Th>";
                        s += "<Th>Start Time</Th>";
                        s += "<Th>End Time</Th>";
                        s += "<Th>Paper Code</Th>";
                        s += "<Th>Paper Name</Th>";
                        s += "<Th>Room</Th>";
                        s += "<Th>Desk</Th></TR>";
                        foreach (ScheduledComponent sc in scl1.m_List)
                        {
                            s += "<TR><TD>" + sc.m_Date.ToShortDateString() + "</TD>";
                            s += "<TD>" + sc.m_Date.DayOfWeek.ToString() + "</TD>";
                            t1 = sc.m_Date;
                            s += "<TD>" + sc.m_Date.ToShortTimeString() + "</TD>";
                            t1 = t1.AddMinutes(sc.m_TimeAllowed);
                            s += "<TD>" + t1.ToShortTimeString() + "</TD>";
                            s += "<TD>" + sc.m_ComponentCode + "</TD>";
                            s += "<TD>" + sc.m_ComponentTitle.ToLower() + "</TD>";
                            if (sc.m_RoomId != Guid.Empty)
                            {
                                room1.Load(sc.m_RoomId.ToString());
                                s += "<TD>" + room1.m_roomcode + "</TD>";
                            }
                            else
                            {
                                s += "<TD>not yet assigned</TD>";
                            }

                            s += "<TD>" + sc.m_Desk + "</TD></TR>";
                        }
                        s += "</TABLE></center>";
                    }
                    s += "<br><center><h3>Candidate Number = " + p1.m_examNo.ToString() + " , UCI=" + p1.m_UCI + "</h3></center></Font>";
                    servercontent.InnerHtml = s;
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string s = ""; bool edit = false; string s1 = "";
                try
                {
                    Utility u = new Utility();
                    edit = u.CheckStaffInConfigGroup(Context, "SEN-MANAGERS");
                }
                catch (Exception e1)
                {
                    s = e1.Message;
                }

                string type            = Request.QueryString["Type"];
                string studentID       = Request.QueryString["Id"];
                string studentFullName = Request.QueryString["Name"];
                string photo           = Request.QueryString["Photo"];
                string senId           = Request.QueryString["StudentSENId"];
                ViewState.Add("senId", senId);
                StudentSEN sen1 = new StudentSEN(); sen1.Load(senId);
                s  = "<p align=\"center\">" + studentFullName;
                s += "<br>Special Needs Strategies</p>";
                s += "<p align=\"center\"> <img src=\"" + photo + "\" width = \"110\" height=\"140\"></p>";
                string NewString = "../content/StudentSENStrategies.aspx?Type=New&Id=" + studentID + "&Name=" + studentFullName + "&Photo=" + photo + "&StudentSENId=" + sen1.m_SENid.ToString();;
                ViewState.Add("NewString", NewString);
                if (type == "Display")
                {
                    StudentSENList senlist1  = new StudentSENList(studentID);
                    SENTypeList    sentypes1 = new SENTypeList();
                    foreach (SENType sent1 in sentypes1._List)
                    {
                        if (sen1.m_SenType == sent1.id)
                        {
                            Response.Write(sent1.SENtype + " :   ");
                        }
                    }
                    s += sen1.m_SenDescription + "<br><br>";
                    if (sen1.m_strategies.m_List.Count > 0)
                    {
                        foreach (StudentSENStrategy senst1 in sen1.m_strategies.m_List)
                        {
                            if (edit)
                            {
                                s1  = "../content/StudentSENStrategies.aspx?Type=Edit&";
                                s1 += "&Id=" + studentID.ToString() + "&Name=" + studentFullName;
                                s1 += "&Photo=" + photo + "&StudentSENId=" + sen1.m_SENid.ToString();
                                s1 += "&StudentSENStrategy=" + senst1.Id.ToString();
                                s  += "<A HREF=\"" + s1 + "\">Strategy: </A>";
                            }
                            else
                            {
                                s += "Strategy: ";
                            }
                            s += senst1.Strategy_Value + "<br>";
                        }
                    }
                    content0.InnerHtml = s;
                }
                if (type == "Edit")
                {
                    s += "<br>";
                    content0.InnerHtml      = s;
                    TextBox1.Visible        = true; Button_Save.Visible = true;
                    CreateNewButton.Visible = false; Button_Cancel.Visible = true;
                    Button_Delete.Visible   = true;
                    string StudentSENStrategyId = Request.QueryString["StudentSENStrategy"];
                    ViewState.Add("StudentSENStrategyId", StudentSENStrategyId);
                    StudentSENStrategy sss1 = new StudentSENStrategy(); sss1.Load(StudentSENStrategyId);
                    TextBox1.Text = sss1.Strategy_Value;
                    string CancelString = "../content/StudentSENStrategies.aspx?Type=Display&Id=" + studentID + "&Name=" + studentFullName + "&Photo=" + photo + "&StudentSENId=" + sen1.m_SENid.ToString();
                    ViewState.Add("Cancel_String", CancelString);
                }
                if (type == "New")
                {
                    s += "<br>";
                    content0.InnerHtml      = s;
                    TextBox1.Visible        = true; Button_Save.Visible = true;
                    CreateNewButton.Visible = false; Button_Cancel.Visible = true;
                    Button_Delete.Visible   = false;
                    TextBox1.Text           = "";
                    string CancelString = "../content/StudentSENStrategies.aspx?Type=Display&Id=" + studentID + "&Name=" + studentFullName + "&Photo=" + photo + "&StudentSENId=" + sen1.m_SENid.ToString();
                    ViewState.Add("Cancel_String", CancelString);
                }
            }
        }
示例#4
0
        protected void Button_ShowTimetable_Click(object sender, EventArgs e)
        {
            GridView1.Visible = false;
            visibility(3);
            string       studentID = Label_StudentID.Text;
            PupilDetails p1        = new PupilDetails(studentID);
            {
                Utility  u1 = new Utility();
                DateTime t1 = new DateTime();
                DateTime t0 = new DateTime();
                t0 = DateTime.Now;
                t1 = t0.AddMonths(6);
                t0 = t0.AddMonths(-2);
                //string season = u1.ThisSeason(t0);
                ArrayList m_list = new ArrayList();

                string s = "PersonImagePage.aspx?id=" + p1.m_PersonId.ToString();
                s  = "\"" + s;
                s += "\" width = \"110\" height=\"140\"";
                Response.Write("<FONT FACE = \"Arial\"><p align=\"center\"> <img src=" + s + "></p>");
                {
                    Response.Write("<br><center><h2>Exam Timetable for " + p1.m_GivenName + "  " + p1.m_Surname + "</h2></center>");
                    StudentSENList sen1 = new StudentSENList(p1.m_StudentId.ToString()); s = "";
                    foreach (StudentSEN s1 in sen1.m_List)
                    {
                        if (s1.m_ExamsExtraTime > 0)
                        {
                            s += "Extra Time (" + s1.m_ExamsExtraTime.ToString() + "%)  ";
                        }
                        if (s1.m_ExamsCanType)
                        {
                            s += "  Can Type ";
                        }
                    }
                    if (s != "")
                    {
                        s = "<center><h3>" + s + "</h3></center>";
                        Response.Write(s);
                    }
                    ScheduledComponentList scl1 = new ScheduledComponentList();
                    scl1.LoadList_Student(t0, t1, studentID);
                    SimpleRoom room1 = new SimpleRoom();
                    Response.Write("<BR><p  align=\"center\" ><TABLE BORDER><TR>");
                    s = "Date"; Response.Write("<TD>" + s + "</TD>");
                    s = "Day"; Response.Write("<TD>" + s + "</TD>");
                    s = "Start Time"; Response.Write("<TD>" + s + "</TD>");
                    s = "End Time"; Response.Write("<TD>" + s + "</TD>");
                    s = "Paper Code"; Response.Write("<TD>" + s + "</TD>");
                    s = "Paper Name"; Response.Write("<TD>" + s + "</TD>");
                    s = "Room"; Response.Write("<TD>" + s + "</TD>");
                    s = "Desk"; Response.Write("<TD>" + s + "</TD>");
                    Response.Write("</TR>");
                    foreach (ScheduledComponent sc in scl1.m_List)
                    {
                        Response.Write("<TR>");
                        s  = sc.m_Date.ToShortDateString(); Response.Write("<TD>" + s + "</TD>");
                        s  = sc.m_Date.DayOfWeek.ToString(); Response.Write("<TD>" + s + "</TD>");
                        t1 = sc.m_Date;
                        s  = sc.m_Date.ToShortTimeString(); Response.Write("<TD>" + s + "</TD>");
                        t1 = t1.AddMinutes(sc.m_TimeAllowed);
                        s  = t1.ToShortTimeString(); Response.Write("<TD>" + s + "</TD>");
                        s  = sc.m_ComponentCode; Response.Write("<TD>" + s + "</TD>");
                        s  = sc.m_ComponentTitle.ToLower(); Response.Write("<TD>" + s + "</TD>");
                        if (sc.m_RoomId != Guid.Empty)
                        {
                            room1.Load(sc.m_RoomId.ToString());
                            s = room1.m_roomcode; Response.Write("<TD>" + s + "</TD>");
                        }
                        else
                        {
                            Response.Write("<TD>not yet assigned</TD>");
                        }

                        s = sc.m_Desk; Response.Write("<TD>" + s + "</TD>");
                        Response.Write("</TR>");
                    }
                    Response.Write("</TABLE>");
                }
                Response.Write("<br><center><h3>Candidate Number = " + p1.m_examNo.ToString() + " , UCI=" + p1.m_UCI + "</h3></center></Font>");
            }
        }