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.";
            }
        }
Exemplo n.º 2
0
        protected void DropDownList_ExamBoards_SelectedIndexChanged(object sender, EventArgs e)
        {
            ExamOption_List exol1 = new ExamOption_List();

            exol1.Load(DropDownList_ExamBoards.SelectedValue, YearCode.ToString(), SeasonCode.ToString());
            DropDownList_Options.Items.Clear();
            foreach (ExamOption e1  in exol1.m_list)
            {
                ListItem l1 = new ListItem(e1.m_OptionCode + ":" + e1.m_OptionTitle, e1.m_OptionID.ToString());
                DropDownList_Options.Items.Add(l1);
            }
        }
Exemplo n.º 3
0
        private string GetWhereString()
        {
            string s = " WHERE (ExamYear='" + Year.ToString() + "') AND ( ExamSeason='" + SeasonCode.ToString() + "' ) ";

            switch (DisplayType)
            {
            case "Student":
                s += " AND StudentAdmissionNumber ='" + StudentAdno + "' ";
                break;

            case "Option":
                s += " AND OptionCode = '" + DropDownList1.SelectedItem.Text + "' ";
                break;

            case "Subject":
                //need to work out which options....
                if (CourseId == "0")
                {    //so load all options...
                    s = "HAVING (ExamYear = '" + Year.ToString() + "') AND(ExamSeason = '" + SeasonCode.ToString() + "')"; return(s);
                }
                ExamOption_List el1 = new ExamOption_List();
                el1.LoadforCourse(new Guid(CourseId), YearCode.ToString(), SeasonCode.ToString());
                s = "";
                bool first = true;
                foreach (ExamOption e in el1.m_list)
                {
                    if (first)
                    {
                        first = false; s = " HAVING ";
                    }
                    else
                    {
                        s += " OR ";
                    }
                    s += " (OptionCode = '" + e.m_OptionCode + "' ) AND (ExamYear = '" + Year.ToString() + "' ) AND (ExamSeason = '" + SeasonCode.ToString() + "')";
                }
                if (first)
                {                                           //we didn't have any options...
                    s = " HAVING (OptionCode = 'ZZZZZZ' )"; //null return!
                }
                break;

            case "Status":
                s += " AND (EntryStatusCode  ='" + DropDownList1.SelectedItem.Value + "' ) ";
                break;
            }
            return(s);
        }
        protected void DropDownList_ExamBoards_SelectedIndexChanged(object sender, EventArgs e)
        {
            ExamOption_List exol1 = new ExamOption_List();

            exol1.Load(DropDownList_ExamBoards.SelectedValue, YearCode.ToString(), SeasonCode.ToString());
            DropDownList_Options.Items.Clear();
            foreach (ExamOption e1 in exol1.m_list)//only add if we HAVE components!!
            {
                ExamCompononent_List ecl1 = new ExamCompononent_List(); ecl1.Load(e1.m_OptionID);
                if (ecl1.m_list.Count > 0)
                {
                    ListItem l1 = new ListItem(e1.m_OptionCode + ":" + e1.m_OptionTitle, e1.m_OptionID.ToString());
                    DropDownList_Options.Items.Add(l1);
                }
            }
            DropDownList_Options_SelectedIndexChanged(sender, e);
        }
Exemplo n.º 5
0
        protected bool CheckOptions(Exam_Board eb)
        {
            ExamFiles       ef      = new Cerval_Library.ExamFiles();
            ExamOption_List examOl1 = new ExamOption_List();

            examOl1.Load(eb.m_ExamBoardId.ToString(), YearCode.ToString(), SeasonCode.ToString());
            System.Collections.ArrayList ExamOptionsList = new System.Collections.ArrayList();
            ExamOptionsList = ef.ExamsOptionsFromBaseData(eb, SeasonCode.ToString(), YearCode.ToString());
            int m1 = 0; int m2 = 0;

            foreach (ExamOption examo1 in examOl1.m_list)
            {
                foreach (ExamBaseOption eb1 in ExamOptionsList)
                {
                    if (eb1.m_OptionEntryCode == examo1.m_OptionCode)
                    {
                        m1 = 0; m2 = 0;
                        try { m1 = System.Convert.ToInt32(eb1.m_MaximiumMark); }
                        catch { }
                        try { m2 = System.Convert.ToInt32(examo1.m_OptionMaximumMark); }
                        catch { }
                        try
                        {
                            if (m1 != m2)
                            {
                                examo1.m_OptionMaximumMark = eb1.m_MaximiumMark;
                                examo1.UpdateMaxMark();
                            }
                            //ought to check we have all the components for this...
                            string component_file = ef.path + "c" + eb1.m_file_path.Substring(1, eb1.m_file_path.Length - 1);
                            string link_file      = ef.path + "l" + eb1.m_file_path.Substring(1, eb1.m_file_path.Length - 1);
                            ef.Install_Components(examo1.m_OptionCode, link_file, component_file, eb, SeasonCode.ToString(), YearCode.ToString());
                        }
                        catch
                        {
                        }
                    }
                }
            }

            return(true);
        }
