Ejemplo n.º 1
0
        private void deptcomboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            DepartmentModel rec   = (DepartmentModel)deptcomboBox1.SelectedItem;
            ArrayList       alist = DatabaseModel.getTeachers(rec.DeptID);


            IEnumerator en = alist.GetEnumerator();

            while (en.MoveNext())
            {
                listBox1.Items.Add(en.Current);
            }
        }
Ejemplo n.º 2
0
        public static ArrayList getDept(int facultyid)
        {
            ArrayList    alist = new ArrayList();
            string       query = "select * from department where faculty_id=" + facultyid;
            OleDbCommand com   = new OleDbCommand(query, con);

            con.Open();
            OleDbDataReader read = com.ExecuteReader();


            while (read.Read())
            {
                DepartmentModel rec = new DepartmentModel();
                rec.DeptID    = read.GetInt32(0);
                rec.FacultyID = read.GetInt32(1);
                rec.DeptName  = read.GetString(2);

                alist.Add(rec);
            }
            con.Close();
            return(alist);
        }