예제 #1
0
 protected void SetupList()
 {
     if (RadioButtonList1.SelectedValue == "Staff")
     {
         StaffList stl1 = new StaffList(); stl1.LoadList(DateTime.Now, true);
         ListBox_staff.Items.Clear();
         foreach (SimpleStaff s1 in stl1.m_stafflist)
         {
             ListItem l = new ListItem(s1.m_StaffCode, s1.m_StaffId.ToString());
             ListBox_staff.Items.Add(l);
         }
     }
     if (RadioButtonList1.SelectedValue == "Subjects")
     {
         ListBox_staff.Items.Clear();
         CourseList cl1 = new CourseList(5);
         foreach (Course c in cl1._courses)
         {
             ListItem l = new ListItem(c.CourseCode, c._CourseID.ToString());
             ListBox_staff.Items.Add(l);
         }
     }
     if (RadioButtonList1.SelectedValue == "All")
     {
         StaffList stl1 = new StaffList(); stl1.LoadList(DateTime.Now, true);
         ListBox_staff.Items.Clear();
         foreach (SimpleStaff s1 in stl1.m_stafflist)
         {
             ListItem l = new ListItem(s1.m_StaffCode, s1.m_StaffId.ToString());
             ListBox_staff.Items.Add(l); l.Selected = true;
         }
     }
 }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Utility   u   = new Utility();
                StaffList sl1 = new StaffList(); sl1.LoadList(DateTime.Now, true);
                foreach (SimpleStaff s in sl1.m_stafflist)
                {
                    DropDownList_staff.Items.Add(s.m_StaffCode);
                }
                TimetableControl1.type = TT_writer.TimetableType.Booking;
#if DEBUG
                TimetableControl1.BaseId = new Guid(u.Get_StaffID("CC"));
                if (u.CheckStaffInConfigGroup("CC", "PhysicsExptSupervisor"))
                {
                    Label_ActAs.Visible = true; DropDownList_staff.Visible = true;
                }
#else
                TimetableControl1.BaseId = u.GetsStaffIdfromRequest(Request);
                //TimetableControl1.BaseId = u.GetStaffIDfromContext(Context);
                if (u.CheckStaffInConfigGroup(Context, "PhysicsExptSupervisor"))
                {
                    Label_ActAs.Visible = true; DropDownList_staff.Visible = true;
                }
#endif
            }
        }
예제 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            StaffList sl1 = new StaffList(); sl1.LoadList(DateTime.Now, true);

            foreach (SimpleStaff s in sl1.m_stafflist)
            {
                ListItem l = new ListItem(s.m_StaffCode + " : " + s.m_PersonGivenName + " " + s.m_PersonSurname, s.m_StaffId.ToString());
                ListBox_staff.Items.Add(l);
            }
        }
예제 #4
0
        private void BuildNamesList(string type)
        {
            NameList.Items.Clear();
            if (type == "staff")
            {
                StaffList stlist1 = new StaffList(); stlist1.LoadList(DateTime.Now, true);
                foreach (SimpleStaff s in stlist1.m_stafflist)
                {
                    ListItem l = new ListItem(s.m_PersonGivenName + " " + s.m_PersonSurname + "-" + s.m_StaffCode, s.m_StaffId.ToString()); NameList.Items.Add(l);
                }
                Label_Year.Text      = "Type to search on name or code.";
                TextBox_mask.Visible = true;
                Display_List.Items.FindByValue("Details").Enabled = true;
                Display_List.Items.FindByValue("Incidents Authored by").Enabled = true;
            }
            if (type == "room")
            {
                RoomList rmlist1 = new RoomList(); rmlist1.LoadList();
                foreach (SimpleRoom r in rmlist1.m_roomlist)
                {
                    ListItem l = new ListItem(r.m_roomcode, r.m_RoomID.ToString()); NameList.Items.Add(l);
                }
                Label_Year.Text = "Rooms";
                RadioButtonList_StaffType.Visible = false;
            }

            if (type == "Currentstaff")
            {
                StaffList stlist1 = new StaffList(); stlist1.LoadList(DateTime.Now, false);
                foreach (SimpleStaff s in stlist1.m_stafflist)
                {
                    ListItem l = new ListItem(s.m_PersonGivenName + " " + s.m_PersonSurname + "-" + s.m_StaffCode, s.m_StaffId.ToString()); NameList.Items.Add(l);
                }
                Label_Year.Text      = "Type to search on name or code.";
                TextBox_mask.Visible = true;
                Display_List.Items.FindByValue("Details").Enabled = true;
                Display_List.Items.FindByValue("Incidents Authored by").Enabled = true;
            }

            if (type == "Allstaff")
            {
                StaffList stlist1 = new StaffList(); stlist1.LoadFullList();
                foreach (SimpleStaff s in stlist1.m_stafflist)
                {
                    ListItem l = new ListItem(s.m_PersonGivenName + " " + s.m_PersonSurname + "-" + s.m_StaffCode, s.m_StaffId.ToString()); NameList.Items.Add(l);
                }
                Label_Year.Text      = "Type to search on name or code.";
                TextBox_mask.Visible = true;
                Display_List.Items.FindByValue("Details").Enabled = true;
                Display_List.Items.FindByValue("Incidents Authored by").Enabled = true;
            }
        }
예제 #5
0
        protected void TextBox_mask_TextChanged(object sender, EventArgs e)
        {
            NameList.Items.Clear();

            StaffList stlist1 = new StaffList(); stlist1.LoadList(DateTime.Now, true);

            foreach (SimpleStaff s in stlist1.m_stafflist)
            {
                if ((s.m_PersonSurname.ToUpper().Contains(TextBox_mask.Text.ToUpper()) || (s.m_PersonGivenName.ToUpper().Contains(TextBox_mask.Text.ToUpper()))) || s.m_StaffCode.ToUpper().Contains(TextBox_mask.Text.ToUpper()))
                {
                    ListItem l = new ListItem(s.m_PersonGivenName + " " + s.m_PersonSurname + "-" + s.m_StaffCode, s.m_StaffId.ToString()); NameList.Items.Add(l);
                }
            }
            if (NameList.Items.Count > 0)
            {
                NameList.Items[0].Selected = true;
                NameList.Visible           = true;
                Display_List.Visible       = true;
                Display();
            }
        }