Exemplo n.º 6
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            // going to delete option/component values

            ExamOption_List eol1 = new ExamOption_List();

            eol1.Load(YearCode.ToString(), SeasonCode.ToString());
            ExamCompononent_List ecl1 = new ExamCompononent_List();

            ecl1.LoadAllComponentsSeason(YearCode.ToString(), SeasonCode.ToString());

            foreach (ExamOption eo in eol1.m_list)
            {
                eo.Delete();
            }
            foreach (ExamComponent ec in ecl1.m_list)
            {
                ec.Delete();
            }
        }
Exemplo n.º 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                GetMasterValues();
                DropDownList1.Visible = false;
                GridView2.Visible     = false;
                GridView1.Visible     = false;
                ListBox1.Visible      = false;
                TextBox1.Visible      = false;
                Label_Select3.Text    = "";
                if (Request.QueryString.Count >= 1)
                {
                    DisplayType = Request.QueryString["Type"];
                }
                switch (DisplayType)
                {
                case "Student":
                    Label_Select1.Text    = "Select Year:";
                    Label_Select3.Text    = "OR type Admission Number:";
                    DropDownList1.Visible = true;
                    DropDownList1.Items.Add("14");
                    DropDownList1.Items.Add("13");
                    DropDownList1.Items.Add("12");
                    DropDownList1.Items.Add("11");
                    DropDownList1.Items.Add("10");
                    DropDownList1.SelectedIndex = 1;
                    DropDownList1.Visible       = true;
                    ListBox1.Visible            = true;
                    TextBox1.Visible            = true;
                    GridView2.Visible           = true;

                    StudentYearList styl1 = new StudentYearList(ListBox1, DropDownList1.SelectedValue + "Year", DateTime.Now);

                    break;

                case "Option":
                    Label_Select1.Text    = "Select Option:";
                    DropDownList1.Visible = true;
                    GridView1.Visible     = true;
                    DropDownList1.Items.Clear();
                    ExamOption_List exol1 = new ExamOption_List(); exol1.Load(YearCode.ToString(), SeasonCode.ToString());
                    foreach (ExamOption exo in exol1.m_list)
                    {
                        DropDownList1.Items.Add(new ListItem(exo.m_OptionCode, exo.m_OptionID.ToString()));
                    }
                    DropDownList1.SelectedIndex = -1;
                    break;

                case "Subject":
                    Label_Select1.Text    = "Select Subject:";
                    DropDownList1.Visible = true;
                    GridView1.Visible     = true;
                    ListItem l1 = new ListItem("All", "0");
                    DropDownList1.Items.Add(l1);
                    CourseList cl1 = new CourseList(0);
                    foreach (Course c in cl1._courses)
                    {
                        if (c.KeyStage == 5)
                        {
                            ListItem l = new ListItem(c.CourseName + "( A-level)", c._CourseID.ToString());
                            DropDownList1.Items.Add(l);
                        }
                        if (c.KeyStage == 4)
                        {
                            ListItem l = new ListItem(c.CourseName + "( GCSE)", c._CourseID.ToString());
                            DropDownList1.Items.Add(l);
                        }
                    }
                    DropDownList1.SelectedIndex = -1;
                    break;

                case "Status":
                    Label_Select1.Text    = "Select Status:";
                    DropDownList1.Visible = true;
                    GridView1.Visible     = true;
                    Exam_Entry_Status_List el1 = new Exam_Entry_Status_List();
                    foreach (Exam_Entry_Status e1 in el1.m_list)
                    {
                        ListItem l2 = new ListItem(e1.m_EntryStatusDescription, e1.m_EntryStatusCode);
                        DropDownList1.Items.Add(l2);
                    }
                    //going to add extra line for Student resits...
                    ListItem l3 = new ListItem("Resit Request waiting to be processed", "RESITS");
                    DropDownList1.Items.Add(l3);
                    DropDownList1.SelectedIndex = -1;

                    break;

                default:
                    break;
                }
            }
        }