Ejemplo n.º 1
0
        protected void UpdateMessageList(string t)
        {
            Cerval_Globals cg1 = new Cerval_Globals();

            ListBox_staff.Items.Clear();
            string   s1    = DropDownList_Year.SelectedValue;
            DateTime date1 = new DateTime();

            date1 = DateTime.Now.AddMonths(0);

            if (t == "Group")
            {
                GroupList gl1;
                gl1 = new GroupList("", date1);
                //put the form groups first
                foreach (Group g in gl1._groups)
                {
                    if (g._GroupCode.StartsWith(s1))
                    {
                        if (g._CourseID == Cerval_Globals.RegistrationCse)//registration../
                        {
                            //only for year groups...
                            ListItem l1 = new ListItem(g._GroupCode, g._GroupID.ToString());
                            ListBox_staff.Items.Add(l1);
                        }
                    }
                }
                foreach (Group g in gl1._groups)
                {
                    if (g._GroupCode.StartsWith(s1))
                    {
                        if ((g._CourseID != Cerval_Globals.RegistrationCse) && (!Cerval_Globals.NewStructureCourses.Contains(g._CourseID)))
                        {
                            ListItem l1 = new ListItem(g._GroupCode, g._GroupID.ToString());
                            ListBox_staff.Items.Add(l1);
                        }
                    }
                }
            }


            if (t == "Student")
            {
                //StudentYearList yl1 = new StudentYearList(ListBox_staff, s1 + "Year", "{ fn NOW() }");
                StudentYearList yl1 = new StudentYearList(ListBox_staff, s1 + "Year", DateTime.Now);
                ListBox_staff.SelectionMode = ListSelectionMode.Multiple;
                TextBox_textTo.Visible      = true;
            }
        }
Ejemplo n.º 2
0
        protected void UpdateMessageList(string t)
        {
            Cerval_Globals cg1 = new Cerval_Globals();

            ListBox_staff.Items.Clear();
            string   s1    = DropDownList_Year.SelectedValue;
            DateTime date1 = new DateTime();

            date1 = DateTime.Now.AddMonths(0);

            if (t == "Group")
            {
                GroupList gl1;
                if (s1 == "My Groups")
                {
                    gl1 = new GroupList();
                    Utility u          = new Utility();
                    string  staff_code = u.GetsStaffCodefromRequest(Request);
                    gl1.LoadList_StaffPrivateGroups(staff_code.Trim(), GroupList.GroupListOrder.GroupName);
                    foreach (Group g in gl1._groups)
                    {
                        ListItem l1 = new ListItem(g._GroupName, g._GroupID.ToString());
                        ListBox_staff.Items.Add(l1);
                    }
                    return;
                }
                else
                {
                    gl1 = new GroupList("", date1);
                }
                //put the form groups first
                foreach (Group g in gl1._groups)
                {
                    if (g._GroupCode.StartsWith(s1))
                    {
                        if (g._CourseID == Cerval_Globals.RegistrationCse)//registration../
                        {
                            //only for year groups...
                            ListItem l1 = new ListItem(g._GroupCode, g._GroupID.ToString());
                            ListBox_staff.Items.Add(l1);
                        }
                    }
                }
                foreach (Group g in gl1._groups)
                {
                    if (g._GroupCode.StartsWith(s1))
                    {
                        if ((g._CourseID != Cerval_Globals.RegistrationCse) && (!Cerval_Globals.NewStructureCourses.Contains(g._CourseID)))
                        {
                            ListItem l1 = new ListItem(g._GroupCode, g._GroupID.ToString());
                            ListBox_staff.Items.Add(l1);
                        }
                    }
                    if (s1.ToUpper() == "14")
                    {
                        if (g._GroupCode.StartsWith("1") || g._GroupCode.StartsWith("7") || g._GroupCode.StartsWith("8") || g._GroupCode.StartsWith("9"))
                        {
                        }
                        else
                        {
                            ListItem l1 = new ListItem(g._GroupCode, g._GroupID.ToString());
                            ListBox_staff.Items.Add(l1);
                        }
                    }
                }
            }


            if (t == "Student")
            {
                //StudentYearList yl1 = new StudentYearList(ListBox_staff, s1 + "Year", "{ fn NOW() }");
                StudentYearList yl1 = new StudentYearList(ListBox_staff, s1 + "Year", DateTime.Now);
                ListBox_staff.SelectionMode = System.Web.UI.WebControls.ListSelectionMode.Multiple;
                TextBox_textTo.Visible      = true;
            }
        }