示例#1
0
        public stdMainpage(string username, userDatabase usrDB, courseDatabase crsDB)
        {
            // Store attributes
            InitializeComponent();
            this.crsDB = crsDB;
            this.usrDB = usrDB;
            std        = usrDB.getStudent(username);

            // Change texts
            welcome.Text += std.fname + " " + std.lname;
            gpa.Text     += " " + std.GPA;
            credits.Text += " " + std.totalCredits;

            // Create all the tables
            createCrsLst();
            createGradeHist();
            createStdSch();

            // Clear selections on tables
            gradeHist.ClearSelection();
            stdSch.ClearSelection();

            // Auto completion source
            foreach (course crs in crsDB.getCourseList())
            {
                crsIDBox.AutoCompleteCustomSource.Add(crs.crsID);
            }
        }
示例#2
0
 private void checkAdviseeScheduleClick(object sender, EventArgs e)
 {
     if (adviseeLst.SelectedRows.Count == 0)
     {
         MessageBox.Show("Select a student from the adivsees list.",
                         "No student selected",
                         MessageBoxButtons.OK,
                         MessageBoxIcon.Error);
     }
     else
     {
         string  username = adviseeLst.SelectedRows[0].Cells["Username"].Value.ToString();
         student std      = usrDB.getStudent(username);
         new admAdviseeSch(std).ShowDialog();
     }
 }