Пример #1
0
 private void show_info()    //shows the relevant infromation about user
 {
     name_label.Text = "Welcome, " + user.FIRSTNAME + " " + user.LASTNAME;
     dept_label.Text = "Department of " + user.SDEPT() + " Engeneering";
     year_label.Text = "Year " + user.YEAR + ", Semester " + user.SEMESTER;
     avg_label.Text  = "Average: " + user.calc_avg();
     pts_label.Text  = "Points: " + user.get_pts(false);
 }
Пример #2
0
        private void F_Head_Department_Degree_Load(object sender, EventArgs e)
        {
            dt = db.FetchTable(db.TPERSON + ", " + db.TSTUDENT, "firstname, lastname, person.id, average", "dept = " + (int)user.DEPT + " and type = 0 and person.id = student.id").Tables[db.TPERSON + ", " + db.TSTUDENT];
            dataGridView1.DataSource = dt;
            dataGridView1.Columns.Add("Points", "Points");

            for (int i = 0; i < dataGridView1.Rows.Count; i++)
            {
                Student stud = db.getStudent("id = " + dataGridView1.Rows[i].Cells[3].Value);
                dataGridView1.Rows[i].Cells[5].Value = stud.get_pts(false);
            }
        }
Пример #3
0
 private void textBox1_TextChanged(object sender, EventArgs e)
 {
     for (int i = 0; i < dataGridView1.Rows.Count; i++)
     {
         Student         stud             = db.getStudent("id = " + dataGridView1.Rows[i].Cells[3].Value);
         CurrencyManager currencyManager1 = (CurrencyManager)BindingContext[dataGridView1.DataSource];
         currencyManager1.SuspendBinding();
         if (!string.IsNullOrEmpty(this.textBox1.Text.ToString()))
         {
             if (stud.get_pts(false) < Convert.ToInt32(textBox1.Text))
             {
                 dataGridView1.Rows[i].Visible = false;
             }
             else
             {
                 dataGridView1.Rows[i].Visible = true;
             }
         }
         currencyManager1.ResumeBinding();
     }
 }
Пример #4
0
 private void F_Student_Grades_Load(object sender, EventArgs e)
 {
     listView1.Items.Clear();
     for (int i = 0; i < user.GRADES.Count; i++)
     {
         ListViewItem Lvi = new ListViewItem(user.GRADES[i].CNAME);
         Lvi.SubItems.Add(user.GRADES[i].YEAR.ToString());
         Lvi.SubItems.Add(user.GRADES[i].SEMESTER.ToString());
         Lvi.SubItems.Add(user.GRADES[i].GRADE.ToString());
         Lvi.SubItems.Add(user.GRADES[i].POINTS.ToString());
         listView1.Items.Add(Lvi);
     }
     label2.Text = user.FIRSTNAME + " " + user.LASTNAME + "\nAverage: " + user.AVERAGE + "\nPoints: " + user.get_pts(false).ToString();
 }